complex
Class CellID

java.lang.Object
  extended bycomplex.CellID
All Implemented Interfaces:
java.lang.Comparable

public class CellID
extends java.lang.Object
implements java.lang.Comparable

A class to store the ID of a cell; able to create new IDs, which are unique in the complex. Each CellID is represented by a long integer, specifying the (unique) number of a cell.

Author:
karsten

Field Summary
private  long id
           
private static long max_id
           
 
Constructor Summary
CellID()
          Creates a new unique ID.
CellID(long id)
          Creates a CellID object for an existing ID.
 
Method Summary
 int compareTo(java.lang.Object other)
           
static void setMaxID(long id)
          Sets the largest known ID; all newly created IDs will be greater than this.
 long toInt()
          Returns the wrapped up integer, which defines the CellID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

max_id

private static long max_id

id

private long id
Constructor Detail

CellID

public CellID()
Creates a new unique ID.


CellID

public CellID(long id)
Creates a CellID object for an existing ID.

Parameters:
id - an existing ID, which will be wrapped into a CellID.
Method Detail

toInt

public long toInt()
Returns the wrapped up integer, which defines the CellID.

Returns:
the number of the cell

setMaxID

public static void setMaxID(long id)
Sets the largest known ID; all newly created IDs will be greater than this. If there have already been larger IDs, this command will be ignored.

Parameters:
id - the largest known ID

compareTo

public int compareTo(java.lang.Object other)
Specified by:
compareTo in interface java.lang.Comparable