au.com.swz.swttocom.swt
Class AbstractEnumeration<Object>

java.lang.Object
  extended by au.com.swz.swttocom.swt.AbstractEnumeration<Object>
Type Parameters:
Object - the Type that is going to be enumerated
All Implemented Interfaces:
IDisposeableResource, java.util.Enumeration<Object>
Direct Known Subclasses:
VariantEnumeration

public abstract class AbstractEnumeration<Object>
extends java.lang.Object
implements java.util.Enumeration<Object>, IDisposeableResource

The base class for a COM type enumerations.

Author:
X005105

Constructor Summary
protected AbstractEnumeration(org.eclipse.swt.internal.ole.win32.IEnumVARIANT ienumvariant)
           
 
Method Summary
abstract  Object create(org.eclipse.swt.ole.win32.Variant v)
          Implementations must unmarshal the specified variant in to a Type that is being enumerated.
 void dispose()
          Disposes of this enumeration if it has not yet been disposed.
protected  void finalize()
          If this enuemration has not yet been disposed, the finalizer will register this enumeration with the SWTtoCOM resource manager to ensure it is disposed of.
 boolean hasMoreElements()
          Tests if this enumeration contains more elements.
 Object nextElement()
          Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEnumeration

protected AbstractEnumeration(org.eclipse.swt.internal.ole.win32.IEnumVARIANT ienumvariant)
Method Detail

hasMoreElements

public boolean hasMoreElements()
Tests if this enumeration contains more elements.

Specified by:
hasMoreElements in interface java.util.Enumeration<Object>
Returns:
true if this enumeration contains more elements.

nextElement

public Object nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Specified by:
nextElement in interface java.util.Enumeration<Object>
Returns:
the next eleemnt of this enumeration.

dispose

public void dispose()
Disposes of this enumeration if it has not yet been disposed. Enumerations are automatically disposed of when the last element in the enumeration is retrieved. In the event that the entire enumeration is not retreived then this method will be used by the SWTtoCOM resource manager to dispose of the native resources.

Specified by:
dispose in interface IDisposeableResource

finalize

protected void finalize()
                 throws java.lang.Throwable
If this enuemration has not yet been disposed, the finalizer will register this enumeration with the SWTtoCOM resource manager to ensure it is disposed of. This method has no effect if the enuemration has already been disposed of.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

create

public abstract Object create(org.eclipse.swt.ole.win32.Variant v)
Implementations must unmarshal the specified variant in to a Type that is being enumerated.

Parameters:
v - the variant that contains the type to be unmarshalled.
Returns:
a new object.