Package eu.bandm.tools.d2d2.infra
Class CharSet
java.lang.Object
eu.bandm.tools.d2d2.infra.CharSet
- All Implemented Interfaces:
- CharSet,- Serializable,- Predicate<Character>
Implements Character Sets as an ordered sequence of ranges.
Behaves immutable.
Behaves immutable.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static classRealizes the ranges which make up the character sets.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final CharSetAll supported characters, currently MORE than unicode ! DOCMEstatic final CharSetevidentstatic final charHighest possible character value, needed for the definition ofnegate().static final charLowest possible character value, currently0x0000, needed for the definition ofnegate().
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionCalculates the intersection of both sets.booleancontains(char c) EvidentbooleanEvidentbooleaninthashCode()static CharSetmakeCharSet(String chars) Constructs an instance which contains all characters contained in the string argument.negate()Calculates the netation of this set, w.r.t.Calculates the union of the two sets.Evident.static StringStatic variant ofstringRepD2d().Generate a numeric representation of the character ranges in the set.Convert back into the representation used in d2d-definition sources (="ddf").protected static Stringxn(char c) Generate a numeric representation of a character, whenever sensible.
- 
Field Details- 
LOWpublic static final char LOWLowest possible character value, currently0x0000, needed for the definition ofnegate().- See Also:
 
- 
HIpublic static final char HIHighest possible character value, needed for the definition ofnegate().- See Also:
 
- 
EMPTY_SETevident
- 
ALL_CHARSAll supported characters, currently MORE than unicode ! DOCME
 
- 
- 
Constructor Details- 
CharSetpublic CharSet(char l, char u) Construct an instance which ontains the range fromltou.- Throws:
- IllegalArgumentException- in case l is numerically larger than u.
 
- 
CharSetpublic CharSet(char l) Construct a singleton character set.
- 
CharSetConstruct an instance which contains the all characters contained in the string argument.
 
- 
- 
Method Details- 
equals
- 
equalsEvident
- 
hashCodepublic int hashCode()
- 
makeCharSetConstructs an instance which contains all characters contained in the string argument.
- 
containspublic boolean contains(char c) Evident
- 
singletonContentsEvident.- Returns:
- the only member of this, if it is a singleton set, otherwisenull.
 
- 
andCalculates the intersection of both sets.
- 
negate
- 
orCalculates the union of the two sets. Implemented by stepping through the ordered list of ranges and "zipping" them.
- 
xnGenerate a numeric representation of a character, whenever sensible.
- 
stringRepGenerate a numeric representation of the character ranges in the set.- Returns:
- a symbolic string representation, showing characters and decimal values.
 
- 
stringRepD2dConvert back into the representation used in d2d-definition sources (="ddf").- Returns:
- the un-parsed representation according to D2dmodule syntax.
 
- 
staticStringRepD2dStatic variant ofstringRepD2d().
 
-