org.gersteinlab.tyna.webapp.data
Class CategoryInfo

java.lang.Object
  extended by org.gersteinlab.tyna.webapp.data.CategoryInfo

public class CategoryInfo
extends java.lang.Object

        This class reads some category information for query.
        

Version:
1.0 (October 3, 2005) Change History: 1.0 - Initial version
Author:
Kevin Yuk-Lap Yip

Nested Class Summary
protected  class CategoryInfo.CategoryInfoNodeIterator
           
 
Field Summary
protected  java.util.Map categoriesToNodes
          A map from the classes to the nodes
protected  java.util.Map nodesToCategories
          A map from the nodes to the categories
 
Constructor Summary
CategoryInfo(java.io.InputStream src)
          Read the category information from a source.
 
Method Summary
 java.lang.String[] getCategoryNames()
          Get an array of all the category names.
 int getNodeCount(java.lang.String categoryName)
          Get the number of nodes of a category.
 NodeIterator getNodeIterator(java.lang.String categoryName)
          Get an iterator of the nodes of a category.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

categoriesToNodes

protected java.util.Map categoriesToNodes
A map from the classes to the nodes


nodesToCategories

protected java.util.Map nodesToCategories
A map from the nodes to the categories

Constructor Detail

CategoryInfo

public CategoryInfo(java.io.InputStream src)
             throws java.io.IOException
Read the category information from a source.

Throws:
java.io.IOException - If any IO problem occurs
Method Detail

getCategoryNames

public java.lang.String[] getCategoryNames()
Get an array of all the category names.

Returns:
The array

getNodeIterator

public NodeIterator getNodeIterator(java.lang.String categoryName)
Get an iterator of the nodes of a category.

Parameters:
categoryName - The name of the category
Returns:
The iterator, null if the category does not exist

getNodeCount

public int getNodeCount(java.lang.String categoryName)
Get the number of nodes of a category.

Parameters:
categoryName - The name of the category
Returns:
The number