Class DynamicTable

java.lang.Object
org.eclipse.jetty.http3.qpack.internal.table.DynamicTable
All Implemented Interfaces:
Iterable<Entry>, Dumpable

public class DynamicTable extends Object implements Iterable<Entry>, Dumpable
  • Constructor Details

    • DynamicTable

      public DynamicTable()
  • Method Details

    • add

      public void add(Entry entry)
      Add an entry into the Dynamic Table. This will throw if it is not possible to insert this entry. Use canInsert(HttpField) to check whether it is possible to insert this entry.
      Parameters:
      entry - the entry to insert.
    • canInsert

      public boolean canInsert(HttpField field)
      Is there enough room to insert a new entry into the Dynamic Table, possibly evicting unreferenced entries.
      Parameters:
      field - the HttpField to insert into the table.
      Returns:
      if an entry with this HttpField can be inserted.
    • index

      public int index(Entry entry)
      Get the relative index of an entry in the Dynamic Table.
      Parameters:
      entry - the entry to find the relative index of.
      Returns:
      the relative index of this entry.
    • getAbsolute

      public Entry getAbsolute(int absoluteIndex)
      Get an entry from the Dynamic table given an absolute index.
      Parameters:
      absoluteIndex - the absolute index of the entry in the table.
      Returns:
      the entry with the absolute index.
    • get

      public Entry get(int index)
    • get

      public Entry get(String name)
    • get

      public Entry get(HttpField field)
    • getBase

      public int getBase()
    • getSize

      public int getSize()
    • getCapacity

      public int getCapacity()
    • getSpace

      public int getSpace()
    • getNumEntries

      public int getNumEntries()
    • getInsertCount

      public int getInsertCount()
    • setCapacity

      public void setCapacity(int capacity)
    • canReference

      public boolean canReference(Entry entry)
    • getDrainingIndex

      protected int getDrainingIndex()
      Entries with indexes lower than the draining index should not be referenced. This allows these entries to eventually be evicted as no more references will be made to them.
      Returns:
      the smallest absolute index that is allowed to be referenced.
    • iterator

      public Iterator<Entry> iterator()
      Specified by:
      iterator in interface Iterable<Entry>
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Description copied from interface: Dumpable
      Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
      Specified by:
      dump in interface Dumpable
      Parameters:
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      Throws:
      IOException - if unable to write to Appendable
    • toString

      public String toString()
      Overrides:
      toString in class Object