EASP API 7.14.0

net.juniper.smgt.ent.im
Interface PersistentIterator


public interface PersistentIterator

An iterator over a sequence of Persistent objects. The iteration will always be in case-insensitive alphabetical order of the Persistent objects' display names. The size of the iterator can be checked. A subsequence of the objects can be specified using one of the setBoundaries methods. Doing so will reset the iterator such that it iterates over only the specified subsequence.


Method Summary
 boolean hasNext()
          Returns true if the iterator has a next element.
 Persistent next()
          Returns the next element in the iteration.
 void setBoundaries(java.lang.String startName, java.lang.String endName)
          Resets the position of the iterator such that the object returned by the next call to next will be the first Persistent object in the iteration sequence with a display name equal to or greater than startName.
 void setBoundaries(java.lang.String startName, java.lang.String endName, int compareStrength)
          Resets the position of the iterator such that the object returned by the next call to next will be the first Persistent object in the iteration sequence with a display name equal to or greater than startName.
 int size()
          Returns the total number of elements in the iteration sequence.
 

Method Detail

hasNext

boolean hasNext()
Returns true if the iterator has a next element.


next

Persistent next()
                throws java.util.NoSuchElementException,
                       CommunicationException
Returns the next element in the iteration.

Throws:
java.util.NoSuchElementException - Thrown if the iterator has already returned the last element.
CommunicationException - Thrown if there is a problem communicating with the directory.

setBoundaries

void setBoundaries(java.lang.String startName,
                   java.lang.String endName)
Resets the position of the iterator such that the object returned by the next call to next will be the first Persistent object in the iteration sequence with a display name equal to or greater than startName. The iterator will subsequently iterate over all Persistent objects in the iteration sequence that have a display name less than endName. The ordering of the objects is handled by a java.text.Collator instance, after calling that Collator's setStrength(java.text.Collator.PRIMARY) method.

Parameters:
startName - The starting display name (inclusive).
endName - The ending display name (exclusive).

setBoundaries

void setBoundaries(java.lang.String startName,
                   java.lang.String endName,
                   int compareStrength)
                   throws CommunicationException
Resets the position of the iterator such that the object returned by the next call to next will be the first Persistent object in the iteration sequence with a display name equal to or greater than startName. The iterator will subsequently iterate over all Persistent objects in the iteration sequence that have a display name less than endName. The ordering of the objects is handled by a java.text.Collator instance, after calling that Collator's setStrength(compareStrength) method.

Parameters:
startName - The starting display name (inclusive).
endName - The ending display name (exclusive).
compareStrength - Must be one of Collator.PRIMARY, Collator.SECONDARY, or Collator.TERTIARY.
Throws:
CommunicationException - Thrown if there is a problem communicating with the directory.

size

int size()
Returns the total number of elements in the iteration sequence. This value is not affected by calling next. If one of the setBoundaries methods has been called previously, this method will return the number of elements in the subsequence specified by that method call.


EASP API 7.14.0