home *** CD-ROM | disk | FTP | other *** search
- package java.net;
-
- public class InterfaceAddress {
- private InetAddress address = null;
- private Inet4Address broadcast = null;
- private short maskLength = 0;
-
- InterfaceAddress() {
- }
-
- public InetAddress getAddress() {
- return this.address;
- }
-
- public InetAddress getBroadcast() {
- return this.broadcast;
- }
-
- public short getNetworkPrefixLength() {
- return this.maskLength;
- }
-
- public boolean equals(Object var1) {
- if (!(var1 instanceof InterfaceAddress)) {
- return false;
- } else {
- InterfaceAddress var2 = (InterfaceAddress)var1;
- if (!(this.address != null & var2.address == null) && this.address.equals(var2.address)) {
- if (!(this.broadcast != null & var2.broadcast == null) && this.broadcast.equals(var2.broadcast)) {
- return this.maskLength == var2.maskLength;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
- }
-
- public int hashCode() {
- return this.address.hashCode() + (this.broadcast != null ? this.broadcast.hashCode() : 0) + this.maskLength;
- }
-
- public String toString() {
- return this.address + "/" + this.maskLength + " [" + this.broadcast + "]";
- }
- }
-