Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

kernel.support

Class KL_REVERSE_COMPARATOR


Direct ancestors

KL_REVERSE_PART_COMPARATOR, KL_COMPARATOR

Known direct descendants

DS_REVERSE_COMPARATOR

Creation

Features

Invariants

indexing

description

Reverse total order comparators

library

Gobo Eiffel Kernel Library

copyright

Copyright (c) 2001-2002, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/07/13 17:05:10 $

revision

$Revision: 1.3 $

class

KL_REVERSE_COMPARATOR [G]

inherit

KL_REVERSE_PART_COMPARATOR
KL_COMPARATOR

create

make (a_comparator: like comparator)

-- Create a new reverse comparator based on a_comparator.

-- (From KL_REVERSE_PART_COMPARATOR)

require
a_comparator_not_void: a_comparator /= Void
ensure
comparator_set: comparator = a_comparator

feature -- Access

comparator: KL_COMPARATOR [G]

-- Base comparator

-- (From KL_REVERSE_PART_COMPARATOR)

feature -- Status report

greater_equal (u, v: G): BOOLEAN

-- Is u considered greater than or equal to v?

-- (From KL_COMPARATOR)

require
u_not_void: u /= Void
v_not_void: v /= Void
ensure
definition: Result = (greater_than (u, v) or order_equal (u, v))
greater_than (u, v: G): BOOLEAN

-- Is u considered greater than v?

-- (From KL_PART_COMPARATOR)

require
u_not_void: u /= Void
v_not_void: v /= Void
ensure
definition: Result = less_than (v, u)
less_equal (u, v: G): BOOLEAN

-- Is u considered less than or equal to v?

-- (From KL_COMPARATOR)

require
u_not_void: u /= Void
v_not_void: v /= Void
ensure
definition: Result = (less_than (u, v) or order_equal (u, v))
less_than (u, v: G): BOOLEAN

-- Is u considered less than v?

-- (From KL_PART_COMPARATOR)

require
u_not_void: u /= Void
v_not_void: v /= Void
ensure
asymmetric: Result implies not less_than (v, u)
ensure then
definition: Result = comparator.less_than (v, u)
order_equal (u, v: G): BOOLEAN

-- Are u and v considered equal?

-- (From KL_COMPARATOR)

require
u_not_void: u /= Void
v_not_void: v /= Void
ensure
definition: Result = (not less_than (u, v) and not greater_than (u, v))

feature -- Setting

set_comparator (a_comparator: like comparator)

-- Set comparator to a_comparator.

-- (From KL_REVERSE_PART_COMPARATOR)

require
a_comparator_not_void: a_comparator /= Void
ensure
comparator_set: comparator = a_comparator

invariant

comparator_not_void: comparator /= Void

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

end