Class: Fox::FXDict
- Inherits:
-
FXObject
- Object
- FXObject
- Fox::FXDict
- Defined in:
- rdoc-sources/FXDict.rb,
lib/fox16/dict.rb
Overview
The dictionary class maintains a fast-access hash table of entities indexed by a character string. It is typically used to map strings to pointers; however, derived classes may allow any type of data to be indexed by strings.
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) first
readonly
Position of first filled slot, or >= total [Integer].
-
- (Object) last
readonly
Position of last filled slot, or -1 [Integer].
-
- (Object) length
(also: #size)
readonly
Total number of entries in the table [Integer].
Instance Method Summary (collapse)
-
- (Object) clear
Clear all entries.
-
- (Object) each_key
Iterate over the keys in this dictionary.
-
- (Boolean) empty?
Returns true if this dictionary contains no key-value pairs.
-
- (Boolean) has_key?(key)
(also: #include?, #member?)
Returns true if the given key is present.
-
- (FXDict) initialize
constructor
Construct an empty dictionary.
-
- (Object) key(pos)
Return key at position pos.
-
- (Object) keys
Returns a new array populated with the keys from this dictionary.
-
- (Boolean) marked?(pos)
Return mark flag of entry at position pos.
-
- (Object) next(pos)
Return position of next filled slot after pos in the hash table, or a value greater than or equal to total if no filled slot was found.
-
- (Object) prev(pos)
Return position of previous filled slot before pos in the hash table, or a -1 if no filled slot was found.
Methods inherited from FXObject
#bind, #handle, #load, #save, subclasses
Constructor Details
- (FXDict) initialize
Construct an empty dictionary.
24 |
# File 'rdoc-sources/FXDict.rb', line 24 def initialize ; end |
Instance Attribute Details
- (Object) first (readonly)
Position of first filled slot, or >= total [Integer]
14 15 16 |
# File 'rdoc-sources/FXDict.rb', line 14 def first @first end |
- (Object) last (readonly)
Position of last filled slot, or -1 [Integer]
17 18 19 |
# File 'rdoc-sources/FXDict.rb', line 17 def last @last end |
- (Object) length (readonly) Also known as: size
Total number of entries in the table [Integer]
11 12 13 |
# File 'rdoc-sources/FXDict.rb', line 11 def length @length end |
Instance Method Details
- (Object) clear
Clear all entries
52 |
# File 'rdoc-sources/FXDict.rb', line 52 def clear() ; end |
- (Object) each_key
Iterate over the keys in this dictionary.
19 20 |
# File 'lib/fox16/dict.rb', line 19 def each_key # :yields: key end |
- (Boolean) empty?
Returns true if this dictionary contains no key-value pairs.
30 |
# File 'lib/fox16/dict.rb', line 30 def empty?() ; end |
- (Boolean) has_key?(key) Also known as: include?, member?
Returns true if the given key is present.
68 |
# File 'rdoc-sources/FXDict.rb', line 68 def has_key?(key) ; end |
- (Object) key(pos)
Return key at position pos.
29 |
# File 'rdoc-sources/FXDict.rb', line 29 def key(pos) ; end |
- (Object) keys
Returns a new array populated with the keys from this dictionary.
10 |
# File 'lib/fox16/dict.rb', line 10 def keys() ; end |
- (Boolean) marked?(pos)
Return mark flag of entry at position pos.
34 |
# File 'rdoc-sources/FXDict.rb', line 34 def marked?(pos) ; end |
- (Object) next(pos)
Return position of next filled slot after pos in the hash table, or a value greater than or equal to total if no filled slot was found.
41 |
# File 'rdoc-sources/FXDict.rb', line 41 def next(pos) ; end |
- (Object) prev(pos)
Return position of previous filled slot before pos in the hash table, or a -1 if no filled slot was found.
47 |
# File 'rdoc-sources/FXDict.rb', line 47 def prev(pos) ; end |