|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.neighboursearch.covertrees.Stack<T>
T
- The type of elements to be stored in
the stack.public class Stack<T>
Class implementing a stack.
Field Summary | |
---|---|
java.util.ArrayList<T> |
elements
The elements inside the stack. |
int |
length
The number of elements in the stack. |
Constructor Summary | |
---|---|
Stack()
Constructor. |
|
Stack(int capacity)
Constructor. |
Method Summary | |
---|---|
void |
addAll(java.util.Collection c)
Adds all the given elements in the stack. |
void |
clear()
Removes all the elements from the stack. |
T |
element(int i)
Returns the ith element in the stack. |
java.lang.String |
getRevision()
Returns the revision string. |
T |
last()
Returns the last element in the stack. |
T |
pop()
Pops (removes) the first (last added) element in the stack. |
void |
push(Stack<T> v,
T new_ele)
Pushes the given element onto the given stack. |
void |
push(T new_ele)
Pushes the given element to the stack. |
void |
replaceAllBy(Stack<T> s)
Replace all elements in the stack with the elements of another given stack. |
void |
set(int i,
T e)
Sets the ith element in the stack. |
java.util.List |
subList(int beginIdx,
int uptoLength)
Returns a sublist of the elements in the stack. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int length
public java.util.ArrayList<T> elements
Constructor Detail |
---|
public Stack()
public Stack(int capacity)
capacity
- The initial capacity of the stack.Method Detail |
---|
public T last()
public T element(int i)
i
- The index of the element to return.
public void set(int i, T e)
i
- The index at which the element is
to be inserted.e
- The element to insert.public java.util.List subList(int beginIdx, int uptoLength)
beginIdx
- The start index of the
sublist.uptoLength
- The length of the
sublist.
public void clear()
public void addAll(java.util.Collection c)
c
- The collection of elements to add
in the stack.public void replaceAllBy(Stack<T> s)
s
- The stack whose elements should
be put in this stack.public T pop()
public void push(T new_ele)
new_ele
- The element to be pushed
to the stack.public void push(Stack<T> v, T new_ele)
v
- The stack onto push the element.new_ele
- The element to push.public java.lang.String getRevision()
getRevision
in interface RevisionHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |