|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--ResourceManager.ResourceModel
ResourceModel: A Data Model (as in MVC Model) for managing the Resources stored in the Resource Fork of a Macintosh File. After reading, the raw byte data of the loaded Resources can be accessed and interpreted as a client sees fit.
Constructor Summary | |
ResourceModel()
Sets up a new ResourceModel |
|
ResourceModel(java.lang.String inName)
Sets up a new ResourceModel to load from the given filename |
Method Summary | |
void |
become(ResourceModel become_this)
A sort of copy constructor; allows an existing ResourceModel to take over the data of another rather than instantiating a new one. |
boolean |
contains(java.lang.String inType)
A method to check whether any Resources of the given Type exist |
boolean |
contains(java.lang.String inType,
short idtocheck)
A convenience method allowing a test with a primitive short key in addition to the Short Object method |
boolean |
contains(java.lang.String inType,
java.lang.Short idtocheck)
A method to check whether a Resource of the given Type and ID exists |
int |
getCountOfType(java.lang.String inType)
Returns the number of Resources of the given type |
java.lang.String |
getFilename()
Returns the name of the Mac Resource Fork file being managed |
Resource |
getResource(java.lang.String inType,
short idtoget)
A convenience method allowing access with a primitive short key in addition to the Short Object method |
Resource |
getResource(java.lang.String inType,
java.lang.Short idtoget)
Returns the single Resource keyed to the given numeric Resource ID of the ResourceType keyed to the given 4-Letter Type ID. |
ResourceType |
getResourceType(java.lang.String inType)
Returns the single ResourceType keyed to the given ID. |
java.lang.String[] |
getTypeArray()
Returns a String array of all the Types of the Model |
java.util.Enumeration |
getTypes()
Returns an Enumeration of all the Type keys of the Model to enable iterative Hashtable access to all the ResourceType of this Model |
void |
init()
Prepares the ResourceModel for loading. |
void |
init(java.lang.String inName)
Prepares the ResourceModel for loading and sets the name of the file being loaded. |
void |
print(java.io.PrintStream ps)
Dumps the ResourceModel information (not including data) to a Stream |
void |
printAll(java.io.PrintStream ps)
Dumps the ResourceModel information (not including data) to a Stream as well as the info of all the Types it holds |
void |
read(java.io.RandomAccessFile inraf)
Initiates a full read, parse and store of the Mac Resource Fork specified by the given RandomAccessFile. |
void |
read(java.io.RandomAccessFile inraf,
long seekSet)
Initiates a full read, parse and store of the Mac Resource Fork specified by the given RandomAccessFile. |
void |
setFilename(java.lang.String inName)
Sets the name of the Mac Resource Fork file being managed |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ResourceModel()
public ResourceModel(java.lang.String inName)
inName
- the new name of the fileMethod Detail |
public void init()
public void init(java.lang.String inName)
inName
- the new name of the filepublic void become(ResourceModel become_this)
become_this
- the ResourceModel whose data we will assume.public void setFilename(java.lang.String inName)
inName
- the new name of the filepublic java.lang.String getFilename()
public void read(java.io.RandomAccessFile inraf) throws java.io.IOException
inraf
- the RandomAccessFile Object specifying the Resource Fork
to be loadedpublic void read(java.io.RandomAccessFile inraf, long seekSet) throws java.io.IOException
inraf
- the RandomAccessFile Object specifying the Resource Fork
to be loadedseekSet
- the file position of the beginning of the Resource Forkpublic void print(java.io.PrintStream ps)
ps
- the PrintStream to print the infopublic void printAll(java.io.PrintStream ps)
ps
- the PrintStream to print the infopublic java.util.Enumeration getTypes()
public java.lang.String[] getTypeArray()
public ResourceType getResourceType(java.lang.String inType)
inType
- the 4-Letter ID Key of the desired ResourceTypepublic Resource getResource(java.lang.String inType, java.lang.Short idtoget)
inType
- the 4-Letter ID Key of the desired ResourceTypeidtoget
- the numeric ID Key of the desired Resourcepublic Resource getResource(java.lang.String inType, short idtoget)
inType
- the 4-Letter ID Key of the desired ResourceTypeidtoget
- the numeric ID Key of the desired Resourcepublic boolean contains(java.lang.String inType)
inType
- the 4-Letter ID Key of the desired ResourceTypepublic boolean contains(java.lang.String inType, java.lang.Short idtocheck)
inType
- the 4-Letter ID Key of the desired ResourceTypeidtocheck
- the numeric ID Key of the desired Resourcepublic boolean contains(java.lang.String inType, short idtocheck)
inType
- the 4-Letter ID Key of the desired ResourceTypeidtocheck
- the numeric ID Key of the desired Resourcepublic int getCountOfType(java.lang.String inType)
inType
- the 4-Letter ID Key of the desired ResourceType
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |