|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.Vector<E> org.gicentre.treemappa.MortonList<E>
E
- Type of object stored in the Morton ordered collection.public class MortonList<E>
Stores a one-dimensional ordered list of objects that can represent a two-dimensional arrangement
using Morton ordering. The order of objects stored in this collection is assumed to be Morton.
Ordering can be VERTICAL
(mirror 'N' shaped) or HORIZONTAL
('Z' shaped).
Field Summary | |
---|---|
static int |
HORIZONTAL
Indicates that Morton ordering is 'Z' shaped. |
static int |
VERTICAL
Indicates that Morton ordering is mirror 'N' shaped. |
Fields inherited from class java.util.Vector |
---|
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
MortonList()
Creates the collection assuming a vertical Morton layout. |
|
MortonList(int direction)
Creates the collection with a Morton layout in the given direction. |
Method Summary | |
---|---|
E |
get(int x,
int y)
Returns the object at the given x,y position or null if no object at the given position. |
int |
getMorton(int x,
int y)
Reports the Morton number representing the given x,y coordinate pair. |
E |
getNextX(java.lang.Object obj)
Returns the object that is to the 'right' (x+1) of the first instance of the given reference object or null if no object to the right or if the given reference object not found. |
E |
getNextY(java.lang.Object obj)
Returns the object that is 'below' (y+1) the first instance of the given reference object or null if no object below or if the given reference object not found. |
int |
getX(int mortonNumber)
Reports the x coordinate of the position represented by the given Morton number. |
int |
getY(int mortonNumber)
Reports the y coordinate of the position represented by the given Morton number. |
java.awt.Point |
positionOf(java.lang.Object obj)
Returns the x,y position of the first occurrence of the given object in this collection, or null if the collection does not contain the object. |
void |
resetDirection(int mDirection)
Clears this collection and sets the given direction for Morton ordering. |
Methods inherited from class java.util.Vector |
---|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
iterator, listIterator, listIterator |
Field Detail |
---|
public static final int VERTICAL
public static final int HORIZONTAL
Constructor Detail |
---|
public MortonList()
public MortonList(int direction)
direction
- Direction of layout. Should be one of VERTICAL
(mirrored 'N' shaped) or HORIZONTAL
('Z' shaped).Method Detail |
---|
public void resetDirection(int mDirection)
mDirection
- New direction for Morton ordering. Should be one of VERTICAL
(mirrored 'N' shaped) or HORIZONTAL
('Z' shaped).public java.awt.Point positionOf(java.lang.Object obj)
obj
- Object whose position will be reported.
public E get(int x, int y)
x
- x coordinate of the position from which to retrieve the object.y
- x coordinate of the position from which to retrieve the object.
public E getNextX(java.lang.Object obj)
obj
- Reference object from which to find its neighbour.
public E getNextY(java.lang.Object obj)
obj
- Reference object from which to find its neighbour.
public int getX(int mortonNumber)
mortonNumber
- Number to process.
public int getY(int mortonNumber)
mortonNumber
- Number to process.
public int getMorton(int x, int y)
x
- x coordinate of position to calculate.y
- y coordinate of position to calculate.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |