|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.comm.PathBundle
Used to conglomerate valid physical ports device links (only) into a list containing File objects and descriptive information.The named object is the root object. Paths representing either single files or directories can be added via the
At any time, the list of accumulated PathBundle stored in the root object can be accessed, each containing a File representing a single file in the filesystem, and the type of port that it was associated with atadd()
method. Non-existent paths are ignored. For each file added, singly, in bulk and collectively a new PhyPort object is added to the root PhyPort's list.add()
time.Usage:
PathBundle ports = new PathBundle();
ports.add
("/dev/term",CommPortIdentifier.PORT_SERIAL
);
ports.add
("/dev/cua/a",CommPortIdentifier.PORT_SERIAL
);In the above lines, the first 'add()' adds a PathBundle object to the master list for each file found in /dev/term
The second 'add()' adds a single PathBundle object representing the file /dev/cua/a.PhyPort pathList[] = ports.
getAll()
;
for (i = 0; i < ports.getCount()
; i++)
System.out.println("File #" + i + pathList[i].getPath()
);
Field Summary | |
private java.io.File |
file
|
private java.util.Vector |
rootPathVector
|
private boolean |
rootPort
|
private int |
type
|
Constructor Summary | |
|
PathBundle()
Public constructor. |
private |
PathBundle(java.io.File file,
int type,
PathBundle rootPort)
Private constructor. |
Method Summary | |
void |
add(java.lang.String pathName,
int type)
Given a path to a port, or a path to a directory containing a valid port device link and an associated port type, adds each physical port path encountered to the internal list. |
private void |
addToVector(PathBundle phyPort)
Add port to root port's vector. |
void |
clear()
Clear the PathBundle list. |
PathBundle[] |
getAll()
Return all the PathBundle objects in the list. |
int |
getCount()
Get number of physical ports stored in root class. |
java.io.File |
getFile()
Get the File object associated with this object. |
java.lang.String |
getName()
Get the base name path to the physical port path associated with this object. |
java.lang.String |
getPath()
Get the full path to the physical port associated with this object. |
int |
getType()
Get the type, serial or parallel, associated with this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.io.File file
private int type
private java.util.Vector rootPathVector
private boolean rootPort
Constructor Detail |
public PathBundle()
private PathBundle(java.io.File file, int type, PathBundle rootPort)
File
object and a port
type it adds the file to specified root port's internal list in
the form of a PhysPorts
object.
Method Detail |
private void addToVector(PathBundle phyPort)
phyPort
- port to add.public void add(java.lang.String pathName, int type)
pathName
- Path name to serial or parallel port or directory
containing them.type
- Integer type to associate with port.public PathBundle[] getAll()
public java.io.File getFile()
File
object associated with this object.
File
associated with this object.public int getType()
public java.lang.String getPath()
public java.lang.String getName()
public int getCount()
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |