public abstract class Component extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
ANY_CHAR
This component matches any character.
|
static int |
CHARACTER_SET
A character set component matches only those characters
in the set (positive) or not in the set (negative).
|
static int |
LITERAL
A literal component matches exactly.
|
protected int |
mIndex
The component's position within the regular expression
pattern.
|
protected int |
mMaximumSize
The component's maximum possible length.
|
protected int |
mMinimumSize
The component's minimum possible length.
|
protected int |
mType
The component's type.
|
static int |
NO_MAX_MATCH_LIMIT
The maximum range limit is set to this value when the
the limit is infinite.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Component(int type,
int minLength,
int maxLength,
int index)
Sets the component's type, minimum and maximum length.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendSize(StringBuilder buffer)
Adds the size to the output only if not {1, 1}.
|
abstract boolean |
equalTo(char c)
Returns
true if this component is equal to
the character c; returns false otherwise. |
abstract boolean |
greaterThan(char c)
Returns
true if this component is greater than
the character c; returns false otherwise. |
int |
index()
Returns the component's pattern index.
|
abstract boolean |
lessThan(char c)
Returns
true if this component is less than
the character c; returns false otherwise. |
int |
maximumSize()
Returns the component's maximum size.
|
int |
minimumSize()
Returns the component's minimum size.
|
int |
type()
Returns this component's type.
|
public static final int NO_MAX_MATCH_LIMIT
public static final int LITERAL
public static final int CHARACTER_SET
public static final int ANY_CHAR
protected final int mType
LITERAL, CHARACTER_SET or
ANY_CHAR.protected final int mMinimumSize
protected final int mMaximumSize
protected final int mIndex
protected Component(int type,
int minLength,
int maxLength,
int index)
type - The regular expression component type.minLength - The component's minimum length.maxLength - The component's maximum length.index - The component's position in the pattern.public int type()
LITERAL
CHARACTER_SET
ANY_CHAR
public int minimumSize()
public int maximumSize()
public int index()
public abstract boolean lessThan(char c)
true if this component is less than
the character c; returns false otherwise.c - Test against this character.true if this component is less than
the character c; returns false otherwise.public abstract boolean equalTo(char c)
true if this component is equal to
the character c; returns false otherwise.c - Test against this character.true if this component is equal to
the character c; returns false otherwise.public abstract boolean greaterThan(char c)
true if this component is greater than
the character c; returns false otherwise.c - Test against this character.true if this component is greater than
the character c; returns false otherwise.protected void appendSize(StringBuilder buffer)
buffer - Append the size to this output buffer.Copyright © 2019. All rights reserved.