indexing
description: "Managers that control the data transactions"
status: "See note at end of class"
date: "$Date$"
revision: "$Revision$"
class interface
TRANSFER_MANAGER
create
make
feature
has (v: like transaction): BOOLEAN
v
object_comparison
CHAIN
ensure CONTAINER
not_found_in_empty: Result implies not is_empty
index: INTEGER
item
ARRAYED_LIST
index_of (v: like transaction; i: INTEGER): INTEGER
iv
object_comparison
CHAIN
require LINEAR
positive_occurrences: i > 0
ensure LINEAR
non_negative_result: Result >= 0
transaction: like first
ARRAYED_LIST
require TRANSACTION_CONTAINER
True
require TRAVERSABLE
not_off: not off
require ACTIVE
readable: readable
require else ARRAYED_LIST
index_is_valid: valid_index (index)
source: DATA_RESOURCE
target: DATA_RESOURCE
feature
count: INTEGER
ARRAYED_LIST
finished_transactions: INTEGER
occurrences (v: like transaction): INTEGER
v
object_comparison
CHAIN
ensure BAG
non_negative_occurrences: Result >= 0
occurrences (v: like transaction): INTEGER
v
object_comparison
CHAIN
ensure BAG
non_negative_occurrences: Result >= 0
total_count: INTEGER
ensure
index_unchanged: index = old index
feature
is_equal (other: like Current): BOOLEAN
other
LIST
require ANY
other_not_void: other /= void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then LIST
indices_unchanged: index = old index and other.index = old other.index
true_implies_same_size: Result implies count = other.count
feature
after: BOOLEAN
LIST
before: BOOLEAN
LIST
changeable_comparison_criterion: BOOLEAN
object_comparison
CONTAINER
error: BOOLEAN
require
not_empty: not is_empty
error_reason: STRING
require
error_exists: error
ensure
non_empty_string: Result /= void and then not Result.is_empty
index_unchanged: index = old index
error_stops: BOOLEAN
TRANSACTION_CONTAINER
exhausted: BOOLEAN
LINEAR
ensure LINEAR
exhausted_when_off: off implies Result
Extendible: BOOLEAN is True
DYNAMIC_CHAIN
full: BOOLEAN
ARRAYED_LIST
insertable (t: TRANSACTION): BOOLEAN
t
require TRANSACTION_CONTAINER
transaction_exists: t /= void
is_empty: BOOLEAN
FINITE
is_inserted (v: TRANSACTION): BOOLEAN
vput
extend
ARRAYED_LIST
object_comparison: BOOLEAN
equal=
=
CONTAINER
off: BOOLEAN
CHAIN
prunable: BOOLEAN
ARRAYED_LIST
readable: BOOLEAN
SEQUENCE
transactions_succeeded: BOOLEAN
require
not_empty: not is_empty
transfer_finished: BOOLEAN
writable: BOOLEAN
SEQUENCE
feature
compare_objects
equal
=
CONTAINER
require CONTAINER
changeable_comparison_criterion
ensure CONTAINER
object_comparison
compare_references
=
equal
CONTAINER
require CONTAINER
changeable_comparison_criterion
ensure CONTAINER
reference_comparison: not object_comparison
continue_on_error
TRANSACTION_CONTAINER
ensure TRANSACTION_CONTAINER
does_not_stop: not error_stops
reset_status
ensure
finished_flag_reset: not transfer_finished
no_error: not error
stop_on_error
TRANSACTION_CONTAINER
ensure TRANSACTION_CONTAINER
stop: error_stops
feature
back
ARRAYED_LIST
require BILINEAR
not_before: not before
finish
ARRAYED_LIST
ensure then CHAIN
at_last: not is_empty implies islast
ensure then ARRAYED_LIST
before_when_empty: is_empty implies before
forth
ARRAYED_LIST
require LINEAR
not_after: not after
ensure then LIST
moved_forth: index = old index + 1
select_transaction (i: INTEGER)
i
ARRAYED_LIST
require CHAIN
valid_cursor_index: valid_cursor_index (i)
require TRANSACTION_CONTAINER
not_empty: not is_empty
index_in_range: 1 <= n and n <= count
ensure CHAIN
position_expected: index = i
ensure TRANSACTION_CONTAINER
selected: index = n
search (v: like transaction)
itemv
v
exhausted
object_comparison
BILINEAR
ensure LINEAR
object_found: (not exhausted and object_comparison) implies equal (v, transaction)
item_found: (not exhausted and not object_comparison) implies v = transaction
start
ARRAYED_LIST
ensure then CHAIN
at_first: not is_empty implies isfirst
ensure then ARRAYED_LIST
after_when_empty: is_empty implies after
feature
add_transaction (t: TRANSACTION)
TRANSACTION_CONTAINER
require TRANSACTION_CONTAINER
transaction_exists: t /= void
transaction_correct: t.is_correct
ensure TRANSACTION_CONTAINER
one_more_item: count = old count + 1
index_unchanged: not old is_empty implies index = old index
append (s: SEQUENCE [TRANSACTION])
s
SEQUENCE
require SEQUENCE
argument_not_void: s /= void
ensure SEQUENCE
new_count: count >= old count
extend (v: like transaction)
v
ARRAYED_LISTforce
ARRAYED_LIST
require COLLECTION
extendible: extendible
ensure COLLECTION
item_inserted: is_inserted (v)
ensure then BAG
one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
fill (other: CONTAINER [TRANSACTION])
other
other
COLLECTION
require COLLECTION
other_not_void: other /= void
extendible
force (v: like transaction)
v
ARRAYED_LISTextend
ARRAYED_LIST
require SEQUENCE
extendible: extendible
ensure then SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)
put (v: like transaction)
v
replace
CHAIN
require COLLECTION
extendible: extendible
ensure COLLECTION
item_inserted: is_inserted (v)
ensure then CHAIN
same_count: count = old count
ensure then SEQUENCE
new_count: count = old count + 1
replace (v: like first)
v
ARRAYED_LIST
require ACTIVE
writable: writable
ensure ACTIVE
item_replaced: transaction = v
feature
prune (v: like transaction)
v
afterv
ARRAYED_LIST
require COLLECTION
prunable: prunable
prune_all (v: like transaction)
v
object_comparison
ARRAYED_LIST
require COLLECTION
prunable
ensure COLLECTION
no_more_occurrences: not has (v)
ensure then DYNAMIC_CHAIN
is_exhausted: exhausted
ensure then ARRAYED_LIST
is_after: after
remove
after
ARRAYED_LIST
require ACTIVE
prunable: prunable
writable: writable
ensure then DYNAMIC_LIST
after_when_empty: is_empty implies after
ensure then ARRAYED_LIST
index: index = old index
remove_transaction (n: INTEGER)
n
require
not_empty: not is_empty
index_in_range: 1 <= n and n <= count
ensure
one_less_item: count = count - 1
index_unchanged: (old index < old count) implies (index = old index)
index_adapted: (old index = old count) implies (index = old index - 1)
wipe_out
ARRAYED_LIST
require COLLECTION
prunable
ensure COLLECTION
wiped_out: is_empty
ensure then DYNAMIC_LIST
is_before: before
feature
linear_representation: LINEAR [TRANSACTION]
LINEAR
feature
copy (other: like Current)
other
clone
ARRAY
require ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure ANY
is_equal: is_equal (other)
ensure then ARRAY
equal_areas: area.is_equal (other.area)
feature
execute_transaction
ensure
counter_updated: not transaction.error implies finished_transactions = old finished_transactions + transaction.count
transfer
require
not_empty: not is_empty
flags_reset: not (transfer_finished and transactions_succeeded)
ensure
transfer_flag_set: transfer_finished
feature
do_all (action: PROCEDURE [ANY, TUPLE [TRANSACTION]])
action
action
LINEAR
require TRAVERSABLE
action_exists: action /= void
do_if (action: PROCEDURE [ANY, TUPLE [TRANSACTION]]; test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN])
actiontest
actiontest
LINEAR
require TRAVERSABLE
action_exists: action /= void
test_exits: test /= void
for_all (test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN]): BOOLEAN
test
LINEAR
require TRAVERSABLE
test_exits: test /= void
there_exists (test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN]): BOOLEAN
test
LINEAR
require TRAVERSABLE
test_exits: test /= void
invariant
finished_transaction_range: 0 <= finished_transactions and finished_transactions <= total_count
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
TRANSACTION_CONTAINER
empty_definition: is_empty = (count = 0)
index_in_range: not is_empty implies (1 <= index and index <= count)
ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies (not readable) and (not writable)
BILINEAR
not_both: not (after and before)
before_constraint: before implies off
LINEAR
after_constraint: after implies off
TRAVERSABLE
empty_constraint: is_empty implies off
FINITE
empty_definition: is_empty = (count = 0)
non_negative_count: count >= 0
ARRAYED_LIST
prunable: prunable
starts_from_one: lower = 1
empty_means_storage_empty: is_empty implies all_default
ARRAY
area_exists: area /= void
consistent_size: capacity = upper - lower + 1
non_negative_count: count >= 0
index_set_has_same_count: valid_index_set
RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
BOUNDED
valid_count: count <= capacity
full_definition: full = (count = capacity)
INDEXABLE
index_set_not_void: index_set /= void
LIST
before_definition: before = (index = 0)
after_definition: after = (index = count + 1)
CHAIN
non_negative_index: index >= 0
index_small_enough: index <= count + 1
off_definition: off = ((index = 0) or (index = count + 1))
isfirst_definition: isfirst = ((not is_empty) and (index = 1))
islast_definition: islast = ((not is_empty) and (index = count))
item_corresponds_to_index: (not off) implies (transaction = i_th (index))
index_set_has_same_count: index_set.count = count
DYNAMIC_CHAIN
extendible: extendible
end -- TRANSFER_MANAGER