|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectStructures.RouterCollection
public class RouterCollection
Helper class to hold a collection of Router object
Constructor Summary | |
---|---|
RouterCollection()
|
|
RouterCollection(java.util.Map<java.lang.String,Router> routers)
|
Method Summary | |
---|---|
void |
addRouter(Router r)
Adding a Router object in the RouterCollection |
java.util.Map<java.lang.String,java.lang.String> |
createHostNametoIPMap()
Creates a Map where each of the router's IP address is mapped to its hostname It is used to create a meaningfull network diagram(graph) |
Router |
getRouter(int index)
Method to return a single Router based on index |
Router |
getRouter(java.lang.String routerID)
Method to return a single Router |
java.util.Collection<Router> |
getRoutersCollection()
Method to return a Collection of Routers |
int |
getSize()
|
void |
printCollection()
Prints the collection of routers |
void |
saveToXML()
Persists the collection in a XML file one for each file |
void |
sortCollection()
Method for sorting the router based on the RouterComparator definition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RouterCollection()
public RouterCollection(java.util.Map<java.lang.String,Router> routers)
Method Detail |
---|
public void sortCollection()
public java.util.Collection<Router> getRoutersCollection()
public Router getRouter(java.lang.String routerID)
routerID
- The wanted router's ID
public Router getRouter(int index)
index
- The index of required Router
public void addRouter(Router r)
r
- The Router object to be addedpublic void printCollection()
public java.util.Map<java.lang.String,java.lang.String> createHostNametoIPMap()
public void saveToXML()
public int getSize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |