netkit.graph
Class AttributeIgnore

java.lang.Object
  extended by netkit.graph.Attribute
      extended by netkit.graph.AttributeIgnore

public final class AttributeIgnore
extends Attribute

This class handles attributes that are of type IGNORE. IGNORE attributes are all filled in as 'missing'. This class is immutable.

Author:
Sofus A. Macskassy (sofmac@gmail.com)
See Also:
Attributes, SchemaReader

Constructor Summary
AttributeIgnore(java.lang.String name)
          The constructor must be provided the name for this attribute.
 
Method Summary
 java.lang.String formatForOutput(double value)
          Formats the supplied value from this attribute as a String for output.
 double parseAndInsert(java.lang.String token)
          Parses the supplied string token for insertion into this attribute and converts the token into a double value; a "?" token results in NaN.
 
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

AttributeIgnore

public AttributeIgnore(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; a "?" token results in NaN.

Specified by:
parseAndInsert in class Attribute
Parameters:
token - the string value to parse.
Returns:
the token converted into an double.
Throws:
java.lang.NumberFormatException - if the token does not contain a parsable integer.

formatForOutput

public java.lang.String formatForOutput(double value)
Description copied from class: Attribute
Formats the supplied value from this attribute as a String for output. Subclasses will supply their own mechanism for conversion.

Specified by:
formatForOutput in class Attribute
Parameters:
value - a double to be converted into an output String.
Returns:
a String representing the supplied value.