Package provided.owlMaps.general.impl
Class Path<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
provided.owlMaps.general.impl.Path<E>
- Type Parameters:
E
- The type of element in the path
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
,java.util.RandomAccess
,IPath<E>
,IPaths<E>
public class Path<E> extends java.util.ArrayList<E> implements IPath<E>
A concrete implementation of IPath based on an ArrayList.
This implementation may not be suitable for all applications, particularly those
that require concurrent modification and thread safety.
- Author:
- swong
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
For serializationFields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
Constructors Constructor Description Path()
Construct an empty path with the default capacity.Path(int initialCapacity)
Construct an empty path with the given initial capacityPath(E... elements)
Construct a path from a varargs of element values.Path(java.util.Collection<? extends E> c)
Construct a path from the given Collection of elements -
Method Summary
Modifier and Type Method Description <R, P> R
execute(IPathsAlgo<R,E,P> algo, P... params)
The "accept" method of the visitor hosts.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.lang.Iterable
forEach
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor serialization- See Also:
- Constant Field Values
-
-
Constructor Details
-
Path
public Path()Construct an empty path with the default capacity. -
Path
Construct a path from a varargs of element values.- Parameters:
elements
- Vararg of the elements to fill the path
-
Path
public Path(int initialCapacity)Construct an empty path with the given initial capacity- Parameters:
initialCapacity
- the initial capacity of the list
-
Path
Construct a path from the given Collection of elements- Parameters:
c
- A collection of elements to use
-
-
Method Details
-
execute
Description copied from interface:IPaths
The "accept" method of the visitor hosts.- Specified by:
execute
in interfaceIPaths<E>
- Type Parameters:
R
- The return type of the visitor algorithmP
- The parameter type of the visitor algorithm.- Parameters:
algo
- The visitor to acceptparams
- The parameters to pass to the visitor execution- Returns:
- The return value from the visitor execution.
-