public abstract class ScalarType extends MathType implements Comparable
Constructor and Description |
---|
ScalarType(String name)
Create a
ScalarType with the specified name. |
Modifier and Type | Method and Description |
---|---|
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. |
addTimeAlias, binary, buildShadowType, cloneDerivative, equalsExceptName, equalsExceptNameButUnits, findScalarType, guessMaps, main, missingData, prettyString, prettyString, stringToType, toString, unary
public ScalarType(String name) throws VisADException
ScalarType
with the specified name.name
- The name of this ScalarType
VisADException
- If the name is not valid.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)
public int hashCode()
scalarType1.equals(scalarType2)
, then
scalarType1.hashCode() == scalarType2.hashCode()
.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.Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.