|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.unidata.util.Parameter
public class Parameter
A parameter has a name and a value that is String, a double, or an array of doubles. A substitute for ucar.nc2.Attribute, to prevent dependencies of the ucar.unidata packages on ucar.nc2.
Constructor Summary | |
---|---|
Parameter(String name,
double value)
Create a scalar double-valued param. |
|
Parameter(String name,
double[] value)
Create a array double-valued param. |
|
Parameter(String name,
Parameter from)
Copy constructir, with new name. |
|
Parameter(String name,
String val)
Create a String-valued param. |
Method Summary | |
---|---|
boolean |
equals(Object oo)
Instances which have same content are equal. |
int |
getLength()
Get the number of values. |
String |
getName()
Get the name of this Parameter. |
double |
getNumericValue()
Retrieve numeric value, use if isString() is false. |
double |
getNumericValue(int i)
Get the ith numeric value. |
double[] |
getNumericValues()
Get array of numeric values as doubles. |
String |
getStringValue()
Retrieve String value; only call if isString() is true. |
int |
hashCode()
Override Object.hashCode() to implement equals. |
boolean |
isString()
True if value is a String. |
String |
toString()
String representation |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Parameter(String name, Parameter from)
name
- name of new Parameter.from
- copy values from here.public Parameter(String name, String val)
name
- name of new Parameter.val
- value of Parameterpublic Parameter(String name, double value)
name
- name of new Parameter.value
- value of Parameterpublic Parameter(String name, double[] value)
name
- name of new Parameter.value
- value of ParameterMethod Detail |
---|
public String getName()
public boolean isString()
public String getStringValue()
public double getNumericValue()
getNumericValue(0)
public double getNumericValue(int i)
i
- index
public int getLength()
public double[] getNumericValues()
public boolean equals(Object oo)
equals
in class Object
oo
- compare to this Parameter.
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |