|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.constraints.geost.DBox
public class DBox
| Field Summary | |
|---|---|
static SimpleArrayList<SimpleArrayList<DBox>> |
freeBoxes
static store of available boxes, accessible by dimension. |
int[] |
length
It specifies for each dimension the length of dbox in that dimension. |
int[] |
origin
It specifies point in n-dimensional space where the dbox originates from. |
static SimpleArrayList<DBox> |
transientInstances
TODO, finish the comment. |
static java.lang.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 Summary | |
|---|---|
DBox(int[] origin,
int[] length)
constructs a new Box. |
|
| Method Summary | |
|---|---|
int |
area()
It computes the area in 2D case or volume in 3D case. |
static DBox |
boundingBox(java.util.Collection<DBox> boxes)
computes the bounding box of the given collection of boxes |
java.lang.String |
checkInvariants()
It checks whether the DBox is consistent. |
boolean |
containsPoint(int[] pointCoordinates)
It checks if this DBox contains the point as specified by an array of coordinates. |
DBox |
copyInto(DBox box)
It copies this DBox into given DBox. |
static void |
dispatchBox(DBox unusedBox)
It allows the system to reuse the given box by placing it into the pool of allocated boxes. |
boolean |
equals(java.lang.Object obj)
|
static DBox |
getAllocatedInstance(int dimension)
It returns an instance of DBox of the corresponding dimension, using a previously allocated one if possible |
int |
hashCode()
|
DBox |
intersectWith(DBox other)
It intersects this DBox with the given DBox. |
DBox |
intersectWith(DBox other,
int[] otherOffset)
It intersects this DBox with the given DBox, but the other DBox is shifted by the specified offset. |
DBox |
intersectWith(int[] offset,
DBox other,
int[] otherOffset)
It intersects this DBox with a view of the given DBox that was shifted according to the given offset. |
static DBox |
newBox(int dimension)
It returns an usable box, reusing a box from the pool if possible. |
static java.lang.String |
poolStatus()
It provides a string representation of the DBoxes which are present in the DBox pool. |
java.util.Collection<DBox> |
subtract(DBox hole,
java.util.Collection<DBox> difference)
computes the difference between this box and the given box. |
java.util.Collection<DBox> |
subtractAll(java.util.Collection<DBox> others,
java.util.Collection<DBox> result)
It computes the result of a subtraction from this box of all the boxes given. |
static java.util.Collection<DBox> |
subtractAll(java.util.Collection<DBox> source,
java.util.Collection<DBox> holes,
java.util.Collection<DBox> result)
It computes the result of a subtraction from the given collection of boxes of all the boxes given in the subtracting collection. |
static void |
supportDimension(int dimension)
It makes sure that there is a slot of the given dimension in the slot. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final SimpleArrayList<DBox> transientInstances
public static final SimpleArrayList<SimpleArrayList<DBox>> freeBoxes
public final int[] origin
public final int[] length
public static java.lang.String[] xmlAttributes
| Constructor Detail |
|---|
public DBox(int[] origin,
int[] length)
origin - it specifies the origin of the DBox in the n-dimensional space.length - it specifies the length of the Dbox in the n-dimensional space.| Method Detail |
|---|
public static final void supportDimension(int dimension)
dimension - public java.lang.String checkInvariants()
public static final void dispatchBox(DBox unusedBox)
unusedBox - the not used DBox which is being recycled.public static final DBox newBox(int dimension)
dimension - it specifies number of dimensions of a requested box
public static final DBox getAllocatedInstance(int dimension)
dimension -
public static java.lang.String poolStatus()
public boolean containsPoint(int[] pointCoordinates)
pointCoordinates - it specifies the point coordinates.
public DBox intersectWith(DBox other)
other - the DBox to intersect this one with
public DBox intersectWith(DBox other,
int[] otherOffset)
other - DBox with which the intersection is computed.otherOffset - the offset
public DBox intersectWith(int[] offset,
DBox other,
int[] otherOffset)
offset - the offset to apply to this box before intersectingother - the DBox to intersect this one withotherOffset - the offset to apply to the other DBox before intersecting
public java.util.Collection<DBox> subtract(DBox hole,
java.util.Collection<DBox> difference)
hole - the box to subtract this box withdifference - the collection of boxes corresponding to the remaining area
public static DBox boundingBox(java.util.Collection<DBox> boxes)
boxes -
public static java.util.Collection<DBox> subtractAll(java.util.Collection<DBox> source,
java.util.Collection<DBox> holes,
java.util.Collection<DBox> result)
source - the collection of boxes to subtract fromholes - the boxes to subtract from the source boxesresult - the collection to store the resulting boxes into
public java.util.Collection<DBox> subtractAll(java.util.Collection<DBox> others,
java.util.Collection<DBox> result)
others - the boxes to subtract from this boxresult - the collection to store the resulting boxes into
public int area()
public final DBox copyInto(DBox box)
box - the DBox to copy this DBox into
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||