Class DS_LINKED_QUEUE `note`
```description:

"Queues (First-In, First-Out) implemented with linked cells"

library:    "Gobo Eiffel Structure Library"
author:     "Eric Bezault <ericb@gobosoft.com>"
`class interface`
`DS_LINKED_QUEUE [G]`
`inherit`
```DS_QUEUE [G]
DS_DISPENSER [G]
DS_SEARCHABLE [G]
DS_CONTAINER [G]```
`create`
```make
-- Create an empty queue.
-- Use `=' as comparison criterion.
ensure
empty: is_empty```
```make_equal
-- Create an empty queue.
-- Use equal as comparison criterion.
ensure
empty: is_empty```
```make_default
-- Create an empty queue.
-- Use `=' as comparison criterion.
-- (From DS_CONTAINER.)
ensure
empty: is_empty```
`feature -- Access`
```item: G
-- Item at front of queue
-- (From DS_DISPENSER.)
require
not_empty: not is_empty```
```equality_tester: DS_EQUALITY_TESTER [G]
-- Equality tester;
-- A void equality tester means that `='
-- will be used as comparison criterion.
-- (From DS_SEARCHABLE.)```
`feature -- Measurement`
```count: INTEGER
-- Number of items in queue
-- (From DS_CONTAINER.)```
```occurrences (v: G): INTEGER
-- Number of times v appears in queue
-- (Use equality_tester's comparison criterion
-- if not void, use `=' criterion otherwise.)
-- (From DS_SEARCHABLE.)
ensure
positive: Result >= 0
has: has (v) implies Result >= 1```
`feature -- Status report`
```has (v: G): BOOLEAN
-- Does queue include v?
-- (Use equality_tester's comparison criterion
-- if not void, use `=' criterion otherwise.)
-- (From DS_SEARCHABLE.)
ensure
not_empty: Result implies not is_empty```
```is_empty: BOOLEAN
-- Is queue empty?
-- (From DS_CONTAINER.)```
```extendible (n: INTEGER): BOOLEAN
-- May queue be extended with n items?
require
positive_n: n >= 0
ensure
definition: Result = True```
```same_items (v, u: G): BOOLEAN
-- Are v and u considered equal?
-- (Use equality_tester's comparison criterion
-- if not void, use `=' criterion otherwise.)
-- (From DS_SEARCHABLE.)```
```same_equality_tester (other: DS_SEARCHABLE [G]): BOOLEAN
-- Does container use the same comparison
-- criterion as other?
-- (From DS_SEARCHABLE.)
require
other_not_void: other /= Void```
```equality_tester_settable (a_tester: like equality_tester): BOOLEAN
-- Can set_equality_tester be called with a_tester
-- as argument in current state of container?
-- (From DS_SEARCHABLE.)```
`feature -- Comparison`
```is_equal (other: like Current): BOOLEAN
-- Is current queue equal to other?
-- (From GENERAL.)
require
other_not_void: other /= Void
ensure
consistent: standard_is_equal (other) implies Result
same_type: Result implies same_type (other)
symmetric: Result implies other.is_equal (Current)
same_count: Result implies count = other.count```
`feature -- Duplication`
```copy (other: like Current)
-- Copy other to current queue.
-- (From GENERAL.)
require
other_not_void: other /= Void
type_identity: same_type (other)
ensure
is_equal: is_equal (other)```
`feature -- Setting`
```set_equality_tester (a_tester: like equality_tester)
-- Set equality_tester to a_tester.
-- A void equality tester means that `='
-- will be used as comparison criterion.
-- (From DS_SEARCHABLE.)
require
equality_tester_settable: equality_tester_settable (a_tester)
ensure
equality_tester_set: equality_tester = a_tester```
`feature -- Element change`
```put (v: G)
-- Add v to back of queue.
-- (From DS_DISPENSER.)
require
extendible: extendible (1)
ensure
one_more: count = old count + 1```
```force (v: G)
-- Add v to back of queue.
-- (From DS_DISPENSER.)
ensure
one_more: count = old count + 1```
```extend (other: DS_LINEAR [G])
-- Add items of other to back of queue.
-- (From DS_DISPENSER.)
require
other_not_void: other /= Void
extendible: extendible (other.count)
ensure
new_count: count = old count + other.count```
```append (other: DS_LINEAR [G])
-- Add items of other to back of queue.
-- (From DS_DISPENSER.)
require
other_not_void: other /= Void
ensure
new_count: count = old count + other.count```
`feature -- Removal`
```remove
-- Remove front item from queue.
-- (From DS_DISPENSER.)
require
not_empty: not is_empty
ensure
one_less: count = old count - 1```
```prune (n: INTEGER)
-- Remove n items from queue.
-- (From DS_DISPENSER.)
require
valid_n: 0 <= n and n <= count
ensure
new_count: count = old count - n```
```keep (n: INTEGER)
-- Keep n items in queue.
-- (From DS_DISPENSER.)
require
valid_n: 0 <= n and n <= count
ensure
new_count: count = n```
```wipe_out
-- Remove all items from queue.
-- (From DS_CONTAINER.)
ensure
wiped_out: is_empty```
`invariant`
```positive_count: count >= 0
empty_definition: is_empty = (count = 0)
-- (From DS_CONTAINER.)```
`end -- class DS_LINKED_QUEUE`

 Copyright © 1999-2001, Eric Bezault mailto:ericb@gobosoft.com http://www.gobosoft.com Last Updated: 31 March 2001
{"ft_lang_label":"__label__en","ft_lang_prob":0.52397966,"math_prob":0.81597215,"size":4713,"snap":"2023-40-2023-50","text_gpt3_token_len":1203,"char_repetition_ratio":0.16946273,"word_repetition_ratio":0.3080357,"special_character_ratio":0.2817738,"punctuation_ratio":0.19783197,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97452074,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-23T01:45:45Z\",\"WARC-Record-ID\":\"<urn:uuid:225b1e8b-25b7-4b00-bcac-14831b968040>\",\"Content-Length\":\"25574\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6277ba67-5eec-488b-bc92-2c0b76b4995d>\",\"WARC-Concurrent-To\":\"<urn:uuid:b8aad7c4-d621-43d5-9736-dfd89a9f5911>\",\"WARC-IP-Address\":\"188.165.53.185\",\"WARC-Target-URI\":\"http://gobosoft.com/eiffel/gobo/structure/flatshort/ds_linked_queue.html\",\"WARC-Payload-Digest\":\"sha1:MUYEF35SOTX4CDK5K236MJPUMAQKCAHQ\",\"WARC-Block-Digest\":\"sha1:QPEXENR4BTUSYGJ6FJG6L5VG6L2PRBYZ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233506429.78_warc_CC-MAIN-20230922234442-20230923024442-00656.warc.gz\"}"}