public class InArea extends Object implements ExternalConstraint
| Modifier and Type | Field and Description |
|---|---|
DBox |
allowedArea
It specifies the allowed area in which the objects can reside.
|
Set<InternalConstraint> |
constraints
It holds all the constraints which have been generated from this external constraints.
|
Collection<DBox> |
holes
It specifies the holes within the allowed area in which
the objects can not be placed.
|
static String[] |
xmlAttributes
It specifies the arguments required to be saved by an XML format as well as
the constructor being called to recreate an object from an XML format.
|
| Constructor and Description |
|---|
InArea(DBox area,
Collection<DBox> holes)
It constructs an external constraint to enforce that all objects
within Geost constraint are placed within a specified area with
holes in that area specfied as well.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addPrunableObjects(GeostObject o,
SimpleHashSet<GeostObject> accumulator)
It adds to the accumulator collection the objects that are likely to be pruned if the given object
changes.
|
String |
checkInvariants()
It checks whether the InArea is consistent.
|
Collection<InternalConstraint> |
genInternalConstraints(Geost geost)
It generates internal constraints which will be used by Geost's sweeping
algorithm.
|
Collection<? extends InternalConstraint> |
getObjectConstraints(GeostObject o)
It provides the collection of internal constraints that the given object has to satisfy.
|
GeostObject[] |
getObjectScope()
Provides the collection of objects that this constraint applies to
|
boolean |
isInternalConstraintApplicableTo(InternalConstraint ic,
GeostObject o)
Returns true if the external constraint generated the supplied internal constraint ic, and that ic
applies to object o.
|
void |
onObjectUpdate(GeostObject o)
Handler method called by the Geost kernel when the domain of the object changes.
|
public DBox allowedArea
public Collection<DBox> holes
public Set<InternalConstraint> constraints
public static String[] xmlAttributes
public InArea(DBox area, Collection<DBox> holes)
area - the specification of the area within which the objects have to be placed.holes - the holes in which the objects can not be placed.public String checkInvariants()
public Collection<InternalConstraint> genInternalConstraints(Geost geost)
ExternalConstraintgenInternalConstraints in interface ExternalConstraintgeost - the geost kernel that will use the generated constraintpublic boolean addPrunableObjects(GeostObject o, SimpleHashSet<GeostObject> accumulator)
ExternalConstraintaddPrunableObjects in interface ExternalConstrainto - the object that was prunedaccumulator - the set of objects to add the object topublic void onObjectUpdate(GeostObject o)
ExternalConstraintonObjectUpdate in interface ExternalConstraintpublic Collection<? extends InternalConstraint> getObjectConstraints(GeostObject o)
ExternalConstraintgetObjectConstraints in interface ExternalConstrainto - the geost object that needs to be constrainedpublic boolean isInternalConstraintApplicableTo(InternalConstraint ic, GeostObject o)
ExternalConstraintisInternalConstraintApplicableTo in interface ExternalConstraintic - internal constraint being checkedo - object to which internal constrain should apply topublic GeostObject[] getObjectScope()
ExternalConstraintgetObjectScope in interface ExternalConstraintCopyright © 2016. All rights reserved.