netkit.graph
Class AttributeKey

java.lang.Object
  extended by netkit.graph.Attribute
      extended by netkit.graph.AttributeCategorical
          extended by netkit.graph.AttributeExpandableCategorical
              extended by netkit.graph.AttributeKey

public final class AttributeKey
extends AttributeExpandableCategorical

This class handles attributes that are of type KEY. KEY types have values that must be unique among all entities in the same attribute container.

Author:
Kaveh R. Ghazi
See Also:
Attributes, SchemaReader

Field Summary
 
Fields inherited from class netkit.graph.AttributeCategorical
tokenSet
 
Constructor Summary
AttributeKey(java.lang.String name)
          The constructor must be provided the name for this attribute.
 
Method Summary
 double parseAndInsert(java.lang.String token)
          Parses the supplied string token for insertion into this attribute and converts the token into a double value;
 
Methods inherited from class netkit.graph.AttributeExpandableCategorical
addToken
 
Methods inherited from class netkit.graph.AttributeCategorical
formatForOutput, getToken, getTokens, getValue, size
 
Methods inherited from class netkit.graph.Attribute
getName, getType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeKey

public AttributeKey(java.lang.String name)
The constructor must be provided the name for this attribute.

Parameters:
name - a String representing the name of this attribute.
Method Detail

parseAndInsert

public double parseAndInsert(java.lang.String token)
Parses the supplied string token for insertion into this attribute and converts the token into a double value;

Overrides:
parseAndInsert in class AttributeExpandableCategorical
Parameters:
token - the string value to parse.
Returns:
the token converted into an double.
Throws:
java.lang.RuntimeException - if the token is "?".
java.lang.RuntimeException - if the token is a duplicate.