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

#initializeFXDict

Construct an empty dictionary.



24
# File 'rdoc-sources/FXDict.rb', line 24

def initialize ; end

Instance Attribute Details

#firstObject (readonly)

Position of first filled slot, or >= total [Integer]



14
15
16
# File 'rdoc-sources/FXDict.rb', line 14

def first
  @first
end

#lastObject (readonly)

Position of last filled slot, or -1 [Integer]



17
18
19
# File 'rdoc-sources/FXDict.rb', line 17

def last
  @last
end

#lengthObject (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

#clearObject

Clear all entries



52
# File 'rdoc-sources/FXDict.rb', line 52

def clear() ; end

#each_keyObject

Iterate over the keys in this dictionary.



57
58
# File 'rdoc-sources/FXDict.rb', line 57

def each_key # :yields: key
end

#empty?Boolean

Returns true if this dictionary contains no key-value pairs.

Returns:

  • (Boolean)


76
# File 'rdoc-sources/FXDict.rb', line 76

def empty?() ; end

#has_key?(key) ⇒ Boolean 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

#key(pos) ⇒ Object

Return key at position pos.



29
# File 'rdoc-sources/FXDict.rb', line 29

def key(pos) ; end

#keysObject

Returns a new array populated with the keys from this dictionary.



63
# File 'rdoc-sources/FXDict.rb', line 63

def keys() ; end

#marked?(pos) ⇒ Boolean

Return mark flag of entry at position pos.

Returns:

  • (Boolean)


34
# File 'rdoc-sources/FXDict.rb', line 34

def marked?(pos) ; end

#next(pos) ⇒ Object

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

#prev(pos) ⇒ Object

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