Top Description Fields Constructors Methods
org.apache.html.dom

pack-priv Class CollectionIndex

Located in compilation unit of org.apache.html.dom.HTMLCollectionImpl.

extends Object
Class Inheritance

CollectionImpl#item must traverse down the tree and decrement the index until it matches an element who's index is zero. Since integers are passed by value, this class servers to pass the index into each recursion by reference. It encompasses all the operations that need be performed on the index, although direct access is possible.
See Also
CollectionImpl#item

Field Summary

Modifier and TypeField and Description
private int
_index

Holds the actual value that is passed by reference using this class.

Constructor Summary

AccessConstructor and Description
pack-priv
CollectionIndex(int
The initial value
index
)

Constructs a new index with the specified initial value.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
decrement()

Decrements the index by one.

pack-priv int

Returns:

Current index
getIndex
()

Returns the current index.

pack-priv boolean

Returns:

True if index is zero
isZero
()

Returns true if index is zero (or negative).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_indexback to summary
private int _index

Holds the actual value that is passed by reference using this class.

Constructor Detail

CollectionIndexback to summary
pack-priv CollectionIndex(int index)

Constructs a new index with the specified initial value. The index will then be decremeneted until it reaches zero.

Parameters
index:int

The initial value

Method Detail

decrementback to summary
pack-priv void decrement()

Decrements the index by one.

getIndexback to summary
pack-priv int getIndex()

Returns the current index.

Returns:int

Current index

isZeroback to summary
pack-priv boolean isZero()

Returns true if index is zero (or negative).

Returns:boolean

True if index is zero