Class ModifierSet
java.lang.Object
org.z3950.zing.cql.ModifierSet
Represents a base String and a set of Modifiers.
This class is used as a workhorse delegate by both CQLRelation and CQLProxNode - two functionally very separate classes that happen to require similar data structures and functionality.
A ModifierSet consists of a ``base'' string together with a set of zero or more type comparison value pairs, where type, comparison and value are all strings.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModifier(String type) Adds a modifier of the specifiedtype, but with nocomparisonandvalue, to a ModifierSet.voidaddModifier(String type, String comparison, String value) Adds a modifier of the specifiedtype,comparisonandvalueto a ModifierSet.getBase()Returns the base string with which the ModifierSet was created.intgetEnd()Returns the exclusive source end, suitable forquery.substring(getStart(), getEnd()).Returns an array of the modifiers in a ModifierSet.intgetStart()Returns the inclusive source start of this base and its modifiers.static voidReturns the value of the modifier in the specified ModifierSet that corresponds to the specified type.toCQL()
-
Constructor Details
-
ModifierSet
Creates a new ModifierSet with the specified base.
-
-
Method Details
-
getStart
public int getStart()Returns the inclusive source start of this base and its modifiers. 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 forquery.substring(getStart(), getEnd()).- Returns:
- source end, or -1 when unavailable
- See Also:
-
getBase
Returns the base string with which the ModifierSet was created. -
addModifier
-
addModifier
Adds a modifier of the specifiedtype, but with nocomparisonandvalue, to a ModifierSet. -
modifier
-
getModifiers
-
toCQL
-
main
-