Module org.jpo

Class TextQuery

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

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

    • anyField

      public final String anyField
      If defined this String will be checked against any field on the nodes
  • Constructor Details

    • TextQuery

      public TextQuery(String anyField)
      Constructor to create a new Query object.
      Parameters:
      anyField - the search key to be checked for in any of the data fields.
  • 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 - The lower date range as String
    • 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 startNode)
      set the start node for the search
      Parameters:
      startNode - The start 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 re-execute
      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