downey
Class ErrorStore

java.lang.Object
  extended bydowney.ErrorStore
Direct Known Subclasses:
SimpleDB

public class ErrorStore
extends java.lang.Object

This class provides a mechanism for saving error messages.
Instead of writing messages to System.out.println, a class can extend this class and use the setError and getError methods to record and retrireve error messages.


Field Summary
protected  java.lang.String m_strError
          The string that holds the error store
 
Constructor Summary
ErrorStore()
          Creates a new instance of ErrorStore.
 
Method Summary
 void addError(java.lang.String strError)
          Add to the error store.
 void clearError()
          Empty the error store.
 java.lang.String getError()
          Retrieve the error store.
 void setError(java.lang.String strError)
          Set the error store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_strError

protected java.lang.String m_strError
The string that holds the error store

Constructor Detail

ErrorStore

public ErrorStore()
Creates a new instance of ErrorStore.
The error store is emptied.

Method Detail

getError

public java.lang.String getError()
Retrieve the error store. Also clears the error store.

Returns:
The string that is the current error store

clearError

public void clearError()
Empty the error store.


setError

public void setError(java.lang.String strError)
Set the error store.
The old contents are overwritten.

Parameters:
strError - The new value for the error store.

addError

public void addError(java.lang.String strError)
Add to the error store.
The new value is added to the previous contents of the error store.

Parameters:
strError - The value to be appended to the error store.