|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.ulg.montefiore.run.totem.domain.model.impl.DomainConvertorImpl
public class DomainConvertorImpl
This convertor allow to convert any node,link or LSP id from int to String. These conversions are needed in each class that works on int id instead of String id. WARNING : there is no assumption that the integer id are consecutive. When removing a node, link or Lsp elements, we remove the element but we not reuse its int id for other elements. Instead, the next integer id is used i.e. a not already used integer.
Creation date: 19-Jan-2005 18:40:01
Field Summary | |
---|---|
protected java.util.HashMap<java.lang.Integer,java.lang.String> |
lspInt2String
|
Constructor Summary | |
---|---|
DomainConvertorImpl(Domain domain)
Create all the conversion table from a domain |
Method Summary | |
---|---|
void |
addLinkId(java.lang.String linkId)
Add a conversion for the linkId link |
void |
addLspId(java.lang.String lspId)
Add a conversion for the lspId LSP |
void |
addNodeId(java.lang.String nodeId)
Add a conversion for the nodeId node |
java.lang.String |
getLinkId(int id)
Convert a int link id in a String link id |
int |
getLinkId(java.lang.String id)
Convert a String link id in a int link id |
java.lang.String |
getLspId(int id)
Convert a int lsp id in a String lsp id |
int |
getLspId(java.lang.String id)
Convert a String LSP id in a int LSP id |
int |
getMaxLinkId()
Get the max link int id |
int |
getMaxLspId()
Get the max LSP int id |
int |
getMaxNodeId()
Get the max node int id |
java.lang.String |
getNodeId(int id)
Convert a int node id in a String node id |
int |
getNodeId(java.lang.String id)
Convert a String node id in a int node id |
void |
removeLinkId(java.lang.String linkId)
Remove the conversion for the link linkId |
void |
removeLspId(java.lang.String lspId)
Remove the conversion for the lspId LSP |
void |
removeNodeId(java.lang.String nodeId)
Remove the conversion for the node nodeId |
void |
renameLinkId(java.lang.String oldId,
java.lang.String newId)
Rename a Link without changing its int id |
void |
renameLspId(java.lang.String oldId,
java.lang.String newId)
Rename an LSP without changing its int id |
void |
renameNodeId(java.lang.String oldId,
java.lang.String newId)
Rename a Node without changing its int id |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.HashMap<java.lang.Integer,java.lang.String> lspInt2String
Constructor Detail |
---|
public DomainConvertorImpl(Domain domain)
domain
- Method Detail |
---|
public int getMaxNodeId()
getMaxNodeId
in interface DomainConvertor
public int getNodeId(java.lang.String id) throws NodeNotFoundException
getNodeId
in interface DomainConvertor
id
-
NodeNotFoundException
public java.lang.String getNodeId(int id) throws NodeNotFoundException
getNodeId
in interface DomainConvertor
id
-
NodeNotFoundException
public void addNodeId(java.lang.String nodeId) throws NodeAlreadyExistException
addNodeId
in interface DomainConvertor
nodeId
-
NodeAlreadyExistException
public void removeNodeId(java.lang.String nodeId) throws NodeNotFoundException
removeNodeId
in interface DomainConvertor
nodeId
-
NodeNotFoundException
public int getMaxLinkId()
getMaxLinkId
in interface DomainConvertor
public int getLinkId(java.lang.String id) throws LinkNotFoundException
getLinkId
in interface DomainConvertor
id
-
LinkNotFoundException
public java.lang.String getLinkId(int id) throws LinkNotFoundException
getLinkId
in interface DomainConvertor
id
-
LinkNotFoundException
public void addLinkId(java.lang.String linkId) throws LinkAlreadyExistException
addLinkId
in interface DomainConvertor
linkId
-
LinkAlreadyExistException
public void removeLinkId(java.lang.String linkId) throws LinkNotFoundException
removeLinkId
in interface DomainConvertor
linkId
-
LinkNotFoundException
public int getMaxLspId()
getMaxLspId
in interface DomainConvertor
public int getLspId(java.lang.String id) throws LspNotFoundException
getLspId
in interface DomainConvertor
id
-
LspNotFoundException
public java.lang.String getLspId(int id) throws LspNotFoundException
getLspId
in interface DomainConvertor
id
-
LspNotFoundException
public void addLspId(java.lang.String lspId) throws LspAlreadyExistException
addLspId
in interface DomainConvertor
lspId
-
LspAlreadyExistException
public void removeLspId(java.lang.String lspId) throws LspNotFoundException
removeLspId
in interface DomainConvertor
lspId
-
LspNotFoundException
public void renameLspId(java.lang.String oldId, java.lang.String newId) throws LspNotFoundException, LspAlreadyExistException
renameLspId
in interface DomainConvertor
oldId
- newId
-
LspNotFoundException
- if the oldId not in the index
LspAlreadyExistException
- If the newI already in the indexpublic void renameNodeId(java.lang.String oldId, java.lang.String newId) throws NodeAlreadyExistException, NodeNotFoundException
DomainConvertor
renameNodeId
in interface DomainConvertor
NodeAlreadyExistException
- If the newId already in the index
NodeNotFoundException
- if the oldId not in the indexpublic void renameLinkId(java.lang.String oldId, java.lang.String newId) throws LinkAlreadyExistException, LinkNotFoundException
DomainConvertor
renameLinkId
in interface DomainConvertor
LinkAlreadyExistException
- If the newId already in the index
LinkNotFoundException
- if the oldId not in the index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |