Package org.nd4j.list
Class BaseNDArrayList<X extends Number>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<X>
-
- org.nd4j.list.BaseNDArrayList<X>
-
- All Implemented Interfaces:
Iterable<X>
,Collection<X>
,List<X>
- Direct Known Subclasses:
NDArrayList
public abstract class BaseNDArrayList<X extends Number> extends AbstractList<X>
-
-
Field Summary
Fields Modifier and Type Field Description protected INDArray
container
protected int
size
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int i, X aX)
boolean
add(X aX)
boolean
addAll(int i, Collection<? extends X> collection)
boolean
addAll(Collection<? extends X> collection)
INDArray
array()
Get a view of the underlying array relative to the size of the actual array.void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> collection)
X
get(int i)
int
indexOf(Object o)
boolean
isEmpty()
Iterator<X>
iterator()
int
lastIndexOf(Object o)
ListIterator<X>
listIterator()
ListIterator<X>
listIterator(int i)
X
remove(int i)
boolean
remove(Object o)
boolean
removeAll(Collection<?> collection)
boolean
retainAll(Collection<?> collection)
X
set(int i, X aX)
int
size()
Object[]
toArray()
<T> T[]
toArray(T[] ts)
String
toString()
-
Methods inherited from class java.util.AbstractList
equals, hashCode, removeRange, subList
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Field Detail
-
container
protected INDArray container
-
size
protected int size
-
-
Method Detail
-
array
public INDArray array()
Get a view of the underlying array relative to the size of the actual array. (Sometimes there are overflows in the internals but you want to use the internal INDArray for computing something directly, this gives you the relevant subset that reflects the content of the list)- Returns:
- the view of the underlying ndarray relative to the collection's real size
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] ts)
-
add
public boolean add(X aX)
-
remove
public boolean remove(Object o)
-
containsAll
public boolean containsAll(Collection<?> collection)
- Specified by:
containsAll
in interfaceCollection<X extends Number>
- Specified by:
containsAll
in interfaceList<X extends Number>
- Overrides:
containsAll
in classAbstractCollection<X extends Number>
-
addAll
public boolean addAll(Collection<? extends X> collection)
-
addAll
public boolean addAll(int i, Collection<? extends X> collection)
-
removeAll
public boolean removeAll(Collection<?> collection)
-
retainAll
public boolean retainAll(Collection<?> collection)
-
clear
public void clear()
-
get
public X get(int i)
-
add
public void add(int i, X aX)
-
remove
public X remove(int i)
-
indexOf
public int indexOf(Object o)
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<X extends Number>
- Overrides:
lastIndexOf
in classAbstractList<X extends Number>
-
listIterator
public ListIterator<X> listIterator()
- Specified by:
listIterator
in interfaceList<X extends Number>
- Overrides:
listIterator
in classAbstractList<X extends Number>
-
listIterator
public ListIterator<X> listIterator(int i)
- Specified by:
listIterator
in interfaceList<X extends Number>
- Overrides:
listIterator
in classAbstractList<X extends Number>
-
toString
public String toString()
- Overrides:
toString
in classAbstractCollection<X extends Number>
-
-