org.haphazard.item
Class GlobalItem

java.lang.Object
  extended byorg.haphazard.item.GlobalItem

public class GlobalItem
extends java.lang.Object

Contains all general items and handling of them


Method Summary
 void add(GeneralItem item)
          Adds an item to the global item list
 GeneralItem get(java.lang.String item)
          Gets an item
static GlobalItem getInstance()
          Gets the instance of GlobalItem
 void load(java.io.InputStream stream)
          Loads a global item list from a file Clears the global item list before load.
 void save(java.io.OutputStream stream)
          Saves the global item list in an XML-file
 java.lang.String toXML(int indent)
          Translates this object into an XML notation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static GlobalItem getInstance()
Gets the instance of GlobalItem

Returns:
The only instance of GlobalItem

add

public void add(GeneralItem item)
Adds an item to the global item list

Parameters:
item - The item to add

get

public GeneralItem get(java.lang.String item)
Gets an item

Parameters:
item - The name of the item to get
Returns:
The item if found, null if otherwise

save

public void save(java.io.OutputStream stream)
Saves the global item list in an XML-file

Parameters:
stream - The stream to save to

load

public void load(java.io.InputStream stream)
Loads a global item list from a file Clears the global item list before load.

Parameters:
stream - The stream to load from

toXML

public java.lang.String toXML(int indent)
Translates this object into an XML notation

Parameters:
indent - The indentation level
Returns:
The object in XML notation