com.novell.application.console.snapin
Class DefaultIndexedObjectEntryEnumeration

java.lang.Object
  extended bycom.novell.application.console.snapin.BaseDefaultVirtualEnumeration
      extended bycom.novell.application.console.snapin.DefaultIndexedObjectEntryEnumeration
All Implemented Interfaces:
BrowserObjectEntryEnumeration, CountableObjectEntryEnumeration, java.util.Enumeration, IndexedObjectEntryEnumeration, ObjectEntryEnumeration

public class DefaultIndexedObjectEntryEnumeration
extends BaseDefaultVirtualEnumeration
implements IndexedObjectEntryEnumeration

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

Field Summary
 
Fields inherited from class com.novell.application.console.snapin.BaseDefaultVirtualEnumeration
m_enumerationData, m_iEnumerationIndex, m_shell
 
Fields inherited from interface com.novell.application.console.snapin.CountableObjectEntryEnumeration
APPROXIMATECOUNT, BASECOUNT, EXACTCOUNT, PARTIALCOUNT, UNKNOWNCOUNT
 
Constructor Summary
DefaultIndexedObjectEntryEnumeration(ObjectEntryEnumeration oee, Shell shell)
          Constructs the DefaultIndexedObjectEntryEnumeration object.
 
Method Summary
 void append(ObjectEntry oe)
          Appends an ObjectEntry object to 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
getCount, getCountReliability, refresh, setBlockSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.novell.application.console.snapin.IndexedObjectEntryEnumeration
getCount
 
Methods inherited from interface com.novell.application.console.snapin.BrowserObjectEntryEnumeration
refresh, setBlockSize
 

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

append

public void append(ObjectEntry oe)
Appends an ObjectEntry object to this enumeration.

Parameters:
oe - The ObjectEntry object to be appended.

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.

hasMoreElements

public boolean hasMoreElements()
Determines whether this enumeration has more elements based on the current list cursor index.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if there is at least one more element to be returned from the nextElement() method, false otherwise.

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.

moveFirst

public int moveFirst()
Moves the enumeration cursor to the first entry in this enumeration.

Specified by:
moveFirst in interface BrowserObjectEntryEnumeration
Returns:
The new enumeration cursor index.

moveLast

public int moveLast()
Moves the enumeration cursor to the last entry in this enumeration.

Specified by:
moveLast in interface BrowserObjectEntryEnumeration
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.

Specified by:
moveTo in interface BrowserObjectEntryEnumeration
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.

next

public ObjectEntry next()
Returns the next ObjectEntry element in this enumeration.

Specified by:
next in interface ObjectEntryEnumeration
Returns:
The next ObjectEntry element in this enumeration. If no next element exists, returns null.

nextElement

public java.lang.Object nextElement()
Returns the next Object element from this enumeration.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
The next Object element from 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.

Specified by:
previous in interface BrowserObjectEntryEnumeration
Returns:
The ObjectEntry object previous to the entry at the current enumeration cursor position. If no previous element exists, returns null.

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-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated September 2 2004 0111.