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

dk.rode.thesis.strategy
Interface StringablePolicy<T>

Type Parameters:
T - The type of the applicable stringable objects.
All Known Implementing Classes:
AdaptedPolicy, CharacterPolicy, CompositePolicy, DecoratedPolicy, ObjectPolicy, ProxiedPolicy, SequencePolicy, SequenceValuePolicy

@Participant(value="Strategy")
public interface StringablePolicy<T>

Returns a textual representation in form of a char sequence of a given stringable object.

Author:
Gunni Rode / rode.dk
See Also:
Stringable

Nested Class Summary
static class StringablePolicy.NameIdiom
          An idiom that allows the retrieval of a given StringablePolicy defined as an enumeration constant based on an exact name of another, possibly unrelated, policy.
static class StringablePolicy.Type
          A policy type is a hint a stringable context can use to decide how to use the textual representation a given policy generates in conjunction with additional textual information required to generate an overall representation.
 
Method Summary
 CharSequence toString(T object)
          Returns a textual representation of the object supplied as object in form of a char sequence.
 StringablePolicy.Type type()
          Returns the type of this policy.
 

Method Detail

toString

CharSequence toString(T object)
Returns a textual representation of the object supplied as object in form of a char sequence.

Parameters:
object - The object; cannot be null.
Returns:
The char sequence representation; never null.
Throws:
NullPointerException - If object is null.
See Also:
Stringable.toString(StringablePolicy)

type

StringablePolicy.Type type()
Returns the type of this policy.

The stringable context can use the type to decide how to use the textual representation of this policy in conjunction with additional text.

Returns:
The type; never null.

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.