| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean equals(Object obj) |
| | | { |
| | | if (obj instanceof ChangeNumber) |
| | |
| | | * |
| | | * @return the string |
| | | */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return String.format("%016x%04x%08x", timeStamp, serverId, seqnum); |
| | |
| | | /** |
| | | * check if the current Object is strictly older than ChangeNumber |
| | | * given in parameter. |
| | | * @param CN the Changenumber to compare with |
| | | * @param CN the ChangeNumber to compare with |
| | | * @return true if strictly older, false if younger or same |
| | | */ |
| | | public Boolean older(ChangeNumber CN) |
| | | public boolean older(ChangeNumber CN) |
| | | { |
| | | return compare(this, CN) < 0; |
| | | } |
| | |
| | | /** |
| | | * check if the current Object is older than ChangeNumber |
| | | * given in parameter. |
| | | * @param CN the Changenumber to compare with |
| | | * @param CN the ChangeNumber to compare with |
| | | * @return true if older or equal, false if younger |
| | | */ |
| | | public Boolean olderOrEqual(ChangeNumber CN) |
| | | public boolean olderOrEqual(ChangeNumber CN) |
| | | { |
| | | return compare(this, CN) <= 0; |
| | | } |
| | | |
| | | /** |
| | | * Check if the current Object is newer than ChangeNumber. |
| | | * @param CN the Changenumber to compare with |
| | | * @param CN the ChangeNumber to compare with |
| | | * @return true if newer |
| | | */ |
| | | public boolean newerOrEquals(ChangeNumber CN) |
| | |
| | | |
| | | /** |
| | | * Check if the current Object is strictly newer than ChangeNumber. |
| | | * @param CN the Changenumber to compare with |
| | | * @param CN the ChangeNumber to compare with |
| | | * @return true if strictly newer |
| | | */ |
| | | public boolean newer(ChangeNumber CN) |
| | |
| | | * @return a negative integer, zero, or a positive integer as this object |
| | | * is less than, equal to, or greater than the specified object. |
| | | */ |
| | | @Override |
| | | public int compareTo(ChangeNumber cn) |
| | | { |
| | | return compare(this, cn); |