IAtomList
, java.lang.Iterable<IAtom>
, java.util.Collection<IAtom>
, java.util.List<IAtom>
public class AtomListFromArray extends java.util.AbstractList<IAtom> implements IAtomList
Constructor | Description |
---|---|
AtomListFromArray(int nAtoms) |
Wraps a new atom array of the given length.
|
AtomListFromArray(IAtom[] atoms) |
Wraps the given atom array.
|
Modifier and Type | Method | Description |
---|---|---|
IAtom |
get(int i) |
Part of implementation of AtomSet interface.
|
IAtom[] |
getArray() |
|
void |
setAtoms(IAtom[] newAtoms) |
Copies the atoms in the given array to the wrapped, final array of atoms.
|
void |
setAtoms(IAtomList atomSet) |
Copies the atoms in the given atom set to the wrapped array of atoms.
|
int |
size() |
Returns the length of the wrapped array.
|
java.lang.String |
toString() |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
public AtomListFromArray(int nAtoms)
public AtomListFromArray(IAtom[] atoms)
public IAtom get(int i)
get
in interface IAtomList
get
in interface java.util.List<IAtom>
get
in class java.util.AbstractList<IAtom>
i
- the index of the desired atom in the list
if i is greater than count-1, throws an IllegalArgumentException.public IAtom[] getArray()
public void setAtoms(IAtom[] newAtoms)
java.lang.IllegalArgumentException
- if length of array is not equal to count field of this
instance.java.lang.NullPointerException
- if argument is null.public void setAtoms(IAtomList atomSet)
java.lang.IllegalArgumentException
- if length of array is not equal to count field of this
instance.java.lang.NullPointerException
- if argument is nullpublic int size()
public java.lang.String toString()
toString
in class java.util.AbstractCollection<IAtom>