Module org.jpo

Class CategoryQuery

java.lang.Object
org.jpo.datamodel.CategoryQuery
All Implemented Interfaces:
Query

public class CategoryQuery extends Object implements Query
This class implements the Query interface to show all the nodes attached to a category.
  • Constructor Details

    • CategoryQuery

      public CategoryQuery(Integer key)
      Constructor for a Category Query
      Parameters:
      key - The key for the category
  • Method Details

    • getNumberOfResults

      public int getNumberOfResults()
      The query must be able to say how many results it will return.
      Specified by:
      getNumberOfResults in interface Query
      Returns:
      the number of results
    • getIndex

      public SortableDefaultMutableTreeNode getIndex(int index)
      This method returns the SDMTN node for the indicated position in the query. If the index is out of bounds it returns null.
      Specified by:
      getIndex in interface Query
      Parameters:
      index - The component index that is to be returned.
      Returns:
      the node for the position
    • getTitle

      public String getTitle()
      returns a title for the search that can be used to display the search results under.
      Specified by:
      getTitle in interface Query
      Returns:
      a title
    • toString

      public String toString()
      returns the title for the search that can be used to display the search results under.
      Specified by:
      toString in interface Query
      Overrides:
      toString in class Object
      Returns:
      the title for the search
    • refresh

      public void refresh()
      This method retrieves a new List of nodes that match the category.
      Specified by:
      refresh in interface Query