com.iphrase.runtime.query.constraint
Class Example
java.lang.Object
|
+--com.iphrase.runtime.query.Feature
|
+--com.iphrase.runtime.query.constraint.Constraint
|
+--com.iphrase.runtime.query.constraint.Example
- public class Example
- extends Constraint
Represent a "query by example" constraint.
Constructor Summary |
Example(java.lang.String feature,
java.lang.String value,
java.util.List searchFeatures)
Create an Example constraint. |
Example(java.lang.String feature,
java.lang.String value,
java.lang.String[] searchFeatures)
Create an Example constraint. |
Method Summary |
java.lang.String |
getConstraintSubType()
|
java.lang.Object |
getValue()
Get the value associated with this constraint. |
boolean |
matches(Constraint c)
Determine whether this Constraint matches another. |
static Constraint |
newInstance(java.lang.String state)
Attempt to create a new Example constraint from a OneStep serialization String . |
java.lang.String |
toString()
Serialize this constraint using the OneStep serialization format. |
Methods inherited from class com.iphrase.runtime.query.constraint.Constraint |
clearExplicit, clearHidden, clearNew, clearNotSerialized, clearPrePruned, clearRequired, clearState, equals, getConstraintLabel, getDisplayPrefix, getIsMentions, getState, getType, isExplicit, isHidden, isMentions, isNew, isNotSerialized, isPrePruned, isRangeConstraintType, isRequired, newInstance, newInstance, setExplicit, setHidden, setHidden, setNew, setNotSerialized, setPrePruned, setRequired, setState |
Methods inherited from class com.iphrase.runtime.query.Feature |
getId |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Example
public Example(java.lang.String feature,
java.lang.String value,
java.util.List searchFeatures)
- Create an Example constraint.
- Parameters:
feature
- String
id of example featurevalue
- String
example valuesearchFeatures
- List
of String
feature ids to search
If searchFeatures is 0-length, the engine will search the features specified
by RENDER_QUERY_BY_EXAMPLE
in iq.txt, or if there is no such
configuration, all IR features.
Example
public Example(java.lang.String feature,
java.lang.String value,
java.lang.String[] searchFeatures)
- Create an Example constraint.
- Parameters:
feature
- String
id of example featurevalue
- String
example valuesearchFeatures
- String
array of feature ids to search
If searchFeatures is 0-length, the engine will search the features specified
by RENDER_QUERY_BY_EXAMPLE
in iq.txt, or if there is no such
configuration, all IR features.
getValue
public java.lang.Object getValue()
- Get the value associated with this constraint.
Overrides
Constraint.getValue()
- Overrides:
getValue
in class Constraint
- Returns:
- Object value associated with this constraint
matches
public boolean matches(Constraint c)
- Determine whether this Constraint matches another.
- Overrides:
matches
in class Constraint
- Parameters:
c
- Constraint
to be matched against this- Returns:
true
if the two constraints are of the same type
and have identical fields except for their flags,
else false
.
toString
public java.lang.String toString()
- Serialize this constraint using the OneStep serialization format.
Overrides
Object.toString()
- Overrides:
toString
in class java.lang.Object
- Returns:
- OneStep serialization
String
of this constraint
getConstraintSubType
public java.lang.String getConstraintSubType()
- Overrides:
getConstraintSubType
in class Constraint
- Following copied from class:
com.iphrase.runtime.query.constraint.Constraint
- Returns:
- constraint subType
newInstance
public static Constraint newInstance(java.lang.String state)
throws ArgumentError
- Attempt to create a new Example constraint from a OneStep serialization
String
.
- Parameters:
state
- OneStep serialization String
- Returns:
- deserialized
Constraint
instance - Throws:
ArgumentError
-