Parsing Engine

danbikel.parser.constraints
Class AbstractConstraint

java.lang.Object
  extended by danbikel.parser.constraints.AbstractConstraint
All Implemented Interfaces:
Constraint

public class AbstractConstraint
extends Object
implements Constraint

A base class that throws an UnsupportedOperationException for every optional operation of the Constraint interface. Note that this class is not actually abstract in spite of its name, as it implements all the methods of the Constraint interface.


Constructor Summary
protected AbstractConstraint()
          Constructs a new instance of this base class, typically called implicitly by concrete subclasses.
 
Method Summary
 Constraint getParent()
          Throws an UnsupportedOperationException.
 boolean hasBeenSatisfied()
          Throws an UnsupportedOperationException.
 boolean isLeaf()
          Throws an UnsupportedOperationException.
 boolean isLocallySatisfiedBy(Item item)
          Throws an UnsupportedOperationException.
 boolean isSatisfiedBy(Item item)
          Throws an UnsupportedOperationException.
 boolean isViolatedBy(Item item)
          Throws an UnsupportedOperationException.
 boolean isViolatedByChild(Item childItem)
          Throws an UnsupportedOperationException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConstraint

protected AbstractConstraint()
Constructs a new instance of this base class, typically called implicitly by concrete subclasses.

Method Detail

isLeaf

public boolean isLeaf()
Throws an UnsupportedOperationException.

Specified by:
isLeaf in interface Constraint
Returns:
true if this constraint is part of a tree structure of constraints and is a leaf.
See Also:
ConstraintSet.hasTreeStructure()

getParent

public Constraint getParent()
Throws an UnsupportedOperationException.

Specified by:
getParent in interface Constraint
Returns:
the parent of this constraint
See Also:
ConstraintSet.hasTreeStructure()

isSatisfiedBy

public boolean isSatisfiedBy(Item item)
Throws an UnsupportedOperationException.

Specified by:
isSatisfiedBy in interface Constraint
Parameters:
item - the item to test
Returns:
whether the specified item satisfies this constraint.

hasBeenSatisfied

public boolean hasBeenSatisfied()
Throws an UnsupportedOperationException.

Specified by:
hasBeenSatisfied in interface Constraint
Returns:
true if this constraint has been satisfied, false if it has not

isLocallySatisfiedBy

public boolean isLocallySatisfiedBy(Item item)
Throws an UnsupportedOperationException.

Specified by:
isLocallySatisfiedBy in interface Constraint
Returns:
whether the specified item satisfies the local information of this constraint node

isViolatedBy

public boolean isViolatedBy(Item item)
Throws an UnsupportedOperationException.

Specified by:
isViolatedBy in interface Constraint
Parameters:
item - the item to test
Returns:
whether the specified item violates this constraint.

isViolatedByChild

public boolean isViolatedByChild(Item childItem)
Throws an UnsupportedOperationException.

Specified by:
isViolatedByChild in interface Constraint
Parameters:
childItem - the child item to test
Returns:
true if the specified child item violates this constraint, false otherwise
See Also:
ConstraintSet.hasTreeStructure()

Parsing Engine

Author: Dan Bikel.