|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.comp211.laundry.garment.AGarmentVisitor<R>
R
- the return type of the visitorpublic abstract class AGarmentVisitor<R>
Abstract GarmentVisitor that provides default behavior for non-overridden methods. Sub-classes merely have to supply a default return value and override only the methods that they need. This is just a convenience class to simply coding under specific situations. There is NO requirement that Garment visitors be subclasses of this class!
Constructor Summary | |
---|---|
AGarmentVisitor(R defaultReturn)
Constructor for the class |
Method Summary | |
---|---|
R |
forNullGarment(NullGarment g)
NullGarment case of the visitor |
R |
forPants(Pants p)
Pants case of the visitor |
R |
forShirt(Shirt s)
Shirt case of the visitor |
R |
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 |
---|
public AGarmentVisitor(R defaultReturn)
defaultReturn
- the default value to return if a method is not overridden.Method Detail |
---|
public R forShirt(Shirt s)
GarmentVisitor
forShirt
in interface GarmentVisitor<R>
s
- The Shirt host
public R forPants(Pants p)
GarmentVisitor
forPants
in interface GarmentVisitor<R>
p
- The Pants host
public R forSocks(Socks s)
GarmentVisitor
forSocks
in interface GarmentVisitor<R>
s
- The Socks host
public R forNullGarment(NullGarment g)
GarmentVisitor
forNullGarment
in interface GarmentVisitor<R>
g
- The NullGarment host
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |