|
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<CharacterPolicy> dk.rode.thesis.flyweight.CharacterPolicy
public enum CharacterPolicy
Default policies for formatting Character
objects
into char sequences (not part of the core Flyweight
implementation).
Implementation notes:
This is NOT part of the core Flyweight functionality, merely
to provide better log descriptions!
See implementation notes for the ObjectPolicy
enumeration.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface dk.rode.thesis.strategy.StringablePolicy |
---|
StringablePolicy.NameIdiom, StringablePolicy.Type |
Enum Constant Summary | |
---|---|
IDENTITY
Generates a char sequence representation of a Character
having the following format. |
|
NAME
Generates a char sequence representation of a Character
having the following format. |
|
SHORT
Generates a char sequence representation of a Character
having the following format. |
|
VALUE
Generates a char sequence representation of a Character
having the following format. |
|
VALUE_UPPERCASE
Generates a char sequence representation of a Character
having the following format. |
Method Summary | |
---|---|
CharSequence |
toString(Character character)
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 CharacterPolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static CharacterPolicy[] |
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 CharacterPolicy IDENTITY
Character
having the following format.
Character[hash-code: ..; value: ".."]Where
Character
is the simple class name of the class
of the character, ..
is the hash-code, and
".."
value of the character (excluding quotation marks),
respectively.
public static final CharacterPolicy NAME
Character
having the following format.
CharacterWhere
Character
is the simple class name of the class
of the character.
This policy is considered StringablePolicy.Type.CLOSED
.
public static final CharacterPolicy SHORT
Character
having the following format.
Character[..]Where
Character
is the simple class name of the class
of the character, and ..
is the value of the character,
respectively.
public static final CharacterPolicy VALUE
Character
having the following format.
..Where
..
is the value of the character, i.e. its
string representation.
This policy is considered StringablePolicy.Type.CLOSED
.
public static final CharacterPolicy VALUE_UPPERCASE
Character
having the following format.
..Where
..
is the upper-cased value of the character, i.e. its
string representation upper-cased.
This policy is considered StringablePolicy.Type.CLOSED
.
Method Detail |
---|
public CharSequence toString(Character character)
StringablePolicy
object
in form of a char sequence.
toString
in interface StringablePolicy<Character>
character
- 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<Character>
StringablePolicy.Type.APPENDABLE
is returned unless explicitly documented otherwise for a given constant.public static CharacterPolicy 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 CharacterPolicy[] values()
for (CharacterPolicy c : CharacterPolicy.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 |