org.fopps.model
Class FeatureConstraint

java.lang.Object
  |
  +--org.fopps.model.AbstractItem
        |
        +--org.fopps.model.Relation
              |
              +--org.fopps.model.Constraint
                    |
                    +--org.fopps.model.FeatureConstraint

public class FeatureConstraint
extends Constraint

FeatureConstraint represents a cobnstraint between features. A feature may require another feature or is exclusive to another. Please note that constraints not reflexive: 'A excludes B' does not imply 'B excludes A'. In this case you have to add an exclusive constraint to A and B.

To create a relation ' A requires B', call the constructor as

new FeatureConstraint(a, b ConstraintType.Requires).

Author:
Oliver Wieland

Field Summary
 
Fields inherited from class org.fopps.model.Relation
from, to
 
Fields inherited from class org.fopps.model.AbstractItem
ADDED_EVENT, CHANGE_EVENT, name, REMOVED_EVENT
 
Constructor Summary
FeatureConstraint(AbstractItem pFrom, AbstractItem pTo, ConstraintType constraintType)
          Creates a new feature constraint
 
Method Summary
 boolean check()
          Checks, if constraint is met by current configuration
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class org.fopps.model.Constraint
getConstraintType, isValid, saveUndoOnDisconnect, setConstraintType, toggleConstraintType
 
Methods inherited from class org.fopps.model.Relation
accept, disconnect, getFrom, getTo, isGhost, loopAllowed, setAllowLoop, setFrom, setGhost, setTo
 
Methods inherited from class org.fopps.model.AbstractItem
addIncoming, addListener, addOutgoing, commitGhostRelations, containsType, copyAttributes, delete, filterElements, fireItemAdded, fireItemChanged, fireItemRemoved, getConstraints, getDescription, getIncoming, getIncomingConstraints, getListeners, getName, getOutgoing, getOutgoingConstraints, getRelationTo, hasConstraints, isBlockEvents, isConnectedWith, notifyListeners, removeAllConstraints, removeAllIncoming, removeAllListener, removeAllOutgoing, removeAllRelations, removeGhostRelations, removeIncoming, removeListener, removeOutgoing, removeRelationTo, setBlockEvents, setDescription, setIncoming, setName, setOutgoing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeatureConstraint

public FeatureConstraint(AbstractItem pFrom,
                         AbstractItem pTo,
                         ConstraintType constraintType)
                  throws InvalidRelationException
Creates a new feature constraint

See Also:
Constraint.Constraint(AbstractItem, AbstractItem,ConstraintType)
Method Detail

check

public boolean check()
Description copied from class: Constraint
Checks, if constraint is met by current configuration

Specified by:
check in class Constraint
Returns:
true, if constraint is valid

toString

public java.lang.String toString()
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Overrides:
toString in class Constraint
Returns:
a string representation of the object.


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.