Class AbstractStore.StoreArea

    • Constructor Summary

      Constructors 
      Constructor Description
      StoreArea​(long id, long pointer)  
      StoreArea​(long id, long pointer, long fixed_size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int capacity()
      Returns the capacity of the area.
      protected long checkPositionBounds​(int diff)  
      void copyTo​(AreaWriter destination_writer, int size)
      Copies 'size' bytes from the current position of this Area to the destination AreaWriter.
      byte get()  
      void get​(byte[] buf, int off, int len)  
      char getChar()  
      long getID()
      Returns the unique identifier that represents this area.
      int getInt()  
      long getLong()  
      short getShort()  
      int position()
      Returns the current position of the pointer within the area.
      void position​(int position)
      Sets the position within the area.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • id

        protected final long id
      • start_pointer

        protected final long start_pointer
      • end_pointer

        protected final long end_pointer
      • position

        protected long position
      • buffer

        protected final byte[] buffer
    • Constructor Detail

      • StoreArea

        public StoreArea​(long id,
                         long pointer)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • StoreArea

        public StoreArea​(long id,
                         long pointer,
                         long fixed_size)
                  throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • checkPositionBounds

        protected long checkPositionBounds​(int diff)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • getID

        public long getID()
        Description copied from interface: Area
        Returns the unique identifier that represents this area.
        Specified by:
        getID in interface Area
      • position

        public int position()
        Description copied from interface: Area
        Returns the current position of the pointer within the area. The position starts at beginning of the area.
        Specified by:
        position in interface Area
      • capacity

        public int capacity()
        Description copied from interface: Area
        Returns the capacity of the area.
        Specified by:
        capacity in interface Area
      • position

        public void position​(int position)
                      throws java.io.IOException
        Description copied from interface: Area
        Sets the position within the area.
        Specified by:
        position in interface Area
        Throws:
        java.io.IOException
      • copyTo

        public void copyTo​(AreaWriter destination_writer,
                           int size)
                    throws java.io.IOException
        Description copied from interface: Area
        Copies 'size' bytes from the current position of this Area to the destination AreaWriter.
        Specified by:
        copyTo in interface Area
        Throws:
        java.io.IOException
      • get

        public byte get()
                 throws java.io.IOException
        Specified by:
        get in interface Area
        Throws:
        java.io.IOException
      • get

        public void get​(byte[] buf,
                        int off,
                        int len)
                 throws java.io.IOException
        Specified by:
        get in interface Area
        Throws:
        java.io.IOException
      • getShort

        public short getShort()
                       throws java.io.IOException
        Specified by:
        getShort in interface Area
        Throws:
        java.io.IOException
      • getInt

        public int getInt()
                   throws java.io.IOException
        Specified by:
        getInt in interface Area
        Throws:
        java.io.IOException
      • getLong

        public long getLong()
                     throws java.io.IOException
        Specified by:
        getLong in interface Area
        Throws:
        java.io.IOException
      • getChar

        public char getChar()
                     throws java.io.IOException
        Specified by:
        getChar in interface Area
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object