note
	description: "Unbounded queues, implemented by resizable arrays"
	library: "Free implementation of ELKS library"
	legal: "See notice at end of class."
	status: "See notice at end of class."
	names: dispenser, array
	representation: array
	access: fixed, fifo, membership
	size: fixed
	contents: generic
	date: "$Date: 2018-12-15 18:06:16 +0000 (Sat, 15 Dec 2018) $"
	revision: "$Revision: 102608 $"

class interface
	ARRAYED_QUEUE [G]

create 
	make

feature -- Access

	item: G
			-- Oldest item.

	has (v: like item): BOOLEAN
			-- Does queue include v?
			-- (Reference or object equality,
			-- based on object_comparison.)
	
feature -- Iteration

	new_cursor: ARRAYED_QUEUE_ITERATION_CURSOR [G]
			-- Fresh cursor associated with current structure
	
feature -- Comparison

	is_equal (other: like Current): BOOLEAN
			-- Is other attached to an object considered
			-- equal to current object?
	
feature -- Measurement

	count: INTEGER_32
			-- Number of items

	capacity: INTEGER_32
			-- Number of items that may be stored

	occurrences (v: G): INTEGER_32
			-- Number of times v appears in structure
			-- (Reference or object equality,
			-- based on object_comparison.)

	index_set: INTEGER_INTERVAL
			-- Range of acceptable indexes
		ensure then
			count_definition: Result.count = count
	
feature -- Status report

	is_empty: BOOLEAN
			-- Is the structure empty?
			-- Was declared in ARRAYED_QUEUE as synonym of off.

	off: BOOLEAN
			-- Is the structure empty?
			-- Was declared in ARRAYED_QUEUE as synonym of is_empty.

	extendible: BOOLEAN
			-- May items be added? (Answer: yes.)

	prunable: BOOLEAN
			-- May items be removed? (Answer: no.)
	
feature -- Element change

	extend (v: G)
			-- Add v as newest item.
			-- Was declared in ARRAYED_QUEUE as synonym of put and force.

	put (v: G)
			-- Add v as newest item.
			-- Was declared in ARRAYED_QUEUE as synonym of extend and force.

	force (v: G)
			-- Add v as newest item.
			-- Was declared in ARRAYED_QUEUE as synonym of extend and put.

	replace (v: like item)
			-- Replace oldest item by v.
	
feature -- Duplication

	copy (other: like Current)
			-- Update current object using fields of object attached
			-- to other, so as to yield equal objects.
	
feature -- Removal

	remove
			-- Remove oldest item.
		require else
			writable: writable

	prune (v: G)
			-- Remove one occurrence of v if any.
			-- (Reference or object equality,
			-- based on object_comparison.)

	prune_all (v: G)
			-- Remove all occurrences of v.
			-- (Reference or object equality,
			-- based on object_comparison.)

	wipe_out
			-- Remove all items.
		require else
			prunable: True
	
feature -- Resizing

	trim
			-- Decrease capacity to the minimum value.
			-- Apply to reduce allocated storage.
		ensure then
			same_items: linear_representation ~ old linear_representation
	
feature -- Conversion

	linear_representation: ARRAYED_LIST [G]
			-- Representation as a linear structure
			-- (in the original insertion order)
	
feature -- Retrieval

	correct_mismatch
			-- Attempt to correct object mismatch using Mismatch_information.
	
feature -- Implementation

	grow (n: INTEGER_32)
			-- Ensure that capacity is at least i.
	
note
	copyright: "Copyright (c) 1984-2018, Eiffel Software and others"
	license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
	source: "[
		Eiffel Software
		5949 Hollister Ave., 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 ARRAYED_QUEUE

Generated by ISE EiffelStudio