edu.wpi.first.wpilibj.filters

## Class Filter

- java.lang.Object
- - edu.wpi.first.wpilibj.filters.Filter

- All Implemented Interfaces:
    PIDSource
  Direct Known Subclasses:
    LinearDigitalFilter

      public abstract class Filter
      extends java.lang.Object
      implements PIDSource

  Superclass for filters.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Filter(PIDSource source)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract double` | `get()` Returns the current filter estimate without also inserting new data as pidGet() would do.
    `PIDSourceType` | `getPIDSourceType()` Get which parameter of the device you are using as a process control variable.
    `abstract double` | `pidGet()` Get the result to use in PIDController.
    `protected double` | `pidGetSource()` Calls PIDGet() of source.
    `abstract void` | `reset()` Reset the filter state.
    `void` | `setPIDSourceType(PIDSourceType pidSource)` Set which parameter of the device you are using as a process control variable.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Filter

          public Filter(PIDSource source)

  - ### Method Detail

    - #### setPIDSourceType

          public void setPIDSourceType(PIDSourceType pidSource)

      Description copied from interface: `PIDSource`
      Set which parameter of the device you are using as a process control variable.
      Specified by:
        `setPIDSourceType` in interface `PIDSource`
      Parameters:
        `pidSource` - An enum to select the parameter.

    - #### getPIDSourceType

          public PIDSourceType getPIDSourceType()

      Description copied from interface: `PIDSource`
      Get which parameter of the device you are using as a process control variable.
      Specified by:
        `getPIDSourceType` in interface `PIDSource`
      Returns:
        the currently selected PID source parameter

    - #### pidGet

          public abstract double pidGet()

      Description copied from interface: `PIDSource`
      Get the result to use in PIDController.
      Specified by:
        `pidGet` in interface `PIDSource`
      Returns:
        the result to use in PIDController

    - #### get

          public abstract double get()

      Returns the current filter estimate without also inserting new data as pidGet() would do.
      Returns:
        The current filter estimate

    - #### reset

          public abstract void reset()

      Reset the filter state.

    - #### pidGetSource

          protected double pidGetSource()

      Calls PIDGet() of source.
      Returns:
        Current value of source