Class DnsQueryIdSpace.DnsQueryIdRange

  • Enclosing class:
    DnsQueryIdSpace

    private static final class DnsQueryIdSpace.DnsQueryIdRange
    extends java.lang.Object
    Provides a query if from a range of possible ids.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int count  
      private short[] ids  
      private int startId  
    • Constructor Summary

      Constructors 
      Constructor Description
      DnsQueryIdRange​(int bucketSize, int startId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) int maxUsableIds()
      Return the maximum number of ids that are supported.
      (package private) int nextId()
      Returns the next ID to use for a query or -1 if there is none left to use.
      (package private) void pushId​(int id)
      Push back the id, so it can be used again for the next query.
      (package private) int usableIds()
      Return how much more usable ids are left.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ids

        private final short[] ids
      • startId

        private final int startId
      • count

        private int count
    • Constructor Detail

      • DnsQueryIdRange

        DnsQueryIdRange​(int bucketSize,
                        int startId)
    • Method Detail

      • nextId

        int nextId()
        Returns the next ID to use for a query or -1 if there is none left to use.
        Returns:
        next id to use.
      • pushId

        void pushId​(int id)
        Push back the id, so it can be used again for the next query.
        Parameters:
        id - the id.
      • usableIds

        int usableIds()
        Return how much more usable ids are left.
        Returns:
        the number of ids that are left for usage.
      • maxUsableIds

        int maxUsableIds()
        Return the maximum number of ids that are supported.
        Returns:
        the maximum number of ids.