package containers

Import Path
	github.com/emirpasic/gods/containers (on go.dev)

Dependency Relation
	imports one package, and imported by 4 packages

Involved Source Files Package containers provides core interfaces and functions for data structures. Container is the base interface for all data structures to implement. Iterators provide stateful iterators. Enumerable provides Ruby inspired (each, select, map, find, any?, etc.) container functions. Serialization provides serializers (marshalers) and deserializers (unmarshalers). enumerable.go iterator.go serialization.go
Package-Level Type Names (total 9, all are exported)
/* sort exporteds by: | */
Container is base interface that all data structures implement. ( T) Clear() ( T) Empty() bool ( T) Size() int ( T) Values() []interface{} github.com/emirpasic/gods/lists.List (interface) *github.com/emirpasic/gods/lists/arraylist.List github.com/emirpasic/gods/trees.Tree (interface) *github.com/emirpasic/gods/trees/binaryheap.Heap T : github.com/emirpasic/gods/trees.Tree func GetSortedValues(container Container, comparator utils.Comparator) []interface{}
EnumerableWithIndex provides functions for ordered containers whose values can be fetched by an index. All passes each element of the container to the given function and returns true if the function returns true for all elements. Any passes each element of the container to the given function and returns true if the function ever returns true for any element. Each calls the given function once for each element, passing that element's index and value. Find passes each element of the container to the given function and returns the first (index,value) for which the function is true or -1,nil otherwise if no element matches the criteria. *github.com/emirpasic/gods/lists/arraylist.List
EnumerableWithKey provides functions for ordered containers whose values whose elements are key/value pairs. All passes each element of the container to the given function and returns true if the function returns true for all elements. Any passes each element of the container to the given function and returns true if the function ever returns true for any element. Each calls the given function once for each element, passing that element's key and value. Find passes each element of the container to the given function and returns the first (key,value) for which the function is true or nil,nil otherwise if no element matches the criteria.
IteratorWithIndex is stateful iterator for ordered containers whose values can be fetched by an index. Begin resets the iterator to its initial state (one-before-first) Call Next() to fetch the first element if any. First moves the iterator to the first element and returns true if there was a first element in the container. If First() returns true, then first element's index and value can be retrieved by Index() and Value(). Modifies the state of the iterator. Index returns the current element's index. Does not modify the state of the iterator. Next moves the iterator to the next element and returns true if there was a next element in the container. If Next() returns true, then next element's index and value can be retrieved by Index() and Value(). If Next() was called for the first time, then it will point the iterator to the first element if it exists. Modifies the state of the iterator. Value returns the current element's value. Does not modify the state of the iterator. ReverseIteratorWithIndex (interface) *github.com/emirpasic/gods/lists/arraylist.Iterator *github.com/emirpasic/gods/trees/binaryheap.Iterator
IteratorWithKey is a stateful iterator for ordered containers whose elements are key value pairs. Begin resets the iterator to its initial state (one-before-first) Call Next() to fetch the first element if any. First moves the iterator to the first element and returns true if there was a first element in the container. If First() returns true, then first element's key and value can be retrieved by Key() and Value(). Modifies the state of the iterator. Key returns the current element's key. Does not modify the state of the iterator. Next moves the iterator to the next element and returns true if there was a next element in the container. If Next() returns true, then next element's key and value can be retrieved by Key() and Value(). If Next() was called for the first time, then it will point the iterator to the first element if it exists. Modifies the state of the iterator. Value returns the current element's value. Does not modify the state of the iterator. ReverseIteratorWithKey (interface)
JSONDeserializer provides JSON deserialization FromJSON populates containers's elements from the input JSON representation. *github.com/emirpasic/gods/lists/arraylist.List *github.com/emirpasic/gods/trees/binaryheap.Heap
JSONSerializer provides JSON serialization ToJSON outputs the JSON representation of containers's elements. *github.com/emirpasic/gods/lists/arraylist.List *github.com/emirpasic/gods/trees/binaryheap.Heap
ReverseIteratorWithIndex is stateful iterator for ordered containers whose values can be fetched by an index. Essentially it is the same as IteratorWithIndex, but provides additional: Prev() function to enable traversal in reverse Last() function to move the iterator to the last element. End() function to move the iterator past the last element (one-past-the-end). Begin resets the iterator to its initial state (one-before-first) Call Next() to fetch the first element if any. End moves the iterator past the last element (one-past-the-end). Call Prev() to fetch the last element if any. First moves the iterator to the first element and returns true if there was a first element in the container. If First() returns true, then first element's index and value can be retrieved by Index() and Value(). Modifies the state of the iterator. Index returns the current element's index. Does not modify the state of the iterator. Last moves the iterator to the last element and returns true if there was a last element in the container. If Last() returns true, then last element's index and value can be retrieved by Index() and Value(). Modifies the state of the iterator. Next moves the iterator to the next element and returns true if there was a next element in the container. If Next() returns true, then next element's index and value can be retrieved by Index() and Value(). If Next() was called for the first time, then it will point the iterator to the first element if it exists. Modifies the state of the iterator. Prev moves the iterator to the previous element and returns true if there was a previous element in the container. If Prev() returns true, then previous element's index and value can be retrieved by Index() and Value(). Modifies the state of the iterator. Value returns the current element's value. Does not modify the state of the iterator. *github.com/emirpasic/gods/lists/arraylist.Iterator *github.com/emirpasic/gods/trees/binaryheap.Iterator T : IteratorWithIndex
ReverseIteratorWithKey is a stateful iterator for ordered containers whose elements are key value pairs. Essentially it is the same as IteratorWithKey, but provides additional: Prev() function to enable traversal in reverse Last() function to move the iterator to the last element. Begin resets the iterator to its initial state (one-before-first) Call Next() to fetch the first element if any. End moves the iterator past the last element (one-past-the-end). Call Prev() to fetch the last element if any. First moves the iterator to the first element and returns true if there was a first element in the container. If First() returns true, then first element's key and value can be retrieved by Key() and Value(). Modifies the state of the iterator. Key returns the current element's key. Does not modify the state of the iterator. Last moves the iterator to the last element and returns true if there was a last element in the container. If Last() returns true, then last element's key and value can be retrieved by Key() and Value(). Modifies the state of the iterator. Next moves the iterator to the next element and returns true if there was a next element in the container. If Next() returns true, then next element's key and value can be retrieved by Key() and Value(). If Next() was called for the first time, then it will point the iterator to the first element if it exists. Modifies the state of the iterator. Prev moves the iterator to the previous element and returns true if there was a previous element in the container. If Prev() returns true, then previous element's key and value can be retrieved by Key() and Value(). Modifies the state of the iterator. Value returns the current element's value. Does not modify the state of the iterator. T : IteratorWithKey
Package-Level Functions (only one, which is exported)
GetSortedValues returns sorted container's elements with respect to the passed comparator. Does not effect the ordering of elements within the container.