com.anwrt.commons.protocol.model.data
Class AwtDeltasVector
java.lang.Object
com.anwrt.commons.protocol.model.DAObject
com.anwrt.commons.protocol.model.data.AwtData
com.anwrt.commons.protocol.model.data.AwtDeltasVector
public class AwtDeltasVector
- extends AwtData
Simple container where values are numerical data and only difference are
stored. A coefficient factor can be applied.
values[0] = start* factor values[i+1] = values[i] + factor*deltas[i]
Example : the following values {200 210 180 200} could be encoded as coded
as:
- factor=1, start=200, deltas = { 10 -30 +20 }
- factor=10, start=20, deltas = {1 -3 +2}
creation : 04 mars 2009
- Author:
- David FRANCOIS
|
Constructor Summary |
AwtDeltasVector(java.lang.Number factor,
java.util.List values)
Constructor. |
AwtDeltasVector(java.lang.Number factor,
java.lang.Long start,
java.util.List deltas)
Constructor. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AwtDeltasVector
public AwtDeltasVector(java.lang.Number factor,
java.lang.Long start,
java.util.List deltas)
- Constructor. Create an AwtDeltasVector from a list of deltas
- Parameters:
factor - Factor of the DeltasVector.
AwtDeltasVector
public AwtDeltasVector(java.lang.Number factor,
java.util.List values)
throws java.lang.Exception
- Constructor. Create an AwtDeltasVector with default values
- Parameters:
factor - Factor of the DeltasVector.values - Values of the vector, deltas will be compute automatically
- Throws:
java.lang.Exception - an error occurred when computing deltas
getStart
public java.lang.Number getStart()
getFactor
public java.lang.Number getFactor()
getValues
public java.util.List getValues()
getDeltas
public java.util.List getDeltas()
addValue
public void addValue(java.lang.Number value)
throws java.lang.Exception
- Throws:
java.lang.Exception
addValues
public void addValues(java.util.List values)
throws java.lang.Exception
- Throws:
java.lang.Exception
size
public int size()
toString
public java.lang.String toString()
- Specified by:
toString in class AwtData