indexing
description: "Rectangular areas."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date: 2006-01-22 18:25:44 -0800 (Sun, 22 Jan 2006) $"
revision: "$Revision: 56675 $"
class interface
EV_RECTANGLE
create
default_create
ANY
make (a_x, a_y, a_width, a_height: INTEGER_32)
`a_x'`a_y'`a_width'`a_height'
EV_RECTANGLEset
require
a_width_positive: a_width >= 0
a_height_positive: a_height >= 0
set (a_x, a_y, a_width, a_height: INTEGER_32)
`a_x'`a_y'`a_width'`a_height'
EV_RECTANGLEmake
require
a_width_positive: a_width >= 0
a_height_positive: a_height >= 0
feature
bottom: INTEGER_32
generating_type: STRING_8
ANY
generator: STRING_8
ANY
height: INTEGER_32
`Current'
left: INTEGER_32
right: INTEGER_32
top: INTEGER_32
width: INTEGER_32
`Current'
x: INTEGER_32
y: INTEGER_32
feature
frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
shallow_implies_deep: standard_equal (some, other) implies Result
both_or_none_void: (some = Void) implies (Result = (other = Void))
same_type: (Result and (some /= Void)) implies some.same_type (other)
symmetric: Result implies deep_equal (other, some)
frozen equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))
is_equal (other: like Current): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))
frozen standard_is_equal (other: like Current): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
same_type: Result implies same_type (other)
symmetric: Result implies other.standard_is_equal (Current)
feature
conforms_to (other: ANY): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
has (c: EV_COORDINATE): BOOLEAN
`c'`Current'
require
c_not_void: c /= Void
has_x_y (a_x, a_y: INTEGER_32): BOOLEAN
`a_x'`a_y'`Current'
intersects (other: like Current): BOOLEAN
`other'`Current'
require
other_not_void: other /= Void
lower_left: EV_COORDINATE
`Current'
ensure
result_exists: Result /= Void
result_assigned: Result.x = x and then Result.y = y + height
lower_right: EV_COORDINATE
`Current'
ensure
result_exists: Result /= Void
result_assigned: Result.x = x + width and then Result.y = y + height
same_type (other: ANY): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
definition: Result = (conforms_to (other) and other.conforms_to (Current))
upper_left: EV_COORDINATE
`Current'
ensure
result_exists: Result /= Void
result_assigned: Result.x = x and then Result.y = y
upper_right: EV_COORDINATE
`Current'
ensure
result_exists: Result /= Void
result_assigned: Result.x = x + width and then Result.y = y
feature
grow_bottom (i: INTEGER_32)
`i'
grow_left (i: INTEGER_32)
`i'
require
width + i > 0
grow_right (i: INTEGER_32)
`i'
grow_top (i: INTEGER_32)
`i'
require
height + i > 0
include (a_x, a_y: INTEGER_32)
`a_x'`a_y'`Current'
include_point (c: EV_COORDINATE)
`c'`Current'
require
c_not_void: c /= Void
ensure
has_c: has (c)
merge (other: like Current)
`Current'`other'
require
other_not_void: other /= Void
move (a_x, a_y: INTEGER_32)
`a_x'`a_y'
ensure
x_assigned: x = a_x
y_assigned: y = a_y
move_and_resize (a_x, a_y, a_width, a_height: INTEGER_32)
`a_x'`a_y'`a_width'`a_height'
require
a_width_positive: a_width >= 0
a_height_positive: a_height >= 0
resize (a_width, a_height: INTEGER_32)
`a_width'`a_height'
require
a_width_positive: a_width >= 0
a_height_positive: a_height >= 0
ensure
width_assigned: width = a_width
height_assigned: height = a_height
set_bottom (i: INTEGER_32)
`i'bottom
require
i - y >= 0
ensure
assigned: bottom = i
set_height (new_height: INTEGER_32)
`new_height'height
require
new_height_positive: new_height >= 0
ensure
height_assigned: height = new_height
set_left (i: INTEGER_32)
`i'left
require
i <= right
ensure
assigned: left = i
right_same: right = old right
set_right (i: INTEGER_32)
`i'right
require
i - x >= 0
ensure
assigned: right = i
set_top (i: INTEGER_32)
`i'top
require
i <= bottom
ensure
assigned: top = i
bottom_same: bottom = old bottom
set_width (new_width: INTEGER_32)
`new_width'
require
new_width_positive: new_width >= 0
ensure
width_assigned: width = new_width
set_x (new_x: INTEGER_32)
`new_x'x
ensure
x_set: x = new_x
set_y (new_y: INTEGER_32)
`new_y'y
ensure
y_set: y = new_y
feature
copy (other: like Current)
`other'
ANY
require ANY
other_not_void: other /= Void
type_identity: same_type (other)
ensure ANY
is_equal: is_equal (other)
frozen deep_copy (other: like Current)
copy`other'deep_twin
ANY
require ANY
other_not_void: other /= Void
ensure ANY
deep_equal: deep_equal (Current, other)
frozen deep_twin: like Current
ANY
ensure ANY
deep_equal: deep_equal (Current, Result)
frozen standard_copy (other: like Current)
`other'
ANY
require ANY
other_not_void: other /= Void
type_identity: same_type (other)
ensure ANY
is_standard_equal: standard_is_equal (other)
frozen standard_twin: like Current
`other'
ANY
ensure ANY
standard_twin_not_void: Result /= Void
equal: standard_equal (Result, Current)
frozen twin: like Current
`Current'
twincopycopy
ANY
ensure ANY
twin_not_void: Result /= Void
is_equal: Result.is_equal (Current)
feature
frozen default: like Current
ANY
frozen default_pointer: POINTER
`POINTER'
`p'default
`p'`POINTER'
ANY
default_rescue
ANY
frozen do_nothing
ANY
feature
io: STD_FILES
ANY
out: STRING_8
print (some: ANY)
`some'
ANY
frozen tagged_out: STRING_8
ANYout
ANY
feature
operating_environment: OPERATING_ENVIRONMENT
ANY
invariant
width_positive: width >= 0
height_positive: height >= 0
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
indexing
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
356 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end EV_RECTANGLE