org.diyefi.openlogviewer.genericlog
Class GenericDataElement

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Double>
              extended by org.diyefi.openlogviewer.genericlog.GenericDataElement
All Implemented Interfaces:
Transferable, Serializable, Cloneable, Comparable, Iterable<Double>, Collection<Double>, List<Double>, RandomAccess

public class GenericDataElement
extends ArrayList<Double>
implements Comparable, Serializable, Transferable

GenericDataElement is Comparable Serializable and Transferable and supports property change events it was built this way in order to be copy/pasteable later in the future when constructed this is the meat and potatoes of the program, the graphs and data displayed are pulled from these objects.

Author:
Bryan Harris
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
GenericDataElement()
          Constructor brings the GDE up to speed, defaulting with an available 50,000 datapoints in order to reduce the number of times the Array list has to copy its contents in order to increase size.
 
Method Summary
 boolean add(Double d)
          override add( t) of ArrayList to find min and max values before adding to the List
 void addPropertyChangeListener(String property, PropertyChangeListener PCL)
           
 int compareTo(Object o)
           
 Color getColor()
          getter
 Double getMaxValue()
          getter
 Double getMinValue()
          getter
 String getName()
          getter
 int getSplitNumber()
          getter
 Object getTransferData(DataFlavor flavor)
           
 DataFlavor[] getTransferDataFlavors()
           
 boolean isDataFlavorSupported(DataFlavor flavor)
           
 void removePropertyChangeListener(String property, PropertyChangeListener PCL)
           
 void reset()
          this will set the min and max to the default min/max values
 void setColor(Color c)
          setter
 void setMaxValue(Double highValue)
          setter
 void setMinValue(Double lowValue)
          setter
 void setName(String name)
          set header name, called during GenericLog construction
 void setSplitNumber(int splitNumber)
          sets the splitNumber or division of the graph in the graphing screen if its the same a property change event is fired called "Split"
 String toString()
           
 
Methods inherited from class java.util.ArrayList
add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

GenericDataElement

public GenericDataElement()
Constructor brings the GDE up to speed, defaulting with an available 50,000 datapoints in order to reduce the number of times the Array list has to copy its contents in order to increase size.

Method Detail

add

public boolean add(Double d)
override add( t) of ArrayList to find min and max values before adding to the List

Specified by:
add in interface Collection<Double>
Specified by:
add in interface List<Double>
Overrides:
add in class ArrayList<Double>
Parameters:
d - Double - Double.parseDouble(String) value to add to the array
Returns:
true on success, false if unable

setName

public void setName(String name)
set header name, called during GenericLog construction

Parameters:
name -

getName

public String getName()
getter

Returns:
name

getMaxValue

public Double getMaxValue()
getter

Returns:
newMaxValue

setMaxValue

public void setMaxValue(Double highValue)
setter

Parameters:
highValue -

getMinValue

public Double getMinValue()
getter

Returns:
newMinValue

setMinValue

public void setMinValue(Double lowValue)
setter

Parameters:
lowValue -

getColor

public Color getColor()
getter

Returns:
newColor

setColor

public void setColor(Color c)
setter

Parameters:
c -

getSplitNumber

public int getSplitNumber()
getter

Returns:
splitNumber

setSplitNumber

public void setSplitNumber(int splitNumber)
sets the splitNumber or division of the graph in the graphing screen if its the same a property change event is fired called "Split"

Parameters:
splitNumber -

reset

public void reset()
this will set the min and max to the default min/max values


addPropertyChangeListener

public void addPropertyChangeListener(String property,
                                      PropertyChangeListener PCL)

removePropertyChangeListener

public void removePropertyChangeListener(String property,
                                         PropertyChangeListener PCL)

toString

public String toString()
Overrides:
toString in class AbstractCollection<Double>

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

getTransferData

public Object getTransferData(DataFlavor flavor)
                       throws UnsupportedFlavorException,
                              IOException
Specified by:
getTransferData in interface Transferable
Throws:
UnsupportedFlavorException
IOException

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface Transferable

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)
Specified by:
isDataFlavorSupported in interface Transferable


Copyright © 2011 DIYEFI.org. All Rights Reserved.