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

kernel.spec.ise

Class KL_FIXED_ARRAY_ROUTINES


Direct ancestors

KL_IMPORTED_FIXED_ARRAY_TYPE

Features

Invariants

indexing

description

Routines that ought to be in class FIXED_ARRAY. %
%A fixed array is a zero-based indexed sequence of values, %
%equipped with features put, item and count.

library

Gobo Eiffel Kernel Library

copyright

Copyright (c) 1999, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2004/12/22 22:44:42 $

revision

$Revision: 1.7 $

class

KL_FIXED_ARRAY_ROUTINES [G]

obsolete

[041219] Use SPECIAL and KL_SPECIAL_ROUTINES instead.

inherit

KL_IMPORTED_FIXED_ARRAY_TYPE

feature -- Initialization

make (n: INTEGER): like FIXED_ARRAY_TYPE

-- Create a new fixed array being able to contain n items.

require
non_negative_n: n >= 0
ensure
fixed_array_not_void: Result /= Void
valid_fixed_array: valid_fixed_array (Result)
count_set: Result.count = n
make_from_array (an_array: ARRAY [G]): like FIXED_ARRAY_TYPE

-- Create a new fixed array with items from an_array.

require
an_array_not_void: an_array /= Void
ensure
fixed_array_not_void: Result /= Void
valid_fixed_array: valid_fixed_array (Result)
count_set: Result.count = an_array.count

feature -- Status report

has (an_array: like FIXED_ARRAY_TYPE; v: G): BOOLEAN

-- Does v appear in an_array?

require
an_array_not_void: an_array /= Void
valid_fixed_array (an_array: like FIXED_ARRAY_TYPE): BOOLEAN

-- Make sure that the lower bound of an_array is zero.

require
an_array_not_void: an_array /= Void

feature -- Removal

clear_all (an_array: like FIXED_ARRAY_TYPE)

-- Reset all items to default values.

require
an_array_not_void: an_array /= Void
valid_fixed_array: valid_fixed_array (an_array)

feature -- Resizing

resize (an_array: like FIXED_ARRAY_TYPE; n: INTEGER): like FIXED_ARRAY_TYPE

-- Resize an_array so that it contains n items.
-- Do not lose any previously entered items.
-- Note: the returned fixed array might be an_array
-- or a newly created fixed array where items from
-- an_array have been copied to.

require
an_array_not_void: an_array /= Void
valid_fixed_array: valid_fixed_array (an_array)
n_large_enough: n >= an_array.count
ensure
fixed_array_not_void: Result /= Void
valid_fixed_array: valid_fixed_array (Result)
count_set: Result.count = n

feature -- Conversion

to_fixed_array (an_array: ARRAY [G]): like FIXED_ARRAY_TYPE

-- Fixed array filled with items from an_array.
-- The fixed array and an_array may share internal
-- data. Use make_from_array if this is a concern.

require
an_array_not_void: an_array /= Void
ensure
fixed_array_not_void: Result /= Void
valid_fixed_array: valid_fixed_array (Result)
count_set: Result.count >= an_array.count

feature -- Type anchors

invariant


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

end