elogger API
Overview Classes Cluster Class Index          Top Features

structure.table

Class DS_MULTIARRAYED_HASH_TABLE_CURSOR


Direct ancestors

DS_MULTIARRAYED_SPARSE_TABLE_CURSOR

Creation

Features

Invariants

indexing

description

Cursors for multi-arrayed hash table traversals

library

Gobo Eiffel Structure Library

copyright

Copyright (c) 2001, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

class DS_MULTIARRAYED_HASH_TABLE_CURSOR [G, K -> HASHABLE]

inherit

DS_MULTIARRAYED_SPARSE_TABLE_CURSOR
DS_SPARSE_TABLE_CURSOR

create

make (a_container: like container)

-- Create a new cursor for a_container.
-- (From DS_SPARSE_CONTAINER_CURSOR)

require

a_container_not_void: a_container /= Void

ensure

container_set: container = a_container
before: before

feature -- Access

item: G

-- Item at cursor position
-- (From DS_CURSOR)

require

not_off: not off

container: DS_MULTIARRAYED_HASH_TABLE[G, K]

-- Hash table traversed
-- (From DS_CURSOR)

key: K

-- Key at cursor position
-- (From DS_SPARSE_TABLE_CURSOR)

require

not_off: not off

ANY_: KL_ANY_ROUTINES

-- Routines that ought to be in class ANY
-- (From KL_IMPORTED_ANY_ROUTINES)

ensure

any_routines_not_void: Result /= Void

feature -- Comparison

is_equal (other: like Current): BOOLEAN

-- Are other and current cursor at the same position?
-- (From ANY)

require

other_not_void: other /= Void

ensure

symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result

feature -- Status report

after: BOOLEAN

-- Is there no valid position to right of cursor?
-- (From DS_LINEAR_CURSOR)

is_first: BOOLEAN

-- Is cursor on first item?
-- (From DS_LINEAR_CURSOR)

ensure

not_empty: Result implies not container.is_empty
not_off: Result implies not off

is_valid: BOOLEAN

-- Is cursor valid?
-- (From DS_CURSOR)

obsolete

Backward compatibility with Gobo 1.4

ensure

definition: Result = True

off: BOOLEAN

-- Is there no item at cursor position?
-- (From DS_CURSOR)

same_position (other: like Current): BOOLEAN

-- Is current cursor at same position as other?
-- (From DS_CURSOR)

require

other_not_void: other /= Void

valid_cursor (other: like Current): BOOLEAN

-- Is other a valid cursor according
-- to current traversal strategy?
-- (From DS_CURSOR)

require

other_not_void: other /= Void

ensure

Result implies container.valid_cursor (other)

before: BOOLEAN

-- Is there no valid position to left of cursor?
-- (From DS_BILINEAR_CURSOR)

is_last: BOOLEAN

-- Is cursor on last item?
-- (From DS_BILINEAR_CURSOR)

ensure

not_empty: Result implies not container.is_empty
not_off: Result implies not off

feature -- Cursor movement

go_to (other: like Current)

-- Move cursor to other's position.
-- (From DS_CURSOR)

require

other_not_void: other /= Void
other_valid: valid_cursor (other)

ensure

same_position: same_position (other)

forth

-- Move cursor to next position.
-- (From DS_LINEAR_CURSOR)

require

not_after: not after

go_after

-- Move cursor to after position.
-- (From DS_LINEAR_CURSOR)

ensure

after: after

search_forth (v: G)

-- Move to first position at or after current
-- position where item and v are equal.
-- (Use equality_tester's criterion from container
-- if not void, use = criterion otherwise.)
-- Move after if not found.
-- (From DS_LINEAR_CURSOR)

require

not_off: not off or after

start

-- Move cursor to first position.
-- (From DS_LINEAR_CURSOR)

ensure

empty_behavior: container.is_empty implies after
first_or_after: is_first xor after

back

-- Move cursor to previous position.
-- (From DS_BILINEAR_CURSOR)

require

not_before: not before

finish

-- Move cursor to last position.
-- (From DS_BILINEAR_CURSOR)

ensure

empty_behavior: container.is_empty implies before
last_or_before: is_last xor before

go_before

-- Move cursor to before position.
-- (From DS_BILINEAR_CURSOR)

ensure

before: before

search_back (v: G)

-- Move to first position at or before current
-- position where item and v are equal.
-- (Use equality_tester's criterion from container
-- if not void, use = criterion otherwise.)
-- Move before if not found.
-- (From DS_BILINEAR_CURSOR)

require

not_off: not off or before

feature -- Element change

replace (v: G)

-- Replace item at cursor position by v.
-- (From DS_DYNAMIC_CURSOR)

require

not_off: not off

ensure

replaced: item = v

swap (other: DS_DYNAMIC_CURSOR[G])

-- Exchange items at current and other's positions.
-- Note: cursors may reference two different containers.
-- (From DS_DYNAMIC_CURSOR)

require

not_off: not off
other_not_void: other /= Void
other_not_off: not other.off

ensure

new_item: item = old (other.item)
new_other: other.item = old item

feature -- Duplication

copy (other: like Current)

-- Copy other to current cursor.
-- (From ANY)

require

other_not_void: other /= Void
type_identity: same_type (other)

ensure

is_equal: is_equal (other)

feature {DS_MULTIARRAYED_HASH_TABLE} -- Implementation

next_cursor: DS_MULTIARRAYED_HASH_TABLE_CURSOR[G, K]

-- Next cursor
-- (Used by container to keep track of traversing
-- cursors (i.e. cursors associated with container
-- and which are not currently off).)
-- (From DS_CURSOR)

feature {DS_TRAVERSABLE} -- Implementation

set_next_cursor (a_cursor: like next_cursor)

-- Set next_cursor to a_cursor.
-- (From DS_CURSOR)

ensure

next_cursor_set: next_cursor = a_cursor

feature {DS_SPARSE_CONTAINER} -- Implementation

set_after

-- Set position to after position
-- (From DS_SPARSE_CONTAINER_CURSOR)

ensure

after: after

set_before

-- Set position to before position
-- (From DS_SPARSE_CONTAINER_CURSOR)

ensure

before: before

set_position (p: INTEGER)

-- Set position to p.
-- (From DS_SPARSE_CONTAINER_CURSOR)

require

valid_p: valid_position (p)

ensure

position_set: position = p

valid_position (p: INTEGER): BOOLEAN

-- Is p a valid value for position?
-- (From DS_SPARSE_CONTAINER_CURSOR)

ensure

not_off: (container.valid_position (p) and then container.valid_slot (p)) implies Result
before: (p = container.before_position) implies Result
after: (p = container.after_position) implies Result
valid_slot: (Result and container.valid_position (p)) implies container.valid_slot (p)

feature {DS_SPARSE_CONTAINER, DS_SPARSE_CONTAINER_CURSOR} -- Implementation

position: INTEGER

-- Internal position in container
-- (From DS_SPARSE_CONTAINER_CURSOR)

invariant


-- From DS_SPARSE_CONTAINER_CURSOR

-- From DS_BILINEAR_CURSOR
not_both: not (after and before)
before_constraint: before implies off

-- From DS_LINEAR_CURSOR
after_constraint: after implies off

-- From DS_CURSOR
container_not_void: container /= Void
empty_constraint: container.is_empty implies off

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

Documentation generated by edoc