public enum CaseType extends Enum<CaseType>
The GNU Lesser General Public License for details.
Modifier and Type | Method and Description |
---|---|
static CaseType |
fromInteger(int i)
Lookup method to convert from an integer
|
static CaseType |
fromString(String name)
Lookup method to convert from a String
|
static CaseType |
getCase(String word)
What case is the specified word?.
|
abstract String |
setCase(String word)
Adjust the case of the string as defined by the type.
|
int |
toInteger()
Get an integer representation for this CaseType
|
static String |
toSentenceCase(String word)
Change to sentence case - that is first character in caps, the rest in lower.
|
static CaseType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CaseType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CaseType LOWER
public static final CaseType SENTENCE
public static final CaseType UPPER
public static CaseType[] values()
for (CaseType c : CaseType.values()) System.out.println(c);
public static CaseType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic abstract String setCase(String word)
word
- the string to transformpublic static String toSentenceCase(String word)
word
- The word to be manipulatedpublic static CaseType getCase(String word)
The issue here is that getCase("FreD") is undefined. Telling if this is SENTENCE (Tubal-Cain) or MIXED (really the case) is complex and would slow things down for a case that I don't believe happens with Bible text.
word
- The word to be testedIllegalArgumentException
- is the word is nullpublic int toInteger()
public static CaseType fromString(String name)
name
- the name of the CaseTypepublic static CaseType fromInteger(int i)
i
- the ordinal value of the CaseType