indexing
description: "Intervals between absolute values"
status: "See notice at end of class"
date: "$Date$"
revision: "$Revision$"
class interface
INTERVAL [G -> ABSOLUTE]
create
make (s, e: G)
start_boundend_boundse
require
start_exists: s /= void
end_exists: e /= void
start_before_end: s <= e
ensure
start_bound_set: start_bound /= void and then deep_equal (start_bound, s)
end_bound_set: end_bound /= void and then deep_equal (end_bound, e)
feature
make (s, e: G)
start_boundend_boundse
require
start_exists: s /= void
end_exists: e /= void
start_before_end: s <= e
ensure
start_bound_set: start_bound /= void and then deep_equal (start_bound, s)
end_bound_set: end_bound /= void and then deep_equal (end_bound, e)
feature
end_bound: G
start_bound: G
feature
duration: DURATION
feature
includes (other: like Current): BOOLEAN
other
require PART_COMPARABLE
other_exists: other /= void
intersects (other: like Current): BOOLEAN
other
require
other_exists: other /= void
is_equal (other: like Current): BOOLEAN
other
require ANY
other_not_void: other /= void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
is_included_by (other: like Current): BOOLEAN
other
require PART_COMPARABLE
other_exists: other /= void
is_met_by (other: like Current): BOOLEAN
other
require
other_exists: other /= void
ensure
symmetry: Result = other.meets (Current)
is_overlapped_by (other: like Current): BOOLEAN
other
require
other_exists: other /= void
ensure
symmetry: Result = other.overlaps (Current)
is_strict_included_by (other: like Current): BOOLEAN
other
require PART_COMPARABLE
other_exists: other /= void
meets (other: like Current): BOOLEAN
other
require
other_exists: other /= void
ensure
symmetry: Result = other.is_met_by (Current)
result_definition: Result = (Current <= other and intersects (other))
overlaps (other: like Current): BOOLEAN
other
require
other_exists: other /= void
ensure
result_defition: Result = (strict_before (other.end_bound) and has (other.start_bound))
symmetry: Result = other.is_overlapped_by (Current)
strict_includes (other: like Current): BOOLEAN
other
require PART_COMPARABLE
other_exists: other /= void
infix "<" (other: like Current): BOOLEAN
other
require PART_COMPARABLE
other_exists: other /= void
infix "<=" (other: like Current): BOOLEAN
other
require PART_COMPARABLE
other_exists: other /= void
infix ">" (other: like Current): BOOLEAN
other
require PART_COMPARABLE
other_exists: other /= void
infix ">=" (other: like Current): BOOLEAN
other
require PART_COMPARABLE
other_exists: other /= void
feature
after (v: G): BOOLEAN
v
require
exists: v /= void
ensure
result_definition: Result = (start_bound >= v)
before (v: G): BOOLEAN
v
require
exists: v /= void
ensure
result_definition: Result = (end_bound <= v)
empty: BOOLEAN
ensure
result_definition: Result = duration.is_equal (duration.zero)
has (v: G): BOOLEAN
v
require
exists: v /= void
ensure
result_definition: Result xor not ((start_bound <= v) and then (end_bound >= v))
strict_after (v: G): BOOLEAN
v
require
exists: v /= void
ensure
result_definition: Result = (start_bound > v)
strict_before (v: G): BOOLEAN
v
require
exists: v /= void
ensure
result_definition: Result xor (not (end_bound < v))
feature
set_end_bound (e: G)
end_bounde
require
end_bound_exists: e /= void
end_after_start_bound: e >= start_bound
ensure
end_bound_set: equal (end_bound, e)
set_start_bound (s: G)
start_bounds
require
start_bound_exists: s /= void
start_before_end_bound: s <= end_bound
ensure
start_bound_set: equal (start_bound, s)
feature
gather (other: like Current): like Current
otherother
require
other_exist: other /= void
meeting_interval: meets (other)
ensure
result_exist: Result /= void
result_same_as_union: Result.is_equal (union (other))
intersection (other: like Current): like Current
other
require
other_exists: other /= void
ensure
intersects_validity: intersects (other) implies Result /= void
result_is_included_by_current: intersects (other) implies includes (Result)
result_is_included_by_other: intersects (other) implies other.includes (Result)
union (other: like Current): like Current
other
require
other_exists: other /= void
intersects: intersects (other)
ensure
result_exists: Result /= void
result_includes_current: Result.includes (Current)
result_includes_other: Result.includes (other)
feature
out: STRING
invariant
start_bound_exists: start_bound /= void
end_bound_exists: end_bound /= void
start_bound_before_end_bound: start_bound <= end_bound
current_intersection: intersection (Current).is_equal (Current)
current_union: union (Current).is_equal (Current)
has_bounds: has (start_bound) and has (end_bound)
between_bound: after (start_bound) and before (end_bound)
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
end -- INTERVAL