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 INDArraycontainerprotected intsize-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int i, X aX)booleanadd(X aX)booleanaddAll(int i, Collection<? extends X> collection)booleanaddAll(Collection<? extends X> collection)INDArrayarray()Get a view of the underlying array relative to the size of the actual array.voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> collection)Xget(int i)intindexOf(Object o)booleanisEmpty()Iterator<X>iterator()intlastIndexOf(Object o)ListIterator<X>listIterator()ListIterator<X>listIterator(int i)Xremove(int i)booleanremove(Object o)booleanremoveAll(Collection<?> collection)booleanretainAll(Collection<?> collection)Xset(int i, X aX)intsize()Object[]toArray()<T> T[]toArray(T[] ts)StringtoString()-
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:
containsAllin interfaceCollection<X extends Number>- Specified by:
containsAllin interfaceList<X extends Number>- Overrides:
containsAllin 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:
lastIndexOfin interfaceList<X extends Number>- Overrides:
lastIndexOfin classAbstractList<X extends Number>
-
listIterator
public ListIterator<X> listIterator()
- Specified by:
listIteratorin interfaceList<X extends Number>- Overrides:
listIteratorin classAbstractList<X extends Number>
-
listIterator
public ListIterator<X> listIterator(int i)
- Specified by:
listIteratorin interfaceList<X extends Number>- Overrides:
listIteratorin classAbstractList<X extends Number>
-
toString
public String toString()
- Overrides:
toStringin classAbstractCollection<X extends Number>
-
-