Interface ValueIterator

  • All Known Implementing Classes:
    CollectionValueIterator

    public interface ValueIterator

    Interface for interating through Expressions or values. It may return instances of Expression (which then have to be evaluated) or it may return some Object constant value - this should be checked for after calling next

    This interface is meant to abstract the details of how the values are stored and retrieved, if they are even stored in memory or not, etc. etc. An implementation instance may or may not be resettable and therefore reusable - see reset.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Returns true if the iteration has more values.
      Object next()
      Returns the next Expression or Object value in the interation.
      void reset()
      Optional reset method - allows a single instance of a ValueIterator implementation to be resettable, such that the next call to next returns the first element in the iteration (if any).
    • Method Detail

      • hasNext

        boolean hasNext()
                 throws TeiidComponentException
        Returns true if the iteration has more values. (In other words, returns true if next would return a value rather than throwing an exception.)
        Returns:
        true if this ValueIterator has more values.
        Throws:
        TeiidComponentException - indicating a non business- related Exception such as a service or bean being unavailable, or a communication failure.
      • next

        Object next()
             throws TeiidComponentException
        Returns the next Expression or Object value in the interation.
        Returns:
        the next Expression or Object value in the iteration.
        Throws:
        TeiidComponentException - indicating a non business- related Exception such as a service or bean being unavailable, or a communication failure.
      • reset

        void reset()
        Optional reset method - allows a single instance of a ValueIterator implementation to be resettable, such that the next call to next returns the first element in the iteration (if any). This method should be able to be called at any point during the lifecycle of a ValueIterator instance.
        Throws:
        UnsupportedOperationException - if this method is not implemented