public class IntValueArray extends Object implements ValueArray<org.apache.flink.types.IntValue>
IntValue
.Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_CAPACITY_IN_BYTES |
protected static int |
ELEMENT_LENGTH_IN_BYTES |
Constructor and Description |
---|
IntValueArray()
Initializes an expandable array with default capacity.
|
IntValueArray(int bytes)
Initializes a fixed-size array with the provided number of bytes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(org.apache.flink.types.IntValue value)
Appends the value to this array if and only if the array capacity would
not be exceeded.
|
boolean |
addAll(ValueArray<org.apache.flink.types.IntValue> other)
Appends all of the values in the specified array to the end of this
array.
|
void |
clear()
Resets the array to the empty state.
|
int |
compareTo(ValueArray<org.apache.flink.types.IntValue> o) |
ValueArray<org.apache.flink.types.IntValue> |
copy() |
void |
copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target) |
protected static void |
copyInternal(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target) |
void |
copyNormalizedKey(org.apache.flink.core.memory.MemorySegment target,
int offset,
int len) |
void |
copyTo(ValueArray<org.apache.flink.types.IntValue> target) |
boolean |
equals(Object obj) |
int |
getBinaryLength() |
int |
getMaxNormalizedKeyLen() |
int |
hashCode() |
boolean |
isFull()
An bounded array fills when the allocated capacity has been fully used.
|
Iterator<org.apache.flink.types.IntValue> |
iterator() |
void |
mark()
Saves the array index, which can be restored by calling
reset() . |
void |
read(org.apache.flink.core.memory.DataInputView in) |
void |
reset()
Restores the array index to when
mark() was last called. |
void |
setValue(ValueArray<org.apache.flink.types.IntValue> value) |
int |
size()
Returns the number of elements stored in the array.
|
String |
toString() |
void |
write(org.apache.flink.core.memory.DataOutputView out) |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
protected static final int ELEMENT_LENGTH_IN_BYTES
protected static final int DEFAULT_CAPACITY_IN_BYTES
public IntValueArray()
public IntValueArray(int bytes)
bytes
- number of bytes of the encapsulated arraypublic Iterator<org.apache.flink.types.IntValue> iterator()
public void write(org.apache.flink.core.memory.DataOutputView out) throws IOException
write
in interface org.apache.flink.core.io.IOReadableWritable
IOException
public void read(org.apache.flink.core.memory.DataInputView in) throws IOException
read
in interface org.apache.flink.core.io.IOReadableWritable
IOException
public int getMaxNormalizedKeyLen()
getMaxNormalizedKeyLen
in interface org.apache.flink.types.NormalizableKey<ValueArray<org.apache.flink.types.IntValue>>
public void copyNormalizedKey(org.apache.flink.core.memory.MemorySegment target, int offset, int len)
copyNormalizedKey
in interface org.apache.flink.types.NormalizableKey<ValueArray<org.apache.flink.types.IntValue>>
public int compareTo(ValueArray<org.apache.flink.types.IntValue> o)
compareTo
in interface Comparable<ValueArray<org.apache.flink.types.IntValue>>
public int hashCode()
hashCode
in interface org.apache.flink.types.Key<ValueArray<org.apache.flink.types.IntValue>>
hashCode
in class Object
public boolean equals(Object obj)
equals
in interface org.apache.flink.types.Key<ValueArray<org.apache.flink.types.IntValue>>
equals
in class Object
public void setValue(ValueArray<org.apache.flink.types.IntValue> value)
setValue
in interface org.apache.flink.types.ResettableValue<ValueArray<org.apache.flink.types.IntValue>>
public int getBinaryLength()
getBinaryLength
in interface org.apache.flink.types.CopyableValue<ValueArray<org.apache.flink.types.IntValue>>
public void copyTo(ValueArray<org.apache.flink.types.IntValue> target)
copyTo
in interface org.apache.flink.types.CopyableValue<ValueArray<org.apache.flink.types.IntValue>>
public ValueArray<org.apache.flink.types.IntValue> copy()
copy
in interface org.apache.flink.types.CopyableValue<ValueArray<org.apache.flink.types.IntValue>>
public void copy(org.apache.flink.core.memory.DataInputView source, org.apache.flink.core.memory.DataOutputView target) throws IOException
copy
in interface org.apache.flink.types.CopyableValue<ValueArray<org.apache.flink.types.IntValue>>
IOException
protected static void copyInternal(org.apache.flink.core.memory.DataInputView source, org.apache.flink.core.memory.DataOutputView target) throws IOException
IOException
public int size()
ValueArray
size
in interface ValueArray<org.apache.flink.types.IntValue>
public boolean isFull()
ValueArray
isFull
in interface ValueArray<org.apache.flink.types.IntValue>
public boolean add(org.apache.flink.types.IntValue value)
ValueArray
add
in interface ValueArray<org.apache.flink.types.IntValue>
value
- the value to add to this arraypublic boolean addAll(ValueArray<org.apache.flink.types.IntValue> other)
ValueArray
addAll
in interface ValueArray<org.apache.flink.types.IntValue>
other
- array containing values to be added to this arraypublic void clear()
ValueArray
ValueArray.mark()
in order to allow arrays be shrunk.clear
in interface ValueArray<org.apache.flink.types.IntValue>
public void mark()
ValueArray
reset()
.
This is not serialized and is not part of the contract for
Key.equals(Object)
.mark
in interface ValueArray<org.apache.flink.types.IntValue>
public void reset()
ValueArray
mark()
was last called.reset
in interface ValueArray<org.apache.flink.types.IntValue>
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.