edu.washington.cs.knowitall.rule.constraint
Class PatternConstraint

java.lang.Object
  extended by edu.washington.cs.knowitall.rule.constraint.Constraint
      extended by edu.washington.cs.knowitall.rule.constraint.CaptureConstraint
          extended by edu.washington.cs.knowitall.rule.constraint.AbstractPatternConstraint
              extended by edu.washington.cs.knowitall.rule.constraint.PatternConstraint
Direct Known Subclasses:
SequenceConstraint

public class PatternConstraint
extends AbstractPatternConstraint

Constrains based on the supplied token-based pattern.

Author:
schmmd

Field Summary
 
Fields inherited from class edu.washington.cs.knowitall.rule.constraint.AbstractPatternConstraint
expression
 
Fields inherited from class edu.washington.cs.knowitall.rule.constraint.Constraint
part
 
Constructor Summary
  PatternConstraint(org.jdom.Element e)
           
protected PatternConstraint(org.jdom.Element e, ExtractionPart part)
           
  PatternConstraint(ExtractionPart part, String pattern)
           
 
Method Summary
 boolean equals(Object other)
          Force subclasses to avoid pointer-based comparison.
 List<Constraint> generalize()
          Creates a list of constraints with constraint size reduced by exactly one.
 int size()
          The size of a constraint is the count of subconstraints.
 org.jdom.Element toXmlElement()
           
 
Methods inherited from class edu.washington.cs.knowitall.rule.constraint.AbstractPatternConstraint
check, deserializePattern, getString, value
 
Methods inherited from class edu.washington.cs.knowitall.rule.constraint.CaptureConstraint
value
 
Methods inherited from class edu.washington.cs.knowitall.rule.constraint.Constraint
check, create, create, create, fromXmlElement, getConstraintClass, hashCode, simplify, subsumes, toString, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PatternConstraint

public PatternConstraint(org.jdom.Element e)

PatternConstraint

protected PatternConstraint(org.jdom.Element e,
                            ExtractionPart part)

PatternConstraint

public PatternConstraint(ExtractionPart part,
                         String pattern)
Method Detail

equals

public boolean equals(Object other)
Description copied from class: Constraint
Force subclasses to avoid pointer-based comparison.

Overrides:
equals in class AbstractPatternConstraint

toXmlElement

public org.jdom.Element toXmlElement()
Overrides:
toXmlElement in class Constraint

generalize

public List<Constraint> generalize()
Description copied from class: Constraint
Creates a list of constraints with constraint size reduced by exactly one.

Specified by:
generalize in class Constraint
Returns:

size

public int size()
Description copied from class: Constraint
The size of a constraint is the count of subconstraints. Most constraints will have a size of one. However TermConstraint for example has a size equal to the number of restrictions it has.

Specified by:
size in class Constraint
Returns:


Copyright © 2011 University of Washington CSE. All Rights Reserved.