Documentation of 'visad.ScalarType' Java class
ScalarType
visad

Class ScalarType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable
    Direct Known Subclasses:
    RealType, TextType


    public abstract class ScalarType
    extends MathType
    implements java.lang.Comparable
    ScalarType is the superclass of the VisAD hierarchy of scalar data types.
    See Also:
    Serialized Form
    • Constructor Detail

      • ScalarType

        public ScalarType(java.lang.String name)
                   throws VisADException
        Create a ScalarType with the specified name.
        Parameters:
        name - The name of this ScalarType
        Throws:
        VisADException - If the name is not valid.
    • Method Detail

      • compareTo

        public int compareTo(java.lang.Object obj)
        Compares this object with another of the same type. The comparison is on the names.
        Specified by:
        compareTo in interface java.lang.Comparable
        Parameters:
        obj - The other object of the same type.
        Returns:
        A value less than zero, zero, or greater than zero depending on whether this object is considered less than, equal to, or greater than the other object, respectively.
        Throws:
        java.lang.ClassCastException - if the object is not a ScalarType.
      • equals

        public boolean equals(java.lang.Object obj)
        Indicates if this ScalarType is the same as another object.
        Specified by:
        equals in class MathType
        Parameters:
        obj - The other object.
        Returns:
        true if and only if the other object is a ScalarType and compares equal to this ScalarType.
      • hashCode

        public int hashCode()
        Obtains the hash code for this object. If scalarType1.equals(scalarType2), then scalarType1.hashCode() == scalarType2.hashCode().
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code for this object.
      • alias

        public void alias(java.lang.String alias)
                   throws TypeException
        Change the primary name for this 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.

        Parameters:
        alias - The new name.
        Throws:
        TypeException - If the new name is not valid.
      • getName

        public final java.lang.String getName()
        Returns this ScalarType's name. If an alias exists, then it it is returned; otherwise, the name given to the constructor is used.
        Returns:
        The name of this ScalarType.
      • getOriginalName

        public final java.lang.String getOriginalName()
        Returns the original name of this instance. This method ignores any alias and returns the name given to the constructor.
        Returns:
        The original name.
      • getAlias

        public final java.lang.String getAlias()
        Returns the alias of this instance or null if this instance has no alias. This method returns the alias set by the most recent alias(String) invocation.
        Returns:
        The alias or null.
      • getNameWithBlanks

        public java.lang.String getNameWithBlanks()
      • getScalarTypeByName

        public static ScalarType getScalarTypeByName(java.lang.String name)
        Get the ScalarType which has the specified name.
        Parameters:
        name - Name of ScalarType.
        Returns:
        Either the ScalarType if found, or null.
      • validateName

        public static void validateName(java.lang.String name,
                                        java.lang.String type)
                                 throws TypeException
        Throw a TypeException if the name is invalid.
        Parameters:
        name - Name to check.
        type - Type used in exception message.
        Throws:
        TypeException - If there is a problem with the name.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.