Package com.exedio.cope.util
Class CharSet
- java.lang.Object
-
- com.exedio.cope.util.CharSet
-
- All Implemented Interfaces:
Serializable
public final class CharSet extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static CharSet
ALPHA
static CharSet
ALPHA_LOWER
static CharSet
ALPHA_LOWER_NUMERIC
static CharSet
ALPHA_NUMERIC
static CharSet
ALPHA_UPPER
static CharSet
ALPHA_UPPER_NUMERIC
static CharSet
DOMAIN
static CharSet
EMAIL
Deprecated.static CharSet
EMAIL_ASCII
allows only 7bit ASCII email characters (RFC5322/5321 without quoted strings and comments)static CharSet
EMAIL_INTERNATIONAL
EMAIL_ASCII
plus all characters beyond 7bit ASCIIstatic CharSet
EMAIL_RESTRICTIVE
allows only characters commonly used in email addresses; this is the same character set as previously available asCharSet.EMAIL
; please note that valid characters like + and & are not allowed in this charsetstatic CharSet
HEX_LOWER
static CharSet
HEX_UPPER
static CharSet
NUMERIC
-
Constructor Summary
Constructors Constructor Description CharSet(char from, char to)
CharSet(char from1, char to1, char from2, char to2)
CharSet(char from1, char to1, char from2, char to2, char from3, char to3)
CharSet(char from1, char to1, char from2, char to2, char from3, char to3, char from4, char to4)
CharSet(char from1, char to1, char from2, char to2, char from3, char to3, char from4, char to4, char from5, char to5)
CharSet(char from1, char to1, char from2, char to2, char from3, char to3, char from4, char to4, char from5, char to5, char from6, char to6)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(char c)
boolean
equals(Object other)
String
getRegularExpression()
String
getRegularExpressionForInvalid7BitChars()
int
hashCode()
int
indexOfNotContains(CharSequence s)
Returns the index of the first character in s, which this CharSet does not contain.int
indexOfNotContains(String s)
Returns the index of the first character in s, which this CharSet does not contain.boolean
isSubsetOfAscii()
CharSet
remove(char from, char to)
String
toString()
-
-
-
Field Detail
-
ALPHA
public static final CharSet ALPHA
-
ALPHA_UPPER
public static final CharSet ALPHA_UPPER
-
ALPHA_LOWER
public static final CharSet ALPHA_LOWER
-
ALPHA_NUMERIC
public static final CharSet ALPHA_NUMERIC
-
ALPHA_UPPER_NUMERIC
public static final CharSet ALPHA_UPPER_NUMERIC
-
ALPHA_LOWER_NUMERIC
public static final CharSet ALPHA_LOWER_NUMERIC
-
HEX_UPPER
public static final CharSet HEX_UPPER
-
HEX_LOWER
public static final CharSet HEX_LOWER
-
NUMERIC
public static final CharSet NUMERIC
-
DOMAIN
public static final CharSet DOMAIN
-
EMAIL_RESTRICTIVE
public static final CharSet EMAIL_RESTRICTIVE
allows only characters commonly used in email addresses; this is the same character set as previously available asCharSet.EMAIL
; please note that valid characters like + and & are not allowed in this charset
-
EMAIL_ASCII
public static final CharSet EMAIL_ASCII
allows only 7bit ASCII email characters (RFC5322/5321 without quoted strings and comments)
-
EMAIL_INTERNATIONAL
public static final CharSet EMAIL_INTERNATIONAL
EMAIL_ASCII
plus all characters beyond 7bit ASCII
-
EMAIL
@Deprecated public static final CharSet EMAIL
Deprecated.
-
-
Constructor Detail
-
CharSet
public CharSet(char from, char to)
-
CharSet
public CharSet(char from1, char to1, char from2, char to2)
-
CharSet
public CharSet(char from1, char to1, char from2, char to2, char from3, char to3)
-
CharSet
public CharSet(char from1, char to1, char from2, char to2, char from3, char to3, char from4, char to4)
-
CharSet
public CharSet(char from1, char to1, char from2, char to2, char from3, char to3, char from4, char to4, char from5, char to5)
-
CharSet
public CharSet(char from1, char to1, char from2, char to2, char from3, char to3, char from4, char to4, char from5, char to5, char from6, char to6)
-
-
Method Detail
-
isSubsetOfAscii
public boolean isSubsetOfAscii()
-
contains
public boolean contains(char c)
-
indexOfNotContains
public int indexOfNotContains(String s)
Returns the index of the first character in s, which this CharSet does not contain. Returns -1, if this CharSet contains all characters in s.This method is provided for binary backwards compatibility. It is equivalent to
indexOfNotContains(CharSequence)
.
-
indexOfNotContains
public int indexOfNotContains(CharSequence s)
Returns the index of the first character in s, which this CharSet does not contain. Returns -1, if this CharSet contains all characters in s.
-
remove
public CharSet remove(char from, char to)
-
getRegularExpression
public String getRegularExpression()
-
getRegularExpressionForInvalid7BitChars
public String getRegularExpressionForInvalid7BitChars()
-
-