com.novell.application.console.snapin
Class DefaultVirtualObjectEntryEnumeration

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

public class DefaultVirtualObjectEntryEnumeration
extends BaseDefaultVirtualEnumeration
implements VirtualObjectEntryEnumeration

Provides an implementation of VirtualObjectEntryEnumeration.

This implementation is not virtual, and is intended to be used when the number of elements in the list is small.

The elements will be returned from this enumeration in the same order that they are enumerated out of the Enumeration passed to the constructor.

See Also:
VirtualObjectEntryEnumeration

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.VirtualObjectEntryEnumeration
VENUMPOS_AFTERENUM, VENUMPOS_BEFOREENUM, VENUMPOS_FIRSTENTRY
 
Fields inherited from interface com.novell.application.console.snapin.CountableObjectEntryEnumeration
APPROXIMATECOUNT, BASECOUNT, EXACTCOUNT, PARTIALCOUNT, UNKNOWNCOUNT
 
Constructor Summary
DefaultVirtualObjectEntryEnumeration(ObjectEntryEnumeration oee, Shell shell)
          Constructs the DefaultVirtualObjectEntryEnumeration.
 
Method Summary
 int getCount()
          Get the approximate total enumeration entry count.
 int getCurrentPosition()
          Returns the current enumeration cursor position.
 int getLastEntryPosition()
          Returns the enumeration cursor position for the last entry in the enumeration.
 ObjectEntry[] getNext(int iCount)
          Returns the next count entries in the enumeration.
 ObjectEntry[] getPrev(int iCount)
          Returns the previous count entries in the enumeration.
 boolean hasMoreElements()
          Determine if this enumeration has more elements based on the current list cursor position.
 int moveFirst()
          Moves the enumeration cursor to the first entry in the enumeration.
 int moveLast()
          Moves the enumeration cursor to the last entry in the enumeration.
 int moveLeft(int iCount)
          Moves the enumeration cursor position toward the left in the enumeration.
 int moveRight(int iCount)
          Moves the enumeration cursor position toward the right in the enumeration.
 int moveTo(int iPercent)
          Moves the enumeration cursor position to the entry associated with the position specified in the enumeration.
 int moveTo(java.lang.String target)
          Moves the enumeration cursor position to the entry that most matches the specified target name.
 ObjectEntry next()
          Get the next ObjectEntry element from the enumeration.
 java.lang.Object nextElement()
          Get the next Object element from the enumeration.
 ObjectEntry previous()
          Returns the previous entry in the enumeration and moves the enumeration cursor to the previous entry.
 
Methods inherited from class com.novell.application.console.snapin.BaseDefaultVirtualEnumeration
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.BrowserObjectEntryEnumeration
refresh, setBlockSize
 

Constructor Detail

DefaultVirtualObjectEntryEnumeration

public DefaultVirtualObjectEntryEnumeration(ObjectEntryEnumeration oee,
                                            Shell shell)
Constructs the DefaultVirtualObjectEntryEnumeration.

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

getCount

public int getCount()
Get the approximate total enumeration entry count.

Specified by:
getCount in interface VirtualObjectEntryEnumeration
Overrides:
getCount in class BaseDefaultVirtualEnumeration
Returns:
The approximate total enumeration entry count.

getCurrentPosition

public int getCurrentPosition()
Returns the current enumeration cursor position.

The enumeration cursor position is defined as one of the following:

Given that LASTENTRYPOS is the value returned from the method getLastEntryPosition().

Position values between VENUMPOS_FIRSTENTRY and LASTENTRYPOS indicate a relative approximate position in the enumeration.

Specified by:
getCurrentPosition in interface VirtualObjectEntryEnumeration
Returns:
The current enumeration cursor position.

getLastEntryPosition

public int getLastEntryPosition()
Returns the enumeration cursor position for the last entry in the enumeration.

Defines the cursor position for the last entry for this implementation of VirtualObjectEntryEnumeration.

Specified by:
getLastEntryPosition in interface VirtualObjectEntryEnumeration
Returns:
The enumeration cursor position for the last entry in the enumeration.

getNext

public ObjectEntry[] getNext(int iCount)
Returns the next count entries in the enumeration.

Get the number entries toward the right (end) of the enumeration, as indicated in the count, and move the current enumeration cursor position toward the right of the enumeration.

Moves as per the movement rules as defined in the VirtiualObjectEntryEnumeration interface.

Specified by:
getNext in interface VirtualObjectEntryEnumeration
Parameters:
iCount - The count of next entries to be returned
Returns:
The array of next ObjectEntries.

getPrev

public ObjectEntry[] getPrev(int iCount)
Returns the previous count entries in the enumeration.

Get the number entries toward the left (start) of the enumeration, as indicated in the count, and move the current enumeration cursor position toward the left of the enumeration.

Moves as per the movement rules as defined in the VirtiualObjectEntryEnumeration interface.

Specified by:
getPrev in interface VirtualObjectEntryEnumeration
Parameters:
iCount - The count of previous entries to be returned
Returns:
The array of previous ObjectEntries.

hasMoreElements

public boolean hasMoreElements()
Determine if this enumeration has more elements based on the current list cursor position.

The determination is made based on having more elements to return from the nextElement() method.

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.

moveFirst

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

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

moveLast

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

Specified by:
moveLast in interface BrowserObjectEntryEnumeration
Returns:
The new enumeration cursor position

moveLeft

public int moveLeft(int iCount)
Moves the enumeration cursor position toward the left in the enumeration.

Moves the cursor toward the left (start) of the enumeration according to the count specified.

Moves as per the movement rules as defined in the VirtiualObjectEntryEnumeration interface.

Specified by:
moveLeft in interface VirtualObjectEntryEnumeration
Parameters:
iCount - The count of entries to move.
Returns:
The count of entries actually moved.

moveRight

public int moveRight(int iCount)
Moves the enumeration cursor position toward the right in the enumeration.

Moves the cursor toward the right (end) of the enumeration according to the count specified.

Moves as per the movement rules as defined in the VirtiualObjectEntryEnumeration interface.

Specified by:
moveRight in interface VirtualObjectEntryEnumeration
Parameters:
iCount - The count of entries to move.
Returns:
The count of entries actually moved.

moveTo

public int moveTo(int iPercent)
Moves the enumeration cursor position to the entry associated with the position specified in the enumeration.

The parameter iPercent and the returned enumeration cursor position is an approximate position in the enumeration as described in the comments for getCurrentPosition().

Specified by:
moveTo in interface VirtualObjectEntryEnumeration
Parameters:
iPercent - The desired position in the enumeration.
Returns:
The new enumeration cursor position.
See Also:
getCurrentPosition()

moveTo

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

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

Specified by:
moveTo in interface BrowserObjectEntryEnumeration
Parameters:
target - The name of the entry to which the enumeration cursor position will be moved.
Returns:
The new enumeration cursor position.

next

public ObjectEntry next()
Get the next ObjectEntry element from the enumeration.

Specified by:
next in interface ObjectEntryEnumeration
Returns:
The next ObjectEntry element from the enumeration. If no next element exists, null is returned.

nextElement

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

Specified by:
nextElement in interface java.util.Enumeration
Returns:
The next Object element from the enumeration. If no next element exists, null is returned.

previous

public ObjectEntry previous()
Returns the previous entry in the enumeration and moves the enumeration cursor to the previous entry.

Specified by:
previous in interface BrowserObjectEntryEnumeration
Returns:
The ObjectEntry representing the previous entry in the enumeration. If no previous element exists, null is returned.


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.