de.wagner_ibw.iow
Class IowFactory

java.lang.Object
  |
  +--de.wagner_ibw.iow.IowFactory

public class IowFactory
extends java.lang.Object

This class manages all the plugged IO-Warrior devices.

Author:
Thomas Wagner

Field Summary
static IowFactory INSTANCE
          Factory instance.
 
Method Summary
 void closeAllDevices()
          Close all the IO-Warrior devices.
 void exit(int code)
          Closes all open IO-Warrior devices and terminates the jvm.
static IowFactory getInstance()
          Static factory method.
 Iow24 getIow24Device()
          Returns the first plugged IO-Warrior 24 device.
 Iow24 getIow24Device(java.lang.String serial)
          Returns the IO-Warrior 24 device according to the specified serial number.
 Iow40 getIow40Device()
          Returns the first plugged IO-Warrior 40 device.
 Iow40 getIow40Device(java.lang.String serial)
          Returns the IO-Warrior 40 device according to the specified serial number.
 Iow56 getIow56Device()
          Returns the first plugged IO-Warrior 56 device.
 Iow56 getIow56Device(java.lang.String serial)
          Returns the IO-Warrior 56 device according to the specified serial number.
 AbstractIowDevice getIowDevice()
          Returns the first plugged IO-Warrior device.
 AbstractIowDevice getIowDevice(java.lang.String serial)
          Returns the iow device according to the specified serial number.
 long getNumDevices()
          Returns the number of plugged IO-Warrior devices.
 java.lang.String getVersion()
          Returns the version of the loaded iowkit library.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INSTANCE

public static final IowFactory INSTANCE
Factory instance.

Method Detail

getInstance

public static IowFactory getInstance()
Static factory method.

Returns:
the factory singelton.

getNumDevices

public long getNumDevices()
Returns the number of plugged IO-Warrior devices.

Returns:
Number of plugged IO-Warrior devices.
Since:
0.9.3

getIowDevice

public AbstractIowDevice getIowDevice()
                               throws java.util.NoSuchElementException
Returns the first plugged IO-Warrior device.

Returns:
Instance of an IO-Warrior device.
Throws:
java.util.NoSuchElementException - If no plugged IO-Warrior device was found.
Since:
0.9.5

getIowDevice

public AbstractIowDevice getIowDevice(java.lang.String serial)
                               throws java.util.NoSuchElementException
Returns the iow device according to the specified serial number.

Parameters:
serial - Serial number of the desired IO-Warrior device.
Returns:
@return Instance of the desired IO-Warrior device.
Throws:
java.util.NoSuchElementException - If no IO-Warrior device with desired serial number was found.
Since:
0.9.5

getIow40Device

public Iow40 getIow40Device()
                     throws java.util.NoSuchElementException
Returns the first plugged IO-Warrior 40 device.

Returns:
Instance of an IO-Warrior 40 device.
Throws:
java.util.NoSuchElementException - If no plugged IO-Warrior 40 device was found.

getIow40Device

public Iow40 getIow40Device(java.lang.String serial)
                     throws java.util.NoSuchElementException
Returns the IO-Warrior 40 device according to the specified serial number.

Parameters:
serial - Serial number of the desired IO-Warrior 40 device.
Returns:
@return Instance of the desired IO-Warrior 40 device.
Throws:
java.util.NoSuchElementException - If no IO-Warrior 40 device with desired serial number was found.

getIow24Device

public Iow24 getIow24Device()
                     throws java.util.NoSuchElementException
Returns the first plugged IO-Warrior 24 device.

Returns:
Instance of an IO-Warrior 24 device.
Throws:
java.util.NoSuchElementException - If no plugged IO-Warrior 24 device was found.

getIow24Device

public Iow24 getIow24Device(java.lang.String serial)
                     throws java.util.NoSuchElementException
Returns the IO-Warrior 24 device according to the specified serial number.

Parameters:
serial - Serial number of the desired IO-Warrior 24 device.
Returns:
Instance of the desired IO-Warrior 24 device.
Throws:
java.util.NoSuchElementException - If no IO-Warrior 24 device with desired serial number was found.

getIow56Device

public Iow56 getIow56Device()
                     throws java.util.NoSuchElementException
Returns the first plugged IO-Warrior 56 device.

Returns:
Instance of an IO-Warrior 56 device.
Throws:
java.util.NoSuchElementException - If no plugged IO-Warrior 56 device was found.
Since:
0.9.5

getIow56Device

public Iow56 getIow56Device(java.lang.String serial)
                     throws java.util.NoSuchElementException
Returns the IO-Warrior 56 device according to the specified serial number.

Parameters:
serial - Serial number of the desired IO-Warrior 56 device.
Returns:
Instance of the desired IO-Warrior 56 device.
Throws:
java.util.NoSuchElementException - If no iow 56 device with desired serial number was found.
Since:
0.9.5

closeAllDevices

public void closeAllDevices()
Close all the IO-Warrior devices.


toString

public java.lang.String toString()
Returns a string representation of the object. It consists of the information about all plugged IO-Warrior devices.

Overrides:
toString in class java.lang.Object
Returns:
a string consisting of the device handle, id, revision and serial number of each plugged IO-Warrior device.

exit

public void exit(int code)
Closes all open IO-Warrior devices and terminates the jvm.

Since:
0.9.3

getVersion

public java.lang.String getVersion()
Returns the version of the loaded iowkit library.

Returns:
Version of the iowkit.dll.
Since:
0.9.3