public class GridLongList extends Object implements Message, Externalizable
| Modifier and Type | Field and Description |
|---|---|
static long[] |
EMPTY_ARRAY
Empty array.
|
DIRECT_TYPE_SIZE| Constructor and Description |
|---|
GridLongList() |
GridLongList(int size) |
GridLongList(long[] arr) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(long x)
Add element to this array.
|
void |
addAll(GridLongList l) |
long[] |
array() |
static GridLongList |
asList(long... vals) |
void |
clear()
Clears the list.
|
boolean |
contains(long l) |
GridLongList |
copyWithout(GridLongList l)
Returns (possibly reordered) copy of this list, excluding all elements of given list.
|
short |
directType()
Gets message type.
|
boolean |
equals(Object o) |
byte |
fieldsCount()
Gets fields count.
|
long |
get(int i) |
int |
hashCode() |
boolean |
isEmpty() |
void |
onAckReceived()
Method called when ack message received.
|
void |
readExternal(ObjectInput in) |
boolean |
readFrom(ByteBuffer buf,
MessageReader reader)
Reads this message from provided byte buffer.
|
long |
remove()
Removes and returns the last element of the list.
|
long |
removeIndex(int i)
Removes element by given index.
|
int |
removeValue(int startIdx,
long val)
Removes value from this list.
|
int |
size() |
GridLongList |
sort()
Sorts this list.
|
String |
toString() |
void |
truncate(int size,
boolean last) |
void |
writeExternal(ObjectOutput out) |
boolean |
writeTo(ByteBuffer buf,
MessageWriter writer)
Writes this message to provided byte buffer.
|
public GridLongList()
public GridLongList(int size)
size - Size.public GridLongList(long[] arr)
arr - Array.public static GridLongList asList(long... vals)
vals - Values.public void addAll(GridLongList l)
l - List to add all elements of.public void add(long x)
x - Value.public void clear()
public long remove()
throws NoSuchElementException
add(long) for stack like usage.NoSuchElementException - If the list is empty.public GridLongList copyWithout(GridLongList l)
l - List of elements to remove.l.public long get(int i)
i - Index.public int size()
public boolean isEmpty()
True if this list has no elements.public boolean contains(long l)
l - Element to find.True if found.public void truncate(int size,
boolean last)
size - New size.last - If true the last elements will be removed, otherwise the first.public long removeIndex(int i)
i - Index.public int removeValue(int startIdx,
long val)
startIdx - Index to begin search with.val - Value.-1 otherwise.public long[] array()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionpublic GridLongList sort()
copy().sort() if you need a defensive copy.this For chaining.public void onAckReceived()
onAckReceived in interface Messagepublic boolean writeTo(ByteBuffer buf, MessageWriter writer)
public boolean readFrom(ByteBuffer buf, MessageReader reader)
public short directType()
directType in interface Messagepublic byte fieldsCount()
fieldsCount in interface Message
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023