Class FreeSlots

java.lang.Object
org.basex.util.FreeSlots

public final class FreeSlots extends Object
Organizes free slots in heap files.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int size, long offset)
    Adds a value for the specified slot size.
    long
    get(int size, long offset)
    Returns the offset of a slot that is greater than or equal to the specified size.
     

    Methods inherited from class java.lang.Object

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

    • FreeSlots

      public FreeSlots()
  • Method Details

    • add

      public void add(int size, long offset)
      Adds a value for the specified slot size.
      Parameters:
      size - byte size
      offset - file offset
    • get

      public long get(int size, long offset)
      Returns the offset of a slot that is greater than or equal to the specified size.
      Parameters:
      size - ideal (minimum) slot size
      offset - offset used as fallback if no free slot is available
      Returns:
      insertion offset
    • toString

      public String toString()
      Overrides:
      toString in class Object