FreeHEP API
Version current

org.freehep.util.parameterdatabase
Class ParameterKey

java.lang.Object
  extended byorg.freehep.util.parameterdatabase.ParameterKey

public class ParameterKey
extends Object

Source Code:
ParameterKey.java

Constructor Summary
protected ParameterKey(Object object, String name)
          This protected constructor creates a new ParameterKey with the given parameters.
 
Method Summary
static ParameterKey createParameterKey(Object object, String name)
          This static factory method returns a ParameterKey using the given arguments.
 boolean equals(Object otherKey)
          Two ParameterKeys are equal if and only if the corresponding objects and names are equal.
 void finalize()
          We override the finalize method to allow this ParameterKey to be recycled.
 String getName()
          Return the name of the parameter.
 Object getObject()
          Return the object associated with this ParameterKey.
 int hashCode()
          The hashcode returned is simply the exclusive-or of the hashcodes of the object and the name.
protected  void recycle()
          This method will recycle this ParameterKey.
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterKey

protected ParameterKey(Object object,
                       String name)
This protected constructor creates a new ParameterKey with the given parameters. Users should not create ParameterKeys via this constructor, but should instead use the static factory method createParameterKey().

Method Detail

createParameterKey

public static ParameterKey createParameterKey(Object object,
                                              String name)
This static factory method returns a ParameterKey using the given arguments. This method will try to use a recycled ParameterKey if one is available.


getObject

public Object getObject()
Return the object associated with this ParameterKey. Note that no operations should be performed on the returned object which will affect the results of the equals() method.


getName

public String getName()
Return the name of the parameter.


recycle

protected void recycle()
This method will recycle this ParameterKey. Any further user method calls on this object will result in an IllegalStateException being thrown. This object will be available for reuse only after the JVM determines that there are no more outstanding references to this ParameterKey and the JVM runs the finalize() method.


equals

public boolean equals(Object otherKey)
Two ParameterKeys are equal if and only if the corresponding objects and names are equal.


hashCode

public int hashCode()
The hashcode returned is simply the exclusive-or of the hashcodes of the object and the name.


finalize

public void finalize()
              throws Throwable
We override the finalize method to allow this ParameterKey to be recycled. It is added to the list of recycled keys if the inventory is below the given limit.

Throws:
Throwable

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.