visad
Class BaseQuantity
- java.lang.Object
-
- visad.BaseQuantity
-
- All Implemented Interfaces:
- java.io.Serializable
public final class BaseQuantity extends java.lang.Object implements java.io.SerializableThis class represents a base quantity (e.g. "length"). This class is mutable but monotonic: new base quantities can be added but not removed.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static BaseQuantityadd(java.lang.String name)Add a base quantity to the database.static BaseQuantityadd(java.lang.String name, java.lang.String alias)Add a base quantity with an alias to the database.static BaseQuantityadd(java.lang.String name, java.lang.String[] aliases)Add a base quantity with aliases to the database.static BaseQuantityget(int i)Retrieve the base quantity associated with a given index.static BaseQuantityget(java.lang.String name)Retrieve a base quantity from the database based on a match of either the name or an alias.static BaseQuantitygetByAlias(java.lang.String name)Retrieve a base quantity from the database based on a match of an alias.static BaseQuantitygetByName(java.lang.String name)Retrieve a base quantity from the database based on a match of the name.intgetIndex()Return the index of this base quantity.java.lang.StringgetName()Return the name of this base quantity.static intsize()Return the number of base qantities in the database.
-
-
-
Method Detail
-
add
public static BaseQuantity add(java.lang.String name) throws VisADException
Add a base quantity to the database.- Parameters:
name- The name of the base quantity.- Throws:
VisADException- Attempt to redefine an existing base quantity.
-
add
public static BaseQuantity add(java.lang.String name, java.lang.String alias) throws VisADException
Add a base quantity with an alias to the database.- Parameters:
name- The name of the base quantity being added to the database (e.g. "plane angle", "foobility").alias- An alias for the base quantity (e.g. "angle").- Returns:
- A reference to the new base quantity in the database.
- Throws:
VisADException- Attempt to redefine an existing base quantity or alias. If thrown, then the database is unmodified.
-
add
public static BaseQuantity add(java.lang.String name, java.lang.String[] aliases) throws VisADException
Add a base quantity with aliases to the database.- Parameters:
name- The name of the base quantity being added to the database (e.g. "plane angle", "foobility").aliases- Aliases for the base quantity (e.g. "angle").- Returns:
- A reference to the new base quantity in the database.
- Throws:
VisADException- Attempt to redefine an existing base quantity or alias. If thrown, then the database is unmodified.
-
size
public static int size()
Return the number of base qantities in the database.- Returns:
- The current number of base quantities in the database. This number is strictly monotonic: it will increase by one each time a new base quantity is added to the database.
-
getName
public java.lang.String getName()
Return the name of this base quantity.- Returns:
- The name of this base quantity.
-
getIndex
public int getIndex()
Return the index of this base quantity.- Returns:
- The index of this base quantity.
-
getByName
public static BaseQuantity getByName(java.lang.String name)
Retrieve a base quantity from the database based on a match of the name.- Parameters:
name- The name of the base quantity to be retrieved.- Returns:
- The base quantity in the database corresponding
to
nameornullif no such quantity exists.
-
getByAlias
public static BaseQuantity getByAlias(java.lang.String name)
Retrieve a base quantity from the database based on a match of an alias.- Parameters:
name- An alias of the base quantity to be retrieved.- Returns:
- The base quantity in the database corresponding
to
nameornullif no such quantity exists.
-
get
public static BaseQuantity get(java.lang.String name)
Retrieve a base quantity from the database based on a match of either the name or an alias. Try the name first.- Parameters:
name- The name or an alias of the base quantity to be retrieved.- Returns:
- The base quantity in the database corresponding
to
nameornullif no such quantity exists.
-
get
public static BaseQuantity get(int i)
Retrieve the base quantity associated with a given index.- Parameters:
i- The origin-0 index of the base quantity.- Returns:
- The base quantity at index
i.
-
-
DMelt 3.0 © DataMelt by jWork.ORG