indexing
	description: "Implementation of TUPLE"
	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
	TUPLE

create 
	default_create
			-- Process instances of classes with no creation clause.
			-- (Default: do nothing.)
			-- (from ANY)

	make

feature -- Access

	any_code: NATURAL_8 is 255
			-- Code used to identify type in TUPLE.

	boolean_code: NATURAL_8 is 1

	boolean_item (index: INTEGER_32): BOOLEAN
			-- Boolean item at `index'.
		require
			valid_index: valid_index (index)
			is_boolean: is_boolean_item (index)

	character_code: NATURAL_8 is 2

	character_item (index: INTEGER_32): CHARACTER_8
			-- Character item at `index'.
		require
			valid_index: valid_index (index)
			is_character: is_character_item (index)

	double_item (index: INTEGER_32): REAL_64
			-- Double item at `index'.
			-- Was declared in TUPLE as synonym of real_64_item.
		require
			valid_index: valid_index (index)
			is_numeric: is_double_item (index)

	generating_type: STRING_8
			-- Name of current object's generating type
			-- (type of which it is a direct instance)
			-- (from ANY)

	generator: STRING_8
			-- Name of current object's generating class
			-- (base class of the type of which it is a direct instance)
			-- (from ANY)

	integer_16_code: NATURAL_8 is 7

	integer_16_item (index: INTEGER_32): INTEGER_16
			-- INTEGER_16 item at `index'.
		require
			valid_index: valid_index (index)
			is_integer: is_integer_16_item (index)

	integer_32_code: NATURAL_8 is 8

	integer_32_item (index: INTEGER_32): INTEGER_32
			-- INTEGER_32 item at `index'.
			-- Was declared in TUPLE as synonym of integer_item.
		require
			valid_index: valid_index (index)
			is_integer: is_integer_32_item (index)

	integer_64_code: NATURAL_8 is 9

	integer_64_item (index: INTEGER_32): INTEGER_64
			-- INTEGER_64 item at `index'.
		require
			valid_index: valid_index (index)
			is_integer: is_integer_64_item (index)

	integer_8_code: NATURAL_8 is 6

	integer_8_item (index: INTEGER_32): INTEGER_8
			-- INTEGER_8 item at `index'.
		require
			valid_index: valid_index (index)
			is_integer: is_integer_8_item (index)

	integer_item (index: INTEGER_32): INTEGER_32
			-- INTEGER_32 item at `index'.
			-- Was declared in TUPLE as synonym of integer_32_item.
		require
			valid_index: valid_index (index)
			is_integer: is_integer_32_item (index)

	item alias "[]" (index: INTEGER_32): ANY assign put
			-- Entry of key `index'.
			-- Was declared in TUPLE as synonym of infix "@".
		require
			valid_index: valid_index (index)

	item_code (index: INTEGER_32): NATURAL_8
			-- Type code of item at `index'. Used for
			-- argument processing in ROUTINE
		require
			valid_index: valid_index (index)

	natural_16_code: NATURAL_8 is 11

	natural_16_item (index: INTEGER_32): NATURAL_16
			-- NATURAL_16 item at `index'.
		require
			valid_index: valid_index (index)
			is_integer: is_natural_16_item (index)

	natural_32_code: NATURAL_8 is 12

	natural_32_item (index: INTEGER_32): NATURAL_32
			-- NATURAL_32 item at `index'.
		require
			valid_index: valid_index (index)
			is_integer: is_natural_32_item (index)

	natural_64_code: NATURAL_8 is 13

	natural_64_item (index: INTEGER_32): NATURAL_64
			-- NATURAL_64 item at `index'.
		require
			valid_index: valid_index (index)
			is_integer: is_natural_64_item (index)

	natural_8_code: NATURAL_8 is 10

	natural_8_item (index: INTEGER_32): NATURAL_8
			-- NATURAL_8 item at `index'.
		require
			valid_index: valid_index (index)
			is_integer: is_natural_8_item (index)

	pointer_code: NATURAL_8 is 5

	pointer_item (index: INTEGER_32): POINTER
			-- Pointer item at `index'.
		require
			valid_index: valid_index (index)
			is_pointer: is_pointer_item (index)

	real_32_code: NATURAL_8 is 4

	real_32_item (index: INTEGER_32): REAL_32
			-- real item at `index'.
			-- Was declared in TUPLE as synonym of real_item.
		require
			valid_index: valid_index (index)
			is_real_or_integer: is_real_item (index)

	real_64_code: NATURAL_8 is 3

	real_64_item (index: INTEGER_32): REAL_64
			-- Double item at `index'.
			-- Was declared in TUPLE as synonym of double_item.
		require
			valid_index: valid_index (index)
			is_numeric: is_double_item (index)

	real_item (index: INTEGER_32): REAL_32
			-- real item at `index'.
			-- Was declared in TUPLE as synonym of real_32_item.
		require
			valid_index: valid_index (index)
			is_real_or_integer: is_real_item (index)

	reference_code: NATURAL_8 is 0

	reference_item (index: INTEGER_32): ANY
			-- Reference item at `index'.
		require
			valid_index: valid_index (index)
			is_reference: is_reference_item (index)

	wide_character_code: NATURAL_8 is 14

	wide_character_item (index: INTEGER_32): CHARACTER_32
			-- Character item at `index'.
		require
			valid_index: valid_index (index)
			is_wide_character: is_wide_character_item (index)

	infix "@" (index: INTEGER_32): ANY assign put
			-- Entry of key `index'.
			-- Was declared in TUPLE as synonym of item.
		require
			valid_index: valid_index (index)
	
feature -- Comparison

	frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void
			-- or attached to isomorphic object structures?
			-- (from ANY)
		ensure -- from 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
			-- Are `some' and `other' either both void or attached
			-- to objects considered equal?
			-- (from ANY)
		ensure -- from 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
			-- Is `other' attached to an object considered
			-- equal to current object?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from 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
			-- Are `some' and `other' either both void or attached to
			-- field-by-field identical objects of the same type?
			-- Always uses default object comparison criterion.
			-- (from ANY)
		ensure -- from 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
			-- Is `other' attached to an object of the same type
			-- as current object, and field-by-field identical to it?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			same_type: Result implies same_type (other)
			symmetric: Result implies other.standard_is_equal (Current)
	
feature -- Status report

	conforms_to (other: ANY): BOOLEAN
			-- Does type of current object conform to type
			-- of `other' (as per Eiffel: The Language, chapter 13)?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void

	count: INTEGER_32
			-- Number of element in Current.

	hash_code: INTEGER_32
			-- Hash code value
		ensure -- from HASHABLE
			good_hash_value: Result >= 0

	is_empty: BOOLEAN
			-- Is Current empty?

	is_hashable: BOOLEAN
			-- May current object be hashed?
			-- (True if it is not its type's default.)
			-- (from HASHABLE)
		ensure -- from HASHABLE
			ok_if_not_default: Result implies (Current /= default)

	lower: INTEGER_32 is 1
			-- Lower bound of TUPLE.

	same_type (other: ANY): BOOLEAN
			-- Is type of current object identical to type of `other'?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			definition: Result = (conforms_to (other) and other.conforms_to (Current))

	upper: INTEGER_32
			-- Upper bound of TUPLE.

	valid_index (k: INTEGER_32): BOOLEAN
			-- Is `k' a valid key?

	valid_type_for_index (v: ANY; index: INTEGER_32): BOOLEAN
			-- Is object `v' a valid target for element at position `index'?
		require
			valid_index: valid_index (index)
	
feature -- Element change

	put (v: ANY; index: INTEGER_32)
			-- Insert `v' at position `index'.
		require
			valid_index: valid_index (index)
			valid_type_for_index: valid_type_for_index (v, index)

	put_boolean (v: BOOLEAN; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_boolean_item (index)

	put_character (v: CHARACTER_8; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_character_item (index)

	put_double (v: REAL_64; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
			-- Was declared in TUPLE as synonym of put_real_64.
		require
			valid_index: valid_index (index)
			valid_type: is_double_item (index)

	put_integer (v: INTEGER_32; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
			-- Was declared in TUPLE as synonym of put_integer_32.
		require
			valid_index: valid_index (index)
			valid_type: is_integer_32_item (index)

	put_integer_16 (v: INTEGER_16; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_integer_16_item (index)

	put_integer_32 (v: INTEGER_32; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
			-- Was declared in TUPLE as synonym of put_integer.
		require
			valid_index: valid_index (index)
			valid_type: is_integer_32_item (index)

	put_integer_64 (v: INTEGER_64; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_integer_64_item (index)

	put_integer_8 (v: INTEGER_8; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_integer_8_item (index)

	put_natural_16 (v: NATURAL_16; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_natural_16_item (index)

	put_natural_32 (v: NATURAL_32; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_natural_32_item (index)

	put_natural_64 (v: NATURAL_64; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_natural_64_item (index)

	put_natural_8 (v: NATURAL_8; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_natural_8_item (index)

	put_pointer (v: POINTER; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_pointer_item (index)

	put_real (v: REAL_32; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
			-- Was declared in TUPLE as synonym of put_real_32.
		require
			valid_index: valid_index (index)
			valid_type: is_real_item (index)

	put_real_32 (v: REAL_32; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
			-- Was declared in TUPLE as synonym of put_real.
		require
			valid_index: valid_index (index)
			valid_type: is_real_item (index)

	put_real_64 (v: REAL_64; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
			-- Was declared in TUPLE as synonym of put_double.
		require
			valid_index: valid_index (index)
			valid_type: is_double_item (index)

	put_reference (v: ANY; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_reference_item (index)

	put_wide_character (v: CHARACTER_32; index: INTEGER_32)
			-- Put `v' at position `index' in Current.
		require
			valid_index: valid_index (index)
			valid_type: is_wide_character_item (index)
	
feature -- Duplication

	copy (other: like Current)
			-- Update current object using fields of object attached
			-- to `other', so as to yield equal objects.
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_equal: is_equal (other)

	frozen deep_copy (other: like Current)
			-- Effect equivalent to that of:
			--		copy (`other' . deep_twin)
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			deep_equal: deep_equal (Current, other)

	frozen deep_twin: like Current
			-- New object structure recursively duplicated from Current.
			-- (from ANY)
		ensure -- from ANY
			deep_equal: deep_equal (Current, Result)

	frozen standard_copy (other: like Current)
			-- Copy every field of `other' onto corresponding field
			-- of current object.
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
			type_identity: same_type (other)
		ensure -- from ANY
			is_standard_equal: standard_is_equal (other)

	frozen standard_twin: like Current
			-- New object field-by-field identical to `other'.
			-- Always uses default copying semantics.
			-- (from ANY)
		ensure -- from ANY
			standard_twin_not_void: Result /= Void
			equal: standard_equal (Result, Current)

	frozen twin: like Current
			-- New object equal to `Current'
			-- twin calls copy; to change copying/twining semantics, redefine copy.
			-- (from ANY)
		ensure -- from ANY
			twin_not_void: Result /= Void
			is_equal: Result.is_equal (Current)
	
feature -- Basic operations

	frozen default: like Current
			-- Default value of object's type
			-- (from ANY)

	frozen default_pointer: POINTER
			-- Default value of type `POINTER'
			-- (Avoid the need to write `p'.default for
			-- some `p' of type `POINTER'.)
			-- (from ANY)

	default_rescue
			-- Process exception for routines with no Rescue clause.
			-- (Default: do nothing.)
			-- (from ANY)

	frozen do_nothing
			-- Execute a null action.
			-- (from ANY)
	
feature -- Correction

	mismatch_information: MISMATCH_INFORMATION
			-- Original attribute values of mismatched object
			-- (from MISMATCH_CORRECTOR)
	
feature -- Output

	io: STD_FILES
			-- Handle to standard file setup
			-- (from ANY)

	out: STRING_8
			-- New string containing terse printable representation
			-- of current object
			-- Was declared in ANY as synonym of tagged_out.
			-- (from ANY)

	print (some: ANY)
			-- Write terse external representation of `some'
			-- on standard output.
			-- (from ANY)

	frozen tagged_out: STRING_8
			-- New string containing terse printable representation
			-- of current object
			-- Was declared in ANY as synonym of out.
			-- (from ANY)
	
feature -- Platform

	operating_environment: OPERATING_ENVIRONMENT
			-- Objects available from the operating system
			-- (from ANY)
	
feature -- Retrieval

	correct_mismatch
			-- Attempt to correct object mismatch using Mismatch_information.
	
feature -- Type queries

	is_boolean_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' a BOOLEAN?
		require
			valid_index: valid_index (index)

	is_character_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' a CHARACTER?
		require
			valid_index: valid_index (index)

	is_double_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' a DOUBLE?
		require
			valid_index: valid_index (index)

	is_integer_16_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' an INTEGER_16?
		require
			valid_index: valid_index (index)

	is_integer_32_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' an INTEGER_32?
			-- Was declared in TUPLE as synonym of is_integer_item.
		require
			valid_index: valid_index (index)

	is_integer_64_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' an INTEGER_64?
		require
			valid_index: valid_index (index)

	is_integer_8_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' an INTEGER_8?
		require
			valid_index: valid_index (index)

	is_integer_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' an INTEGER_32?
			-- Was declared in TUPLE as synonym of is_integer_32_item.
		require
			valid_index: valid_index (index)

	is_natural_16_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' an NATURAL_16?
		require
			valid_index: valid_index (index)

	is_natural_32_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' an NATURAL_32?
		require
			valid_index: valid_index (index)

	is_natural_64_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' an NATURAL_64?
		require
			valid_index: valid_index (index)

	is_natural_8_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' an NATURAL_8?
		require
			valid_index: valid_index (index)

	is_pointer_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' a POINTER?
		require
			valid_index: valid_index (index)

	is_real_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' a REAL?
		require
			valid_index: valid_index (index)

	is_reference_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' a REFERENCE?
		require
			valid_index: valid_index (index)

	is_uniform: BOOLEAN
			-- Are all items of the same basic type or all of reference type?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_boolean: BOOLEAN
			-- Are all items of type BOOLEAN?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_character: BOOLEAN
			-- Are all items of type CHARACTER?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_double: BOOLEAN
			-- Are all items of type DOUBLE?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_integer: BOOLEAN
			-- Are all items of type INTEGER?
			-- Was declared in TUPLE as synonym of is_uniform_integer_32.
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_integer_16: BOOLEAN
			-- Are all items of type INTEGER_16?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_integer_32: BOOLEAN
			-- Are all items of type INTEGER?
			-- Was declared in TUPLE as synonym of is_uniform_integer.
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_integer_64: BOOLEAN
			-- Are all items of type INTEGER_64?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_integer_8: BOOLEAN
			-- Are all items of type INTEGER_8?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_natural_16: BOOLEAN
			-- Are all items of type NATURAL_16?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_natural_32: BOOLEAN
			-- Are all items of type NATURAL_32?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_natural_64: BOOLEAN
			-- Are all items of type NATURAL_64?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_natural_8: BOOLEAN
			-- Are all items of type NATURAL_8?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_pointer: BOOLEAN
			-- Are all items of type POINTER?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_real: BOOLEAN
			-- Are all items of type REAL?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_reference: BOOLEAN
			-- Are all items of reference type?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_uniform_wide_character: BOOLEAN
			-- Are all items of type WIDE_CHARACTER?
		ensure
			yes_if_empty: (count = 0) implies Result

	is_wide_character_item (index: INTEGER_32): BOOLEAN
			-- Is item at `index' a WIDE_CHARACTER?
		require
			valid_index: valid_index (index)
	
invariant
		-- from ANY
	reflexive_equality: standard_is_equal (Current)
	reflexive_conformance: conforms_to (Current)

indexing
	library: "EiffelBase: Library of reusable components for Eiffel."
	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 -- class TUPLE