Class OrderIterator.SerializedQueue<E extends java.io.Serializable>

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Queue<E>
    Enclosing class:
    OrderIterator

    private static class OrderIterator.SerializedQueue<E extends java.io.Serializable>
    extends java.util.AbstractQueue<E>
    implements java.io.Closeable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.io.File file  
      private java.io.ObjectInputStream input  
      private E last  
      private E next  
      private java.io.ObjectOutputStream output  
      private int size  
    • Constructor Summary

      Constructors 
      Constructor Description
      SerializedQueue​(java.lang.String prefix)  
      SerializedQueue​(java.lang.String prefix, java.io.File directory)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      java.util.Iterator<E> iterator()  
      boolean offer​(E e)  
      E peek()  
      E peekLast()  
      E poll()  
      int size()  
      • Methods inherited from class java.util.AbstractQueue

        add, addAll, clear, element, remove
      • Methods inherited from class java.util.AbstractCollection

        contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Field Detail

      • file

        private final java.io.File file
      • output

        private final java.io.ObjectOutputStream output
      • input

        private java.io.ObjectInputStream input
      • size

        private int size
      • next

        private E extends java.io.Serializable next
      • last

        private E extends java.io.Serializable last
    • Constructor Detail

      • SerializedQueue

        public SerializedQueue​(java.lang.String prefix)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • SerializedQueue

        public SerializedQueue​(java.lang.String prefix,
                               java.io.File directory)
                        throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • peekLast

        public E peekLast()
      • offer

        public boolean offer​(E e)
        Specified by:
        offer in interface java.util.Queue<E extends java.io.Serializable>
      • poll

        public E poll()
        Specified by:
        poll in interface java.util.Queue<E extends java.io.Serializable>
      • peek

        public E peek()
        Specified by:
        peek in interface java.util.Queue<E extends java.io.Serializable>
      • iterator

        public java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E extends java.io.Serializable>
        Specified by:
        iterator in interface java.lang.Iterable<E extends java.io.Serializable>
        Specified by:
        iterator in class java.util.AbstractCollection<E extends java.io.Serializable>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<E extends java.io.Serializable>
        Specified by:
        size in class java.util.AbstractCollection<E extends java.io.Serializable>
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException