org.diyefi.openlogviewer.genericlog
Class GenericLog

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

public class GenericLog
extends HashMap<String,GenericDataElement>

Author:
Bryan
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static int LOG_LOADED
           
static int LOG_LOADING
           
static int LOG_NOT_LOADED
           
protected  PropertyChangeSupport PCS
           
 
Constructor Summary
GenericLog()
           
GenericLog(String[] headers)
          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
 boolean addValue(String key, double value)
          Add a piece of data to the ArrayList associated with the key
 int getLogStatus()
           
 String getMetadata()
           
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Remove a PropertyChangeListener
 void setHeaders(String[] headers)
          sets the names of the headers for the Comparable interface of GenericDataElement
 void setLogStatus(int newLogStatus)
          Set the state of the log
 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.HashMap
clear, clone, containsKey, containsValue, entrySet, get, 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
equals, hashCode
 

Field Detail

LOG_NOT_LOADED

public static final int LOG_NOT_LOADED
See Also:
Constant Field Values

LOG_LOADING

public static final int LOG_LOADING
See Also:
Constant Field Values

LOG_LOADED

public static final int LOG_LOADED
See Also:
Constant Field Values

PCS

protected final PropertyChangeSupport PCS
Constructor Detail

GenericLog

public GenericLog()

GenericLog

public GenericLog(String[] headers)
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 boolean 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
Returns:
true or false if it was successfully added

setLogStatus

public void setLogStatus(int newLogStatus)
Set the state of the log

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

getLogStatus

public int getLogStatus()
Returns:
-1 if log not loaded 0 if loading or 1 if log is loaded

setHeaders

public void setHeaders(String[] headers)
sets the names of the headers for the Comparable interface of GenericDataElement

Parameters:
headers -

setMetaData

public 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 String getMetadata()
Returns:
String containing the current meta data

addPropertyChangeListener

public 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 void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)
Remove a PropertyChangeListener

Parameters:
propertyName - name of listener
listener - listener


Copyright © 2011 DIYEFI.org. All Rights Reserved.