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
           
protected  PropertyChangeSupport PCS
           
static String recordCountKey
           
static String tempResetKey
           
 
Constructor Summary
GenericLog(String[] headers, int initialCapacity, int ourLoadFactor)
          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()
           
 String getMetadata()
           
 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)
           
 void setMetaData(String md)
          Add metadata This is information about the log being converted such as the location it was from or the date
This method does not add to its self so in order to add more info you must VAR.addMetaData(VAR.getMetaData() + NEWINFO)
 
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

recordCountKey

public static final String recordCountKey
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

PCS

protected final PropertyChangeSupport PCS
Constructor Detail

GenericLog

public GenericLog(String[] headers,
                  int initialCapacity,
                  int ourLoadFactor)
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

setMetaData

public final void setMetaData(String md)
Add metadata This is information about the log being converted such as the location it was from or the date
This method does not add to its self so in order to add more info you must VAR.addMetaData(VAR.getMetaData() + NEWINFO)

Parameters:
md - meta data to be added

getMetadata

public final String getMetadata()
Returns:
String containing the current meta data

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 © 2011 DIYEFI.org. All Rights Reserved.