Class StringBag
java.lang.Object
|
+----java.util.Vector
|
+----StringBag
- public class StringBag
- extends Vector
-
StringBag()
-
-
chooseAtRandom()
-
-
contains(String)
-
-
stringAt(int)
-
-
write()
- This write out the collection of strings all on one line.
StringBag
public StringBag()
contains
public boolean contains(String item)
- Parameters:
- a - string that is possibly in the collection
- Returns:
- true if the given string is in the collection
stringAt
public String stringAt(int i)
- Parameters:
- i - a position, ranging from 0 to size() - 1, in the collection
- Returns:
- the string at the specified position
chooseAtRandom
public String chooseAtRandom()
- Returns:
- an element in the collection, chosen at random
write
public void write()
- This write out the collection of strings all on one line.