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.
-
Constructor Summary
ConstructorsConstructorDescriptionVisitorSet(GenericVisitor<Integer,Void> hashcodeVisitor, GenericVisitor<Boolean,Visitable> equalsVisitor)
Pass the visitors to use for equals and hashcode. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll(Collection<? extends N> col)
void
clear()
boolean
boolean
containsAll(Collection<?> col)
boolean
isEmpty()
iterator()
boolean
boolean
removeAll(Collection<?> col)
boolean
retainAll(Collection<?> col)
int
size()
Object[]
toArray()
<T> T[]
toArray(T[] arr)
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
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:
containsAll
in interfaceCollection<N extends Node>
- Specified by:
containsAll
in 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
-