| java.lang.Object workbench.util.MessageBuffer
MessageBuffer | public class MessageBuffer (Code) | | A class to store messages efficiently.
The messages are internally stored in a LinkedList, but only up to
a specified maximum number of entries (not total size in bytes)
If the maximum is reached
MessageBuffer.getBuffer() will add "(...)" at the beginning
of the generated result to indicate that messages have been cut off.
This ensures that collecting warnings or errors during long running
jobs, does not cause an OutOfMemory error.
author: support@sql-workbench.net |
Constructor Summary | |
public | MessageBuffer() Create a new MessageBuffer, retrieving the max. | public | MessageBuffer(int maxEntries) Create a new MessageBuffer holding a maximum number of maxEntries
Entries in its internal list
Parameters: maxEntries - the max. |
MessageBuffer | public MessageBuffer()(Code) | | Create a new MessageBuffer, retrieving the max. number of entries
from the Settings object. If nothing has been specified in the .settings
file, a maximum number of 1000 entries is used.
|
MessageBuffer | public MessageBuffer(int maxEntries)(Code) | | Create a new MessageBuffer holding a maximum number of maxEntries
Entries in its internal list
Parameters: maxEntries - the max. number of entries to hold in the internal list |
appendNewLine | public synchronized void appendNewLine()(Code) | | |
clear | public synchronized void clear()(Code) | | |
getBuffer | public synchronized CharSequence getBuffer()(Code) | | Create a StringBuilder that contains the collected messages.
Once the result is returned, the internal list is emptied.
This means the second call to this method returns an empty
buffer if no messages have been added between the calls.
|
getLength | public synchronized int getLength()(Code) | | Returns the total length in characters of all messages
that are currently kept in this MessageBuffer
|
getMessages | public List<CharSequence> getMessages()(Code) | | Returns an unmodifiable reference to the stored messages.
|
|
|