Package be.gaudry.model.brolmeter
Class House
java.lang.Object
be.gaudry.model.AbstractLightObject
be.gaudry.model.LightObject
be.gaudry.model.brolmeter.House
- All Implemented Interfaces:
ILightObject
,Serializable
- Direct Known Subclasses:
HouseHibernateWrapper
Family house wich contains some
meters
.- Since:
- 1.0 Dec 15, 2008
- Author:
- Steph GAUDRY
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface be.gaudry.model.ILightObject
DEFAULT_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Removes all of the meters for this house.getMeter(int key)
Returns the Meter to which the specified meter id is mapped, ornull
if this map contains no mapping for the key.Returns an unmodifiable view of themeters
.removeMeter(int key)
Removes the meter mapped by the given key from this house if it is presentMethods inherited from class be.gaudry.model.LightObject
getDisplay, getId, setDisplay, setId
Methods inherited from class be.gaudry.model.AbstractLightObject
equals, hashCode, toString
-
Field Details
-
meters
-
-
Constructor Details
-
House
- Parameters:
id
-display
-
-
-
Method Details
-
getMeters
Returns an unmodifiable view of themeters
. This method allows modules to provide users with "read-only" access to themeters
. 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.
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
meters
(never null).
-
clearMeters
public void clearMeters()Removes all of the meters for this house. -
removeMeter
Removes the meter mapped by the given key from this house if it is presentReturns the value to which this map previously associated the key, or null if the house contained no meter for the key.
This house will not contain a meter for the specified key once the call returns.
- Parameters:
key
- key whose meter is to be removed from this house- Returns:
- the previous meter associated with key, or null if there was no meter for key.
-
addMeter
- Parameters:
meter
-
-
getMeter
Returns the Meter to which the specified meter id is mapped, ornull
if this map contains no mapping for the key.More formally, if this map contains a mapping from a key
k
to a Meterm
such that(key==null ? k==null : key.equals(k))
, then this method returnsm
; otherwise it returnsnull
. (There can be at most one such mapping.)- Parameters:
key
- the meter id whose associated Meter is to be returned- Returns:
- the value to which the specified key is mapped, or
null
if this map contains no mapping for the key - Throws:
ClassCastException
- if the key is of an inappropriate type for this map (optional)NullPointerException
- if the specified key is null
-