Namespace: go.std.container.ring
v1.0Contents
Summary
Provides a low-level interface to the container/ring package.
Package ring implements operations on circular lists.
Index
Legend
-
Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
(None.)
Variables
-
(None.)
Functions, Macros, and Special Forms
-
New
Function v1.0(New n)
New creates a ring of n elements.
Go input arguments: (n int)
Go returns: *Ring
Joker input arguments: [^Int n]
Joker returns: ^*Ring
Types
-
*Ring
Concrete Type v1.0A Ring is an element of a circular list, or ring.
Rings do not have a beginning or end; a pointer to any ring element
serves as reference to the entire ring. Empty rings are represented
as nil Ring pointers. The zero value for a Ring is a one-element
ring with a nil Value.
-
Len
Receiver for *Ring v1.0([])
Len computes the number of elements in ring r.
It executes in time proportional to the number of elements.
-
Link
Receiver for *Ring v1.0([s])
Link connects ring r with ring s such that r.Next()
becomes s and returns the original value for r.Next().
r must not be empty.
If r and s point to the same ring, linking
them removes the elements between r and s from the ring.
The removed elements form a subring and the result is a
reference to that subring (if no elements were removed,
the result is still the original value for r.Next(),
and not nil).
If r and s point to different rings, linking
them creates a single ring with the elements of s inserted
after r. The result points to the element following the
last element of s after insertion.
-
Move
Receiver for *Ring v1.0([n])
Move moves n % r.Len() elements backward (n < 0) or forward (n >= 0)
in the ring and returns that ring element. r must not be empty.
-
Next
Receiver for *Ring v1.0([])
Next returns the next ring element. r must not be empty.
-
Prev
Receiver for *Ring v1.0([])
Prev returns the previous ring element. r must not be empty.
-
Unlink
Receiver for *Ring v1.0([n])
Unlink removes n % r.Len() elements from the ring r, starting
at r.Next(). If n % r.Len() == 0, r remains unchanged.
The result is the removed subring. r must not be empty.
-
Ring
Concrete Type v1.0A Ring is an element of a circular list, or ring.
Rings do not have a beginning or end; a pointer to any ring element
serves as reference to the entire ring. Empty rings are represented
as nil Ring pointers. The zero value for a Ring is a one-element
ring with a nil Value.
-
arrayOfRing
Concrete Type v1.0A Ring is an element of a circular list, or ring.
Rings do not have a beginning or end; a pointer to any ring element
serves as reference to the entire ring. Empty rings are represented
as nil Ring pointers. The zero value for a Ring is a one-element
ring with a nil Value.