edu.rice.comp211.laundry.garment
Class NullGarment
java.lang.Object
edu.rice.comp211.laundry.garment.Garment
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
ONLY
public static final NullGarment ONLY
- Singleton pattern
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"