Class StringAttribute

java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.StringAttribute
All Implemented Interfaces:
Attribute, DeepCopy, Displayable
Direct Known Subclasses:
ArrowShapeAttribute, ChartAttribute, ChartColorAttribute, ClusterColorAttribute, CompoundAttribute, CompoundPositionAttribute, EdgeShapeAttribute, FontAttribute, KeggGroupPartAttribute, KeggIdAttribute, KeggReactionIdAttribute, KeggReactionTypeAttribute, KeggRelationSrcTgtAttribute, KeggRelationSubTypeAttribute, KeggRelationTypeAttribute, KeggTypeAttribute, LabelAlignmentAttribute, LabelColorAttribute, LabelFontAttribute, LabelStyleAttribute, NodePathwayLinkVisualizationAttribute, NodeShapeAttribute, ObjectAttribute, SourceDockingAttribute, TargetDockingAttribute, URLAttribute, XMLAttribute

public class StringAttribute
extends AbstractAttribute
Contains a String.
Version:
$Revision: 1.8 $
  • Constructor Details

    • StringAttribute

      public StringAttribute​(String id, String value)
      Constructs a new instance of a StringAttribute with the given value.
      Parameters:
      id - the id of the attribute.
      value - the value of the Attribute.
    • StringAttribute

      public StringAttribute()
  • Method Details

    • getTypedStringAttribute

      public static Attribute getTypedStringAttribute​(String id)
    • getTypedStringAttribute

      public static Attribute getTypedStringAttribute​(String id, String value)
    • setDefaultValue

      public void setDefaultValue()
      Description copied from interface: Attribute
      The attribute's value is set so that its getValue() method will not return null.
      See Also:
      Attribute.setDefaultValue()
    • setString

      public void setString​(String value)
      Sets the value of this object. The ListenerManager is informed by the method setValue().
      Parameters:
      value - the new value of this object.
    • getString

      public String getString()
      Returns the value of this object.
      Returns:
      the value of this object.
    • getValue

      public Object getValue()
      Returns the value of this attribute, i.e. contained Sting object.
      Returns:
      the value of the attribute, i.e. contained String object.
    • copy

      public Object copy()
      Returns a deep copy of this instance.
      Returns:
      a deep copy of this instance.
    • toString

      public String toString​(int n)
      Description copied from interface: Attribute
      Returns a string representation prepended by n spaces of this attribute.
      Specified by:
      toString in interface Attribute
      Overrides:
      toString in class AbstractAttribute
      Returns:
      DOCUMENT ME!
      See Also:
      Attribute.toString(int)
    • toXMLString

      public String toXMLString()
      Description copied from interface: Displayable
      Returns a well-formed XML string representing the Displayable. The Displayable should be reconstructable via this representation. Therefore it must at least include the type of Displayable (classname) and a representation of its value. PROBABLE FUTURE DESIGN: The Displayables themselves will provide a method to reconstruct their value from the XML representation they provided.
      Specified by:
      toXMLString in interface Displayable
      Overrides:
      toXMLString in class AbstractAttribute
      Returns:
      string holding an XML representation of this Displayable
      See Also:
      Displayable.toXMLString()
    • putAttributeType

      public static void putAttributeType​(String id, Class<? extends Attribute> attributeType)