Class AbstractOsidQuery

java.lang.Object
net.okapia.osid.jamocha.spi.AbstractOsidQuery
All Implemented Interfaces:
OsidQuery, Suppliable
Direct Known Subclasses:
AbstractOsidContainableQuery, AbstractOsidExtensibleQuery, AbstractOsidIdentifiableQuery, AbstractOsidOperableQuery, AbstractOsidSourceableQuery, AbstractOsidTemporalQuery

public abstract class AbstractOsidQuery extends Object implements OsidQuery
Defines a simple OsidQuery to extend. This class does nothing except for storing string match types.
  • Constructor Details

    • AbstractOsidQuery

      public AbstractOsidQuery()
      Constructs a new AbstractOsidQuery.
  • Method Details

    • getStringMatchTypes

      @OSID public TypeList getStringMatchTypes()
      Gets the string matching types supported. A string match type specifies the syntax of the string query, such as matching a word or including a wildcard or regular expression.
      Specified by:
      getStringMatchTypes in interface OsidQuery
      Returns:
      a list containing the supported string match types
    • supportsStringMatchType

      @OSID public boolean supportsStringMatchType(Type stringMatchType)
      Tests if the given string matching type is supported.
      Specified by:
      supportsStringMatchType in interface OsidQuery
      Parameters:
      stringMatchType - a Type indicating a string match type
      Returns:
      true if the given Type is supported, false otherwise
      Throws:
      NullArgumentException - stringMatchType is null
    • addStringMatchType

      protected void addStringMatchType(Type stringMatchType)
      Adds a string match type.
      Parameters:
      stringMatchType - a string matching type
      Throws:
      NullArgumentException - stringMatchType is null
    • matchKeyword

      @OSID public void matchKeyword(String keyword, Type stringMatchType, boolean match)
      Adds a keyword to match. Multiple keywords can be added to perform a boolean OR among them. A keyword may be applied to any of the elements defined in this object such as the display name, description or any method defined in an interface implemented by this object.
      Specified by:
      matchKeyword in interface OsidQuery
      Parameters:
      keyword - keyword to match
      stringMatchType - the string match type
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - keyword or stringMatchType is null
      UnsupportedException - supportsStringMatchType(stringMatchType) is false
    • clearKeywordTerms

      @OSID public void clearKeywordTerms()
      Clears all keyword terms.
      Specified by:
      clearKeywordTerms in interface OsidQuery
    • matchAny

      @OSID public void matchAny(boolean match)
      Matches any object.
      Specified by:
      matchAny in interface OsidQuery
      Parameters:
      match - true to match any object, false to match no objectsx
    • clearAnyTerms

      @OSID public void clearAnyTerms()
      Clears the match any terms.
      Specified by:
      clearAnyTerms in interface OsidQuery