Show / Hide Table of Contents

Class SimpleEnumerator

Provide a generic implementation of an array enumerator.

Inheritance
object
SimpleEnumerator
Implements
IEnumerator
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Tangosol.Util
Assembly: Coherence.dll
Syntax
public class SimpleEnumerator : IEnumerator

Constructors

SimpleEnumerator(ICollection)

Construct a simple enumerator based on a collection.

Declaration
public SimpleEnumerator(ICollection col)
Parameters
Type Name Description
ICollection col

The ICollection to enumerate.

SimpleEnumerator(object[])

Construct the simple enumerator based on an array of objects.

Declaration
public SimpleEnumerator(object[] items)
Parameters
Type Name Description
object[] items

Array of objects to enumerate.

SimpleEnumerator(object[], int, int)

Construct the simple enumerator based on an array of objects.

Declaration
public SimpleEnumerator(object[] items, int start, int countItems)
Parameters
Type Name Description
object[] items

Array of objects to enumerate.

int start

The first object position.

int countItems

The number of objects to enumerate.

SimpleEnumerator(object[], int, int, bool, bool)

Construct the simple enumerator based on an array of objects, making a copy of the array if specified.

Declaration
public SimpleEnumerator(object[] items, int start, int countItems, bool forward, bool copy)
Parameters
Type Name Description
object[] items

Array of objects to enumerate.

int start

The first object position.

int countItems

The number of objects to enumerate.

bool forward

true to iterate forwards, false to iterate from the end backwards to the beginning.

bool copy

Pass true to make a copy of the array or false if the array's contents will not change.

Fields

m_forward

Iterator direction.

Declaration
protected bool m_forward
Field Value
Type Description
bool

m_index

Iterator position: next item to return.

Declaration
protected int m_index
Field Value
Type Description
int

m_items

Array of items to enumerate.

Declaration
protected object[] m_items
Field Value
Type Description
object[]

m_limit

Iterator end position (beyond last).

Declaration
protected int m_limit
Field Value
Type Description
int

m_startindex

Iterator start position.

Declaration
protected int m_startindex
Field Value
Type Description
int

Properties

Current

Gets the current element in the collection.

Declaration
public virtual object Current { get; }
Property Value
Type Description
object

The current element in the collection.

Methods

MoveNext()

Advances the enumerator to the next element of the collection.

Declaration
public virtual bool MoveNext()
Returns
Type Description
bool

true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection.

Reset()

Sets the enumerator to its initial position, which is before the first element in the collection.

Declaration
public virtual void Reset()

Implements

IEnumerator
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.