Class Value
java.lang.Object
com.sparsity.sparksee.gdb.Value
Value class.
It is a container which stores a value and its data type (domain). A Value can be NULL.
- Author:
- Sparsity Technologies http://www.sparsity-technologies.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intMaximum number of characters allowed for a String. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares with the given Value.intSee compare().intSee compare().booleanCompares with the given Value.booleanbooleanGets Boolean Value.Gets the DataType.doubleGets Double Value.intGets Integer Value.longgetLong()Gets Long Value.longgetOID()Gets OID Value.Gets String Value.longGets Timestamp Value.Gets the Value as a Calendar instance.Gets the Value as a Date instance.inthashCode()booleanisNull()Gets if this is a NULL Value.Sets the Value.setBoolean(boolean value) Sets the Value.voidsetBooleanVoid(boolean value) Sets the Value.setDouble(double value) Sets the Value.voidsetDoubleVoid(double value) Sets the Value.setInteger(int value) Sets the Value.voidsetIntegerVoid(int value) Sets the Value.setLong(long value) Sets the Value.voidsetLongVoid(long value) Sets the Value.setNull()Sets the Value to NULL.voidSets the Value to NULL.setOID(long value) Sets the Value.voidsetOIDVoid(long value) Sets the OID Value.Sets the Value.voidsetStringVoid(String value) Sets the Value.setTimestamp(int year, int month, int day, int hour, int minutes, int seconds, int millisec) Sets the Value.setTimestamp(Calendar value) Sets the Value.setTimestamp(Date value) Sets the Value.voidsetTimestampVoid(int year, int month, int day, int hour, int minutes, int seconds, int millisecs) Sets the Value.voidsetTimestampVoid(long value) Sets the Value.voidSets the Value.toString()Gets a String representation of the Value.Gets a string representation of the Value.
-
Field Details
-
MaxLengthString
public static int MaxLengthStringMaximum number of characters allowed for a String.
-
-
Constructor Details
-
Value
public Value()Creates a new instance.It creates a NULL Value.
-
Value
-
-
Method Details
-
equals
-
getTimestamp
public long getTimestamp()Gets Timestamp Value.This must be a non-NULL Timestamp Value.
- Returns:
- The Timestamp Value.
-
getLong
public long getLong()Gets Long Value.This must be a non-NULL Long Value.
- Returns:
- The Long Value.
-
setNull
-
setInteger
Sets the Value.- Parameters:
value- New value.- Returns:
- The calling instance.
-
setDoubleVoid
public void setDoubleVoid(double value) Sets the Value.- Parameters:
value- [in] New Double value.
-
toString
-
setOID
Sets the Value.- Parameters:
value- New value.- Returns:
- The calling instance.
-
getInteger
public int getInteger()Gets Integer Value.This must be a non-NULL Integer Value.
- Returns:
- The Integer Value.
-
getTimestampAsCalendar
Gets the Value as a Calendar instance.- Returns:
- The returning Calendar instance.
-
setDouble
Sets the Value.- Parameters:
value- New value.- Returns:
- The calling instance.
-
getTimestampAsDate
Gets the Value as a Date instance.- Returns:
- The returning Date instance.
-
setTimestampVoid
public void setTimestampVoid(int year, int month, int day, int hour, int minutes, int seconds, int millisecs) Sets the Value.year[in] The year (>=1970).
- Parameters:
year- [in] The year (>=1970).month- [in] The month ([1..12]).day- [in] The of the month ([1..31]).hour- [in] The hour ([0..23]).minutes- [in] The minutes ([0..59]).seconds- [in] The seconds ([0..59]).millisecs- [in] The milliseconds ([0..999]).
-
equals
Compares with the given Value.It does not work if the given Value objects does not have the same DataType.
- Parameters:
value- Given value to compare to.- Returns:
- TRUE if this Value is equal to the given one; FALSE otherwise.
-
setBooleanVoid
public void setBooleanVoid(boolean value) Sets the Value.- Parameters:
value- [in] New Boolean value.
-
hashCode
-
setOIDVoid
public void setOIDVoid(long value) Sets the OID Value.- Parameters:
value- [in] New OID value.
-
compareTo
-
setLongVoid
public void setLongVoid(long value) Sets the Value.- Parameters:
value- [in] New Long value.
-
setTimestamp
public Value setTimestamp(int year, int month, int day, int hour, int minutes, int seconds, int millisec) Sets the Value.- Parameters:
year- The year (>=1970).month- The month ([1..12]).day- The day of the month ([1..31]).hour- The hour ([0..23]).minutes- The minutes ([0..59]).seconds- The seconds ([0..59]).millisec- The milliseconds ([0..999]).- Returns:
- The calling instance.
-
compare
Compares with the given Value.It does not work if the given Value objects does not have the same DataType.
- Parameters:
value- Given value to compare to.- Returns:
- 0 if this Value is equal to the given one; a value less than 0 if this Value is less than the given one; and a value greater than 0 if this Value is greater than the given one.
-
getOID
public long getOID()Gets OID Value.This must be an non-NULL OID Value.
- Returns:
- The OID Value.
-
getBoolean
public boolean getBoolean()Gets Boolean Value.This must be a non-NULL Boolean Value.
- Returns:
- The Boolean Value.
-
set
-
setTimestamp
-
getDataType
-
setTimestamp
-
compareTo
See compare().This just works if the given object is a Value instance.
- Parameters:
value- null
-
setLong
Sets the Value.- Parameters:
value- New value.- Returns:
- The calling instance.
-
setString
-
getDouble
public double getDouble()Gets Double Value.This must be a non-NULL Double Value.
- Returns:
- The Double Value.
-
setStringVoid
-
setVoid
-
setTimestampVoid
public void setTimestampVoid(long value) Sets the Value.- Parameters:
value- [in] New Timestamp value.
-
toString
-
setIntegerVoid
public void setIntegerVoid(int value) Sets the Value.- Parameters:
value- [in] New Integer value.
-
isNull
public boolean isNull()Gets if this is a NULL Value.- Returns:
- TRUE if this is a NULL Value, FALSE otherwise.
-
getString
Gets String Value.This must be a non-NULL String Value.
- Returns:
- The String Value.
-
setNullVoid
public void setNullVoid()Sets the Value to NULL. -
setBoolean
Sets the Value.- Parameters:
value- New value.- Returns:
- The calling instance.
-