org.eclipse.xtext.xbase.lib
Class Conversions.WrappedPrimitiveArray
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<java.lang.Object>
org.eclipse.xtext.xbase.lib.Conversions.WrappedPrimitiveArray
- All Implemented Interfaces:
- java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>, java.util.List<java.lang.Object>, java.util.RandomAccess
- Enclosing class:
- Conversions
public static class Conversions.WrappedPrimitiveArray
- extends java.util.AbstractList<java.lang.Object>
- implements java.util.RandomAccess
A list that is completely backed by an array of primitives and that provides access to that array. Only for
internal use.
Fields inherited from class java.util.AbstractList |
modCount |
Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Conversions.WrappedPrimitiveArray
protected Conversions.WrappedPrimitiveArray(java.lang.Object array)
- Internal constructor for
Conversions.WrappedPrimitiveArray
.
- Parameters:
array
- the to-be-wrapped array. May be null
which will cause any method on the created
object to fail with a NullPointerException
.
create
public static Conversions.WrappedPrimitiveArray create(java.lang.Object array)
- Creates a new
Conversions.WrappedPrimitiveArray
that is backed by the given primitive array
.
- Parameters:
array
- the to-be-wrapped array. May be null
which will cause any method on the resulting
object to fail.
- Returns:
- the wrapped array. Never
null
.
get
public java.lang.Object get(int index)
-
- Specified by:
get
in interface java.util.List<java.lang.Object>
- Specified by:
get
in class java.util.AbstractList<java.lang.Object>
- Throws:
java.lang.NullPointerException
- if the wrapped array was null
.
java.lang.IndexOutOfBoundsException
set
public java.lang.Object set(int index,
java.lang.Object element)
-
- Specified by:
set
in interface java.util.List<java.lang.Object>
- Overrides:
set
in class java.util.AbstractList<java.lang.Object>
- Throws:
java.lang.NullPointerException
- if the wrapped array was null
.
java.lang.ClassCastException
java.lang.NullPointerException
java.lang.IllegalArgumentException
java.lang.IndexOutOfBoundsException
size
public int size()
-
- Specified by:
size
in interface java.util.Collection<java.lang.Object>
- Specified by:
size
in interface java.util.List<java.lang.Object>
- Specified by:
size
in class java.util.AbstractCollection<java.lang.Object>
- Throws:
java.lang.NullPointerException
- if the wrapped array was null
.
internalToArray
public java.lang.Object internalToArray()
- Returns the underlying array in an unsafe manner. That is, modification of the array will be reflected by
this list and vice versa.
- Returns:
- the underlying array. May be
null
if the list was created
with a
null argument.