Top Fields Constructors Methods
com.mchange.v1.util

public Class Sublist

extends AbstractList
Class Inheritance
Imports
java.util.*

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv List<E>
pack-priv int
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
public
public
Sublist(List<E> parent, int
index of the element of the parent list just before which the Sublist begins
start_index
,
int
index of the first element of parent excluded from the Sublist
end_index
)

Method Summary

Modifier and TypeMethod and Description
public void
add(int
index at which the specified element is to be inserted
index
,
Object
element to be inserted
element
)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).

public Object
get(int
index of the element to return
i
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.

public Object
remove(int
the index of the element to be removed
index
)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Removes the element at the specified position in this list (optional operation).

public Object
set(int
index of the element to replace
index
,
Object
element to be stored at the specified position
element
)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

public void
setParent(List<E> parent, int
index of the element of the parent list just before which the Sublist begins
start_index
,
int
index of the first element of parent excluded from the Sublist
end_index
)

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:
addaddAllclearequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveRangesubList

Field Detail

end_indexback to summary
pack-priv int end_index
parentback to summary
pack-priv List<E> parent
start_indexback to summary
pack-priv int start_index

Constructor Detail

Sublistback to summary
public Sublist()
Sublistback to summary
public Sublist(List<E> parent, int start_index, int end_index)
Parameters
start_index:int

index of the element of the parent list just before which the Sublist begins

end_index:int

index of the first element of parent excluded from the Sublist

Method Detail

addback to summary
public void add(int index, Object element)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Doc from java.util.AbstractList.add.

Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters
index:int

Doc from java.util.List.add.

index at which the specified element is to be inserted

element:Object

Doc from java.util.List.add.

element to be inserted

getback to summary
public Object get(int i)

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
i: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

removeback to summary
public Object remove(int index)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Doc from java.util.AbstractList.remove.

Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Parameters
index:int

Doc from java.util.List.remove.

the index of the element to be removed

Returns:Object

Doc from java.util.List.remove.

the element previously at the specified position

setback to summary
public Object set(int index, Object element)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Doc from java.util.AbstractList.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

Parameters
index:int

Doc from java.util.List.set.

index of the element to replace

element:Object

Doc from java.util.List.set.

element to be stored at the specified position

Returns:Object

Doc from java.util.List.set.

the element previously at the specified position

setParentback to summary
public void setParent(List<E> parent, int start_index, int end_index)
Parameters
start_index:int

index of the element of the parent list just before which the Sublist begins

end_index:int

index of the first element of parent excluded from the Sublist

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