Module org.jpo

Class YearQuery

java.lang.Object
org.jpo.datamodel.YearQuery
All Implemented Interfaces:
Serializable, Query

public class YearQuery extends Object implements Serializable, Query
This class stores the parameters for a search and can return a List of the search results.
See Also:
  • Constructor Details

    • YearQuery

      public YearQuery(String year)
      Constructor to create a new Query object.
      Parameters:
      year - the year we want to search for
  • Method Details

    • setLowerDateRange

      public void setLowerDateRange(Calendar lowerDateRange)
      Method to set the lower date range of the search. If null the lower date will be ignored.
      Parameters:
      lowerDateRange - Lower date range
    • getLowerDateRange

      public Calendar getLowerDateRange()
      Method to get the lower date range of the search.
      Returns:
      returns the lower date range
    • setUpperDateRange

      public void setUpperDateRange(Calendar upperDateRange)
      Method to set the upper date range of the search. If null the upper date will be ignored.
      Parameters:
      upperDateRange - The upper date range
    • getUpperDateRange

      public Calendar getUpperDateRange()
      Method to get the upper date range of the search.
      Returns:
      the upper date range
    • setStartNode

      public void setStartNode(SortableDefaultMutableTreeNode n)
      set the start node for the search
      Parameters:
      n - node
    • getSearchResults

      public List<SortableDefaultMutableTreeNode> getSearchResults()
      Returns a List of nodes which match the query criteria beneath the supplied node.
      Returns:
      The List of nodes.
    • getNumberOfResults

      public int getNumberOfResults()
      On a group we return the number of children in the group.
      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 group If there are more Thumbnails than nodes in the group it returns null.
      Specified by:
      getIndex in interface Query
      Parameters:
      index - The component index that is to be returned.
      Returns:
      the node for the index
    • extractSearchResults

      public List<SortableDefaultMutableTreeNode> extractSearchResults()
      Returns a List of nodes which match the query criteria beneath the supplied node.
      Returns:
      The List of nodes.
    • refresh

      public void refresh()
      Forces the query to be re-executed
      Specified by:
      refresh in interface Query
    • isMatch

      public boolean isMatch(SortableDefaultMutableTreeNode n)
      this method returns whether the supplied node matches the search criteria.
      Parameters:
      n - the Node which is to be tested.
      Returns:
      true if the node matches the query, false if not.
    • 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 string for the 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:
      a title