inet.ipaddr

Class IPAddressNetwork.IPAddressStringCache

  • java.lang.Object
    • inet.ipaddr.IPAddressNetwork.IPAddressStringCache
  • Enclosing class:
    IPAddressNetwork


    public static class IPAddressNetwork.IPAddressStringCache
    extends java.lang.Object
    Choose a map of your choice to implement a cache of address strings and their associated addresses. The map will map string representations of the address to IPAddressString objects, which in turn cache any resulting IPAddress objects. Those objects are all themselves thread-safe, but the cache will only be thread-safe if you choose a thread-safe map such as ConcurrentHashMap.
    • Method Detail

      • get

        public IPAddressString get(java.lang.String key)
        Gets the object for the given key. If the object does not exist yet then it is created and added to the cache.
        Returns:
        the object for the given key
      • get

        public IPAddressString get(byte[] bytes,
                                   byte[] bytes2,
                                   java.lang.Integer prefixLength)
      • get

        public IPAddressString get(byte[] bytes,
                                   byte[] bytes2,
                                   java.lang.Integer prefixLength,
                                   java.lang.String zone)
      • contains

        public boolean contains(T value)
        Returns whether the given instance is in the cache.
        Parameters:
        value -
        Returns:
        whether the given instance of T is in the cache