Class _Attribute

java.lang.Object
uk.ac.diamond.datamodel.generic._Attribute
All Implemented Interfaces:
Attribute, Element

public class _Attribute extends Object implements Attribute
The Generic Data Model (GDM) packages are a light-weight in-memory implementation of the ucar.netcdf Common Data Model (CDM). The GDM Attribute elements provide annotation for the other GDM elements. Attribute keys must be unique for the same parent element. In the 2009/10 version of the GDM, attributes are always Strings.
  • Constructor Details

    • _Attribute

      public _Attribute(String key, String value)
    • _Attribute

      public _Attribute()
  • Method Details

    • factory

      public static Attribute factory(String key, String value)
    • factory

      public static Attribute factory(Object config)
    • getKey

      public String getKey()
      Specified by:
      getKey in interface Attribute
    • getValue

      public String getValue()
      Specified by:
      getValue in interface Attribute
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Attribute a)
      Description copied from interface: Attribute
      Test the equality of Attributes
      Specified by:
      equals in interface Attribute
      Parameters:
      a - attribute to test equality with
      Returns:
      true if attributes have same key and same value
    • sameKeyAs

      public boolean sameKeyAs(Attribute a)
      Description copied from interface: Attribute
      Test the equality of Attribute keys
      Specified by:
      sameKeyAs in interface Attribute
      Parameters:
      a - Attribute with the key to test equality with
      Returns:
      true if attributes have same key strings
    • setKey

      public void setKey(String key)
    • setValue

      public void setValue(String value)
      Specified by:
      setValue in interface Attribute
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toXml

      public String toXml()
      Specified by:
      toXml in interface Element
    • getBaseType

      public BaseType getBaseType()
      Specified by:
      getBaseType in interface Element