package lava.net.mmp; import lava.net.common.UNA; /** * **/ class MMPConnection { /** * Free available index. * For example for preventing denial of service. * Useable - for example - as timestamp buffer. **/ public long index = 0; /** * **/ protected UNA remote = null; /** * **/ protected UNA local = null; /** * **/ private int hashCode = -1; /** * **/ protected MMPConnection(UNA remote, UNA local) { this.remote = remote; this.local = local; } /** * **/ public int hashCode() { if(hashCode == -1) { hashCode = (remote == null ? 0 : remote.hashCode()) ^ // (local == null ? 0 : local.hashCode()); } return hashCode; } /** * **/ public boolean equals(Object obj) { return obj instanceof MMPConnection && // obj.hashCode() == hashCode() && // (remote == null ? ((MMPConnection)obj).remote == null : // remote.equals(((MMPConnection)obj).remote)) && // (local == null ? ((MMPConnection)obj).local == null : // local.equals(((MMPConnection)obj).local)); } }