ist.palcom.hmap
Class HmapKey
java.lang.Object
ist.palcom.hmap.HmapKey
public class HmapKey
- extends Object
An HmapKey represents the identity for any HmapNode.
I is a (name, type) pair, but only one of the two need be present.
Thus, as types are not sibling unique, neither can keys be guaranteed to be.
HmapKey
public HmapKey(String name,
String typeName,
String typeVersion,
String typeFullyQualifiedName)
- Parameters:
name - The name of the key (node)type - The type object corresponding to the type of the node
HmapKey
public HmapKey(String name)
fromString
public static HmapKey fromString(String encodedString)
toString
public static String toString(HmapKey key)
toString
public String toString()
- Overrides:
toString in class Object
- Returns:
- A stringified version of this key. The representation is stored for later use.
equals
public boolean equals(HmapKey key)
- Checks another key for equity with this one.
As names are guaranteed to be unique, the name is the only thing necessary to chek,
unless both keys only have types. In that case, it is purely a type comparison mechanism.
- Parameters:
key - The key to be compared with
- Returns:
- true if the keys have the same name and/or type. False is not
hasName
public boolean hasName()
- Returns:
- true if the key has a name. False if not
hasTypeName
public boolean hasTypeName()
- Returns:
- true if the key has a type name. False if not
hasTypeVersion
public boolean hasTypeVersion()
- Returns:
- true of the key has a type version. False if not
hasTypeFullyQualifiedName
public boolean hasTypeFullyQualifiedName()
- Returns:
- true if the key has a type fully qualified name. False if not.
getName
public String getName()
- Returns:
- The name of the key. Null if it has none
getTypeName
public String getTypeName()
- Returns:
- The name of the type of the key.
getTypeVersion
public String getTypeVersion()
- Returns:
- A version string of the type of the key
getTypeFullyQualifiedName
public String getTypeFullyQualifiedName()
- Returns:
- The fully qualified name of the key
setName
public void setName(String name)
- Sets the name of the key. Resets the internal string representation of the key
- Parameters:
name - The new name of the key