Class TLcdFinalizedEnumeration

java.lang.Object
com.luciad.util.enumeration.TLcdFinalizedEnumeration
All Implemented Interfaces:
ILcdAutoCloseableEnumeration, AutoCloseable, Enumeration

public class TLcdFinalizedEnumeration extends Object implements ILcdAutoCloseableEnumeration
This class returns a given Enumeration, and performs a given action after having returned the last element.

Example application: when an Enumeration returns data from a file, the finalizing action can close the file at the end. This way the consumer of the data does not have to be aware of the data source.

  • Constructor Details

    • TLcdFinalizedEnumeration

      public TLcdFinalizedEnumeration(Enumeration aEnumeration, ILcdFinalizeAction aFinalizeAction)
      Constructs a new Enumeration that is identical to the given Enumeration, but in addition it performs the given action after having returned the last element.
      Parameters:
      aEnumeration - the Enumeration that will be returned.
      aFinalizeAction - the action that is performed at the end.
  • Method Details