|
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<SequencePolicy> dk.rode.thesis.strategy.SequencePolicy
public enum SequencePolicy
Default policies for formatting Sequence
objects into textual representations in form of
char sequences.
Implementation notes:
Though defined as an enumeration, different applicable policies
may still be applied to format sequences, i.e. any policy having
the type Stringable<Sequence<?>>
.
See implementation notes for the ObjectPolicy
enumeration.
ObjectPolicy
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface dk.rode.thesis.strategy.StringablePolicy |
---|
StringablePolicy.NameIdiom, StringablePolicy.Type |
Enum Constant Summary | |
---|---|
DEFAULT
Generates a char sequence representation of a sequence by invoking toString() on it. |
|
ID
Generates a char sequence representation of a sequence having the following format: Sequence[..] |
|
IDENTITY
Generates a char sequence representation of a sequence having the following format: Sequence[hash-code: ..[; identity-hash-code: ..]; current: ..] |
|
NAME
Generates a char sequence representation of a sequence having the following format: Sequence Where Sequence is the simple class name of the class
of the sequence. |
|
SHORT
Generates a char sequence representation of a sequence having the following format: Sequence[..] |
|
VALUE
Generates a char sequence representation of a sequence having the following format: .. |
|
VALUE_UPPERCASE
Generates a char sequence representation of a sequence having the following format: .. |
|
VERBOSE
Generates a char sequence representation of a sequence having the following format: Sequence[hash-code: ..[; identity-hash-code: ..]; current: ..; bounded: ..; consistent: ..; unique: ..; state: ..] |
|
VERBOSE_OPEN
Generates a char sequence (StringBuilder) representation of a sequence having the following format: Sequence[hash-code: ..[; identity-hash-code: ..]; current: ..; bounded: ..; consistent: ..; unique: ..; state: .. |
Method Summary | |
---|---|
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 SequencePolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static SequencePolicy[] |
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 |
---|
@Participant(value="ConcreteStrategy") public static final SequencePolicy DEFAULT
toString()
on it.
@Participant(value="ConcreteStrategy") public static final SequencePolicy ID
Sequence[..]Where
Sequence
is the simple class name of the class
of the sequence, and ..
is the identity
hash-code of the sequence.
@Participant(value="ConcreteStrategy") public static final SequencePolicy IDENTITY
Sequence[hash-code: ..[; identity-hash-code: ..]; current: ..]Where
Sequence
is the simple class name of the class
of the sequence, and ..
are the hash-code and
current value of the sequence, respectively.
ObjectPolicy.HASHCODE
@Participant(value="ConcreteStrategy") public static final SequencePolicy NAME
SequenceWhere
Sequence
is the simple class name of the class
of the sequence.
This policy is considered StringablePolicy.Type.CLOSED
.
@Participant(value="ConcreteStrategy") public static final SequencePolicy SHORT
Sequence[..]Where
Sequence
is the simple class name of the class
of the sequence, and ..
is the current sequence
value.
@Participant(value="ConcreteStrategy") public static final SequencePolicy VALUE
..Where
..
is the current value of the sequence.
This policy is considered StringablePolicy.Type.CLOSED
.
@Participant(value="ConcreteStrategy") public static final SequencePolicy VALUE_UPPERCASE
..Where
..
is the current value of the sequence as
an upper-cased string.
This policy is considered StringablePolicy.Type.CLOSED
.
@Participant(value="ConcreteStrategy") public static final SequencePolicy VERBOSE
Sequence[hash-code: ..[; identity-hash-code: ..]; current: ..; bounded: ..; consistent: ..; unique: ..; state: ..]Where
Sequence
is the simple class name of the class
of the sequence.
VERBOSE_OPEN
,
ObjectPolicy.HASHCODE
@Participant(value="ConcreteStrategy") public static final SequencePolicy VERBOSE_OPEN
Sequence[hash-code: ..[; identity-hash-code: ..]; current: ..; bounded: ..; consistent: ..; unique: ..; state: ..Where
Sequence
is the simple class name of the class
of the sequence.
The difference between this policy and VERBOSE
is that the representation formatted by this policy does
not end with a closing bracket (]), i.e. is
StringablePolicy.Type.OPEN
.
ObjectPolicy.HASHCODE
Method Detail |
---|
public CharSequence toString(Sequence<?> sequence)
StringablePolicy
object
in form of a char sequence.
toString
in interface StringablePolicy<Sequence<?>>
sequence
- The object; cannot be null.
ObjectPolicy.NAME
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
is returned unless
explicitly documented otherwise for a given constant.public static SequencePolicy 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 SequencePolicy[] values()
for (SequencePolicy c : SequencePolicy.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 |