com.yobotics.simulationconstructionset
Class DataBuffer
java.lang.Object
com.yobotics.simulationconstructionset.YoVariableHolderImplementation
com.yobotics.simulationconstructionset.DataBuffer
- All Implemented Interfaces:
- YoVariableHolder, java.io.Serializable
public class DataBuffer
- extends YoVariableHolderImplementation
- implements java.io.Serializable
- See Also:
- Serialized Form
| Methods inherited from class com.yobotics.simulationconstructionset.YoVariableHolderImplementation |
addVariablesToHolder, addVariableToHolder, getAllVariables, getAllVariablesArray, getVariable, getVariable, getVariables, getVariables, getVariables, hasUniqueVariable, hasUniqueVariable |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataBuffer
public DataBuffer()
DataBuffer
public DataBuffer(int bufferSize)
getBufferSize
public int getBufferSize()
getMaxBufferSize
public int getMaxBufferSize()
getWrapBuffer
public boolean getWrapBuffer()
addEntry
public void addEntry(DataBufferEntry entry)
addNewEntry
public void addNewEntry(YoVariable newVariable,
int nPoints)
throws DataBuffer.RepeatDataBufferEntryException
- Throws:
DataBuffer.RepeatDataBufferEntryException
addVariable
public void addVariable(YoVariable newVariable)
throws DataBuffer.RepeatDataBufferEntryException
- Throws:
DataBuffer.RepeatDataBufferEntryException
addVariables
public void addVariables(java.util.ArrayList variables)
throws DataBuffer.RepeatDataBufferEntryException
- Throws:
DataBuffer.RepeatDataBufferEntryException
addDataBufferListener
public void addDataBufferListener(DataBufferListener dataBufferListener)
getVariablesThatContain
public java.util.ArrayList<YoVariable> getVariablesThatContain(java.lang.String searchString,
boolean caseSensitive)
getVariablesThatStartWith
public java.util.ArrayList<YoVariable> getVariablesThatStartWith(java.lang.String searchString)
getEntry
public DataBufferEntry getEntry(java.lang.String name)
getEntry
public DataBufferEntry getEntry(YoVariable v)
getEntries
public java.util.ArrayList getEntries()
getVariables
public java.util.ArrayList getVariables()
getVars
public java.util.ArrayList getVars(java.lang.String[] varNames,
java.lang.String[] regularExpressions)
getVarsFromGroup
public java.util.ArrayList getVarsFromGroup(java.lang.String varGroupName,
VarGroupList varGroupList)
setMaxBufferSize
public void setMaxBufferSize(int newMaxBufferSize)
- Sets the maximum size, in ticks, to which the buffer will expand. While nonsense values are not explicitly checked for, they will not cause the buffer to shrink.
- Parameters:
newMaxBufferSize - New max buffer size.
setWrapBuffer
public void setWrapBuffer(boolean newWrapBuffer)
- Enables or disables buffer wrapping in place of buffer expansion. By default the buffer will expand until it reaches maxBufferSize at which point it will wrap to the beginning. When wrapBuffer is enabled the buffer wraps to the beginning without attempting to expand.
- Parameters:
newWrapBuffer - Enable or disable wrap buffer mode.
clearAll
public void clearAll(int nPoints)
changeBufferSize
public void changeBufferSize(int newBufferSize)
copyValuesThrough
public void copyValuesThrough()
getBufferInOutLength
public int getBufferInOutLength()
packData
public void packData()
packData
public void packData(int start)
cropData
public void cropData()
cropData
public void cropData(int start,
int end)
getInPoint
public int getInPoint()
getOutPoint
public int getOutPoint()
setInPoint
public void setInPoint()
setOutPoint
public void setOutPoint()
setInPoint
public void setInPoint(int in)
setOutPoint
public void setOutPoint(int out)
goToInPoint
public void goToInPoint()
goToOutPoint
public void goToOutPoint()
atInPoint
public boolean atInPoint()
atOutPoint
public boolean atOutPoint()
setKeyPoint
public void setKeyPoint()
getKeyPoints
public java.util.ArrayList<java.lang.Integer> getKeyPoints()
setIndex
public void setIndex(int idx)
attachIndexChangedListener
public void attachIndexChangedListener(IndexChangedListener indexChangedListener)
getIndex
public int getIndex()
tick
public boolean tick(int n)
- This method attempts to step the index n points. If the offset is within the valid data set the function returns false and the index is set to index+n. Otherwise the index is forced to the inPoint or the outPoint depending on which is more appropriate.
- Parameters:
n - Number of steps to shift the index, this value can be negative.
- Returns:
- Indicates whether or not the index was forced to one of the ends.
updateAndTick
public boolean updateAndTick(int n)
tickAndUpdate
public void tickAndUpdate()
applyDataProcessingFunction
public void applyDataProcessingFunction(DataProcessingFunction dataProcessingFunction)
isKeyPointToggled
public boolean isKeyPointToggled()
- Returns:
toggleKeyPoint
public void toggleKeyPoint()
getNextTime
public int getNextTime()
getPreviousTime
public int getPreviousTime()