Class LookupTable<I>

java.lang.Object
org.sejda.commons.LookupTable<I>
Type Parameters:
I - type of the items

public class LookupTable<I> extends Object
Component that allows to set up a lookup relation between items of the same type.
Author:
Andrea Vacondio
  • Constructor Details

    • LookupTable

      public LookupTable()
  • Method Details

    • addLookupEntry

      public void addLookupEntry(I keyItem, I valueItem)
      Adds a lookup entry.
      Parameters:
      keyItem -
      valueItem -
    • clear

      public void clear()
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if the table is empty
    • lookup

      public I lookup(I item)
      Looks up the item that correspond to the given one
      Parameters:
      item -
      Returns:
      the item associated to the given input one or null if no mapping is present
    • hasLookupFor

      public boolean hasLookupFor(I item)
      Parameters:
      item -
      Returns:
      true if the table contains a lookup for the given item
    • values

      public Collection<I> values()
      Returns:
      a collection containing values of the table
    • first

      public I first()
      Returns:
      the first item or null if the table is empty.
    • keys

      public Set<I> keys()
      Returns:
      the keys of the table