Package be.gaudry.model.brolmeter
Class VehicleMeter
java.lang.Object
be.gaudry.model.AbstractLightObject
be.gaudry.model.brolmeter.Meter
be.gaudry.model.brolmeter.VehicleMeter
- All Implemented Interfaces:
ILightObject
,Serializable
- Since:
- 1.0 Sep 23, 2009, 1.0
- Version:
- %I%, %G%
- Author:
- Steph GAUDRY
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface be.gaudry.model.ILightObject
DEFAULT_ID
-
Constructor Summary
ConstructorDescriptionVehicleMeter(int id, EMeterType meterType, String unit)
VehicleMeter(String name, String unit)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
int
float
Returns an unmodifiable view of the relative measures (differences between two indexes).Returns an unmodifiable view of the measures (only indexes of the meter).float
float
int
void
setAutonomy(int autonomy)
void
setMaxAverageConsumption(float maxAverageConsumption)
void
setMinAverageConsumption(float minAverageConsumption)
void
setTankerMax(int tankerMax)
toString()
Builds a string with variables values and the class.Methods inherited from class be.gaudry.model.brolmeter.Meter
adaptMeasures, addMeasure, addMeasure, addMeasure, getDisplay, getId, getMeasures, getMeterType, getRelativeMeasures, getUnit, isDirty, setDisplay, setId, setUnit
Methods inherited from class be.gaudry.model.AbstractLightObject
equals, hashCode
-
Constructor Details
-
VehicleMeter
public VehicleMeter() -
VehicleMeter
- Parameters:
name
-unit
-
-
VehicleMeter
- 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 classMeter
-
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 theCollections.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 implementRandomAccess
if the specified list does.- Returns:
- an unmodifiable view of the measures (never null).
-
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 aredirty
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 implementRandomAccess
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
Description copied from class:AbstractLightObject
Builds a string with variables values and the class.- Overrides:
toString
in classMeter
- Returns:
- a String representation of this LightObject only for debugging
- See Also:
Object.toString()
-