/** * This has not been tested at all */ public static void addPortName(String portName, int portType, CommDriver driver) { synchronized (m_Mutex) { m_PortIdentifiers.put(portName, new CommPortIdentifier(portName, portType, driver)); } }
/** * This has not been tested at all */ public static void addPortName(String portName, int portType, CommDriver driver) { synchronized (m_Mutex) { m_PortIdentifiers.put(portName, new CommPortIdentifier(portName, portType, driver)); } }
/** * This has not been tested at all */ public static void addPortName(String portName, int portType, CommDriver driver) { synchronized (m_Mutex) { m_PortIdentifiers.put(portName, new CommPortIdentifier(portName, portType, driver)); } }
public static Enumeration<CommPortIdentifier> getPortIdentifiers() { synchronized (m_Mutex) { return new Enumeration() { List<CommPortIdentifier> m_PortIDs; { // insert the 'addPortName' ports to the dynamic port list m_PortIDs = new LinkedList<CommPortIdentifier>(); for (CommPortIdentifier portid : m_PortIdentifiers.values()) m_PortIDs.add(portid); // and now add the PureSerialPorts List<String> pureports = getPortList(); if (pureports != null) for (String name : pureports) m_PortIDs.add(new CommPortIdentifier(name, PORT_SERIAL, null)); } Iterator<CommPortIdentifier> m_Iterator = m_PortIDs.iterator(); public boolean hasMoreElements() { return m_Iterator != null ? m_Iterator.hasNext() : false; } public Object nextElement() { return m_Iterator.next(); }; }; } }
public static Enumeration getPortIdentifiers() { synchronized (m_Mutex) { return new Enumeration() { List<CommPortIdentifier> m_PortIDs; { // insert the 'addPortName' ports to the dynamic port list m_PortIDs = new LinkedList<CommPortIdentifier>(); for (CommPortIdentifier portid : m_PortIdentifiers.values()) m_PortIDs.add(portid); // and now add the PureSerialPorts List<String> pureports = getPortList(); if (pureports != null) for (String name : pureports) m_PortIDs.add(new CommPortIdentifier(name, PORT_SERIAL, null)); } Iterator<CommPortIdentifier> m_Iterator = m_PortIDs.iterator(); public boolean hasMoreElements() { return m_Iterator != null ? m_Iterator.hasNext() : false; } public Object nextElement() { return m_Iterator.next(); }; }; } }
public static Enumeration<CommPortIdentifier> getPortIdentifiers() { synchronized (m_Mutex) { return new Enumeration() { List<CommPortIdentifier> m_PortIDs; { // insert the 'addPortName' ports to the dynamic port list m_PortIDs = new LinkedList<CommPortIdentifier>(); for (CommPortIdentifier portid : m_PortIdentifiers.values()) m_PortIDs.add(portid); // and now add the PureSerialPorts List<String> pureports = getPortList(); if (pureports != null) for (String name : pureports) m_PortIDs.add(new CommPortIdentifier(name, PORT_SERIAL, null)); } Iterator<CommPortIdentifier> m_Iterator = m_PortIDs.iterator(); public boolean hasMoreElements() { return m_Iterator != null ? m_Iterator.hasNext() : false; } public Object nextElement() { return m_Iterator.next(); }; }; } }
return new CommPortIdentifier(portName, PORT_SERIAL, null); return new CommPortIdentifier(portName, PORT_SERIAL, null);
return new CommPortIdentifier(portName, PORT_SERIAL, null); } else { return new CommPortIdentifier(portName, PORT_SERIAL, null);
return new CommPortIdentifier(portName, PORT_SERIAL, null); } else { return new CommPortIdentifier(portName, PORT_SERIAL, null);