类 Attribute


  • public class Attribute
    extends Object
    作者:
    Yaqiang Wang
    • 构造器详细资料

      • Attribute

        public Attribute​(String name)
        Constructor
        参数:
        name - Name
      • Attribute

        public Attribute​(String name,
                         org.meteoinfo.ndarray.Array values)
        Constructor
        参数:
        name - Name of attribute
        values - Values of attribute
      • Attribute

        public Attribute​(String name,
                         List values)
        Construct attribute with list of String or Number values.
        参数:
        name - name of attribute
        values - list of values. must be String or Number, must all be the same type, and have at least 1 member
      • Attribute

        public Attribute​(String name,
                         Number val)
        Create a scalar numeric-valued Attribute.
        参数:
        name - name of Attribute
        val - value of Attribute
      • Attribute

        public Attribute​(String name,
                         Number val,
                         boolean isUnsigned)
      • Attribute

        public Attribute​(String name,
                         String val)
        Create a String-valued Attribute.
        参数:
        name - name of Attribute
        val - value of Attribute
    • 方法详细资料

      • getShortName

        public String getShortName()
        Get short name
        返回:
        Short name
      • setShortName

        public void setShortName​(String value)
        Set short name
        参数:
        value - Short name
      • getName

        public String getName()
        Get name
        返回:
        Name
      • setName

        public void setName​(String value)
        Set name
        参数:
        value - Name
      • getLength

        public int getLength()
        Get length
        返回:
        Length
      • getDataType

        public org.meteoinfo.ndarray.DataType getDataType()
        Get data type
        返回:
        Data type
      • getStringValue

        public String getStringValue()
        Get string value
        返回:
        String value
      • getStringValue

        public String getStringValue​(int index)
        Get string value
        参数:
        index - Index
        返回:
        String value
      • setStringValue

        public void setStringValue​(String val)
        set the value as a String, trimming trailing zeroes
        参数:
        val - value of Attribute
      • getValues

        public org.meteoinfo.ndarray.Array getValues()
        Get values
        返回:
        Value array
      • getValue

        public Object getValue​(int index)
        Get value
        参数:
        index - Index
        返回:
        Value
      • getValue

        public Object getValue()
      • isString

        public boolean isString()
        The value is String or not
        返回:
        Boolean
      • isUnsigned

        public boolean isUnsigned()
        The value is Unsigned or not
        返回:
        Boolean
      • getNumericValue

        public Number getNumericValue()
        Get numeric value
        返回:
        Numeric value
      • getNumericValue

        public Number getNumericValue​(int index)
        Get numeric value
        参数:
        index - Index
        返回:
        Numeric value
      • setValues

        public void setValues​(org.meteoinfo.ndarray.Array arr)
        set the values from an Array
        参数:
        arr - value of Attribute
      • writeCDL

        protected void writeCDL​(Formatter f)