Package net.quasardb.qdb.ts
Class Value
java.lang.Object
net.quasardb.qdb.ts.Value
- All Implemented Interfaces:
Serializable,Comparable<Value>
Represents a timeseries value.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionValue()Creates new value out of this value, that is, copies the underlying value.protectedValue(Value.Type type) -
Method Summary
Modifier and TypeMethodDescriptionintstatic ValuecreateBlob(byte[] value) Represents a blob value.static ValuecreateBlob(ByteBuffer value) Represents blob value.static ValuecreateDouble(double value) Represents a double value.static ValuecreateInt64(long value) Represents a long integerstatic ValueCreate a null / empty value.static ValuecreateSafeBlob(byte[] value) Represents a safe blob value that copies the byte array.static ValuecreateSafeBlob(ByteBuffer value) Creates a copy of a ByteBuffer into this Value.static ValuecreateString(String value) Create a new String value.static ValuecreateTimestamp(Timespec value) Represents a timestampIf this Value's type is a string, ensures that it creates a directly allocated ByteBuffer with a copy of the UTF-8 string representation.booleangetBlob()doublelonggetInt64()getType()booleanisNull()Returns true if this value is null.voidsetBlob(byte[] value) Updates value to take a certain blob value.voidsetBlob(ByteBuffer value) Updates value to take a certain blob value;voidsetDouble(double value) Updates value to take a certain double value;voidsetInt64(long value) Updates value to take a certain long integer value;voidsetNative(long batchTable, Value.Type columnType, int offset) voidsetNull()Updates value to represent an unintialised value.voidsetSafeBlob(byte[] value) Updates value to take a certain blob value.voidsetSafeBlob(ByteBuffer value) Updates value to take a certain blob value.voidUpdate this value to be a String.voidsetTimestamp(Timespec value) Updates value to take a certain timestamp;toString()
-
Constructor Details
-
Value
public Value() -
Value
-
Value
Creates new value out of this value, that is, copies the underlying value.
-
-
Method Details
-
createNull
Create a null / empty value. -
setNative
-
setNull
public void setNull()Updates value to represent an unintialised value. -
isNull
public boolean isNull()Returns true if this value is null. -
createInt64
Represents a long integer -
setInt64
public void setInt64(long value) Updates value to take a certain long integer value; -
createDouble
Represents a double value. -
setDouble
public void setDouble(double value) Updates value to take a certain double value; -
createTimestamp
Represents a timestamp -
setTimestamp
Updates value to take a certain timestamp; -
createBlob
Represents a blob value. Warning: assumes byte array will stay in memory for as long as this object lives. -
createBlob
Represents blob value. Warning: assumes bytebuffer will stay in memory for as long as this object lives. -
setBlob
public void setBlob(byte[] value) Updates value to take a certain blob value. Warning: assumes byte array will stay in memory for as long as this object lives. -
setBlob
Updates value to take a certain blob value; -
setSafeBlob
public void setSafeBlob(byte[] value) Updates value to take a certain blob value. Will create a copy of the byte array. -
setSafeBlob
Updates value to take a certain blob value. Will create copy of the byte array. -
createSafeBlob
Represents a safe blob value that copies the byte array. -
createSafeBlob
Creates a copy of a ByteBuffer into this Value. -
setString
Update this value to be a String. -
createString
Create a new String value.- Parameters:
value- String representation of value.
-
ensureByteBufferBackedString
If this Value's type is a string, ensures that it creates a directly allocated ByteBuffer with a copy of the UTF-8 string representation. Because this implies that the String is then represented as a direct ByteBuffer with a 'stable' memory region behind it, it'll allow us to use this buffer in native code safely for extended periods of time without requiring a copy.- Returns:
- Returns this value.
-
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<Value>
-
getType
-
getInt64
public long getInt64() -
getDouble
public double getDouble() -
getTimestamp
-
getBlob
-
getString
-
toString
-