|
Evaluating Software Design Patterns — the "Gang of Four" patterns implemented in Java 6 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<AdaptedPolicy> dk.rode.thesis.adapter.AdaptedPolicy
public enum AdaptedPolicy
Additional policies for formatting SequenceAdapter
objects into char sequences (not part of the core Adapter
implementation).
Implementation notes:
This is NOT part of the core Adapter functionality, merely
to provide better log descriptions!
See implementation notes for the ObjectPolicy
enumeration.
SequencePolicy
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface dk.rode.thesis.strategy.StringablePolicy |
---|
StringablePolicy.NameIdiom, StringablePolicy.Type |
Enum Constant Summary | |
---|---|
HIDDEN
Policy used to format string representations of adapters that hides the nested structure "from the sequence on". |
|
VISIBLE
Policy used to format string representations of adapters that indicates the nested structure. |
Method Summary | |
---|---|
abstract CharSequence |
toString(Sequence<?> sequence)
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. |
static AdaptedPolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static AdaptedPolicy[] |
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 |
---|
public static final AdaptedPolicy HIDDEN
public static final AdaptedPolicy VISIBLE
Note, however, that the check for adapted sequences
is done using instanceof
, which will not discover
decorated or proxied sequences!
Adapters using HIDDEN
as their default
policy are respected.
Method Detail |
---|
public abstract CharSequence toString(Sequence<?> sequence)
object
in form of a char sequence.
toString
in interface StringablePolicy<Sequence<?>>
sequence
- The object; cannot be null.
Stringable.toString(StringablePolicy)
public StringablePolicy.Type type()
StringablePolicy
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.
type
in interface StringablePolicy<Sequence<?>>
StringablePolicy.Type.APPENDABLE
.public static AdaptedPolicy valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic static AdaptedPolicy[] values()
for (AdaptedPolicy c : AdaptedPolicy.values()) System.out.println(c);
|
Gunni Rode / rode.dk | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |