Package com.github.javaparser.utils
Class VisitorList<N extends Node>
java.lang.Object
com.github.javaparser.utils.VisitorList<N>
- All Implemented Interfaces:
Iterable<N>
,Collection<N>
,List<N>
A list that overrides the equals and hashcode calculation of the added nodes
by using another equals and hashcode visitor for those methods.
-
Field Summary
Modifier and TypeFieldDescriptionprotected GenericVisitor<Boolean,Visitable>
protected GenericVisitor<Integer,Void>
protected List<com.github.javaparser.utils.VisitorList.EqualsHashcodeOverridingFacade>
-
Constructor Summary
ConstructorDescriptionVisitorList(GenericVisitor<Integer,Void> hashcodeVisitor, GenericVisitor<Boolean,Visitable> equalsVisitor)
Pass the visitors to use for equals and hashcode. -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll(int index, Collection<? extends N> col)
boolean
addAll(Collection<? extends N> col)
void
clear()
boolean
boolean
containsAll(Collection<?> col)
get(int index)
int
boolean
isEmpty()
iterator()
int
lastIndexOf(Object elem)
listIterator(int index)
remove(int index)
boolean
boolean
removeAll(Collection<?> col)
boolean
retainAll(Collection<?> col)
int
size()
subList(int fromIndex, int toIndex)
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.List
equals, hashCode, replaceAll, sort, spliterator
-
Field Details
-
innerList
-
hashcodeVisitor
-
equalsVisitor
-
-
Constructor Details
-
VisitorList
public VisitorList(GenericVisitor<Integer,Void> hashcodeVisitor, GenericVisitor<Boolean,Visitable> equalsVisitor)Pass the visitors to use for equals and hashcode.
-
-
Method Details
-
add
-
add
-
addAll
-
addAll
-
clear
public void clear() -
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection<N extends Node>
- Specified by:
containsAll
in interfaceList<N extends Node>
-
get
-
indexOf
-
isEmpty
public boolean isEmpty() -
iterator
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<N extends Node>
-
listIterator
- Specified by:
listIterator
in interfaceList<N extends Node>
-
listIterator
- Specified by:
listIterator
in interfaceList<N extends Node>
-
remove
-
remove
-
removeAll
-
retainAll
-
set
-
size
public int size() -
subList
-
toArray
-
toArray
public <T> T[] toArray(T[] arr) -
toString
-