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.protected
Value
(Value.Type type) -
Method Summary
Modifier and TypeMethodDescriptionint
static Value
createBlob
(byte[] value) Represents a blob value.static Value
createBlob
(ByteBuffer value) Represents blob value.static Value
createDouble
(double value) Represents a double value.static Value
createInt64
(long value) Represents a long integerstatic Value
Create a null / empty value.static Value
createSafeBlob
(byte[] value) Represents a safe blob value that copies the byte array.static Value
createSafeBlob
(ByteBuffer value) Creates a copy of a ByteBuffer into this Value.static Value
createString
(String value) Create a new String value.static Value
createTimestamp
(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.boolean
getBlob()
double
long
getInt64()
getType()
boolean
isNull()
Returns true if this value is null.void
setBlob
(byte[] value) Updates value to take a certain blob value.void
setBlob
(ByteBuffer value) Updates value to take a certain blob value;void
setDouble
(double value) Updates value to take a certain double value;void
setInt64
(long value) Updates value to take a certain long integer value;void
setNative
(long batchTable, Value.Type columnType, int offset) void
setNull()
Updates value to represent an unintialised value.void
setSafeBlob
(byte[] value) Updates value to take a certain blob value.void
setSafeBlob
(ByteBuffer value) Updates value to take a certain blob value.void
Update this value to be a String.void
setTimestamp
(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:
compareTo
in interfaceComparable<Value>
-
getType
-
getInt64
public long getInt64() -
getDouble
public double getDouble() -
getTimestamp
-
getBlob
-
getString
-
toString
-