Top Description Fields Constructors Methods
org.assertj.core.presentation

pack-priv final Class PrimitiveArrayList

extends AbstractList<Object>
Class Inheritance
Static Imports
java.lang.reflect.Array.getLength, org.assertj.core.util.Arrays.isArrayTypePrimitive, .Arrays.isObjectArray, .Preconditions.checkArgument

Provides a read-only view of an array as a list.

This is different from java.util.ArrayList because the array may be an array of primitives. Arrays of non-primitives also work, but java.util.ArrayList would probably be a better choice for these arrays.

Field Summary

Modifier and TypeField and Description
private final Object
array

The array to provide a view of.

Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
pack-priv
PrimitiveArrayList(final Object
primitive or object array
array
)

Creates a new PrimitiveArrayList.

Method Summary

Modifier and TypeMethod and Description
public Object
get(final int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
Inherited from java.util.AbstractList:
addaddaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveremoveRangesetsubList

Field Detail

arrayback to summary
private final Object array

The array to provide a view of.

Constructor Detail

PrimitiveArrayListback to summary
pack-priv PrimitiveArrayList(final Object array)

Creates a new PrimitiveArrayList.

Parameters
array:Object

primitive or object array

Method Detail

getback to summary
public Object get(final int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

Parameters
index:int

Doc from java.util.List.get.

index of the element to return

Returns:Object

Doc from java.util.List.get.

the element at the specified position in this list

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

Annotations
@Override