|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wikipedia.miner.model.Page
org.wikipedia.miner.model.Category
public class Category
This class represents categories in Wikipedia; the pages that exist to organize articles that discuss related topics. It is intended to contain all properties and methods that are relevant for a category, such as its pertinent statistics, the categories and articles it contains, and the categories it belongs to.
| Field Summary |
|---|
| Fields inherited from class org.wikipedia.miner.model.Page |
|---|
ARTICLE, CATEGORY, DISAMBIGUATION, REDIRECT |
| Constructor Summary | |
|---|---|
Category(WikipediaDatabase database,
int id)
Initialises a newly created Category so that it represents the category given by id. |
|
Category(WikipediaDatabase database,
int id,
java.lang.String title)
Initialises a newly created Category so that it represents the page given by id and title. |
|
Category(WikipediaDatabase database,
java.lang.String title)
Initialises a newly created Category so that it represents the category given by title. |
|
| Method Summary | |
|---|---|
boolean |
contains(Article article)
Returns true if the argument article is a child of this category, otherwise false |
int[] |
getChildArticleIds()
|
SortedVector<Article> |
getChildArticles()
Returns an ordered Vector of Articles that belong to this category. |
SortedVector<Category> |
getChildCategories()
Returns a SortedVector of Categories that this category contains. |
int[] |
getChildCategoryIds()
|
Article |
getEquivalentArticle()
Returns the Article that relates to the same concept as this category. |
SortedVector<Category> |
getParentCategories()
Returns a SortedVector of Categories that this category belongs to. |
int[] |
getParentCategoryIds()
|
static void |
main(java.lang.String[] args)
Provides a demo of functionality available to Categories |
| Methods inherited from class org.wikipedia.miner.model.Page |
|---|
compareTo, createPage, equals, getContent, getFirstParagraph, getFirstSentence, getGenerality, getId, getScope, getTitle, getTitleWithoutScope, getType, getWeight, setWeight, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Category(WikipediaDatabase database,
int id,
java.lang.String title)
database - an active WikipediaDatabaseid - the unique identifier of the categorytitle - the (case dependent) title of the category
public Category(WikipediaDatabase database,
int id)
throws java.sql.SQLException
database - an active WikipediaDatabaseid - the unique identifier of the category
java.sql.SQLException - if no page is defined for the id, or if it is not an article.
public Category(WikipediaDatabase database,
java.lang.String title)
throws java.sql.SQLException
database - an active WikipediaDatabasetitle - the (case dependent) title of the article
java.sql.SQLException - if no article is defined for the title.| Method Detail |
|---|
public Article getEquivalentArticle()
throws java.sql.SQLException
java.sql.SQLException - if there is a problem with the database
public SortedVector<Category> getParentCategories()
throws java.sql.SQLException
java.sql.SQLException - if there is a problem with the Wikipedia database
public int[] getParentCategoryIds()
throws java.sql.SQLException
java.sql.SQLException - if there is a problem with the Wikipedia database.
public SortedVector<Category> getChildCategories()
throws java.sql.SQLException
java.sql.SQLException - if there is a problem with the Wikipedia database
public int[] getChildCategoryIds()
throws java.sql.SQLException
java.sql.SQLException - if there is a problem with the Wikipedia database.
public boolean contains(Article article)
throws java.sql.SQLException
article - the article of interest
java.sql.SQLException - if there is a problem with the Wikipedia database
public SortedVector<Article> getChildArticles()
throws java.sql.SQLException
java.sql.SQLException - if there is a problem with the wikipedia database
public int[] getChildArticleIds()
throws java.sql.SQLException
java.sql.SQLException - if there is a problem with the Wikipedia database.
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - an array of arguments for connecting to a wikipedia database: server and database names at a minimum, and optionally a username and password
java.lang.Exception - if there is a problem with the wikipedia database.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||