Class Modifier

java.lang.Object
org.z3950.zing.cql.Modifier

public class Modifier extends Object
Represents a single modifier, consisting of three elements: a type, a comparison and a value. For example, "distance", "<", "3". The type is mandatory; either the comparison and value must both occur, or neither must.

This class is used only by ModifierSet.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Modifier with the specified type but no comparison or value.
    Modifier(String type, String comparison, String value)
    Creates a new Modifier with the specified type, comparison and value.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the comparison with which the Modifier was created.
    int
    Returns the exclusive source end, suitable for query.substring(getStart(), getEnd()).
    int
    Returns the inclusive source start of this modifier (including the leading slash).
    Returns the type with which the Modifier was created.
    Returns the value with which the Modifier was created.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Modifier

      public Modifier(String type, String comparison, String value)
      Creates a new Modifier with the specified type, comparison and value.
    • Modifier

      public Modifier(String type)
      Creates a new Modifier with the specified type but no comparison or value.
  • Method Details

    • getStart

      public int getStart()
      Returns the inclusive source start of this modifier (including the leading slash). Offsets are zero-based UTF-16 indexes into the original query, excluding surrounding whitespace. Manually constructed objects and implicit defaults have no source location and return -1. Locations describe the original parse and are not updated after tree modifications.
      Returns:
      source start, or -1 when unavailable
    • getEnd

      public int getEnd()
      Returns the exclusive source end, suitable for query.substring(getStart(), getEnd()).
      Returns:
      source end, or -1 when unavailable
      See Also:
    • getType

      public String getType()
      Returns the type with which the Modifier was created.
    • getComparison

      public String getComparison()
      Returns the comparison with which the Modifier was created.
    • getValue

      public String getValue()
      Returns the value with which the Modifier was created.
    • toCQL

      public String toCQL()