|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.datapoint.DatapointMap
public class DatapointMap
A datapoint model storing datapoints with no defined order or hierarchy using a map implementation.
Constructor Summary | |
---|---|
DatapointMap()
Creates a new empty datapoint map. |
|
DatapointMap(java.util.Collection datapoints)
Creates a new datapoint map and adds all datapoints to the map. |
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. |
java.util.Collection |
getDatapoints()
Returns all datapoints currently contained in this map. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DatapointMap()
public DatapointMap(java.util.Collection datapoints)
datapoints
to the map.
A datapoint to be added has to be unique according its main address, the attempt to add two datapoints using the same main address results in a KNXIllegalArgumentException.
datapoints
- collection with entries of type Datapoint
KNXIllegalArgumentException
- on duplicate datapointMethod Detail |
---|
public void add(Datapoint dp)
DatapointModel
An implementation might throw KNXIllegalArgumentException if tried to add a duplicate datapoint.
add
in interface DatapointModel
dp
- datapoint to addpublic boolean contains(Datapoint dp)
DatapointModel
contains
in interface DatapointModel
dp
- datapoint to look up
true
iff such datapoint is found, false
otherwisepublic boolean contains(GroupAddress main)
DatapointModel
main
address.
contains
in interface DatapointModel
main
- KNX group address to look up
true
iff such datapoint is found, false
otherwisepublic Datapoint get(GroupAddress main)
DatapointModel
main
address,
if found in this model.
If no datapoint is found with that address, null
is returned.
get
in interface DatapointModel
main
- KNX group address to get the datapoint for
null
public java.util.Collection getDatapoints()
Datapoint
public void load(XMLReader r) throws KNXMLException
DatapointModel
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.
load
in interface DatapointModel
r
- a XML reader
KNXMLException
- on error loading the datapoint model, or on duplicate loaded
datapointpublic void remove(Datapoint dp)
DatapointModel
remove
in interface DatapointModel
dp
- datapoint to removepublic void removeAll()
DatapointModel
removeAll
in interface DatapointModel
public void save(XMLWriter w) throws KNXMLException
DatapointModel
save
in interface DatapointModel
w
- a XML writer
KNXMLException
- on error saving the datapoint model
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |