Module com.googlecode.lanterna
Package com.googlecode.lanterna.input
Class CharacterPattern.Matching
java.lang.Object
com.googlecode.lanterna.input.CharacterPattern.Matching
- Enclosing interface:
CharacterPattern
This immutable class describes a matching result. It wraps two items,
partialMatch and fullMatch.
- fullMatch
-
The resulting KeyStroke if the pattern matched, otherwise null.
Example: if the tested sequence isEsc [ A
, and if the pattern recognized this asArrowUp
, then this field has a value likenew KeyStroke(KeyType.ArrowUp)
- partialMatch
-
true
, if appending appropriate characters at the end of the sequence can produce a match.
Example: if the tested sequence is "Esc [", and the Pattern would match "Esc [ A", then this field would be set totrue
.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal KeyStroke
static final CharacterPattern.Matching
Re-usable result for "not yet" half-matchesfinal boolean
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
fullMatch
-
partialMatch
public final boolean partialMatch -
NOT_YET
Re-usable result for "not yet" half-matches
-
-
Constructor Details
-
Matching
Convenience constructor for exact matches- Parameters:
fullMatch
- the KeyStroke that matched the sequence
-
Matching
General constructorFor mismatches rather use
null
and for "not yet" matches use NOT_YET. Use this constructor, where a sequence may yield both fullMatch and partialMatch or for merging result Matchings of multiple patterns.- Parameters:
partialMatch
- true if further characters could lead to a matchfullMatch
- The perfectly matching KeyStroke
-
-
Method Details