edu.umd.cs.piccolox.event
Class PNotificationCenter.NotificationKey

java.lang.Object
  extended by java.lang.ref.Reference
      extended by java.lang.ref.WeakReference
          extended by edu.umd.cs.piccolox.event.PNotificationCenter.NotificationKey
Enclosing class:
PNotificationCenter

protected static class PNotificationCenter.NotificationKey
extends WeakReference

Represents a notification type from a particular object.


Constructor Summary
PNotificationCenter.NotificationKey(Object name, Object object)
          Creates a notification key with the provided name associated to the object given.
PNotificationCenter.NotificationKey(Object name, Object object, ReferenceQueue queue)
          Creates a notification key with the provided name associated with the provided object.
 
Method Summary
 boolean equals(Object anObject)
          Two keys are equal if they have the same name and are associated with the same object and conform to all other equals rules.
 int hashCode()
          
 Object name()
          Returns name of notification this key represents.
 String toString()
          Returns a nice string representation of this notification key.
 
Methods inherited from class java.lang.ref.Reference
clear, enqueue, get, isEnqueued
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PNotificationCenter.NotificationKey

public PNotificationCenter.NotificationKey(Object name,
                                           Object object)
Creates a notification key with the provided name associated to the object given.

Parameters:
name - name of notification
object - associated object

PNotificationCenter.NotificationKey

public PNotificationCenter.NotificationKey(Object name,
                                           Object object,
                                           ReferenceQueue queue)
Creates a notification key with the provided name associated with the provided object.

Parameters:
name - name of notification
object - associated object
queue - ReferenceQueue in which this NotificationKey will be appended once it has been cleared to be garbage collected
Method Detail

name

public Object name()
Returns name of notification this key represents.

Returns:
name of notification

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object anObject)
Two keys are equal if they have the same name and are associated with the same object and conform to all other equals rules.

Overrides:
equals in class Object
Parameters:
anObject - object being tested for equivalence to this NotificationKey
Returns:
true if this object is logically equivalent to the one passed in

toString

public String toString()
Returns a nice string representation of this notification key.

Overrides:
toString in class Object
Returns:
string representation of this notification key


Copyright © 1995-2010 Piccolo2D. All Rights Reserved.