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

dk.rode.thesis.chainofresponsibility
Class SymbolHandler

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

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

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

Author:
Gunni Rode / rode.dk

Constructor Summary
SymbolHandler()
          No-arg constructor.
SymbolHandler(HandlerChain<Character> chain)
          Constructor, which registers this symbol 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

SymbolHandler

public SymbolHandler()
No-arg constructor.

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


SymbolHandler

public SymbolHandler(HandlerChain<Character> chain)
Constructor, which registers this symbol 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.