com.jstatcom.ts
Class TSTypes

java.lang.Object
  extended by com.jstatcom.ts.TSTypes

public class TSTypes
extends java.lang.Object

This class contains an enumeration of constants that define different types of time series.

It implements the typesave enum pattern (Joshua Bloch, "Effective Java", Item 21) . If you compare TSTypes, always use the == operator. This is save, because they are Singletons (Gamma et al., 1995) .

Author:
Markus Kraetzig

Field Summary
static TSTypes DETERMINISTIC
          Type for deterministic series.
static TSTypes ENDOGENOUS
          Type for endogenous series.
static TSTypes EXOGENOUS
          Type for exogenous series.
 
Constructor Summary
TSTypes(java.lang.String name)
          Creates a TSTypes with a descriptive name.
 
Method Summary
 boolean equals(java.lang.Object o)
          Override prevention method to enforce a.equals(b) if and only if a==b.
 javax.swing.Icon getIcon()
          Gets the respective icon that visualizes the property.
 java.lang.String getName()
          Gets the name of the type.
 int hashCode()
          Override prevention method invokes super method.
 java.lang.String toString()
          Returns a string representation of the type, do not use for comparisons.
static TSTypes valueOf(java.lang.String str)
          Factory method that gets a reference to the static type from an identifying string.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ENDOGENOUS

public static final TSTypes ENDOGENOUS
Type for endogenous series.


EXOGENOUS

public static final TSTypes EXOGENOUS
Type for exogenous series.


DETERMINISTIC

public static final TSTypes DETERMINISTIC
Type for deterministic series.

Constructor Detail

TSTypes

public TSTypes(java.lang.String name)
Creates a TSTypes with a descriptive name.

Parameters:
name - identifier
Throws:
java.lang.IllegalStateException - if a type with the same name has already been created before
java.lang.IllegalArgumentException - if (name == null)
Method Detail

valueOf

public static final TSTypes valueOf(java.lang.String str)
Factory method that gets a reference to the static type from an identifying string. The lookup is case insensitive.

Parameters:
str - type name
Returns:
singleton instance for the type name, or null if no such type exists
Throws:
java.lang.IllegalArgumentException - if (str == null)

equals

public final boolean equals(java.lang.Object o)
Override prevention method to enforce a.equals(b) if and only if a==b.

Overrides:
equals in class java.lang.Object
Parameters:
o - object to compare with
Returns:
true if equal, false otherwise

getIcon

public javax.swing.Icon getIcon()
Gets the respective icon that visualizes the property.

Returns:
icon for visualization of this type

getName

public final java.lang.String getName()
Gets the name of the type. Do not use for comparisons, but compare by reference.

Returns:
name of this type

hashCode

public final int hashCode()
Override prevention method invokes super method.

Overrides:
hashCode in class java.lang.Object
Returns:
hash code

toString

public final java.lang.String toString()
Returns a string representation of the type, do not use for comparisons.

Overrides:
toString in class java.lang.Object
Returns:
string representing this type