eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'CharacterSet':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: CharacterSet


Inheritance:

   Object
   |
   +--Collection
      |
      +--CharacterSet

Package:
stx:libbasic2
Category:
Collections-Unordered
Version:
rev: 1.5 date: 2014/12/28 14:08:18
user: cg
file: CharacterSet.st directory: libbasic2
module: stx stc-classLibrary: libbasic2
Author:
Claus Gittinger

Description:


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.


Class protocol:

instance creation
o  allSingleByteCharacters
return a new character set, which contains all single-byte characters

o  empty
return a new, empty character set

o  new
return a new, empty character set

o  nonSeparators
return a new character set, which contains any but whitespace characters

o  separators
return a new character set, which contains all whitespace characters


Instance protocol:

accessing
o  byteArrayMap

adding & removing
o  add: aCharacter
add aCharacter to the collection.
Returns aCharacter (sigh)

o  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
o  = something

o  hash

copying
o  postCopy
make sure that the bitmap is not shared with the copy

initialization
o  addAllSingleByteCharacters
(256 / 8)

o  initialize
empty

o  setByteArrayMap: aByteArray

queries
o  do: aBlock
(comment from inherited method)
evaluate the argument, aBlock for each element

o  includes: aCharacter
Return true if the set contains aCharacter

o  size
(comment from inherited method)
return the number of elements in the receiver.
This is usually redefined in subclasses for more performance.

set operations
o  complement
return a character set containing all characters (from codepoint 0 to 255),
which are NOT included in the receiver



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Wed, 19 Sep 2018 11:16:22 GMT