|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.util.LongList
public final class LongList
A List type class for long values. The implementation uses an array. If the number of elements grows larger than the capacity, the capacity will automatically grow.
Constructor Summary | |
---|---|
LongList()
Creates a new list of long values with a default capacity of 50. |
|
LongList(int initialCapacity)
Creates a new list of long values with a specified initial capacity. |
|
LongList(long[] longArray)
Creates a new list of long values with an initial array of elements. |
Method Summary | |
---|---|
void |
add(int index,
long value)
Adds a long value to the list at the specified index. |
void |
add(long value)
Adds a long value to the end of the list. |
void |
add(LongList toAdd)
Adds all elements of a LongList to this one. |
void |
clear()
Removes all of the elements from the list. |
boolean |
contains(long value)
Returns true if the list contains the specified value. |
boolean |
equals(java.lang.Object o)
|
long |
get(int index)
Returns the long value at the specified index. |
int |
hashCode()
|
int |
indexOf(long value)
Returns the index in this list of the first occurrence of the specified value, or -1 if this list does not contain this value. |
void |
remove(int index)
Removes a value from the list at the specified index. |
int |
size()
Returns the number of elements in the list. |
LongList |
slice(int startIndex,
int length)
Returns a slice of the list. |
long[] |
toArray()
Returns a new array containing the list elements. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LongList()
public LongList(int initialCapacity)
initialCapacity
- a capacity to initialize the list with.public LongList(long[] longArray)
longArray
- an array to create a list from.Method Detail |
---|
public void add(long value)
value
- the value to add to the list.public void add(int index, long value)
index
- the index in the list to add the value at.value
- the value to add to the list.public void remove(int index)
index
- the index to remove a value at.public void clear()
public long get(int index)
index
- the index of the value to return.
public int indexOf(long value)
value
- the value to search for.
public boolean contains(long value)
value
- the value to search for.
public int size()
public LongList slice(int startIndex, int length)
startIndex
- - where to startlength
- - amount of elements to get.public void add(LongList toAdd)
toAdd
- - the elements to add.public long[] toArray()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |