traffic
Class MachinesList
java.lang.Object
|
+--traffic.MachinesList
- All Implemented Interfaces:
- java.io.Serializable
- public class MachinesList
- extends java.lang.Object
- implements java.io.Serializable
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MachinesList
public MachinesList()
MachinesList
public MachinesList(java.lang.String title)
MachinesList
public MachinesList(java.lang.String title,
Machine[] machines)
MachinesList
public MachinesList(Machine[] machines)
MachinesList
public MachinesList(java.io.BufferedReader br)
throws java.io.IOException
getTreeModel
public javax.swing.tree.DefaultTreeModel getTreeModel()
getRoot
public javax.swing.tree.DefaultMutableTreeNode getRoot()
getMachinesCount
public int getMachinesCount()
getMachine
public Machine getMachine(int idx)
getRelativeWeight
public double getRelativeWeight(int idx)
addMachine
public void addMachine(Machine machine)
removeMachine
public void removeMachine(Machine machine)
removeMachine
public void removeMachine(javax.swing.tree.DefaultMutableTreeNode nodeMachine)
removeAllMachines
public void removeAllMachines()
addProfile
public javax.swing.tree.DefaultMutableTreeNode addProfile(ClientProfile cp,
javax.swing.tree.DefaultMutableTreeNode parent)
removeProfile
public void removeProfile(javax.swing.tree.DefaultMutableTreeNode parent,
javax.swing.tree.DefaultMutableTreeNode pNode)
removeAllProfiles
public void removeAllProfiles(javax.swing.tree.DefaultMutableTreeNode mNode)
addMachines
public void addMachines(Machine[] m)
writeTo
public void writeTo(java.io.FileWriter fw)
throws java.io.IOException
- public int getClientPort(DefaultMutableTreeNode parent, DefaultMutableTreeNode pNode, int clientNb) {
Machine m = (Machine) parent.getUserObject();
ClientProfile cp = (ClientProfile) pNode.getUserObject();
return cp.getPort();
}
java.io.IOException
readFrom
public static Machine[] readFrom(java.io.BufferedReader br)
throws java.io.IOException
java.io.IOException
readMachinesFrom
public void readMachinesFrom(java.io.BufferedReader br)
throws java.io.IOException
java.io.IOException
chooseOne
public int chooseOne()
main
public static void main(java.lang.String[] args)
- Methode: Main pour tester la classe