Package com.github.javaparser.utils
Class VisitorList<N extends Node>
- java.lang.Object
-
- com.github.javaparser.utils.VisitorList<N>
-
- All Implemented Interfaces:
java.lang.Iterable<N>
,java.util.Collection<N>
,java.util.List<N>
public class VisitorList<N extends Node> extends java.lang.Object implements java.util.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
VisitorList.EqualsHashcodeOverridingFacade
-
Field Summary
Fields Modifier and Type Field Description protected GenericVisitor<java.lang.Boolean,Visitable>
equalsVisitor
protected GenericVisitor<java.lang.Integer,java.lang.Void>
hashcodeVisitor
protected java.util.List<VisitorList.EqualsHashcodeOverridingFacade>
innerList
-
Constructor Summary
Constructors Constructor Description VisitorList(GenericVisitor<java.lang.Integer,java.lang.Void> hashcodeVisitor, GenericVisitor<java.lang.Boolean,Visitable> equalsVisitor)
Pass the visitors to use for equals and hashcode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, N elem)
boolean
add(N elem)
boolean
addAll(int index, java.util.Collection<? extends N> col)
boolean
addAll(java.util.Collection<? extends N> col)
void
clear()
boolean
contains(java.lang.Object elem)
boolean
containsAll(java.util.Collection<?> col)
N
get(int index)
int
indexOf(java.lang.Object elem)
boolean
isEmpty()
java.util.Iterator<N>
iterator()
int
lastIndexOf(java.lang.Object elem)
java.util.ListIterator<N>
listIterator()
java.util.ListIterator<N>
listIterator(int index)
N
remove(int index)
boolean
remove(java.lang.Object elem)
boolean
removeAll(java.util.Collection<?> col)
boolean
retainAll(java.util.Collection<?> col)
N
set(int index, N elem)
int
size()
java.util.List<N>
subList(int fromIndex, int toIndex)
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] arr)
java.lang.String
toString()
-
-
-
Field Detail
-
innerList
protected java.util.List<VisitorList.EqualsHashcodeOverridingFacade> innerList
-
hashcodeVisitor
protected final GenericVisitor<java.lang.Integer,java.lang.Void> hashcodeVisitor
-
equalsVisitor
protected final GenericVisitor<java.lang.Boolean,Visitable> equalsVisitor
-
-
Constructor Detail
-
VisitorList
public VisitorList(GenericVisitor<java.lang.Integer,java.lang.Void> hashcodeVisitor, GenericVisitor<java.lang.Boolean,Visitable> equalsVisitor)
Pass the visitors to use for equals and hashcode.
-
-
Method Detail
-
add
public boolean add(N elem)
-
add
public void add(int index, N elem)
-
addAll
public boolean addAll(java.util.Collection<? extends N> col)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends N> col)
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object elem)
-
containsAll
public boolean containsAll(java.util.Collection<?> col)
-
indexOf
public int indexOf(java.lang.Object elem)
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<N> iterator()
-
lastIndexOf
public int lastIndexOf(java.lang.Object elem)
-
listIterator
public java.util.ListIterator<N> listIterator()
-
listIterator
public java.util.ListIterator<N> listIterator(int index)
-
remove
public boolean remove(java.lang.Object elem)
-
removeAll
public boolean removeAll(java.util.Collection<?> col)
-
retainAll
public boolean retainAll(java.util.Collection<?> col)
-
size
public int size()
-
subList
public java.util.List<N> subList(int fromIndex, int toIndex)
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] arr)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-