Class DataBlockUIDHandler

java.lang.Object
PamguardMVC.uid.DataBlockUIDHandler

public class DataBlockUIDHandler extends Object
  • Field Details

    • ROUNDINGFACTOR

      public static final int ROUNDINGFACTOR
      Rounding up factor for new file starts. May make this as a user definable option one day.
      See Also:
  • Constructor Details

    • DataBlockUIDHandler

      public DataBlockUIDHandler(PamDataBlock dataBlock)
      Construct a UID handler for a datablock.
      Parameters:
      dataBlock - Datablock owning the UID handler.
  • Method Details

    • getNextUID

      public long getNextUID(PamDataUnit dataUnit)
      Get the next available UID. If the dataUnit already has a UID, then return the same number, otherwise increment uid by 1, then return the new value.
      Parameters:
      dataUnit - Dataunit which may or may not have an existing UID
      Returns:
      old UID if it existed, otherwise a new one.
    • setCurrentUID

      public void setCurrentUID(long uid)
      Set the current UID value.
      Parameters:
      uid - UID value.
    • roundUpUID

      public void roundUpUID(int rounding)
      Round up the UID value so that the next file will start on a nice round number.
      Parameters:
      rounding - factor
    • getCurrentUID

      public long getCurrentUID()
      Get the current UID without incrementing it
      Returns:
      The current UID.