org.chwf.resources
Class ResourceID

java.lang.Object
  |
  +--org.chwf.resources.ResourceID

public class ResourceID
extends java.lang.Object

Class used to identify a resource/resource factory. It is suitable for use as a key in hash maps.

Author:
Paul Strack

Constructor Summary
ResourceID(java.lang.Class type, java.lang.String name)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compare one resource ID to another.
 java.lang.String getName()
          The resource name.
 java.lang.Class getType()
          The resource type.
 int hashCode()
          The ID's hashCode.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceID

public ResourceID(java.lang.Class type,
                  java.lang.String name)
           throws java.lang.IllegalArgumentException
Constructor.
Parameters:
type - The resource type.
name - The resource name.
Throws:
java.lang.IllegalArgumentException - If either parameter is null.
Method Detail

getType

public java.lang.Class getType()
The resource type.
Returns:
The resource type.

getName

public java.lang.String getName()
The resource name.
Returns:
The resource type.

equals

public boolean equals(java.lang.Object o)
Compare one resource ID to another.
Overrides:
equals in class java.lang.Object
Parameters:
o - The compared object.
Returns:
True if type and name are equal, false if not (or not the object is not a ResourceID).

hashCode

public int hashCode()
The ID's hashCode.
Overrides:
hashCode in class java.lang.Object
Returns:
The ID's hashCode.


Copyright © 2002-2004, Paul Strack. All Rights Reserved.