de.jaetzold.art
Class RobotInterfaceFactory

java.lang.Object
  |
  +--de.jaetzold.art.RobotInterfaceFactory

public class RobotInterfaceFactory
extends Object

This is the class for creating instances of RobotInterface. To use it you will have to construct a new instance of RobotInterfaceFactory and then use any of the provided getInterface(...)-Methods for retrieving instances of RobotInterface.

Note: This class depends on a whitespace-separated list of fully qualified class-names given as the value of the property de.jaetzold.art.RobotInterfaceFactory.platforms

The property's value is taken from the System-properties and if it isn't defined there from the file de.jaetzold.art.properties

See Also:
RobotInterfaceDefinition, RobotInterfaceStringDefinition, RobotInterface

Constructor Summary
RobotInterfaceFactory()
          Contruct a new Factory for RobotInterfaces.
 
Method Summary
 RobotInterface getInterface()
          Returns the first sucessfully detected Interface.
 RobotInterface getInterface(RobotInterfaceDefinition port)
          Scans only the given Port.
 RobotInterface getInterface(RobotInterfaceDefinition[] ports)
          Scans only the given Ports.
 RobotInterface getInterface(String id)
          Searches for an interface conforming to a RobotInterfaceStringDefinition constructed from the given String.
 RobotInterface[] getInterfaces()
          Automatically scans all known Ports for all known types of Interfaces.
 RobotInterface getInterfaces(int index)
          JavaBeans indexed property.
 RobotInterface[] getInterfaces(RobotInterfaceDefinition port)
          Scans for RobotInterfaces only for the given Port.
 RobotInterface[] getInterfaces(RobotInterfaceDefinition[] ports)
          Scans for RobotInterfaces only for the given Ports.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RobotInterfaceFactory

public RobotInterfaceFactory()
Contruct a new Factory for RobotInterfaces.
Method Detail

getInterfaces

public RobotInterface getInterfaces(int index)
JavaBeans indexed property.
See Also:
getInterfaces()

getInterfaces

public RobotInterface[] getInterfaces()
Automatically scans all known Ports for all known types of Interfaces. 'known' means the ones given in the property de.jaetzold.art.RobotInterfaceFactory.platforms

If no interface could be found an array of length 0 is returned.

See Also:
getInterfaces(RobotInterfaceDefinition[])

getInterfaces

public RobotInterface[] getInterfaces(RobotInterfaceDefinition port)
Scans for RobotInterfaces only for the given Port. If no interface could be found an array of length 0 is returned.
See Also:
getInterfaces(RobotInterfaceDefinition[])

getInterfaces

public RobotInterface[] getInterfaces(RobotInterfaceDefinition[] ports)
Scans for RobotInterfaces only for the given Ports. RobotInterface-classes have to implement a method with this exact same signature (and a compatible return-type) in order to provide automatic detection capability through RobotInterfaceFactory.

This method simply collects the RobotInterfaces returned by these methods. In each call to this method the known classes are retrieved again from the property de.jaetzold.art.RobotInterfaceFactory.platforms and then they are asked again for RobotInterfaces.

All other getInterface(...)-methods rely on this method, so subclasses of RobotInterfaceFactorys only need to override this method to support all the various methods for retrieving a RobotInterface.

If no interface could be found an array of length 0 is returned.


getInterface

public RobotInterface getInterface()
Returns the first sucessfully detected Interface. If no interface could be found this method returns null.
See Also:
getInterfaces(RobotInterfaceDefinition[])

getInterface

public RobotInterface getInterface(RobotInterfaceDefinition port)
Scans only the given Port. If no interface could be found this method returns null.
See Also:
getInterfaces(RobotInterfaceDefinition[])

getInterface

public RobotInterface getInterface(RobotInterfaceDefinition[] ports)
Scans only the given Ports. If no interface could be found this method returns null.
See Also:
getInterfaces(RobotInterfaceDefinition[])

getInterface

public RobotInterface getInterface(String id)
Searches for an interface conforming to a RobotInterfaceStringDefinition constructed from the given String. If no interface could be found this method returns null.
See Also:
getInterfaces(RobotInterfaceDefinition[]), RobotInterfaceStringDefinition