Class Page.PageReference<K,V>

java.lang.Object
org.h2.mvstore.Page.PageReference<K,V>
Enclosing class:
Page<K,V>

public static final class Page.PageReference<K,V> extends Object
A pointer to a page, either in-memory or using a page position.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final long
    The descendant count for this child page.
    (package private) static final Page.PageReference
    Singleton object used when arrays of PageReference have not yet been filled.
    private Page<K,V>
    The page, if in memory, or null.
    private long
    The position, if known, or 0.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    (package private)
    PageReference(long pos, long count)
     
     
     
    private
    PageReference(Page<K,V> page, long pos, long count)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    Clear if necessary, reference to the actual child Page object, so it can be garbage collected if not actively used elsewhere.
    static <X, Y> Page.PageReference<X,Y>
    Get an empty page reference.
     
    (package private) long
     
    (package private) void
    Re-acquire position from in-memory page.
     

    Methods inherited from class java.lang.Object

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

    • EMPTY

      static final Page.PageReference EMPTY
      Singleton object used when arrays of PageReference have not yet been filled.
    • pos

      private long pos
      The position, if known, or 0.
    • page

      private Page<K,V> page
      The page, if in memory, or null.
    • count

      final long count
      The descendant count for this child page.
  • Constructor Details

    • PageReference

      public PageReference(Page<K,V> page)
    • PageReference

      PageReference(long pos, long count)
    • PageReference

      private PageReference(Page<K,V> page, long pos, long count)
  • Method Details

    • empty

      public static <X, Y> Page.PageReference<X,Y> empty()
      Get an empty page reference.
      Type Parameters:
      X - the key class
      Y - the value class
      Returns:
      the page reference
    • getPage

      public Page<K,V> getPage()
    • clearPageReference

      void clearPageReference()
      Clear if necessary, reference to the actual child Page object, so it can be garbage collected if not actively used elsewhere. Reference is cleared only if corresponding page was already saved on a disk.
    • getPos

      long getPos()
    • resetPos

      void resetPos()
      Re-acquire position from in-memory page.
    • toString

      public String toString()
      Overrides:
      toString in class Object