edu.rice.comp211.laundry.garment
Class NullGarment

java.lang.Object
  extended by edu.rice.comp211.laundry.garment.Garment
      extended by edu.rice.comp211.laundry.garment.NullGarment

public class NullGarment
extends Garment

Represents the absence of a garment. Used for such things as providing a concrete return value if a search for a garment fails.

Author:
swong

Field Summary
static NullGarment ONLY
          Singleton pattern
 
Method Summary
<R> R
accept(GarmentVisitor<R> v)
          Calls the forNullGarment case of the visitor and returns the result.
 String toString()
          String representation of the class
 
Methods inherited from class edu.rice.comp211.laundry.garment.Garment
adjective, equals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ONLY

public static final NullGarment ONLY
Singleton pattern

Method Detail

accept

public <R> R accept(GarmentVisitor<R> v)
Calls the forNullGarment case of the visitor and returns the result.

Specified by:
accept in class 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

toString

public String toString()
String representation of the class

Overrides:
toString in class Object
Returns:
"Null Garment"