|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.tum.cs.commons.collections.PairList<S,T>
public class PairList<S,T>
A list for storing pairs in a specific order.
| Constructor Summary | |
|---|---|
PairList()
Constructor. |
|
PairList(int initialCapacity)
Constructor. |
|
PairList(PairList<S,T> other)
Copy constructor. |
|
| Method Summary | |
|---|---|
void |
add(S first,
T second)
Add the given pair to the list. |
void |
addAll(PairList<S,T> other)
Adds all pairs from another list. |
void |
clear()
Clears this list. |
protected void |
ensureSpace(int space)
Make sure there is space for at least the given amount of elements. |
List<S> |
extractFirstList()
Creates a new list containing all first elements. |
List<T> |
extractSecondList()
Creates a new list containing all second elements. |
S |
getFirst(int i)
Returns the first element at given index. |
T |
getSecond(int i)
Returns the second element at given index. |
boolean |
isEmpty()
Returns whether the list is empty. |
void |
removeLast()
Removes the last element of the list. |
void |
setFirst(int i,
S value)
Sets the first element at given index. |
void |
setSecond(int i,
T value)
Sets the first element at given index. |
int |
size()
Returns the size of the list. |
void |
swapPairs()
Swaps the pairs of this list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PairList()
public PairList(int initialCapacity)
public PairList(PairList<S,T> other)
| Method Detail |
|---|
public boolean isEmpty()
public int size()
public void add(S first,
T second)
public void addAll(PairList<S,T> other)
protected void ensureSpace(int space)
public S getFirst(int i)
public void setFirst(int i,
S value)
public T getSecond(int i)
public void setSecond(int i,
T value)
public List<S> extractFirstList()
public List<T> extractSecondList()
public void swapPairs()
public void clear()
public void removeLast()
|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||