Class BulkSet<S>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<S>
org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet<S>
- All Implemented Interfaces:
Serializable,Iterable<S>,Collection<S>,Set<S>
BulkSet is a weighted set (i.e. a multi-set). Objects are added along with a bulk counter the denotes how many times the object was added to the set.
Given that count-based compression (vs. enumeration) can yield large sets, methods exist that are long-based (2^64).
- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanaddAll(Collection<? extends S> collection) booleanasBulk()voidclear()booleanbooleanvoidforEach(BiConsumer<S, Long> consumer) longClass<?>inthashCode()booleanisEmpty()iterator()longlongSize()booleanbooleanremoveAll(Collection<?> collection) intsize()toString()intMethods inherited from class java.util.AbstractCollection
containsAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
containsAll, retainAll, toArray, toArray
-
Constructor Details
-
BulkSet
public BulkSet()
-
-
Method Details
-
getAllContainedElementsClass
- Returns:
- the class of all contained elements/objects if it is guaranteed that all are of the same type/class (but not necessarily, i.e., they can have the same type/class, but we may return null here if it was not analysed/identified). If no common class was identified, then null is returned.
-
allContainedElementsSameClass
public boolean allContainedElementsSameClass()- Returns:
- true if it is guaranteed that all contained elements/objects are of the same type/class and not null (but not necessarily, i.e., they can have the same type/class, but we may return false here if it was not analysed/identified)
-
size
public int size()- Specified by:
sizein interfaceCollection<S>- Specified by:
sizein interfaceSet<S>- Specified by:
sizein classAbstractCollection<S>
-
uniqueSize
public int uniqueSize() -
longSize
public long longSize() -
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<S>- Specified by:
isEmptyin interfaceSet<S>- Overrides:
isEmptyin classAbstractCollection<S>
-
contains
- Specified by:
containsin interfaceCollection<S>- Specified by:
containsin interfaceSet<S>- Overrides:
containsin classAbstractCollection<S>
-
add
- Specified by:
addin interfaceCollection<S>- Specified by:
addin interfaceSet<S>- Overrides:
addin classAbstractCollection<S>
-
addAll
- Specified by:
addAllin interfaceCollection<S>- Specified by:
addAllin interfaceSet<S>- Overrides:
addAllin classAbstractCollection<S>
-
forEach
-
asBulk
-
add
-
get
-
remove
- Specified by:
removein interfaceCollection<S>- Specified by:
removein interfaceSet<S>- Overrides:
removein classAbstractCollection<S>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<S>- Specified by:
clearin interfaceSet<S>- Overrides:
clearin classAbstractCollection<S>
-
spliterator
- Specified by:
spliteratorin interfaceCollection<S>- Specified by:
spliteratorin interfaceIterable<S>- Specified by:
spliteratorin interfaceSet<S>
-
removeAll
- Specified by:
removeAllin interfaceCollection<S>- Specified by:
removeAllin interfaceSet<S>- Overrides:
removeAllin classAbstractSet<S>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<S>- Specified by:
hashCodein interfaceSet<S>- Overrides:
hashCodein classAbstractSet<S>
-
equals
- Specified by:
equalsin interfaceCollection<S>- Specified by:
equalsin interfaceSet<S>- Overrides:
equalsin classAbstractSet<S>
-
toString
- Overrides:
toStringin classAbstractCollection<S>
-
iterator
-