com.novell.application.console.snapin
Class DefaultIndexedObjectEntryEnumeration

java.lang.Object
  |
  +--com.novell.application.console.snapin.BaseDefaultVirtualEnumeration
        |
        +--com.novell.application.console.snapin.DefaultIndexedObjectEntryEnumeration
All Implemented Interfaces:
BrowserObjectEntryEnumeration, CountableObjectEntryEnumeration, java.util.Enumeration, IndexedObjectEntryEnumeration, ObjectEntryEnumeration

public class DefaultIndexedObjectEntryEnumeration
extends BaseDefaultVirtualEnumeration
implements IndexedObjectEntryEnumeration, CountableObjectEntryEnumeration

Converts an ObjectEntryEnumeration object into an enumeration that supports positioning to an entry, getting next and previous entries, and support for type down.

See Also:
ObjectEntryEnumeration

Fields inherited from class com.novell.application.console.snapin.BaseDefaultVirtualEnumeration
m_enumerationData, m_iEnumerationIndex, m_shell
 
Constructor Summary
DefaultIndexedObjectEntryEnumeration(ObjectEntryEnumeration oee, Shell shell)
          Constructs the DefaultIndexedObjectEntryEnumeration object.
 
Method Summary
 void append(ObjectEntry oe)
          Appends an ObjectEntry object to this enumeration.
 int getCount()
          Returns the number of entries in this enumeration.
 int getCountReliability()
          Returns an integer which is a representation of the reliability of the count of objects in this enumeration.
 ObjectEntry[] getNext(int count)
          Returns the next specified number of entries in this enumeration.
 ObjectEntry[] getPrev(int count)
          Returns the previous specified number of entries in this enumeration.
 boolean hasMoreElements()
          Determines whether this enumeration has more elements based on the current list cursor index.
 void insert(ObjectEntry oe, int index)
          Inserts an ObjectEntry object into this enumeration at the specified index.
 int moveFirst()
          Moves the enumeration cursor to the first entry in this enumeration.
 int moveLast()
          Moves the enumeration cursor to the last entry in this enumeration.
 int moveTo(int index)
          Moves the enumeration cursor index to the entry associated with the index specified.
 int moveTo(java.lang.String targetName)
          Moves the enumeration cursor position to the entry that most closely matches the specified target name.
 ObjectEntry next()
          Returns the next ObjectEntry element in this enumeration.
 java.lang.Object nextElement()
          Returns the next Object element from this enumeration.
 ObjectEntry previous()
          Returns the previous entry in this enumeration and moves the enumeration cursor to the previous entry.
 int remove(ObjectEntry oe)
          Removes the specified ObjectEntry from this enumeration.
 void replace(ObjectEntry oldEntry, ObjectEntry newEntry)
          Replaces an ObjectEntry object in this enumeration with another ObjectEntry object.
 
Methods inherited from class com.novell.application.console.snapin.BaseDefaultVirtualEnumeration
refresh, setBlockSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIndexedObjectEntryEnumeration

public DefaultIndexedObjectEntryEnumeration(ObjectEntryEnumeration oee,
                                            Shell shell)
Constructs the DefaultIndexedObjectEntryEnumeration object.
Parameters:
oee - The ObjectEntryEnumeration object used to populate this enumeration.
shell - The instance of the Shell that will be used to get object names.
Method Detail

hasMoreElements

public boolean hasMoreElements()
Determines whether this enumeration has more elements based on the current list cursor index.
Returns:
true if there is at least one more element to be returned from the nextElement() method, false otherwise.

nextElement

public java.lang.Object nextElement()
Returns the next Object element from this enumeration.
Returns:
The next Object element from this enumeration. If no next element exists, returns null.

next

public ObjectEntry next()
Returns the next ObjectEntry element in this enumeration.
Returns:
The next ObjectEntry element in this enumeration. If no next element exists, returns null.

previous

public ObjectEntry previous()
Returns the previous entry in this enumeration and moves the enumeration cursor to the previous entry.
Returns:
The ObjectEntry object previous to the entry at the current enumeration cursor position. If no previous element exists, returns null.

moveFirst

public int moveFirst()
Moves the enumeration cursor to the first entry in this enumeration.
Returns:
The new enumeration cursor index.

moveLast

public int moveLast()
Moves the enumeration cursor to the last entry in this enumeration.
Returns:
The new enumeration cursor index.

moveTo

public int moveTo(int index)
Moves the enumeration cursor index to the entry associated with the index specified.

The parameter index and the returned enumeration cursor position is an absolute index into this enumeration.

Specified by:
moveTo in interface IndexedObjectEntryEnumeration
Parameters:
index - The index of the entry to move to.
Returns:
The new enumeration cursor index.

moveTo

public int moveTo(java.lang.String targetName)
           throws SnapinException
Moves the enumeration cursor position to the entry that most closely matches the specified target name.

If an exact match is not found, then the enumeration cursor position is moved to the entry that most closely matches the target name.

Parameters:
targetName - The name of the entry to which the enumeration cursor index will be moved.
Returns:
The new enumeration cursor position.
Throws:
SnapinException - Thrown by the provider when an error occurs.

getNext

public ObjectEntry[] getNext(int count)
Returns the next specified number of entries in this enumeration.

getNext returns count entries beginning with the entry at the current cursor position. If count is greater than the number of remaining entries in this enumeration, getNext will return only the existing next entries. The current enumeration cursor position is moved toward the end of this enumeration by the number of entries returned.

Specified by:
getNext in interface IndexedObjectEntryEnumeration
Parameters:
count - The number of next entries to be returned.
Returns:
An array of the next count ObjectEntry objects in this enumeration.

getPrev

public ObjectEntry[] getPrev(int count)
Returns the previous specified number of entries in this enumeration.

getPrev returns the count entries previous to the entry at the current cursor position. If count is greater than the number of previous entries in this enumeration, getPrev will return only the existing previous entries. The current enumeration cursor position moves toward the beginning of this enumeration by the number of entries returned.

Specified by:
getPrev in interface IndexedObjectEntryEnumeration
Parameters:
count - The number of previous entries to be returned.
Returns:
An array of the previous count ObjectEntry objects in this enumeration.

getCount

public int getCount()
Returns the number of entries in this enumeration.
Specified by:
getCount in interface IndexedObjectEntryEnumeration
Returns:
The number of entries in this enumeration.

getCountReliability

public int getCountReliability()
Returns an integer which is a representation of the reliability of the count of objects in this enumeration.
Specified by:
getCountReliability in interface CountableObjectEntryEnumeration
Returns:
The integer representation for the reliability of the count. EXACTCOUNT (1) - exact count, we know we have exactly this many objects APPROXIMATECOUNT (2) - approximate count. This is most likely the total number of objects within the container (the subordinate count) It could actually be more than the number of objects in this enumeration because of selective search criteria BASECOUNT (3) - base count. This is the number of objects represented in this enumeration, but because of size/memory restrictions there is actually more objects in the directory that match this search criteria. This is all the objects that can be contained in this enumeration. PARTIALCOUNT (4) - partial count. This is the number of objects represented in this buffer (JCListEnumerator to multiple JClient.listToJCListEnumerator to to DDCListToBuffer calls). There may be more objects if the DDCListToBuffer was called additional times UNKNOWNCOUNT (5) - unknown count. I have no idea.

insert

public void insert(ObjectEntry oe,
                   int index)
Inserts an ObjectEntry object into this enumeration at the specified index.
Parameters:
oe - The ObjectEntry object to be inserted.
index - The position in this enumeration where the entry will be inserted.

append

public void append(ObjectEntry oe)
Appends an ObjectEntry object to this enumeration.
Parameters:
oe - The ObjectEntry object to be appended.

remove

public int remove(ObjectEntry oe)
Removes the specified ObjectEntry from this enumeration.
Parameters:
oe - The ObjectEntry object to be removed.

replace

public void replace(ObjectEntry oldEntry,
                    ObjectEntry newEntry)
Replaces an ObjectEntry object in this enumeration with another ObjectEntry object.
Parameters:
oldEntry - The ObjectEntry object to be replaced.
newEntry - The ObjectEntry object to replace the old entry.
See Also:
ObjectEntry


API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
ConsoleOne is a registered trademark of Novell Inc.
Generated December 9 2003 1727.