Documentation ¶
Overview ¶
This package serves to define the set of types that the containers will implement. These interfaces are meant to be composed together if necessary to allow for very specific sub-types of containers to be specified.
Index ¶
- Constants
- Variables
- type Addressable
- type Capacity
- type Clear
- type Comparisons
- type ComparisonsOtherConstraint
- type DeleteDirectedGraphOps
- type DeleteGraphOps
- type DeleteKeyedOps
- type DeleteKeyedSequentialOps
- type DeleteOps
- type DeleteSequentialOps
- type FirstElemDelete
- type FirstElemRead
- type FirstElemWrite
- type GraphComparisonsConstraint
- type KeyedComparisons
- type KeyedComparisonsOtherConstraint
- type LastElemDelete
- type LastElemRead
- type LastElemWrite
- type Length
- type RWSyncable
- type ReadGraphOps
- type ReadKeyedOps
- type ReadOps
- type ReadUniqueOps
- type SetOperations
- type StaticCapacity
- type WriteDynKeyedOps
- type WriteGraphOps
- type WriteKeyedOps
- type WriteKeyedSequentialOps
- type WriteOps
- type WriteStaticKeyedOps
- type WriteStaticKeyedSequentialOps
- type WriteUniqueKeyedOps
- type WriteUniqueOps
Constants ¶
const ( // A constant that may be passed to the pop function of the [DeleteOps] // interface to specify popping all values. PopAll int = math.MaxInt )
Variables ¶
var Duplicate = errors.New("The container already contains the supplied value.")
var Empty = errors.New("The container is empty.")
var Full = errors.New("The container is full.")
var KeyError = errors.New("The supplied key was invalid.")
var UpdateViolation = errors.New("Attempting to update the supplied value would violate uniqueness constraints.")
var ValueError = errors.New("The supplied value was invalid.")
Functions ¶
This section is empty.
Types ¶
type Addressable ¶
type Addressable interface{ IsAddressable() bool }
An interface that determines if a container is addressable or not.
type Capacity ¶
type Capacity interface{ Capacity() int }
An interface that allows access to the containers capacity.
type Clear ¶
type Clear interface{ Clear() }
An iterface that allows a container to be cleared, deleting all values.
type Comparisons ¶
type Comparisons[RI any, V any] interface { UnorderedEq(other RI) bool IsSuperset(other RI) bool IsSubset(other RI) bool }
An interface that defines what value-only comparisons can be performed on a container.
type ComparisonsOtherConstraint ¶
type ComparisonsOtherConstraint[V any] interface { RWSyncable Addressable Length ReadOps[V] }
An interface that defines what kinds of values can be passed to the methods in the Comparisons interface.
type DeleteDirectedGraphOps ¶
type DeleteDirectedGraphOps[V any, E any] interface { DeleteLink(from V, to V, e E) error DeleteLinkPntr(from *V, to *V, e *E) error DeleteLinks(from V, to V) error DeleteLinksPntr(from *V, to *V) error }
An interface that enforces implementaiton of delete-only, directed, graph structure, operations.
type DeleteGraphOps ¶
type DeleteGraphOps[V any, E any] interface { DeleteVertex(v V) error DeleteVertexPntr(v *V) error DeleteEdge(e E) error DeleteEdgePntr(e *E) error }
An interface that enforces implementaiton of delete-only, graph structure, operations.
type DeleteKeyedOps ¶
An interface that enforces implementation of delete-only, key/value, operations.
type DeleteKeyedSequentialOps ¶
type DeleteKeyedSequentialOps[K any, V any] interface { DeleteSequential(start int, end int) error }
An interface that enforces implementation of delete-only, key/value, operations.
type DeleteSequentialOps ¶
An interface that enforces implementation of delete-only, value-only, sequential operations.
type FirstElemDelete ¶
An interface that enforces the implementation of delete-only first element access.
type FirstElemRead ¶
An interface that enforces the implementation of read-only first element access.
type FirstElemWrite ¶
An interface that enforces the implementation of write-only first element access.
type GraphComparisonsConstraint ¶
type GraphComparisonsConstraint[V any, E any] interface { RWSyncable Addressable ReadGraphOps[V, E] }
An interface that defines what kinds of values can be passed to the methods in the Comparisons and KeyedComparisons interfaces.
type KeyedComparisons ¶
An interface that defines what key/value comparisons can be performed on a container that has keyed values.
type KeyedComparisonsOtherConstraint ¶
type KeyedComparisonsOtherConstraint[K any, V any] interface { RWSyncable Addressable Length ReadKeyedOps[K, V] }
An interface that defines what kinds of values can be passed to the methods in the KeyedComparisons interface.
type LastElemDelete ¶
An interface that enforces the implementation of delete-only last element access.
type LastElemRead ¶
An interface that enforces the implementation of read-only last element access.
type LastElemWrite ¶
An interface that enforces the implemntation of write-only last element access.
type Length ¶
type Length interface{ Length() int }
An interface that allows access to the containers length.
type RWSyncable ¶
type RWSyncable interface { Lock() RLock() Unlock() RUnlock() IsSynced() bool }
An interface that exposes the RWMutex's interface as well as a convience function that will be used to determine if something is synced or if it simply implements this interface as a pass through.
type ReadGraphOps ¶
type ReadGraphOps[V any, E any] interface { NumLinks() int NumEdges() int NumVertices() int Edges() iter.Iter[E] EdgePntrs() iter.Iter[*E] Vertices() iter.Iter[V] VerticePntrs() iter.Iter[*V] GetEdge(e *E) error GetVertex(v *V) error ContainsEdge(e E) bool ContainsEdgePntr(e *E) bool ContainsVertex(v V) bool ContainsVertexPntr(v *V) bool OutEdges(v V) iter.Iter[E] OutEdgePntrs(v *V) iter.Iter[*E] NumOutLinks(v V) int NumOutLinksPntr(v *V) int OutVertices(v V) iter.Iter[V] OutVerticePntrs(v *V) iter.Iter[*V] OutEdgesAndVertices(v V) iter.Iter[basic.Pair[E, V]] OutEdgesAndVerticePntrs(v *V) iter.Iter[basic.Pair[*E, *V]] EdgesBetween(from V, to V) iter.Iter[E] EdgesBetweenPntr(from *V, to *V) iter.Iter[*E] ContainsLink(from V, to V, e E) bool ContainsLinkPntr(from *V, to *V, e *E) bool }
An interface that enforces implementation of read-only, graph structure, opertions.
type ReadKeyedOps ¶
type ReadKeyedOps[K any, V any] interface { Get(k K) (V, error) GetPntr(k K) (*V, error) KeyOf(v V) (K, bool) KeyOfPntr(v *V) (K, bool) Keys() iter.Iter[K] }
An interface that enforces implementation of read-only, key/value, operations.
type ReadOps ¶
type ReadOps[V any] interface { Vals() iter.Iter[V] ValPntrs() iter.Iter[*V] Contains(v V) bool ContainsPntr(v *V) bool }
An interface that enforces implementation of read-only, value-only, operations.
type ReadUniqueOps ¶
An interface that enforces implementation of read-only, value-only, operations.
type SetOperations ¶
type SetOperations[RI any, V any] interface { Intersection(l RI, r RI) Union(l RI, r RI) Difference(l RI, r RI) }
An interface that defines what set-wise operations can be performed on a container.
type StaticCapacity ¶
An interface that defines what it means to have static capacity. Note that there is no DynamicCapacity interface, meaning that all containers are considered to be dynamic by default and are only static if explicity stated so by the implementation of this interface.
type WriteDynKeyedOps ¶
type WriteDynKeyedOps[K any, V any] interface { Insert(kvPairs ...basic.Pair[K, V]) error InsertSequential(idx K, v ...V) error }
An interface that enforces implementation of write-only, key/value, dynamic key, operations. A dynamic key operation is an operation that allows changing the value of a key but also allows changing of multiple keys as a result of that operation.
type WriteGraphOps ¶
type WriteGraphOps[V any, E any] interface { AddEdges(e ...E) error AddVertices(v ...V) error UpdateEdge(orig E, updateOp func(orig *E)) error UpdateVertex(orig V, updateOp func(orig *E)) error Link(from V, to V, e E) error LinkPntr(from *V, to *V, e *E) error }
An interface that enforces implementation of write-only, graph structure, operations.
type WriteKeyedOps ¶
An interface that enforces implementation of write-only, key/value, operations.
type WriteKeyedSequentialOps ¶
An interface that enforces implementation of write-only, key/value, sequential operations.
type WriteStaticKeyedOps ¶
An interface that enforces implementation of write-only, key/value, static key, sequential, operations. A static key operation is an operation that allows changing the value of a key but does not allow changing of multiple keys as a result of that operation.
type WriteStaticKeyedSequentialOps ¶
type WriteStaticKeyedSequentialOps[K any, V any] interface { EmplaceSequential(idk K, v ...V) error }
An interface that enforces implementation of write-only, key/value, static key, operations. A static key operation is an operation that allows changing the value of a key but does not allow changing of multiple keys as a result of that operation.
type WriteUniqueKeyedOps ¶
An interface that enforces implementation of write-only, key/value, unique valued, operations.