com.jstatcom.model
Class JSCConstants

java.lang.Object
  extended by com.jstatcom.model.JSCConstants

public class JSCConstants
extends java.lang.Object

This class contains miscellaneous constants for the data model. The class might be extended to create subclasses that add further constants by using the following declaration:

public static final JSCConstants NEW_CONSTANT = new JSCConstants("NEW_CONSTANT");

Author:
Markus Kraetzig

Field Summary
static boolean DEBUG
          Debug flag that can be set with the DEBUG property.
static java.lang.Double NaN
          Missing value.
static long NaNLongBits
          Missing value as long.
static java.lang.Double NEG_INF
          Negative infinity.
static java.lang.Double POS_INF
          Positive infinity.
 
Method Summary
static java.lang.String checkNameThrowEx(java.lang.String name)
          Checks whether name is a valid variable name and throws an exception of not.
 boolean equals(java.lang.Object o)
          Override prevention method to enforce a.equals(b) if and only if a==b.
static java.lang.String getSystemTemp()
          Reads out the system property java.io.tempdir.
static java.lang.String getUserDir()
          Reads out the system property user.dir.
static java.lang.String getUserHome()
          Reads out the system property home.
 int hashCode()
          Override prevention method invokes super method.
static java.lang.String isValidName(java.lang.String name)
          Checks whether name conforms to the rules for valid variable names.
 java.lang.String toString()
          Gets string representation of this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
Debug flag that can be set with the DEBUG property.


NaN

public static final java.lang.Double NaN
Missing value.


NaNLongBits

public static final long NaNLongBits
Missing value as long.


POS_INF

public static final java.lang.Double POS_INF
Positive infinity.


NEG_INF

public static final java.lang.Double NEG_INF
Negative infinity.

Method Detail

checkNameThrowEx

public static java.lang.String checkNameThrowEx(java.lang.String name)
Checks whether name is a valid variable name and throws an exception of not.

Important:
null is allowed as an argument because this is often convenient. In this case null is returned.

Parameters:
name - the string to check
Returns:
trimmed name if ok or null if name was null
Throws:
java.lang.IllegalArgumentException - with error string if (JSCConstants.isValidName(name) != 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

hashCode

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

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

isValidName

public static java.lang.String isValidName(java.lang.String name)
Checks whether name conforms to the rules for valid variable names. Valid names must not be null or empty and must begin with either a letter or '_' . They may contain letters, digits and '_', but no other characters or whitespace.

Parameters:
name - the name to be checked
Returns:
null if ok, error message otherwise

toString

public java.lang.String toString()
Gets string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
a string

getSystemTemp

public static java.lang.String getSystemTemp()
Reads out the system property java.io.tempdir.

Returns:
the directory name of the temporary directory
Throws:
java.lang.RuntimeException - if property is empty

getUserDir

public static java.lang.String getUserDir()
Reads out the system property user.dir.

Returns:
the directory name of the user directory
Throws:
java.lang.RuntimeException - if property is empty

getUserHome

public static java.lang.String getUserHome()
Reads out the system property home.

Returns:
the directory name of the user's home directory
Throws:
java.lang.RuntimeException - if property is empty