edu.rice.comp211.laundry.garment
Class SameTypeGarmentVisitor

java.lang.Object
  extended by edu.rice.comp211.laundry.garment.SameTypeGarmentVisitor
All Implemented Interfaces:
GarmentVisitor<Boolean>

public class SameTypeGarmentVisitor
extends Object
implements GarmentVisitor<Boolean>

A visitor to a Garment that returns true if the other garment is the same type as the host, i.e. Shirt, Pants, Socks or NullGarment. False is returned otherwise. The adjective is ignored.

Author:
swong

Constructor Summary
SameTypeGarmentVisitor(Garment other)
          Constructor for the class
 
Method Summary
 Boolean forNullGarment(NullGarment g)
          NullGarment case of the visitor
 Boolean forPants(Pants p)
          Pants case of the visitor
 Boolean forShirt(Shirt s)
          Shirt case of the visitor
 Boolean forSocks(Socks s)
          Socks case of the visitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SameTypeGarmentVisitor

public SameTypeGarmentVisitor(Garment other)
Constructor for the class

Parameters:
other - The other Garment to compare against
Method Detail

forShirt

public Boolean forShirt(Shirt s)
Description copied from interface: GarmentVisitor
Shirt case of the visitor

Specified by:
forShirt in interface GarmentVisitor<Boolean>
Parameters:
s - The Shirt host
Returns:
The return value of the visitor

forPants

public Boolean forPants(Pants p)
Description copied from interface: GarmentVisitor
Pants case of the visitor

Specified by:
forPants in interface GarmentVisitor<Boolean>
Parameters:
p - The Pants host
Returns:
The return value of the visitor

forSocks

public Boolean forSocks(Socks s)
Description copied from interface: GarmentVisitor
Socks case of the visitor

Specified by:
forSocks in interface GarmentVisitor<Boolean>
Parameters:
s - The Socks host
Returns:
The return value of the visitor

forNullGarment

public Boolean forNullGarment(NullGarment g)
Description copied from interface: GarmentVisitor
NullGarment case of the visitor

Specified by:
forNullGarment in interface GarmentVisitor<Boolean>
Parameters:
g - The NullGarment host
Returns:
The return value of the visitor