@Test public void testCompareToZdo() { ZigBeeEndpointAddress address1 = new ZigBeeEndpointAddress(25000); ZigBeeEndpointAddress address2 = new ZigBeeEndpointAddress(25000); assertEquals(0, address1.compareTo(address2)); ZigBeeEndpointAddress address3 = new ZigBeeEndpointAddress("25001"); assertEquals(-1, address1.compareTo(address3)); }
@Override public int compareTo(ZigBeeAddress that) { if (this == that) { return 0; } ZigBeeEndpointAddress thatAddr = (ZigBeeEndpointAddress) that; if (thatAddr.getAddress() == getAddress() && thatAddr.getEndpoint() == getEndpoint()) { return 0; } if (thatAddr.getAddress() == getAddress()) { return getEndpoint() - thatAddr.getEndpoint(); } return getAddress() - thatAddr.getAddress(); }
ZigBeeEndpointAddress extends ZigBeeAddress { @Override public int compareTo(ZigBeeAddress that) { if (this == that) { return 0; } ZigBeeEndpointAddress thatAddr = (ZigBeeEndpointAddress) that; if (thatAddr.getAddress() == getAddress() && thatAddr.getEndpoint() == getEndpoint()) { return 0; } if (thatAddr.getAddress() == getAddress()) { return getEndpoint() - thatAddr.getEndpoint(); } return getAddress() - thatAddr.getAddress(); } }
ZigBeeEndpointAddress extends ZigBeeAddress { @Override public int compareTo(ZigBeeAddress that) { if (this == that) { return 0; } ZigBeeEndpointAddress thatAddr = (ZigBeeEndpointAddress) that; if (thatAddr.getAddress() == getAddress() && thatAddr.getEndpoint() == getEndpoint()) { return 0; } if (thatAddr.getAddress() == getAddress()) { return getEndpoint() - thatAddr.getEndpoint(); } return getAddress() - thatAddr.getAddress(); } ZigBeeEndpointAddress(int address);  ZigBeeEndpointAddress(int address, int endpoint);  ZigBeeEndpointAddress(String address); }
ZigBeeEndpointAddress extends ZigBeeAddress { @Override public int compareTo(ZigBeeAddress that) { if (this == that) { return 0; } ZigBeeEndpointAddress thatAddr = (ZigBeeEndpointAddress) that; if (thatAddr.getAddress() == getAddress() && thatAddr.getEndpoint() == getEndpoint()) { return 0; } if (thatAddr.getAddress() == getAddress()) { return getEndpoint() - thatAddr.getEndpoint(); } return getAddress() - thatAddr.getAddress(); } ZigBeeEndpointAddress(int address);  ZigBeeEndpointAddress(int address, int endpoint);  ZigBeeEndpointAddress(String address); @Override int getAddress(); @Override void setAddress(final int address); @Override boolean isGroup(); int getEndpoint(); void setEndpoint(final int endpoint); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(ZigBeeAddress that); @Override String toString(); }
ZigBeeEndpointAddress extends ZigBeeAddress { @Override public int compareTo(ZigBeeAddress that) { if (this == that) { return 0; } ZigBeeEndpointAddress thatAddr = (ZigBeeEndpointAddress) that; if (thatAddr.getAddress() == getAddress() && thatAddr.getEndpoint() == getEndpoint()) { return 0; } if (thatAddr.getAddress() == getAddress()) { return getEndpoint() - thatAddr.getEndpoint(); } return getAddress() - thatAddr.getAddress(); } ZigBeeEndpointAddress(int address);  ZigBeeEndpointAddress(int address, int endpoint);  ZigBeeEndpointAddress(String address); @Override int getAddress(); @Override void setAddress(final int address); @Override boolean isGroup(); int getEndpoint(); void setEndpoint(final int endpoint); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(ZigBeeAddress that); @Override String toString();  }