Documentation of 'visad.util.WeakMapValue' Java class
WeakMapValue
visad.util

Class WeakMapValue



  • public final class WeakMapValue
    extends java.lang.ref.WeakReference
    A weakly-referenced Map value. The purpose of this class is to aid the creation of memory-sensitive, canonical mappings.
    • Constructor Summary

      Constructors 
      Constructor and Description
      WeakMapValue(java.lang.Object key, java.lang.Object value, java.lang.ref.ReferenceQueue queue)
      Constructs from a key and value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj)
      Indicates if this instance equals another object.
      java.lang.Object getKey()
      Returns the key associated with this value.
      java.lang.Object getValue()
      Returns the value associated with this value.
      int hashCode()
      Returns the hash code of this instance.
      • Methods inherited from class java.lang.ref.Reference

        clear, enqueue, get, isEnqueued
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WeakMapValue

        public WeakMapValue(java.lang.Object key,
                            java.lang.Object value,
                            java.lang.ref.ReferenceQueue queue)
        Constructs from a key and value. The key and value are not copied.
        Parameters:
        key - The key for the map.
        value - The value for the map.
        queue - The queue to receive garbaged-collected instances of this class.
        Throws:
        java.lang.NullPointerException - if the queue is null.
    • Method Detail

      • getKey

        public final java.lang.Object getKey()
        Returns the key associated with this value. The returned object is not a copy.
        Returns:
        The associated key.
      • getValue

        public final java.lang.Object getValue()
        Returns the value associated with this value. The returned object is not a copy. It may be null if this reference object has been cleared by the program or garbage collector.
        Returns:
        The associated value or null.
      • equals

        public boolean equals(java.lang.Object obj)
        Indicates if this instance equals another object. This method returns true if and only if the other object is a WeakMapValue and the values of both instances are either null or equal.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - The other object.
        Returns:
        True if and only if this instance equals the other object.
      • hashCode

        public int hashCode()
        Returns the hash code of this instance. This is the same as the hash code of the associated value.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code of this instance.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.