public class WorldObjectId extends Object implements Serializable
Every implementations MUST implement equals() and hashCode() correctly as we will use this inside hashmaps/sets.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isDouble
Whether the id wolds 'double' inside
token. |
protected boolean |
isLong
Whether the id wolds 'long' inside
token. |
protected cz.cuni.amis.utils.token.Token |
token
Unique representation of this id, contains ints that uniquely identifies it.
|
| Modifier | Constructor and Description |
|---|---|
protected |
WorldObjectId(double id)
Instantiates a new object with id of 'id'.
|
protected |
WorldObjectId(long id)
Instantiates a new object with id of 'id'.
|
protected |
WorldObjectId(String name)
Instantiates a new object with id of 'name'.
|
protected |
WorldObjectId(cz.cuni.amis.utils.token.Token token) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
static WorldObjectId |
get(double objId)
Returns shared instance of the
WorldObjectId for 'objId'. |
static WorldObjectId |
get(long objId)
Returns shared instance of the
WorldObjectId for 'objId'. |
static WorldObjectId |
get(String name)
Returns shared instance of the
WorldObjectId for 'name'. |
double |
getDoubleId()
Returns id as 'double', only iff
isDoubleId(), otherwise it raises a PogamutException. |
long |
getLongId()
Returns id as 'long', only iff
isLongId(), otherwise it raises a PogamutException. |
String |
getStringId()
Always returns a string representation of the ID.
|
int |
hashCode() |
boolean |
isDoubleId()
Whether the is is a double one.
|
boolean |
isLongId()
Whether the id is a long one.
|
boolean |
isNumericId()
Whether the id holds a numeric value (i.e., it is either
isLongId() or isDoubleId()). |
String |
toString()
Returns string representation of the id, format: WorldObjectId[id]
|
protected cz.cuni.amis.utils.token.Token token
protected boolean isLong
token.protected boolean isDouble
token.protected WorldObjectId(String name)
name - protected WorldObjectId(long id)
id - protected WorldObjectId(double id)
id - protected WorldObjectId(cz.cuni.amis.utils.token.Token token)
public String getStringId()
public boolean isNumericId()
isLongId() or isDoubleId()).public boolean isLongId()
public boolean isDoubleId()
public long getLongId()
isLongId(), otherwise it raises a PogamutException.public double getDoubleId()
isDoubleId(), otherwise it raises a PogamutException.public String toString()
public static WorldObjectId get(String name)
WorldObjectId for 'name'. If no WorldObjectId exists for 'name',
new one is created.
THREAD-SAFE!
name - public static WorldObjectId get(long objId)
WorldObjectId for 'objId'. If no WorldObjectId exists for 'objId',
new one is created.
THREAD-SAFE!
name - public static WorldObjectId get(double objId)
WorldObjectId for 'objId'. If no WorldObjectId exists for 'objId',
new one is created.
THREAD-SAFE!
name - Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.