com.sibvisions.util.type
Enum StringUtil.TextType

java.lang.Object
  extended by java.lang.Enum<StringUtil.TextType>
      extended by com.sibvisions.util.type.StringUtil.TextType
All Implemented Interfaces:
Serializable, Comparable<StringUtil.TextType>
Enclosing class:
StringUtil

public static enum StringUtil.TextType
extends Enum<StringUtil.TextType>

the text types.


Enum Constant Summary
AZLetters
          only letters from A(a) to Z(z).
AZLettersDigits
          letters from A(a) to Z(z) and digits.
Digits
          only digits.
FromFirstLetter
          all characters but start from first letter.
Letters
          only letters.
LettersDigits
          letters and digits.
LettersDigitsSpace
          letters and digits and space.
LettersDigitsWhitespace
          letters and digits and whitespace.
LowerCase
          all characters that are lowercase.
UpperCase
          all characters that are uppercase.
WithoutLeadingDigits
          all characters but without leading digits.
 
Method Summary
 boolean acceptCharacter(char pChar)
          Tests if this type does accept the given char.
 boolean isStartCharacter(char pChar)
          Tests if the given char is a valid start position for the type.
static StringUtil.TextType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static StringUtil.TextType[] 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

AZLetters

public static final StringUtil.TextType AZLetters
only letters from A(a) to Z(z).


AZLettersDigits

public static final StringUtil.TextType AZLettersDigits
letters from A(a) to Z(z) and digits.


Digits

public static final StringUtil.TextType Digits
only digits.


FromFirstLetter

public static final StringUtil.TextType FromFirstLetter
all characters but start from first letter.


Letters

public static final StringUtil.TextType Letters
only letters.


LettersDigits

public static final StringUtil.TextType LettersDigits
letters and digits.


LettersDigitsSpace

public static final StringUtil.TextType LettersDigitsSpace
letters and digits and space.


LettersDigitsWhitespace

public static final StringUtil.TextType LettersDigitsWhitespace
letters and digits and whitespace.


LowerCase

public static final StringUtil.TextType LowerCase
all characters that are lowercase.


UpperCase

public static final StringUtil.TextType UpperCase
all characters that are uppercase.


WithoutLeadingDigits

public static final StringUtil.TextType WithoutLeadingDigits
all characters but without leading digits.

Method Detail

values

public static StringUtil.TextType[] 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 (StringUtil.TextType c : StringUtil.TextType.values())
    System.out.println(c);

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

valueOf

public static StringUtil.TextType 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

acceptCharacter

public boolean acceptCharacter(char pChar)
Tests if this type does accept the given char.

This function is called on every char in a string.

Parameters:
pChar - the char to test.
Returns:
true if this type does accept the given char.

isStartCharacter

public boolean isStartCharacter(char pChar)
Tests if the given char is a valid start position for the type.

This function is only called as long as it does not return true. It is used to determine whether a valid start position for the type has been reached or not. As long as this function returns false acceptCharacter(char) will not be called. If it returns true acceptCharacter(char) will be called for every char but no longer this function.

Parameters:
pChar - the char to test.
Returns:
true if the given char is a valid start position.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.