Package com.github.javaparser.utils
Class VisitorSet<N extends Node>
java.lang.Object
com.github.javaparser.utils.VisitorSet<N>
- All Implemented Interfaces:
Iterable<N>,Collection<N>,Set<N>
A set that overrides the equals and hashcode calculation of the added nodes
by using another equals and hashcode visitor for those methods.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final GenericVisitor<Boolean, Visitable> private final GenericVisitor<Integer, Void> private final Set<VisitorSet<N>.EqualsHashcodeOverridingFacade> -
Constructor Summary
ConstructorsConstructorDescriptionVisitorSet(GenericVisitor<Integer, Void> hashcodeVisitor, GenericVisitor<Boolean, Visitable> equalsVisitor) Pass the visitors to use for equals and hashcode. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends N> col) voidclear()booleanbooleancontainsAll(Collection<?> col) booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> col) booleanretainAll(Collection<?> col) intsize()Object[]toArray()<T> T[]toArray(T[] arr) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Field Details
-
innerSet
-
hashcodeVisitor
-
equalsVisitor
-
-
Constructor Details
-
VisitorSet
public VisitorSet(GenericVisitor<Integer, Void> hashcodeVisitor, GenericVisitor<Boolean, Visitable> equalsVisitor) Pass the visitors to use for equals and hashcode.
-
-
Method Details
-
add
-
addAll
-
clear
public void clear() -
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<N extends Node>- Specified by:
containsAllin interfaceSet<N extends Node>
-
isEmpty
public boolean isEmpty() -
iterator
-
remove
-
removeAll
-
retainAll
-
size
public int size() -
toArray
-
toArray
public <T> T[] toArray(T[] arr) -
toString
-