home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / net / InterfaceAddress.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.1 KB  |  48 lines

  1. package java.net;
  2.  
  3. public class InterfaceAddress {
  4.    private InetAddress address = null;
  5.    private Inet4Address broadcast = null;
  6.    private short maskLength = 0;
  7.  
  8.    InterfaceAddress() {
  9.    }
  10.  
  11.    public InetAddress getAddress() {
  12.       return this.address;
  13.    }
  14.  
  15.    public InetAddress getBroadcast() {
  16.       return this.broadcast;
  17.    }
  18.  
  19.    public short getNetworkPrefixLength() {
  20.       return this.maskLength;
  21.    }
  22.  
  23.    public boolean equals(Object var1) {
  24.       if (!(var1 instanceof InterfaceAddress)) {
  25.          return false;
  26.       } else {
  27.          InterfaceAddress var2 = (InterfaceAddress)var1;
  28.          if (!(this.address != null & var2.address == null) && this.address.equals(var2.address)) {
  29.             if (!(this.broadcast != null & var2.broadcast == null) && this.broadcast.equals(var2.broadcast)) {
  30.                return this.maskLength == var2.maskLength;
  31.             } else {
  32.                return false;
  33.             }
  34.          } else {
  35.             return false;
  36.          }
  37.       }
  38.    }
  39.  
  40.    public int hashCode() {
  41.       return this.address.hashCode() + (this.broadcast != null ? this.broadcast.hashCode() : 0) + this.maskLength;
  42.    }
  43.  
  44.    public String toString() {
  45.       return this.address + "/" + this.maskLength + " [" + this.broadcast + "]";
  46.    }
  47. }
  48.