public final class BinaryRegister extends Object implements ScalarRegister, BinarySettable
BinaryValued object.| Constructor and Description |
|---|
BinaryRegister()
Creates a new null-valued register.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
asBinary()
Gets the contained binary value.
|
byte[] |
asBinaryRef()
Gets a reference to the contained binary value.
|
ScalarTokenType |
getType()
Gets the data type of the token.
|
boolean |
isNull()
Indicates whether the token is null valued.
|
boolean |
isZero()
Indicates whether the value is the zero value
for the type.
|
void |
set(byte[] data)
Sets the container to the given binary data.
|
void |
set(byte[] data,
int offset,
int length)
Sets the container to a subsequence of the given binary
data.
|
void |
set(TokenValued value)
Sets the contained value to the given token value.
|
void |
setNull()
Sets the contained value to be null valued.
|
void |
setRef(byte[] ref)
Sets the container to the given byte array reference.
|
void |
setZero()
Sets the contained value to be zero valued.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetType, isZeroisNullpublic void setNull()
TokenSettablesetNull in interface TokenSettablepublic void setZero()
TokenSettablesetZero in interface TokenSettablepublic void set(byte[] data)
BinarySettable
The input array is copied to prevent later modification of the value
that is set. To avoid this overhead and prevent the data copy,
use the BinarySettable.setRef(byte[]) method instead.
set in interface BinarySettabledata - binary value to which to set the containerpublic void set(byte[] data,
int offset,
int length)
BinarySettableset in interface BinarySettabledata - binary data containing the subsequence to which to set the containeroffset - starting offset of the subsequencelength - length of the subsequence, in bytespublic void setRef(byte[] ref)
BinarySettable
While this call avoids the overhead seen with BinarySettable.set(byte[]),
the caller must guarantee that the input array will not be
modified subsequent to this call. Failure to comply may
result in the dataflow exhibiting unexpected behavior.
setRef in interface BinarySettableref - binary value to which to set the containerpublic void set(TokenValued value)
TokenSettableset in interface TokenSettablevalue - the value to which to set the containerpublic final ScalarTokenType getType()
TokenValuedgetType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ScalarTypedgetType in interface TokenTypedpublic final byte[] asBinary()
BinaryValued
The array returned is a copy of the binary data contained in
the object. To avoid this overhead, use BinaryValued.asBinaryRef()
instead.
asBinary in interface BinaryValuedbyte[]. If
null valued, as indicated by TokenValued.isNull(),
null is returned.public final byte[] asBinaryRef()
BinaryValued
While this call avoids the overhead seen with BinaryValued.asBinary(),
the caller must guarantee that the returned array will not be
modified. Failure to comply may result in the dataflow exhibiting
unexpected behavior, as other operators may (or may not)
see the modified value.
asBinaryRef in interface BinaryValuedbyte[] holding the contained
value. If null valued, as indicated by TokenValued.isNull(),
null is returned.public final boolean isZero()
ScalarValuedisZero in interface ScalarValuedtrue if the value is the zero value,
false otherwise.public final boolean isNull()
TokenValuedisNull in interface TokenValuedtrue if the token is null valued,
false otherwiseCopyright © 2021 Actian Corporation. All rights reserved.