|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object visad.MathType visad.ScalarType
public abstract class ScalarType
ScalarType is the superclass of the VisAD hierarchy of scalar data types.
Constructor Summary | |
---|---|
ScalarType(String name)
Create a ScalarType with the specified name. |
Method Summary | |
---|---|
void |
alias(String alias)
Change the primary name for this ScalarType . |
int |
compareTo(Object obj)
Compares this object with another of the same type. |
boolean |
equals(Object obj)
Indicates if this ScalarType is the same as another object. |
String |
getAlias()
Returns the alias of this instance or null if this instance
has no alias. |
String |
getName()
Returns this ScalarType 's name. |
String |
getNameWithBlanks()
|
String |
getOriginalName()
Returns the original name of this instance. |
static ScalarType |
getScalarTypeByName(String name)
Get the ScalarType which has the specified name. |
int |
hashCode()
Obtains the hash code for this object. |
protected Object |
readResolve()
Returns the instance corresponding to this newly deserialized instance. |
static void |
validateName(String name,
String type)
Throw a TypeException if the name is invalid. |
Methods inherited from class visad.MathType |
---|
addTimeAlias, binary, buildShadowType, cloneDerivative, equalsExceptName, equalsExceptNameButUnits, findScalarType, guessMaps, main, missingData, prettyString, prettyString, stringToType, toString, unary |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ScalarType(String name) throws VisADException
ScalarType
with the specified name.
name
- The name of this ScalarType
VisADException
- If the name is not valid.Method Detail |
---|
public int compareTo(Object obj)
compareTo
in interface Comparable
obj
- The other object of the same type.
ClassCastException
- if the object is not a ScalarType
.public boolean equals(Object obj)
equals
in class MathType
obj
- The other object.
true
if and only if the other object is a
ScalarType and compares equal to this ScalarType.public int hashCode()
scalarType1.equals(scalarType2)
, then
scalarType1.hashCode() == scalarType2.hashCode()
.
hashCode
in class Object
public void alias(String alias) throws TypeException
ScalarType
.
The original name can still be used.If multiple aliases are created, the last one is dominant.
This is handy for translating standard VisAD RealType
names to a language other than English.
alias
- The new name.
TypeException
- If the new name is not valid.public final String getName()
ScalarType
's name. If an alias exists, then it
it is returned; otherwise, the name given to the constructor is used.
ScalarType
.public final String getOriginalName()
public final String getAlias()
null
if this instance
has no alias. This method returns the alias set by the most recent
alias(String)
invocation.
null
.public String getNameWithBlanks()
public static ScalarType getScalarTypeByName(String name)
ScalarType
which has the specified name.
name
- Name of ScalarType
.
ScalarType
if found,
or null
.public static void validateName(String name, String type) throws TypeException
TypeException
if the name is invalid.
name
- Name to check.type
- Type used in exception message.
TypeException
- If there is a problem with the name.protected final Object readResolve() throws InvalidObjectException
Returns the instance corresponding to this newly deserialized instance. If a ScalarType with the same name as this instance already exists and is compatible with this instance, then it is returned. Otherwise, this instance is returned.
This method is protected so that it is always invoked during deserialization and final to prevent subclasses from evading it.
InvalidObjectException
- if an incompatible ScalarType with the same
name as this instance already exists.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |