edu.rice.comp211.laundry.garment
Class Garment

java.lang.Object
  extended by edu.rice.comp211.laundry.garment.Garment
Direct Known Subclasses:
NullGarment, Pants, Shirt, Socks

public abstract class Garment
extends Object

Root class of the Garment union. Represents an abstract garment.


Constructor Summary
protected Garment(String pAdjective)
           
 
Method Summary
abstract
<R> R
accept(GarmentVisitor<R> v)
          Executes ("accepts") a visitor for this garment
 String adjective()
          Accessor for the adjective
 boolean equals(Object elt)
          Returns true if to Garments are the same class and have the same adjective string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Garment

protected Garment(String pAdjective)
Method Detail

adjective

public String adjective()
Accessor for the adjective

Returns:
the garment's adjective

accept

public abstract <R> R accept(GarmentVisitor<R> v)
Executes ("accepts") a visitor for this garment

Type Parameters:
R - The return type of the visitor (determined by the visitor being used)
Parameters:
v - The visitor to accept
Returns:
The return value of the visitor

equals

public boolean equals(Object elt)
Returns true if to Garments are the same class and have the same adjective string.

Overrides:
equals in class Object