Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://angel.cs.msu.su/projects/system/toolsdoc/netcdf_java/ucar/netcdf/Attribute.html
Дата изменения: Tue Dec 28 20:59:06 2004 Дата индексирования: Sun Apr 10 00:14:17 2016 Кодировка: |
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ucar.netcdf.Attribute
Attributes are similar to "IndexedProperties" in the lingo of java beans. They have a name, type and an array of values. The array is often of length 1, degenerating into a simple property. The array should never be length 0. An Attribute object is used to contain netcdf "metadata", like units of a measurable quantity or its valid range.
These attributes have fixed values over their lifetime; no setValue() methods are provided.
Instances which have same name and same value elements are equal. We override hashCode() and equals() to be consistent with this semantic.
Constructor Summary | |
Attribute(java.lang.String name,
double value)
Construct simple numeric attribute. |
|
Attribute(java.lang.String name,
java.lang.Number value)
Construct simple numeric attribute. |
|
Attribute(java.lang.String name,
java.lang.Object theValue)
Construct an array valued Attribute. |
|
Attribute(java.lang.String name,
java.lang.String theValue)
Construct a string valued attribute. |
Method Summary | |
boolean |
equals(java.lang.Object oo)
Instances which have same name and same value elements are equal. |
java.lang.Object |
get(int index)
Retrieve indexed value. |
java.lang.Class |
getComponentType()
If the value represents an array type, returns the Class object representing the component type of the array; otherwise returns null. |
int |
getLength()
If the value represents an array type, returns the length of the value array; otherwise return String.length of the String value. |
java.lang.String |
getName()
Returns the name of this Attribute. |
java.lang.Number |
getNumericValue()
Retrieve simple numeric value. |
java.lang.Number |
getNumericValue(int index)
Retrieve indexed numeric value. |
java.lang.String |
getStringValue()
Retrieve String value. |
java.lang.Object |
getValue()
Retrieve the value in its most general form. |
int |
hashCode()
Instances which have same name and same value elements are equal. |
boolean |
isString()
If the value is an instance of String, return true
otherwise returns false |
void |
toCdl(java.lang.StringBuffer buf)
Format as CDL. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Attribute(java.lang.String name, java.lang.Number value)
name
- String which is to be the name of this Attributevalue
- A Number to be the Attribute valuepublic Attribute(java.lang.String name, double value)
name
- String which is to be the name of this Attributevalue
- A double to be the Attribute valuepublic Attribute(java.lang.String name, java.lang.String theValue)
name
- String which is to be the name of this AttributetheValue
- The valuepublic Attribute(java.lang.String name, java.lang.Object theValue)
name
- String which is to be the name of this AttributetheValue
- The value, an array of primitives. The primitive
type must be netcdf encodeable.Method Detail |
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object oo)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String getName()
getName
in interface ucar.netcdf.Named
public java.lang.Object getValue()
isString()
public java.lang.String getStringValue()
ClassCastException
- if this is not String valued.isString()
public java.lang.Object get(int index)
index
- int which is the index into the value array.value[index]
public java.lang.Number getNumericValue(int index)
index
- int which is the index into the value array.value[index]
public java.lang.Number getNumericValue()
getNumericValue(0)
public boolean isString()
true
otherwise returns false
public java.lang.Class getComponentType()
Class.getComponentType()
public int getLength()
public void toCdl(java.lang.StringBuffer buf)
buf
- StringBuffer into which to write
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |