public class GridLongList extends Object implements Message, Externalizable
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) |
static GridLongList |
addAll(GridLongList to,
GridLongList from) |
long[] |
array() |
static GridLongList |
asList(long... vals) |
void |
clear()
Clears the list.
|
boolean |
contains(long l) |
boolean |
containsAll(GridLongList l) |
GridLongList |
copy() |
GridLongList |
copyWithout(GridLongList l)
Returns (possibly reordered) copy of this list, excluding all elements of given list.
|
short |
directType()
Gets message type.
|
boolean |
distinct() |
boolean |
equals(Object o) |
byte |
fieldsCount()
Gets fields count.
|
long |
get(int i) |
int |
hashCode() |
boolean |
isEmpty() |
long |
last()
Gets the last element.
|
void |
onAckReceived()
Method called when ack message received.
|
void |
pop(int cnt)
Removes given number of elements from the end.
|
void |
readExternal(ObjectInput in) |
boolean |
readFrom(ByteBuffer buf,
MessageReader reader)
Reads this message from provided byte buffer.
|
static GridLongList |
readFrom(DataInput in) |
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 |
replaceValue(int startIdx,
long oldVal,
long newVal)
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.
|
static void |
writeTo(DataOutput out,
GridLongList list) |
public GridLongList()
public GridLongList(int size)
size - Size.public GridLongList(long[] arr)
arr - Array.public static GridLongList asList(long... vals)
vals - Values.public GridLongList copy()
public void addAll(GridLongList l)
l - List to add all elements of.public void add(long x)
x - Value.public void clear()
public long last()
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 boolean containsAll(GridLongList l)
l - List to check.True if this list contains all the elements of passed in list.public boolean distinct()
True if there are no duplicates.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 int replaceValue(int startIdx,
long oldVal,
long newVal)
startIdx - Index to begin search with.oldVal - Old value.newVal - New value.-1 otherwise.public long[] array()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundException@Nullable public static GridLongList readFrom(DataInput in) throws IOException
in - Input to read list from.IOException - If failed.public static void writeTo(DataOutput out, @Nullable GridLongList list) throws IOException
out - Output to write to.list - List.IOException - If failed.public static GridLongList addAll(@Nullable GridLongList to, GridLongList from)
to - To list.from - From list.public GridLongList sort()
copy().sort() if you need a defensive copy.this For chaining.public void pop(int cnt)
cnt - Count to pop from the end.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 Fabric : ver. 2.4.0 Release Date : March 5 2018