jAER project on SourceForge

net.sf.jaer.hardwareinterface
Class HardwareInterfaceFactory

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet<java.lang.Class>
              extended by net.sf.jaer.hardwareinterface.HardwareInterfaceFactory
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Class>, java.util.Collection<java.lang.Class>, java.util.Set<java.lang.Class>, HardwareInterfaceFactoryInterface

public class HardwareInterfaceFactory
extends java.util.HashSet<java.lang.Class>
implements HardwareInterfaceFactoryInterface

This class builds a list of all available devices and lets you get one of them. It is a singleton: get the instance() and ask it to make an interface for you.

Author:
tobi
See Also:
Serialized Form

Method Summary
 HardwareInterface getFirstAvailableInterface()
          Gets the first available interface.
 HardwareInterface getInterface(int n)
          build list of devices and return the n'th one, 0 based
 int getNumInterfacesAvailable()
          Says how many total of all types of hardware are available
static HardwareInterfaceFactory instance()
          Use this instance to access the methods, e.g.
static void main(java.lang.String[] arg)
           
 
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Method Detail

instance

public static HardwareInterfaceFactory instance()
Use this instance to access the methods, e.g. HardwareInterfaceFactory.instance().getNumInterfacesAvailable().

Returns:
the singleton instance.

getNumInterfacesAvailable

public int getNumInterfacesAvailable()
Says how many total of all types of hardware are available

Specified by:
getNumInterfacesAvailable in interface HardwareInterfaceFactoryInterface
Returns:
number of devices

getFirstAvailableInterface

public HardwareInterface getFirstAvailableInterface()
Description copied from interface: HardwareInterfaceFactoryInterface
Gets the first available interface.

Specified by:
getFirstAvailableInterface in interface HardwareInterfaceFactoryInterface
Returns:
first available interface, starting with CypressFX2 and then going to SiLabsC8051F320

getInterface

public HardwareInterface getInterface(int n)
build list of devices and return the n'th one, 0 based

Specified by:
getInterface in interface HardwareInterfaceFactoryInterface
Parameters:
n - the number starting from 0
Returns:
the HardwareInterface

main

public static void main(java.lang.String[] arg)

jAER project on SourceForge