Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {---------------- ! -----------------------------}
- public boolean isBetween(Key fromKey, Key toKey) {
- if (fromKey.compareTo(toKey) < 0) {
- if (this.compareTo(fromKey) > 0 && this.compareTo(toKey) < 0) {
- return true;
- }
- } else if (fromKey.compareTo(toKey) > 0) {
- if (this.compareTo(toKey) > 0 || this.compareTo(fromKey) > 0) {
- return true;
- }
- }
- return false;
- }
- {--------------- 2 ------------------------------>
- public boolean isBetween(Key fromKey, Key toKey) {
- if (fromKey.compareTo(toKey) < 0) {
- if (this.compareTo(fromKey) > 0 && this.compareTo(toKey) < 0) {
- return true;
- }
- } else if (fromKey.compareTo(toKey) > 0) {
- if (this.compareTo(toKey) < 0 || this.compareTo(fromKey) > 0) {
- return true;
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement