Evaluating Software Design Patterns
— the "Gang of Four" patterns implemented in Java 6

dk.rode.thesis.chainofresponsibility
Class LetterHandler

java.lang.Object
  extended by dk.rode.thesis.chainofresponsibility.CharacterHandler
      extended by dk.rode.thesis.chainofresponsibility.LetterHandler
All Implemented Interfaces:
Handler<Character>

@Participant(value="ConcreteHandler")
public class LetterHandler
extends CharacterHandler

A letter handler is a handler that can handle letter characters.

Author:
Gunni Rode / rode.dk

Constructor Summary
LetterHandler()
          No-arg constructor.
LetterHandler(HandlerChain<Character> chain)
          Constructor, which registers this letter handler to the handler chain supplied as chain.
 
Method Summary
protected  boolean handle(Character character)
          Returns true if this handler can and have handled character, false if not.
 
Methods inherited from class dk.rode.thesis.chainofresponsibility.CharacterHandler
handle, register, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LetterHandler

public LetterHandler()
No-arg constructor.

This handler is not registered to any handler chain until specifically registered using the CharacterHandler.register(HandlerChain) method.


LetterHandler

public LetterHandler(HandlerChain<Character> chain)
Constructor, which registers this letter handler to the handler chain supplied as chain.

Parameters:
chain - The handler chain; cannot be null.
Throws:
NullPointerException - If chain is null.
Method Detail

handle

protected boolean handle(Character character)
Description copied from class: CharacterHandler
Returns true if this handler can and have handled character, false if not.

Specified by:
handle in class CharacterHandler
Parameters:
character - The character; can be null.
Returns:
True if character was handled, false if not.

Gunni Rode / rode.dk

Feel free to use and/or modify the Java 6 source code developed for this thesis AT YOUR OWN RISK, but note that the source code comes WITHOUT ANY — and I do mean WITHOUT ANY — form of warranty WHAT SO EVER!

The original thesis and source code are available at rode.dk/thesis.