Package lejos.robotics.filter
Class SliceFilter
- java.lang.Object
-
- lejos.robotics.filter.AbstractFilter
-
- lejos.robotics.filter.SliceFilter
-
- All Implemented Interfaces:
SampleProvider
public class SliceFilter extends AbstractFilter
Saimple filter to take a slice of another filter- Author:
- Lawrie Griffiths
-
-
Field Summary
-
Fields inherited from class lejos.robotics.filter.AbstractFilter
sampleSize, source
-
-
Constructor Summary
Constructors Constructor Description SliceFilter(SampleProvider source, int firstIndex, int lastIndex)
-
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.
-
-
-
Constructor Detail
-
SliceFilter
public SliceFilter(SampleProvider source, int firstIndex, int lastIndex)
-
-
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- Overrides:
sampleSizein classAbstractFilter- 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- Overrides:
fetchSamplein classAbstractFilter- 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.
-
-