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 classVisitorList.EqualsHashcodeOverridingFacade
-
Field Summary
Fields Modifier and Type Field Description protected GenericVisitor<java.lang.Boolean,Visitable>equalsVisitorprotected GenericVisitor<java.lang.Integer,java.lang.Void>hashcodeVisitorprotected 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 voidadd(int index, N elem)booleanadd(N elem)booleanaddAll(int index, java.util.Collection<? extends N> col)booleanaddAll(java.util.Collection<? extends N> col)voidclear()booleancontains(java.lang.Object elem)booleancontainsAll(java.util.Collection<?> col)Nget(int index)intindexOf(java.lang.Object elem)booleanisEmpty()java.util.Iterator<N>iterator()intlastIndexOf(java.lang.Object elem)java.util.ListIterator<N>listIterator()java.util.ListIterator<N>listIterator(int index)Nremove(int index)booleanremove(java.lang.Object elem)booleanremoveAll(java.util.Collection<?> col)booleanretainAll(java.util.Collection<?> col)Nset(int index, N elem)intsize()java.util.List<N>subList(int fromIndex, int toIndex)java.lang.Object[]toArray()<T> T[]toArray(T[] arr)java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
-