Пример #1
0
 /**
  * Loads a category from Wikipedia by its title.
  *
  * @param title Title of the category to load.
  * @return The category if it exists. {@code null} if any category exists with that name.
  */
 public Category loadCategory(String title) {
   Category cat;
   try {
     cat = wiki.getCategory(title);
   } catch (WikiApiException e) {
     cat = null;
   }
   return cat;
 }
Пример #2
0
 /**
  * Loads a category from Wikipedia by its page ID.
  *
  * @param ID Identifier of the category to load.
  * @return The category if it exists. {@code null} if any category exists with that ID.
  */
 public Category loadCategory(int ID) {
   return wiki.getCategory(ID);
 }