|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object zinger.bsheet.Dependencies
public class Dependencies
One- or two-way dependecies collection.
This class implements tracking of forward or forward and backward dependencies using
of points on a two-dimensional plane using conventional x
and y
coordinates and Point
objects. A Dependencies
object can be set
to keep track of backward dependencies or not at creation time.
Dependencies(int, int, boolean)
Constructor Summary | |
---|---|
Dependencies(int width,
int height,
boolean doBackwardDependencies)
Constructs an instance with given dimensions. |
Method Summary | |
---|---|
void |
addDependency(int causeX,
int causeY,
int effectX,
int effectY)
Adds a dependency. |
java.util.Set |
getDependencies(int x,
int y,
boolean backward)
Returns a set of unmodifiable dependencies for a given point. |
protected java.util.Set |
getDependencies(int x,
int y,
boolean backward,
boolean mutable)
Returns a set of dependencies for a given point. |
void |
removeDependency(int causeX,
int causeY,
int effectX,
int effectY)
Removes a dependency. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Dependencies(int width, int height, boolean doBackwardDependencies)
width
- width of two-dimensional planeheight
- height of two-dimensional planedoBackwardDependencies
- if true
, backwardGrid
will be created and dependencies
will be kept in a two-way form (forward and backward dependencies). Otherwise,
only forward dependencies will be tracked.backwardGrid
Method Detail |
---|
public void addDependency(int causeX, int causeY, int effectX, int effectY)
public void removeDependency(int causeX, int causeY, int effectX, int effectY)
protected java.util.Set getDependencies(int x, int y, boolean backward, boolean mutable)
backward
- if true
, the set of backward dependencies is returned if available,
otherwise a set of forward dependencies is returned.mutable
- if true
, an internal
non-null
instance of Set
is guaranteed to be returned.
Even if it's false
, an internal Set
may be returned and therefore
should not be modified if modifications to it are not meant to be persisted in this instance.
In this case, use getDependencies(int, int, boolean)
getDependencies(int, int, boolean)
public java.util.Set getDependencies(int x, int y, boolean backward)
getDependencies(int, int, boolean, boolean)
. The
resulting Set
, however, is wrapped in an unmodifiable proxy.
getDependencies(int, int, boolean, boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |