/** * Get the hash code for this instance. It will be equal to the hash code of the {@code InetAddress} object herein. * * @return the hash code */ public int hashCode() { return inetAddress.hashCode(); }
@Override public int hashCode() { if (this.inetAddr == null) { return this.udpPort; } return this.udpPort + inetAddr.hashCode(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((inetAddress == null) ? 0 : inetAddress.hashCode()); result = prime * result + port; return result; }
public int hashCode() { return ip_addr != null ? ip_addr.hashCode() + port : port; }
@Override public int hashCode() { return baseAddress.hashCode(); }
@Override public int hashCode() { int result = ip != null ? ip.hashCode() : 0; result = 31 * result + (uri != null ? uri.hashCode() : 0); return result; }
@Override public int hashCode() { int result = peerId.hashCode(); result = 31 * result + address.hashCode(); result = 31 * result + port; return result; } }
@Override public final int hashCode() { if (addr == null) { return hostname.hashCode() + port; } return addr.hashCode() + port; }
@Override public int hashCode() { int result = address.hashCode(); result = 31 * result + port; result = 31 * result + (hardwareAddress != null ? Arrays.hashCode(hardwareAddress) : 0); return result; } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((directory == null) ? 0 : directory.hashCode()); result = prime * result + ((diskStoreID == null) ? 0 : diskStoreID.hashCode()); result = prime * result + ((host == null) ? 0 : host.hashCode()); result = prime * result + (int) (revokedTime ^ (revokedTime >>> 32)); return result; }
/** * Returns a hash code for the object. This method is supported for the benefit of hashtables such * as those provided by java.util.Hashtable. * * @return the integer 0 if description is null; otherwise a unique integer. */ @Override public int hashCode() { int result = 17; final int mult = 37; result = mult * result + (this.host == null ? 0 : this.host.hashCode()); result = mult * result + this.port; result = mult * result + (this.bindAddress == null ? 0 : this.bindAddress.hashCode()); return result; }
/** * implements the java.lang.Comparable interface * @see java.lang.Comparable * @param o - the Object to be compared * @return a negative integer, zero, or a positive integer as this object is less than, * equal to, or greater than the specified object. * @exception java.lang.ClassCastException - if the specified object's type prevents it * from being compared to this Object. */ public int compareTo(Address o) { int h1, h2, rc; // added Nov 7 2005, makes sense with canonical addresses if(this == o) return 0; if(!(o instanceof IpAddress)) throw new ClassCastException("comparison between different classes: the other object is " + (o != null? o.getClass() : o)); IpAddress other = (IpAddress) o; if(ip_addr == null) if (other.ip_addr == null) return port < other.port ? -1 : (port > other.port ? 1 : 0); else return -1; h1=ip_addr.hashCode(); h2=other.ip_addr.hashCode(); rc=h1 < h2? -1 : h1 > h2? 1 : 0; return rc != 0 ? rc : port < other.port ? -1 : (port > other.port ? 1 : 0); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((diskStoreId == null) ? 0 : diskStoreId.hashCode()); result = prime * result + ((directory == null) ? 0 : directory.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((host == null) ? 0 : host.hashCode()); result = prime * result + (int) (timeStamp ^ (timeStamp >>> 32)); result = prime * result + version; return result; }
public String getLocalIpAddress() { try { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) { InetAddress inetAddress = enumIpAddr.nextElement(); if (!inetAddress.isLoopbackAddress()) { String ip = Formatter.formatIpAddress(inetAddress.hashCode()); Log.i(TAG, "***** IP="+ ip); return ip; } } } } catch (SocketException ex) { Log.e(TAG, ex.toString()); } return null; }
@Override public int hashCode() { int result = 0; result = result + netMbr.getInetAddress().hashCode(); result = result + getPort(); return result; }
public String getClassKey(final CrawlURI curi) { CrawlHost host; host = serverCache.getHostFor(curi.getUURI()); if(host == null) { return "NO-HOST"; } else if(host.getIP() == null) { return "NO-IP-".concat(Long.toString(Math.abs((long) host .getHostName().hashCode()) & DEFAULT_NOIP_BITMASK)); } else { return Long.toString(Math.abs((long) host.getIP().hashCode()) % DEFAULT_QUEUES_HOSTS_MODULO); } }
if (localAddress instanceof InetSocketAddress) { final InetSocketAddress address = (InetSocketAddress) localAddress; hash = address.getAddress().hashCode() * 23 + address.getPort(); } else if (localAddress instanceof LocalSocketAddress) { hash = ((LocalSocketAddress) localAddress).getName().hashCode(); if (remoteAddress instanceof InetSocketAddress) { final InetSocketAddress address = (InetSocketAddress) remoteAddress; hash = (address.getAddress().hashCode() * 23 + address.getPort()) * 23 + hash; } else if (remoteAddress instanceof LocalSocketAddress) { hash = ((LocalSocketAddress) remoteAddress).getName().hashCode() * 23 + hash;
/** * Generates a hash code for this route. * * @return the hash code */ @Override public final int hashCode() { int hc = this.targetHost.hashCode(); if (this.localAddress != null) hc ^= localAddress.hashCode(); if (this.proxyChain != null) { hc ^= proxyChain.length; for (HttpHost aProxyChain : proxyChain) hc ^= aProxyChain.hashCode(); } if (this.secure) hc ^= 0x11111111; hc ^= this.tunnelled.hashCode(); hc ^= this.layered.hashCode(); return hc; }
/** * Generates a hash code for this tracked route. * Route trackers are modifiable and should therefore not be used * as lookup keys. Use {@link #toRoute toRoute} to obtain an * unmodifiable representation of the tracked route. * * @return the hash code */ @Override public final int hashCode() { int hc = this.targetHost.hashCode(); if (this.localAddress != null) hc ^= localAddress.hashCode(); if (this.proxyChain != null) { hc ^= proxyChain.length; for (int i=0; i<proxyChain.length; i++) hc ^= proxyChain[i].hashCode(); } if (this.connected) hc ^= 0x11111111; if (this.secure) hc ^= 0x22222222; hc ^= this.tunnelled.hashCode(); hc ^= this.layered.hashCode(); return hc; }