com.jstatcom.model
Class JSCConstants
- java.lang.Object
-
- com.jstatcom.model.JSCConstants
-
public class JSCConstants extends java.lang.ObjectThis 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");
-
-
Field Summary
Fields Modifier and Type Field and Description static booleanDEBUGDebug flag that can be set with theDEBUGproperty.static java.lang.DoubleNaNMissing value.static longNaNLongBitsMissing value aslong.static java.lang.DoubleNEG_INFNegative infinity.static java.lang.DoublePOS_INFPositive infinity.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static java.lang.StringcheckNameThrowEx(java.lang.String name)Checks whethernameis a valid variable name and throws an exception of not.booleanequals(java.lang.Object o)Override prevention method to enforcea.equals(b)if and onlyif a==b.static java.lang.StringgetSystemTemp()Reads out the system propertyjava.io.tempdir.static java.lang.StringgetUserDir()Reads out the system propertyuser.dir.static java.lang.StringgetUserHome()Reads out the system propertyhome.inthashCode()Override prevention method invokes super method.static java.lang.StringisValidName(java.lang.String name)Checks whethernameconforms to the rules for valid variable names.java.lang.StringtoString()Gets string representation of this object.
-
-
-
Field Detail
-
DEBUG
public static boolean DEBUG
Debug flag that can be set with theDEBUGproperty.
-
NaN
public static final java.lang.Double NaN
Missing value.
-
NaNLongBits
public static final long NaNLongBits
Missing value aslong.
-
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 whethernameis a valid variable name and throws an exception of not.Important:
nullis allowed as an argument because this is often convenient. In this casenullis returned.- Parameters:
name- the string to check- Returns:
- trimmed
nameif ok ornullifnamewasnull - Throws:
java.lang.IllegalArgumentException- with error stringif (JSCConstants.isValidName(name) != null)
-
equals
public final boolean equals(java.lang.Object o)
Override prevention method to enforcea.equals(b)if and onlyif a==b.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- object to compare with- Returns:
trueif equal,falseotherwise
-
hashCode
public final int hashCode()
Override prevention method invokes super method.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hash code
-
isValidName
public static java.lang.String isValidName(java.lang.String name)
Checks whethernameconforms to the rules for valid variable names. Valid names must not benullor 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:
nullif ok, error message otherwise
-
toString
public java.lang.String toString()
Gets string representation of this object.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string
-
getSystemTemp
public static java.lang.String getSystemTemp()
Reads out the system propertyjava.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 propertyuser.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 propertyhome.- Returns:
- the directory name of the user's home directory
- Throws:
java.lang.RuntimeException- if property is empty
-
-
DMelt 3.0 © DataMelt by jWork.ORG