Class: Fox::FXDict

Inherits:
FXObject show all
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

FXFileDict, FXIconDict, FXSettings, FXStringDict

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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