org.diyefi.openlogviewer.genericlog
Class GenericLog

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<String,GenericDataElement>
              extended by org.diyefi.openlogviewer.genericlog.GenericLog
All Implemented Interfaces:
Serializable, Cloneable, Map<String,GenericDataElement>

public class GenericLog
extends LinkedHashMap<String,GenericDataElement>

See Also:
Serialized Form

Nested Class Summary
static class GenericLog.LogState
           
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static String elapsedTimeKey
           
static String RECORD_COUNT_KEY
           
static String tempResetKey
           
 
Constructor Summary
GenericLog(String[] headers, int initialCapacity, int ourLoadFactor, ResourceBundle labels)
          provide a String array of headers
each header will be used as a HashMap key, the data related to each header will be added to an ArrayList.
 
Method Summary
 void addPropertyChangeListener(String name, PropertyChangeListener listener)
          Add a property change listener to the generic log, REQUIRED!! GenericLog.LOG_STATUS is the name of the status property
 void addValue(String key, double value)
          Add a piece of data to the ArrayList associated with the key
 void clearOut()
           
 GenericLog.LogState getLogStatus()
           
 String getLogStatusMessage()
           
 int getRecordCount()
           
 void incrementPosition()
           
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Remove a PropertyChangeListener
 void setLogStatus(GenericLog.LogState newLogStatus)
          Set the state of the log
 void setLogStatusMessage(String message)
           
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Field Detail

RECORD_COUNT_KEY

public static final String RECORD_COUNT_KEY
See Also:
Constant Field Values

tempResetKey

public static final String tempResetKey
See Also:
Constant Field Values

elapsedTimeKey

public static final String elapsedTimeKey
See Also:
Constant Field Values
Constructor Detail

GenericLog

public GenericLog(String[] headers,
                  int initialCapacity,
                  int ourLoadFactor,
                  ResourceBundle labels)
provide a String array of headers
each header will be used as a HashMap key, the data related to each header will be added to an ArrayList.

Parameters:
headers - - of the data to be converted
Method Detail

addValue

public final void addValue(String key,
                           double value)
Add a piece of data to the ArrayList associated with the key

Parameters:
key - - header
value - - data to be added

incrementPosition

public final void incrementPosition()

setLogStatus

public final void setLogStatus(GenericLog.LogState newLogStatus)
Set the state of the log

Parameters:
newLogStatus - GenericLog.LOG_NOT_LOADED / GenericLog.LOG_LOADING / GenericLog.LOG_LOADED

getLogStatus

public final GenericLog.LogState getLogStatus()
Returns:
-1 if log not loaded 0 if loading or 1 if log is loaded

addPropertyChangeListener

public final void addPropertyChangeListener(String name,
                                            PropertyChangeListener listener)
Add a property change listener to the generic log, REQUIRED!! GenericLog.LOG_STATUS is the name of the status property

Parameters:
name -
listener - new OBJECT.addPropertyChangeListener("LogLoaded", new PropertyChangeListener() {
public void propertyChange( final PropertyChangeEvent propertyChangeEvent) {
OpenLogViewerApp.getInstance().setLog((GenericLog) propertyChangeEvent.getSource()); ...Insert code here...
}
});

removePropertyChangeListener

public final void removePropertyChangeListener(String propertyName,
                                               PropertyChangeListener listener)
Remove a PropertyChangeListener

Parameters:
propertyName - name of listener
listener - listener

getLogStatusMessage

public final String getLogStatusMessage()

setLogStatusMessage

public final void setLogStatusMessage(String message)

getRecordCount

public final int getRecordCount()

clearOut

public final void clearOut()


Copyright © 2015 DIYEFI.org. All Rights Reserved.