Module org.xbib.rpm

Class AbstractSpecEntry<T>

java.lang.Object
org.xbib.rpm.header.entry.AbstractSpecEntry<T>
Type Parameters:
T - the type parameter
All Implemented Interfaces:
SpecEntry<T>
Direct Known Subclasses:
BinSpecEntry, Int16SpecEntry, Int32SpecEntry, Int64SpecEntry, Int8SpecEntry, StringSpecEntry

public abstract class AbstractSpecEntry<T> extends Object implements SpecEntry<T>
  • Field Details

    • size

      protected int size
    • entryType

      protected EntryType entryType
    • count

      protected int count
    • offset

      protected int offset
    • values

      protected T values
  • Constructor Details

    • AbstractSpecEntry

      public AbstractSpecEntry()
  • Method Details

    • getEntryType

      public EntryType getEntryType()
      Specified by:
      getEntryType in interface SpecEntry<T>
    • setEntryType

      public void setEntryType(EntryType entryType)
      Specified by:
      setEntryType in interface SpecEntry<T>
    • setSize

      public void setSize(int size)
      Specified by:
      setSize in interface SpecEntry<T>
    • setCount

      public void setCount(int count)
      Specified by:
      setCount in interface SpecEntry<T>
    • incCount

      public void incCount(int count)
      Specified by:
      incCount in interface SpecEntry<T>
    • setOffset

      public void setOffset(int offset)
      Specified by:
      setOffset in interface SpecEntry<T>
    • getValues

      public T getValues()
      Specified by:
      getValues in interface SpecEntry<T>
    • setValues

      public void setValues(T values)
      Specified by:
      setValues in interface SpecEntry<T>
    • getOffset

      public int getOffset(int offset)
      Specified by:
      getOffset in interface SpecEntry<T>
    • ready

      public boolean ready()
      Specified by:
      ready in interface SpecEntry<T>
    • getType

      public abstract int getType()
      Specified by:
      getType in interface SpecEntry<T>
    • size

      public abstract int size()
      Returns the size this entry will need in the provided data buffer to write it's contents, corrected for any trailing zeros to fill to a boundary.
      Specified by:
      size in interface SpecEntry<T>
    • read

      public abstract void read(ByteBuffer buffer)
      Reads this entries value from the provided buffer using the set count.
      Specified by:
      read in interface SpecEntry<T>
    • write

      public abstract void write(ByteBuffer data)
      Writes this entries index to the index buffer and its values to the output channel provided.
      Specified by:
      write in interface SpecEntry<T>
    • index

      public void index(ByteBuffer index, int position)
      Writes the index entry into the provided buffer at the current position.
      Specified by:
      index in interface SpecEntry<T>
    • toString

      public String toString()
      Overrides:
      toString in class Object