com.iphrase.runtime.query.constraint
Class Mentions

java.lang.Object
  |
  +--com.iphrase.runtime.query.Feature
        |
        +--com.iphrase.runtime.query.constraint.Constraint
              |
              +--com.iphrase.runtime.query.constraint.Mentions

public class Mentions
extends Constraint

Represent a concept constraint against indexed text feature types. Clients are not allowed to create Mentions constraints directly - the engine creates them as a result of meaning resolution of query text terms. Therefore they can be serialized and deserialized but there is no public ctor.


Inner classes inherited from class com.iphrase.runtime.query.constraint.Constraint
Constraint.Flags
 
Method Summary
 java.lang.String getConstraintSubType()
          Determine subType representation of the non-range inequality constraints
 java.lang.String[] getLabels()
          Get the text labels associated with this Mentions constraint.
 java.lang.String getOperatorByTermIndex(int termIndex, java.lang.String andStr, java.lang.String orStr)
          Returnes andStr or orStr depends on the boolean operator used for termIndex search
 int getRemoveIndex(java.lang.String term)
           
 java.lang.String[] getTerms()
          Get the text terms associated with this Mentions constraint.
 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 Mentions constraint from a OneStep serialization String.
 void setValue(java.lang.String value)
          Set the value associated with this constraint.
 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
 

Method Detail

getTerms

public java.lang.String[] getTerms()
Get the text terms associated with this Mentions constraint.
Returns:
String array of text terms extracted from a text query

getLabels

public java.lang.String[] getLabels()
Get the text labels associated with this Mentions constraint.
Returns:
String array of text terms extracted from a text query

getOperatorByTermIndex

public java.lang.String getOperatorByTermIndex(int termIndex,
                                               java.lang.String andStr,
                                               java.lang.String orStr)
Returnes andStr or orStr depends on the boolean operator used for termIndex search
Returns:
andStr or orStr

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

setValue

public void setValue(java.lang.String value)
Set the value associated with this constraint. This will typically be a label. This method is public for a protected Query method.
Parameters:
value - String value associated with this constraint

matches

public boolean matches(Constraint c)
Determine whether this Constraint matches another. Mentions is a special case because it is only created on the server. Therefore, implement matches as equals, i.e strict equivalence including flags.
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 (an identical serialization). 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()
Determine subType representation of the non-range inequality constraints
Overrides:
getConstraintSubType in class Constraint
Returns:
subType - op, the values to return is: ""

newInstance

public static Constraint newInstance(java.lang.String state)
                              throws ArgumentError
Attempt to create a new Mentions constraint from a OneStep serialization String.
Parameters:
state - OneStep serialization String
Returns:
deserialized Constraint instance
Throws:
ArgumentError -  

getRemoveIndex

public int getRemoveIndex(java.lang.String term)

© Copyright 2005, 2006. IBM Corporation. All rights reserved.