net.quartzware
Class ResBundle

java.lang.Object
  |
  +--net.quartzware.ResBundle

public class ResBundle
extends java.lang.Object

Encapsulates the data and functions of a 'resource bundle'.


Constructor Summary
ResBundle(Entry[] entries, java.lang.String suffix)
          Constructs a ResBundle from the given array of entries
ResBundle(java.lang.String suffix)
          Default Constructor PRE: none POST: This class is created
ResBundle(java.util.Vector entries, java.lang.String suffix)
          Constructs a ResBundle from the given vector of entries
 
Method Summary
 void addEntry(Entry e)
          Adds a new key to this ResBundle
 java.util.Vector getAllEntries()
          Returns all entries held by this ResBundle
 Entry getEntry(int idx)
          Returns the nth entry held by this ResBundle
 Entry getParentEntry(java.lang.String key)
          Returns all entries held by this ResBundle
 java.lang.String getSuffix()
          Returns suffix of this ResBundle
 boolean isDirty()
          Returns whether or not this ResBundle has been modified since the last save
 void removeEntry(java.lang.String key)
          Removes the entry corresponding to 'key' from this resbundle.
 void setDirty(boolean dirty)
          Tell this ResBundle whether it is dirty or not.
 void setEditorWindow(EditorWindow ew)
          Tell this EditorWindow who its parent is.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResBundle

public ResBundle(java.lang.String suffix)
Default Constructor PRE: none POST: This class is created

ResBundle

public ResBundle(Entry[] entries,
                 java.lang.String suffix)
Constructs a ResBundle from the given array of entries
Parameters:
entries - an array of entries from which to create this ResBundle PRE: entries does not equal null POST: this class is created

ResBundle

public ResBundle(java.util.Vector entries,
                 java.lang.String suffix)
Constructs a ResBundle from the given vector of entries
Parameters:
entries - a vector of entries from which to create this ResBundle PRE: entries does not equal null POST: this class is created
Method Detail

getSuffix

public java.lang.String getSuffix()
Returns suffix of this ResBundle
Returns:
the suffix PRE: none POST: suffix is returned

getParentEntry

public Entry getParentEntry(java.lang.String key)
Returns all entries held by this ResBundle
Returns:
the Entries PRE: key is not equal null POST: the Entry which contains key is returned if it exists, else null is returned

getAllEntries

public java.util.Vector getAllEntries()
Returns all entries held by this ResBundle
Returns:
the Entries PRE: none POST: all entries are returned

getEntry

public Entry getEntry(int idx)
Returns the nth entry held by this ResBundle
Parameters:
idx - the index of the entry to return
Returns:
an Entry PRE: idx is in the bounds of the array. POST: the entry is returned

removeEntry

public void removeEntry(java.lang.String key)
Removes the entry corresponding to 'key' from this resbundle.
Parameters:
entries - an array of entries from which to create this ResBundle PRE: key is not equal to null POST: if entry corresponding to entry is found it is removed.

isDirty

public boolean isDirty()
Returns whether or not this ResBundle has been modified since the last save
Returns:
true if the ResBundle has been modified PRE: none POST: returns whether the resource bundle is dirty

setDirty

public void setDirty(boolean dirty)
Tell this ResBundle whether it is dirty or not.
Parameters:
dirty - the value to set dirty to. PRE: none POST: it changes dirty status to the variable passed in.

setEditorWindow

public void setEditorWindow(EditorWindow ew)
Tell this EditorWindow who its parent is.
Parameters:
ew - The parent PRE: none POST: this class has a reference to its parent.

addEntry

public void addEntry(Entry e)
Adds a new key to this ResBundle
Parameters:
key - the key to add PRE: e does not equal null POST: the entry is added to this resource bundle.