tuwien.auto.calimero.datapoint
Interface DatapointModel

All Known Implementing Classes:
DatapointMap

public interface DatapointModel

A container for keeping Datapoints, using some particular hierarchical structure or order between those datapoints.

Its purpose is to imitate a real world datapoint layout, to build and maintain some kind of model for it, allowing a user to create and work with an arrangement of datapoints being adequate for the application requirements.
This interface aims to act as the base for building more complex layouts, for example to model part of a KNX network.

See Also:
DatapointMap

Method Summary
 void add(Datapoint dp)
          Adds a datapoint to this model.
 boolean contains(Datapoint dp)
          Checks whether this model contains the specified datapoint.
 boolean contains(GroupAddress main)
          Checks whether this model contains the datapoint identified using the specified main address.
 Datapoint get(GroupAddress main)
          Returns the datapoint identified using the specified main address, if found in this model.
 void load(XMLReader r)
          Loads a datapoint model from XML input into this model.
 void remove(Datapoint dp)
          Removes the specified datapoint from this model, if that datapoint is found.
 void removeAll()
          Removes all datapoints contained in this model.
 void save(XMLWriter w)
          Saves the datapoint model to XML using the supplied writer.
 

Method Detail

add

void add(Datapoint dp)
Adds a datapoint to this model.

An implementation might throw KNXIllegalArgumentException if tried to add a duplicate datapoint.

Parameters:
dp - datapoint to add
Throws:
KNXIllegalArgumentException - on duplicate datapoint

contains

boolean contains(Datapoint dp)
Checks whether this model contains the specified datapoint.

Parameters:
dp - datapoint to look up
Returns:
true iff such datapoint is found, false otherwise

contains

boolean contains(GroupAddress main)
Checks whether this model contains the datapoint identified using the specified main address.

Parameters:
main - KNX group address to look up
Returns:
true iff such datapoint is found, false otherwise

get

Datapoint get(GroupAddress main)
Returns the datapoint identified using the specified main address, if found in this model.

If no datapoint is found with that address, null is returned.

Parameters:
main - KNX group address to get the datapoint for
Returns:
the datapoint or null

load

void load(XMLReader r)
          throws KNXMLException
Loads a datapoint model from XML input into this model.

Datapoints already contained in this model are not required to be removed before loading, the loaded model will be added to the already existing datapoints.

Parameters:
r - a XML reader
Throws:
KNXMLException - on error loading the datapoint model, or on duplicate loaded datapoint

remove

void remove(Datapoint dp)
Removes the specified datapoint from this model, if that datapoint is found.

Parameters:
dp - datapoint to remove

removeAll

void removeAll()
Removes all datapoints contained in this model.


save

void save(XMLWriter w)
          throws KNXMLException
Saves the datapoint model to XML using the supplied writer.

Parameters:
w - a XML writer
Throws:
KNXMLException - on error saving the datapoint model