Class ThreadSpecificObject<T>


  • public class ThreadSpecificObject<T>
    extends java.lang.Object
    This ties the given object with the thread upon which this object is created This class can be used as the key in a hashSet if the incoming object can be used as the key in a hashSet
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int hash  
      private T incoming  
      private long tid  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      T getIncomingObject()
      Gets the incoming object bound to the thread id
      long getThreadIdentifier()
      Gets the thread on which this object was created
      int hashCode()  
      • Methods inherited from class java.lang.Object

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

      • incoming

        private final T incoming
      • tid

        private final long tid
      • hash

        private final int hash
    • Constructor Detail

      • ThreadSpecificObject

        public ThreadSpecificObject​(T incoming)
    • Method Detail

      • getThreadIdentifier

        public long getThreadIdentifier()
        Gets the thread on which this object was created
        Returns:
        The thread on which this object was created
      • getIncomingObject

        public T getIncomingObject()
        Gets the incoming object bound to the thread id
        Returns:
        The incoming object bound to the thread id
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object