Class IteratorTestOutput


  • public class IteratorTestOutput
    extends Object
    The expected results from invoking a IteratorTestCase on a IteratorTestInput. The output will be either a SortedMap of Keys and Values or an exception but never both. If one of these members is null, the other is guaranteed to be non-null.
    • Constructor Detail

      • IteratorTestOutput

        public IteratorTestOutput​(SortedMap<Key,​Value> output)
        Create an instance of the class.
        Parameters:
        output - The sorted collection of Key-Value pairs generated by an Iterator.
      • IteratorTestOutput

        public IteratorTestOutput​(Exception e)
    • Method Detail

      • getOutput

        public SortedMap<Key,​Value> getOutput()
        Returns the output from the iterator.
        Returns:
        The sorted Key-Value pairs from an iterator, null if an exception was thrown.
      • hasOutput

        public boolean hasOutput()
        Returns:
        True if there is output, false if the output is null.
      • getException

        public Exception getException()
        Returns the exception thrown by the iterator.
        Returns:
        The exception thrown by the iterator, null if no exception was thrown.
      • hasException

        public boolean hasException()
        Returns:
        True if there is an exception, null if the iterator successfully generated Key-Value pairs.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object