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

structure.list

Class DS_NESTED_LIST


Known direct descendants

PR_VARIABLE, PR_TRANSITION

Features

Invariants

indexing

description

Lists whose items are held either locally or in %
%other nested lists. Note that nested lists built %
%that way form a possibly cyclic di-graph. Nested %
%lists can be 'flattened', that is all items %
%accessible remotely are also kept locally, using %
%a DS_NESTED_LIST_FLATTENER.

library

Gobo Eiffel Structure Library

copyright

Copyright (c) 1998, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2004/11/14 15:10:15 $

revision

$Revision: 1.8 $

deferred class

DS_NESTED_LIST [G]

feature -- Access

local_items: DS_LINEAR [G]

-- Items held locally

ensure
local_items_not_void: Result /= Void
remote_items: DS_LINEAR [DS_NESTED_LIST [G]]

-- Items held by other lists

ensure
remote_items_not_void: Result /= Void
no_void_remote: not Result.has (Void)

feature {DS_NESTED_LIST_FLATTENER} -- Implementation

add_local_item (an_item: G)

-- Add an_item to local_items.

ensure
item_added: local_items.has (an_item)
index: INTEGER

-- Index used to detect possible cycles
-- in the di-graph made of nested lists

set_index (i: INTEGER)

-- Set index to i.

ensure
index_set: index = i
set_local_items (items: like local_items)

-- Set local_items to items.

require
items_not_void: items /= Void
ensure
local_items_set: local_items = items

invariant

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

end