com.novell.application.console.snapin
Class DefaultVirtualObjectEntryEnumeration

java.lang.Object
  |
  +--com.novell.application.console.snapin.BaseDefaultVirtualEnumeration
        |
        +--com.novell.application.console.snapin.DefaultVirtualObjectEntryEnumeration
All Implemented Interfaces:
BrowserObjectEntryEnumeration, 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

Fields inherited from class com.novell.application.console.snapin.BaseDefaultVirtualEnumeration
m_enumerationData, m_iEnumerationIndex, m_shell
 
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
refresh, setBlockSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

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.

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()
Get the next Object element from the enumeration.
Returns:
The next Object element from the enumeration. If no next element exists, null is returned.

next

public ObjectEntry next()
Get the next ObjectEntry element from the enumeration.
Returns:
The next ObjectEntry 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.
Returns:
The ObjectEntry representing the previous entry in the enumeration. If no previous element exists, null is returned.

moveFirst

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

moveLast

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

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.

Parameters:
target - The name of the entry to which the enumeration cursor position will be moved.
Returns:
The new enumeration cursor position.

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.

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.

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.

getCount

public int getCount()
Get the approximate total enumeration entry count.
Specified by:
getCount in interface VirtualObjectEntryEnumeration
Returns:
The approximate total enumeration entry count.


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