public class GridIntList extends Object implements Message, Externalizable
DIRECT_TYPE_SIZE| Constructor and Description |
|---|
GridIntList() |
GridIntList(int size) |
GridIntList(int[] arr) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int x)
Add element to this array.
|
void |
addAll(GridIntList l) |
static GridIntList |
addAll(GridIntList to,
GridIntList from) |
int[] |
array() |
static GridIntList |
asList(int... vals) |
void |
clear()
Clears the list.
|
boolean |
contains(int l) |
boolean |
containsAll(GridIntList l) |
GridIntList |
copy() |
GridIntList |
copyWithout(GridIntList 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.
|
int |
get(int i) |
int |
hashCode() |
boolean |
isEmpty() |
GridIntIterator |
iterator() |
int |
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 GridIntList |
readFrom(DataInput in) |
int |
remove()
Removes and returns the last element of the list.
|
int |
removeIndex(int i)
Removes element by given index.
|
int |
removeValue(int startIdx,
int val)
Removes value from this list.
|
int |
replaceValue(int startIdx,
int oldVal,
int newVal)
Removes value from this list.
|
int |
size() |
GridIntList |
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,
GridIntList list) |
public GridIntList()
public GridIntList(int size)
size - Size.public GridIntList(int[] arr)
arr - Array.public static GridIntList asList(int... vals)
vals - Values.public GridIntList copy()
public void addAll(GridIntList l)
l - List to add all elements of.public void add(int x)
x - Value.public void clear()
public int last()
public int remove()
throws NoSuchElementException
add(int) for stack like usage.NoSuchElementException - If the list is empty.public GridIntList copyWithout(GridIntList l)
l - List of elements to remove.l.public int get(int i)
i - Index.public int size()
public boolean isEmpty()
True if this list has no elements.public boolean contains(int l)
l - Element to find.True if found.public boolean containsAll(GridIntList 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 int removeIndex(int i)
i - Index.public int removeValue(int startIdx,
int val)
startIdx - Index to begin search with.val - Value.-1 otherwise.public int replaceValue(int startIdx,
int oldVal,
int newVal)
startIdx - Index to begin search with.oldVal - Old value.newVal - New value.-1 otherwise.public int[] 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 GridIntList readFrom(DataInput in) throws IOException
in - Input to read list from.IOException - If failed.public static void writeTo(DataOutput out, @Nullable GridIntList list) throws IOException
out - Output to write to.list - List.IOException - If failed.public static GridIntList addAll(@Nullable GridIntList to, GridIntList from)
to - To list.from - From list.public GridIntList 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 Messagepublic GridIntIterator iterator()
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018