FileDocCategorySizeDatePackage
Box.javaAPI DocExample516Wed May 05 14:54:50 BST 2004com.oreilly.tiger.ch02

Box

public class Box extends Object

Fields Summary
protected List
contents
Constructors Summary
public Box()

    contents = new ArrayList<T>();
  
Methods Summary
public voidadd(T o)

    contents.add(o);
  
public intgetSize()

    return contents.size();
  
public Tgrab()

    if (!isEmpty()) {
      return contents.remove(0);
    } else
      return null;
  
public booleanisEmpty()

    return (contents.size() == 0);