Class House

All Implemented Interfaces:
ILightObject, Serializable
Direct Known Subclasses:
HouseHibernateWrapper

public class House extends LightObject
Family house wich contains some meters.
Since:
1.0 Dec 15, 2008
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • House

      public House(int id, String display)
      Parameters:
      id -
      display -
  • Method Details

    • getMeters

      public Collection<Meter> getMeters()
      Returns an unmodifiable view of the meters. This method allows modules to provide users with "read-only" access to the meters. 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 implement RandomAccess 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

      public Meter removeMeter(int key)
      Removes the meter mapped by the given key from this house if it is present

      Returns 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

      public void addMeter(Meter meter)
      Parameters:
      meter -
    • getMeter

      public Meter getMeter(int key)
      Returns the Meter to which the specified meter id is mapped, or null if this map contains no mapping for the key.

      More formally, if this map contains a mapping from a key k to a Meter m such that (key==null ? k==null : key.equals(k)), then this method returns m; otherwise it returns null. (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