public class CharacterSequence extends Object
new CharacterSequence("ABCDEF", "abcdef")
would represent a
sequence of the first six case-insensitive alphabetical characters. A matching function, matches(int, char)
,
determines whether a candidate character matches any of the defined forms.Constructor and Description |
---|
CharacterSequence(String... strings)
Creates a new instance from one or more sequences.
|
Modifier and Type | Method and Description |
---|---|
String[] |
getForms() |
int |
length() |
boolean |
matches(int index,
char c)
Determines whether the character at the given index of the sequence matches the given value.
|
public CharacterSequence(String... strings)
new CharacterSequence("`1234567890-=", "~!@#$%^&*()_+");
strings
- One or more characters strings, one for each form. At least one sequence MUST be defined. If
multiple sequences are defined, they MUST be of equal length.public String[] getForms()
public boolean matches(int index, char c)
index
- Character sequence index.c
- Character to check for.public int length()
Copyright © 2003-2024 Virginia Tech. All Rights Reserved.