Package jmri.jmrit.ctc
Class CTCExceptionBuffer
- java.lang.Object
-
- jmri.jmrit.ctc.CTCExceptionBuffer
-
- All Implemented Interfaces:
InstanceManagerAutoDefault
public class CTCExceptionBuffer extends java.lang.Object implements InstanceManagerAutoDefault
Most times the user does not have the System Console displayed when the CTC system is being started up. As such, errors logged to the CTCException class just "disappear" into the ether on that console, and the user has no knowledge of any problems. In this object, I will also gather up all of the errors, warnings and info messages that my system generates in CTCException, and display them to the user via a dialog box of some form, after the CTC system is fully started. For safety, I implement InstanceManagerAutoDefault so that the objects default constructor is called (for future safety). I'm not sure if "class" variables below are initialized properly if this is not done.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CTCExceptionBuffer.ExceptionBufferRecordSeverity
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.ArrayList<jmri.jmrit.ctc.CTCExceptionBuffer.ExceptionBufferRecord>
_mArrayListOfExceptionBufferRecords
-
Constructor Summary
Constructors Constructor Description CTCExceptionBuffer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
java.lang.String
getAllMessages()
CTCExceptionBuffer.ExceptionBufferRecordSeverity
getHighestExceptionBufferRecordSeverity()
You SHOULD call "isEmpty()" first, because this routine returns by default "INFO" IF there are NO entries in the list.boolean
isEmpty()
void
logString(CTCExceptionBuffer.ExceptionBufferRecordSeverity exceptionBufferRecordSeverity, java.lang.String string)
-
-
-
Field Detail
-
_mArrayListOfExceptionBufferRecords
java.util.ArrayList<jmri.jmrit.ctc.CTCExceptionBuffer.ExceptionBufferRecord> _mArrayListOfExceptionBufferRecords
-
-
Constructor Detail
-
CTCExceptionBuffer
public CTCExceptionBuffer()
-
-
Method Detail
-
logString
public void logString(CTCExceptionBuffer.ExceptionBufferRecordSeverity exceptionBufferRecordSeverity, java.lang.String string)
-
isEmpty
public boolean isEmpty()
-
clear
public void clear()
-
getHighestExceptionBufferRecordSeverity
public CTCExceptionBuffer.ExceptionBufferRecordSeverity getHighestExceptionBufferRecordSeverity()
You SHOULD call "isEmpty()" first, because this routine returns by default "INFO" IF there are NO entries in the list. It's purpose is to give the user an idea of the worst case scenario in the errors.- Returns:
- The highest level of severity in our list.
-
getAllMessages
public java.lang.String getAllMessages()
-
-