|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.collections.StringStack
This class implements a stack for String objects.
Constructor Summary | |
StringStack()
Creates an empty instance. |
Method Summary | |
StringStack |
add(String s)
Adds the String to the collection if it does not already contain it. |
StringStack |
addAll(StringStack ss)
Adds all Strings in the given StringStack to the collection (skipping those it already contains) |
void |
clear()
Clears the stack. |
boolean |
contains(String s)
Returns whether this stack contain the specified text. |
boolean |
empty()
Whether the stack is empty. |
boolean |
equals(Object ssbuf)
Compares two StringStacks. |
String |
get(int i)
Get a string off the stack at a certain position. |
int |
size()
Returns the size of the stack. |
String |
toString()
Converts the stack to a single String with no
separator. |
String |
toString(String separator)
Converts the stack to a single String . |
String[] |
toStringArray()
Turns this stack into an array. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public StringStack()
Method Detail |
public StringStack add(String s)
s
- The String
object to add to this stack
(if it is not null
and doesn't already exist in
the stack).public StringStack addAll(StringStack ss)
ss
- The stack of String
objects to add to
this stack (if it is not null
and doesn't already
exist in the stack).public void clear()
public boolean contains(String s)
s
- The text to search for.public final boolean empty()
public boolean equals(Object ssbuf)
toString()
method returns such.equals
in class Object
public String get(int i)
i
- The position.public final int size()
public String toString()
String
with no
separator.toString
in class Object
public String toString(String separator)
String
.separator
- The text to use as glue between elements in
the stack.separator
--as a single block of text.public String[] toStringArray()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |