com.partnersoft.v3x.graphics
Class GridCoordinate

java.lang.Object
  extended by com.partnersoft.v3x.graphics.GridCoordinate
All Implemented Interfaces:
java.io.Serializable

public class GridCoordinate
extends java.lang.Object
implements java.io.Serializable

A coordinate in a hierarchical, gridded coordinate system. Includes how deep it is in the hierarchy as well as the cell index at each level.

See Also:
Serialized Form

Constructor Summary
GridCoordinate()
          Create a new, blank GridCoordinate.
GridCoordinate(int a)
          Create a new single-level GridCoordinate.
GridCoordinate(int[] coords)
          Create a new n-level GridCoordinate.
GridCoordinate(int a, int b)
          Create a new second-level GridCoordinate.
GridCoordinate(int a, int b, int c)
          Create a new third-level GridCoordinate.
GridCoordinate(int a, int b, int c, int d)
          Create a new fourth-level GridCoordinate.
 
Method Summary
 java.util.ArrayList getCoords()
          Get the coordinates as a ArrayList.
 int[] getCoordsArray()
          Get the coordinate index array.
 int getLevel()
          Get the level (depth) of the coordinate.
 void setCoords(java.util.ArrayList newCoords)
          Set the coordinates as a vector.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridCoordinate

public GridCoordinate()
Create a new, blank GridCoordinate.


GridCoordinate

public GridCoordinate(int a)
Create a new single-level GridCoordinate.


GridCoordinate

public GridCoordinate(int a,
                      int b)
Create a new second-level GridCoordinate.


GridCoordinate

public GridCoordinate(int a,
                      int b,
                      int c)
Create a new third-level GridCoordinate.


GridCoordinate

public GridCoordinate(int a,
                      int b,
                      int c,
                      int d)
Create a new fourth-level GridCoordinate.


GridCoordinate

public GridCoordinate(int[] coords)
Create a new n-level GridCoordinate.

Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getLevel

public int getLevel()
Get the level (depth) of the coordinate.


getCoordsArray

public int[] getCoordsArray()
Get the coordinate index array.


getCoords

public java.util.ArrayList getCoords()
Get the coordinates as a ArrayList.


setCoords

public void setCoords(java.util.ArrayList newCoords)
Set the coordinates as a vector.