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

dk.rode.thesis.strategy
Enum StringablePolicy.Type

java.lang.Object
  extended by java.lang.Enum<StringablePolicy.Type>
      extended by dk.rode.thesis.strategy.StringablePolicy.Type
All Implemented Interfaces:
Serializable, Comparable<StringablePolicy.Type>
Enclosing interface:
StringablePolicy<T>

public static enum StringablePolicy.Type
extends Enum<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.

A Stringable object that has been formatted with a policy having the CLOSED type hints to the stringable context that additional text should not be appended to its representation, where as the OPEN type on the contrary expects the context to do so.

The APPENDABLE type represents a complete stand-alone textual representation (as do CLOSED), but where stringable contexts may append additional text if they desire, or simply use as is.

Author:
Gunni Rode / rode.dk
See Also:
StringablePolicy.type()

Enum Constant Summary
APPENDABLE
          The context is free to append text to the generated representation if it so desires.
CLOSED
          The context is expected not to append text to the generated representation.
OPEN
          The context is expected to append text to the generated representation.
 
Method Summary
static StringablePolicy.Type valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StringablePolicy.Type[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

APPENDABLE

public static final StringablePolicy.Type APPENDABLE
The context is free to append text to the generated representation if it so desires.


CLOSED

public static final StringablePolicy.Type CLOSED
The context is expected not to append text to the generated representation.


OPEN

public static final StringablePolicy.Type OPEN
The context is expected to append text to the generated representation.

Method Detail

valueOf

public static StringablePolicy.Type valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

values

public static StringablePolicy.Type[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (StringablePolicy.Type c : StringablePolicy.Type.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

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.