ResourceManager
Class ResourceType

java.lang.Object
  |
  +--ResourceManager.ResourceType

public class ResourceType
extends java.lang.Object

ResourceType: ResourceType reads and holds all the Resources of a single type (e.g. 'ICON', 'MENU'). It allows both individual Hashtable access and en masse Array access to the Resources. Public accessor methods are provided to access additional Type data such as the ID of the type and the number of Resources


Constructor Summary
ResourceType()
           
 
Method Summary
 boolean contains(short idtocheck)
          A convenience method allowing a test with a primitive short key in addition to the Short Object method
 boolean contains(java.lang.Short idtocheck)
          Test whether a Resource of the given ID exists or not
 java.lang.String getID()
          Returns the Type Code of this ResourceType, e.g.
 Resource[] getResArray()
          Returns all the Resources of this ResourceType in a standard Array.
 Resource getResource(short idtoget)
          A convenience method allowing access with a primitive short key in addition to the Short Object method
 Resource getResource(java.lang.Short idtoget)
          Returns the single Resource keyed to the given ID.
 java.util.Enumeration getResourceIDs()
          Returns an Enumeration of all the ID keys of the type to enable iterative Hashtable access to all the Resources of this type
 void print(java.io.PrintStream ps)
          Dumps the ResourceType information (not including data) to a Stream
 void printAll(java.io.PrintStream ps)
          Dumps the ResourceType information (not including data) to a Stream as well as the info of all the Resources it holds
 short size()
          Returns the number of Items of this ResourceType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceType

public ResourceType()
Method Detail

print

public void print(java.io.PrintStream ps)
Dumps the ResourceType information (not including data) to a Stream
Parameters:
ps - the PrintStream to print the info

printAll

public void printAll(java.io.PrintStream ps)
Dumps the ResourceType information (not including data) to a Stream as well as the info of all the Resources it holds
Parameters:
ps - the PrintStream to print the info

size

public short size()
Returns the number of Items of this ResourceType

getID

public java.lang.String getID()
Returns the Type Code of this ResourceType, e.g. 'icl8', 'BNDL'

getResArray

public Resource[] getResArray()
Returns all the Resources of this ResourceType in a standard Array. Some clients may find Array access (0, 1, 2, etc.) more useful for some applications than Hash access based on the Resource ID

getResource

public Resource getResource(java.lang.Short idtoget)
Returns the single Resource keyed to the given ID. This is Hashtable style access and is easier for some applications, when trying to access a particular Resource.
Parameters:
idtoget - the ID Key of the desired Resource

getResource

public Resource getResource(short idtoget)
A convenience method allowing access with a primitive short key in addition to the Short Object method
Parameters:
idtoget - the ID Key of the desired Resource

contains

public boolean contains(java.lang.Short idtocheck)
Test whether a Resource of the given ID exists or not
Parameters:
idtocheck - the Resource ID in question

contains

public boolean contains(short idtocheck)
A convenience method allowing a test with a primitive short key in addition to the Short Object method
Parameters:
idtocheck - the Resource ID in question

getResourceIDs

public java.util.Enumeration getResourceIDs()
Returns an Enumeration of all the ID keys of the type to enable iterative Hashtable access to all the Resources of this type