Class StringBag

java.lang.Object
   |
   +----java.util.Vector
           |
           +----StringBag

public class StringBag
extends Vector

Constructor Index

 o StringBag()

Method Index

 o chooseAtRandom()
 o contains(String)
 o stringAt(int)
 o write()
This write out the collection of strings all on one line.

Constructors

 o StringBag
 public StringBag()

Methods

 o 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
 o 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
 o chooseAtRandom
 public String chooseAtRandom()
Returns:
an element in the collection, chosen at random
 o write
 public void write()
This write out the collection of strings all on one line.