|
Class: CharacterSet
Object
|
+--Collection
|
+--CharacterSet
- Package:
- stx:libbasic2
- Category:
- Collections-Unordered
- Version:
- rev:
1.6
date: 2019/05/27 13:04:14
- user: cg
- file: CharacterSet.st directory: libbasic2
- module: stx stc-classLibrary: libbasic2
- Author:
- Claus Gittinger
Used to represent 8-bit character sets (for now) as a bitmap.
Bit[n] is set, if Character codePoint:(n-1) is included in the set.
instance creation
-
allSingleByteCharacters
-
return a new character set, which contains all single-byte characters
-
empty
-
return a new, empty character set
-
new
-
return a new, empty character set
-
nonSeparators
-
return a new character set, which contains any but whitespace characters
-
separators
-
return a new character set, which contains all whitespace characters
accessing
-
byteArrayMap
-
adding & removing
-
add: aCharacter
-
add aCharacter to the collection.
Returns aCharacter (sigh)
-
remove: aCharacter ifAbsent: exceptionValue
-
(comment from inherited method)
search for the first element, which is equal to anObject;
if found, remove and return it.
If not found, return the value of the exceptionBlock.
Uses equality compare (=) to search for the occurrence.
An error is raised here - it is to be implemented by a concrete subclass.
comparing
-
= something
-
-
hash
-
copying-private
-
postCopy
-
make sure that the bitmap is not shared with the copy
initialization
-
addAllSingleByteCharacters
-
(256 / 8)
-
initialize
-
empty
-
setByteArrayMap: aByteArray
-
queries
-
do: aBlock
-
(comment from inherited method)
evaluate the argument, aBlock for each element
-
includes: aCharacter
-
Return true if the set contains aCharacter
-
size
-
(comment from inherited method)
return the number of elements in the receiver.
This is usually redefined in subclasses for more performance.
set operations
-
complement
-
return a character set containing all characters (from codepoint 0 to 255),
which are NOT included in the receiver
|