Package lejos.robotics.filter
Class AbstractFilter
- java.lang.Object
-
- lejos.robotics.filter.AbstractFilter
-
- All Implemented Interfaces:
SampleProvider
- Direct Known Subclasses:
AbstractCalibrationFilter,AccelerometerAdapter,Dump,IntegrationFilter,LowPassFilter,ModulusFilter,OffsetCorrectionFilter,PublishFilter,RangeFinderAdapter,SampleBuffer,SampleThread,SliceFilter,SumFilter,ZeroFilter
public abstract class AbstractFilter extends java.lang.Object implements SampleProvider
Base class for Sample filters- Author:
- Kirk, Aswin
-
-
Field Summary
Fields Modifier and Type Field Description protected intsampleSizeprotected SampleProvidersource
-
Constructor Summary
Constructors Constructor Description AbstractFilter(SampleProvider source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfetchSample(float[] sample, int offset)Fetches a sample from a sensor or filter.intsampleSize()Returns the number of elements in a sample.
The number of elements does not change during runtime.
-
-
-
Field Detail
-
source
protected final SampleProvider source
-
sampleSize
protected int sampleSize
-
-
Constructor Detail
-
AbstractFilter
public AbstractFilter(SampleProvider source)
-
-
Method Detail
-
sampleSize
public int sampleSize()
Description copied from interface:SampleProviderReturns the number of elements in a sample.
The number of elements does not change during runtime.- Specified by:
sampleSizein interfaceSampleProvider- Returns:
- the number of elements in a sample
-
fetchSample
public void fetchSample(float[] sample, int offset)Description copied from interface:SampleProviderFetches a sample from a sensor or filter.- Specified by:
fetchSamplein interfaceSampleProvider- Parameters:
sample- The array to store the sample in.offset- The elements of the sample are stored in the array starting at the offset position.
-
-