tuwien.auto.eibpoints

Class PointList


public class PointList
extends java.lang.Object

The PointList class facilitates the integration of a variety of EIB/KNX points. This class provides methods for adding and removing as well as lookup of EIB/KNX points by different parameters. Finally the whole configuration can be saved and restored in XML format.
See Also:
Point

Constructor Summary

PointList()
Default constructor.
PointList(InputStream _XMLStream)
This constructor restores a PointList configuration, by parsing a XML structure.
PointList(String _DeviceFile)
This constructor initializes this object by parsing a configuration file in XML format.

Method Summary

void
addPoint(Point _Point)
Add a EIB/KNX point to the actual configuration.
Point[]
getAllPoints()
Returns a array with all EIB/KNX points contained in the point list.
Point
getPoint(String _PointName)
Get a reference to the point with the specified name.
Point
getPoint(EIB_Address _Address)
Searches the list and returns the point with the specified group address.
String[]
getPointDescriptions()
Get a description containing the name and address string from all points contained in this object.
void
removePoint(Point _Point)
Removes this EIB/KNX point.
void
toFile(String FileName)
Stores the current configuration at the specified file location, in XML format.
OutputStream
toStream()
Saves the configuration in XML file to an output stream.

Constructor Details

PointList

public PointList()
Default constructor. Use this to construct an empty list.

PointList

public PointList(InputStream _XMLStream)
            throws EICLException
This constructor restores a PointList configuration, by parsing a XML structure. If the XML structure is not the expected an EICLException is thrown.
Parameters:
_XMLStream - The XML file as InputStream
Throws:
EICLException - The EICLException is thrown if the passed structure does not conform to the expected.

PointList

public PointList(String _DeviceFile)
            throws EICLException
This constructor initializes this object by parsing a configuration file in XML format.
Parameters:
_DeviceFile - The file in which the configuration is stored
Throws:
EICLException - If the structure does not correspond to the expected, or the Point constructor throws an Exception

Method Details

addPoint

public void addPoint(Point _Point)
            throws EICLException
Add a EIB/KNX point to the actual configuration.
Parameters:
_Point - The EIB/KNX point reference.
Throws:
EICLException - If the device already exists.

getAllPoints

public Point[] getAllPoints()
Returns a array with all EIB/KNX points contained in the point list. Note that all parameters are passed as references.
Returns:
The array containing all points

getPoint

public Point getPoint(String _PointName)
            throws EICLException
Get a reference to the point with the specified name.
Parameters:
_PointName - The EIB/KNX point name.
Returns:
the point Returns the corresponding point.
Throws:
EICLException - The EICLException is thrown if no point with this name can be found.

getPoint

public Point getPoint(EIB_Address _Address)
            throws EICLException
Searches the list and returns the point with the specified group address.
Parameters:
_Address - The EIB group address.
Returns:
the point The EIB/KNX point with the specified address.
Throws:
EICLException - The EICLException is thrown if none can be found.

getPointDescriptions

public String[] getPointDescriptions()
Get a description containing the name and address string from all points contained in this object.
Returns:
A point description of all points.

removePoint

public void removePoint(Point _Point)
Removes this EIB/KNX point.
Parameters:
_Point - The reference to the point to be removed.

toFile

public void toFile(String FileName)
            throws EICLException
Stores the current configuration at the specified file location, in XML format.
Parameters:
FileName - The file location.
Throws:
EICLException - If the creation was erroneous.

toStream

public OutputStream toStream()
            throws EICLException
Saves the configuration in XML file to an output stream.
Returns:
The output stream containing the point list configuration in XML format.
Throws:
EICLException - If the file creation was erroneous.