public class GridLongList extends Object implements Externalizable
| 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) |
static GridLongList |
asList(long... vals) |
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.
|
boolean |
distinct() |
boolean |
equals(Object o) |
long |
get(int i) |
int |
hashCode() |
long[] |
internalArray() |
boolean |
isEmpty() |
void |
readExternal(ObjectInput in) |
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) |
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 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[] internalArray()
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.Copyright © 2014. All rights reserved.