|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.rt.util.Identity
public class Identity
A variable identity uniquely identifying a variable by its type and a set of key attribute values. The string representation of Identity is unique for the corresponding variable instance, too. In addition, the same identity may have a differentiating index when applied as a key in a map.
Nulls in key attribute values are handled as pattern parameters.
An optional attribute may be applied to identify a named attribute within a variable.
Note that getters return direct references to arrays causing changes to their elements to affect the internal state of the identity.
org.norther.tammi.demo.Test@Name-1:10001J 10002J
Field Summary | |
---|---|
static char |
ATTRIBUTE_DELIMITER
The attribute delimiter. |
static char |
ELEMENT_DELIMITER
The element delimiter. |
static char |
IDENTIFIER_DELIMITER
The identifier delimiter. |
Constructor Summary | |
---|---|
Identity(String name,
Object... ids)
Constucts a new identity. |
|
Identity(String type,
String attrib,
Object... ids)
Constucts a new attribute identity. |
|
Identity(Variable var)
Constucts a new variable identity. |
|
Identity(Variable var,
String attrib)
Constucts a new variable attribute identity. |
Method Summary | |
---|---|
Object |
clone()
|
boolean |
equals(Object object)
|
static Object |
fromString(String str)
Returns the string id as an object. |
String |
getAttribute()
Gets the attribute. |
int |
getIndex()
Gets the index. |
String |
getType()
Gets the class type. |
Object |
getValue()
Gets the key attribute value. |
Object[] |
getValues()
Gets the key attribute values. |
int |
hashCode()
|
boolean |
identifies(Variable var)
Checks whether this identity identifies the specified variable. |
boolean |
isIndexed()
Checks whether indexed. |
int |
length()
Returns the length of the id value array. |
void |
setAttribute(String attrib)
Sets the attribute. |
void |
setIndex(int ind)
Sets the index. |
String |
toPath()
Returns a path-like representation of the identity. |
String |
toString()
|
static String |
toString(Object id)
Returns the specified id as a string. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char ELEMENT_DELIMITER
public static final char ATTRIBUTE_DELIMITER
public static final char IDENTIFIER_DELIMITER
Constructor Detail |
---|
public Identity(String name, Object... ids)
Note that the keys should appear in the definition order of the corresponding attributes.
name
- the canonical name or class type.ids
- optional key values.public Identity(String type, String attrib, Object... ids)
type
- the class type.attrib
- the attribute.ids
- the key values.public Identity(Variable var)
var
- the variable.public Identity(Variable var, String attrib)
var
- the variable.attrib
- the attribute.Method Detail |
---|
public static String toString(Object id)
id
- the id.
public static Object fromString(String str)
str
- the string.
public boolean equals(Object object)
equals
in class Object
public int hashCode()
hashCode
in class Object
public Object clone()
clone
in class Object
public String toString()
toString
in class Object
public String toPath()
public Object getValue()
public Object[] getValues()
public String getType()
public String getAttribute()
public void setAttribute(String attrib)
attrib
- the attribute.public boolean isIndexed()
public int getIndex()
public void setIndex(int ind)
ind
- the index.public int length()
public boolean identifies(Variable var)
var
- the varianble.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |