
es.tid.vntm.topology.elements.Intf Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of network-emulator Show documentation
Show all versions of network-emulator Show documentation
Emulator of GMPLS-controlled transport Network
The newest version!
package es.tid.vntm.topology.elements;
import java.util.ArrayList;
public class Intf {
String name;
//TODO should the address not be mapped to a layer ??
ArrayList address;
//TODO should the list of layers in an interface be selected using an ENUM
ArrayList layering;
//TODO should the list of supported Counters be an ENUM
ArrayList supportedCounters;
Boolean isPhysical;
//TODO for a virtual interface, should there be an association with a parent interface
String parentInterfaceName;
Boolean intfUp;
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the address
*/
public ArrayList getAddress() {
return address;
}
/**
* @param address the address to set
*/
public void setAddress(ArrayList address) {
this.address = address;
}
/**
* @return the layering
*/
public ArrayList getLayering() {
return layering;
}
/**
* @param layering the layering to set
*/
public void setLayering(ArrayList layering) {
this.layering = layering;
}
/**
* @return the supportedCounters
*/
public ArrayList getSupportedCounters() {
return supportedCounters;
}
/**
* @param supportedCounters the supportedCounters to set
*/
public void setSupportedCounters(ArrayList supportedCounters) {
this.supportedCounters = supportedCounters;
}
/**
* @return the isPhysical
*/
public Boolean isPhysical() {
return isPhysical;
}
/**
* @param isPhysical the isPhysical to set
*/
public void setPhysical(Boolean isPhysical) {
this.isPhysical = isPhysical;
}
/**
* @return the parentInterfaceName
*/
public String getParentInterfaceName() {
return parentInterfaceName;
}
/**
* @param parentInterfaceName the parentInterfaceName to set
*/
public void setParentInterfaceName(String parentInterfaceName) {
this.parentInterfaceName = parentInterfaceName;
}
public Boolean isIntfUp() {
return intfUp;
}
public void setIntfUp(Boolean intfUp) {
this.intfUp = intfUp;
}
@Override
public boolean equals(Object arg0) {
// TODO Auto-generated method stub
if (((Intf)arg0).getName().equals(this.name)
//&&((Intf)arg0).isPhysical() == (this.isPhysical)
//&&((Intf)arg0).getParentInterfaceName().equals(this.parentInterfaceName)
&&(this.address.size() == ((Intf)arg0).getAddress().size())){
for (int i =0; i< address.size();i++){
if (!((Intf)arg0).getAddress().get(i).equals(address.get(i))){
return false;
}
}
if((supportedCounters!= null)&&(((Intf)arg0).getSupportedCounters() != null)){
if (supportedCounters.size() == (((Intf)arg0).getSupportedCounters().size()))
for (int i =0; i< supportedCounters.size(); i++){
if (!((Intf)arg0).getSupportedCounters().get(i).equals(supportedCounters.get(i))){
return false;
}
}
else{
return false;
}
}
if (((Intf)arg0).getLayering() != null){
if (layering.size() == (((Intf)arg0).getLayering().size())){
for (int i =0; i< layering.size(); i++){
if (!((Intf)arg0).getLayering().get(i).equals(layering.get(i))){
return false;
}
}
}
else
return false;
}
}
else{
return false;
}
return true;
}
public String toString(){
String temp="";
temp += "Name = " + name + " ";
temp += "Address = (";
for (int i=0;address!=null && i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy