Class VehicleMeter

All Implemented Interfaces:
ILightObject, Serializable

public class VehicleMeter extends Meter
Since:
1.0 Sep 23, 2009, 1.0
Version:
%I%, %G%
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Constructor Details

    • VehicleMeter

      public VehicleMeter()
    • VehicleMeter

      public VehicleMeter(String name, String unit)
      Parameters:
      name -
      unit -
    • VehicleMeter

      public VehicleMeter(int id, EMeterType meterType, String unit)
      Parameters:
      id -
      meterType -
      unit -
  • Method Details

    • getAutonomy

      public int getAutonomy()
      Returns:
      the autonomy
    • setAutonomy

      public void setAutonomy(int autonomy)
      Parameters:
      autonomy - the autonomy to set
    • getMaxAverageConsumption

      public float getMaxAverageConsumption()
      Returns:
      the maxAverageConsumption
    • setMaxAverageConsumption

      public void setMaxAverageConsumption(float maxAverageConsumption)
      Parameters:
      maxAverageConsumption - the maxAverageConsumption to set
    • getMinAverageConsumption

      public float getMinAverageConsumption()
      Returns:
      the minAverageConsumption
    • setMinAverageConsumption

      public void setMinAverageConsumption(float minAverageConsumption)
      Parameters:
      minAverageConsumption - the minAverageConsumption to set
    • getTankerMax

      public int getTankerMax()
      Returns:
      the tankerMax
    • setTankerMax

      public void setTankerMax(int tankerMax)
      Parameters:
      tankerMax - the tankerMax to set
    • clearMeasures

      public void clearMeasures()
      Overrides:
      clearMeasures in class Meter
    • getConsumptions

      public List<Measure> getConsumptions()
      Returns an unmodifiable view of the measures (only indexes of the meter). This collection is sorted by insertion order and not by date; call the Collections.sort(List) method to sort by date. \n This method allows modules to provide users with "read-only" access to the measures. Query operations on the returned list "read through" to the specified list, and attempts to modify the returned list, whether direct or via its iterator, result in an UnsupportedOperationException. \n \n The returned list will be serializable if the specified list is serializable. Similarly, the returned list will implement RandomAccess if the specified list does.
      Returns:
      an unmodifiable view of the measures (never null).
    • getAverageConsumptions

      public List<Measure> getAverageConsumptions()
      Returns an unmodifiable view of the relative measures (differences between two indexes). This collection is sorted by date. \n This method may have a cost if we have added some measures since the last call (when we add a measure, the relative measures are dirty and must be re-evaluated when we ask for it). \n This method allows modules to provide users with "read-only" access to the measures. Query operations on the returned list "read through" to the specified list, and attempts to modify the returned list, whether direct or via its iterator, result in an UnsupportedOperationException. \n \n The returned list will be serializable if the specified list is serializable. Similarly, the returned list will implement RandomAccess if the specified list does.
      Returns:
      an unmodifiable view of the measures (never null).
      See Also:
      Meter.adaptMeasures(java.util.Collection, List)
    • getAverageConsumption

      public final float getAverageConsumption()
      Returns:
      the averageConsumption
    • toString

      public String toString()
      Description copied from class: AbstractLightObject
      Builds a string with variables values and the class.
      Overrides:
      toString in class Meter
      Returns:
      a String representation of this LightObject only for debugging
      See Also:
      Object.toString()