/** {@inheritDoc} */ public int compareTo(Entry other) { if (start < other.start) { return -1; } else if (start > other.start) { return 1; } if (end < other.end) { return -1; } else if (end > other.end) { return 1; } return handlers.compareTo(other.handlers); }
/** {@inheritDoc} */ public int compareTo(CatchHandlerList other) { if (this == other) { // Easy out. return 0; } int thisSize = size(); int otherSize = other.size(); int checkSize = Math.min(thisSize, otherSize); for (int i = 0; i < checkSize; i++) { Entry thisEntry = get(i); Entry otherEntry = other.get(i); int compare = thisEntry.compareTo(otherEntry); if (compare != 0) { return compare; } } if (thisSize < otherSize) { return -1; } else if (thisSize > otherSize) { return 1; } return 0; }
/** * Gets the element at the given index. It is an error to call * this with the index for an element which was never set; if you * do that, this will throw {@code NullPointerException}. * * @param n {@code >= 0, < size();} which index * @return {@code non-null;} element at that index */ public Entry get(int n) { return (Entry) get0(n); }
int size = size(); Entry entry = get(i); if ((i == (size - 1)) && catchesAll()) { sb.append("<any>"); } else {
CatchHandlerList result = new CatchHandlerList(catchSize); result.set(i, oneType, oneHandler.getAddress()); result.setImmutable(); return result;
/** * Sets the entry at the given index. * * @param n {@code >= 0, < size();} which index * @param entry {@code non-null;} the entry to set at {@code n} */ public void set(int n, Entry entry) { set0(n, entry); }
/** {@inheritDoc} */ @Override public int hashCode() { int hash = (start * 31) + end; hash = (hash * 31) + handlers.hashCode(); return hash; }
/** * Constructs an instance. * * @param start {@code >= 0;} start address * @param end {@code > start;} end address (exclusive) * @param handlers {@code non-null;} list of catch handlers */ public Entry(int start, int end, CatchHandlerList handlers) { if (start < 0) { throw new IllegalArgumentException("start < 0"); } if (end <= start) { throw new IllegalArgumentException("end <= start"); } if (handlers.isMutable()) { throw new IllegalArgumentException("handlers.isMutable()"); } this.start = start; this.end = end; this.handlers = handlers; }
int size = size(); Entry entry = get(i); if ((i == (size - 1)) && catchesAll()) { sb.append("<any>"); } else {
CatchHandlerList result = new CatchHandlerList(catchSize); result.set(i, oneType, oneHandler.getAddress()); result.setImmutable(); return result;
/** * Sets the entry at the given index. * * @param n {@code >= 0, < size();} which index * @param entry {@code non-null;} the entry to set at {@code n} */ public void set(int n, Entry entry) { set0(n, entry); }
/** {@inheritDoc} */ @Override public int hashCode() { int hash = (start * 31) + end; hash = (hash * 31) + handlers.hashCode(); return hash; }
/** * Constructs an instance. * * @param start {@code >= 0;} start address * @param end {@code > start;} end address (exclusive) * @param handlers {@code non-null;} list of catch handlers */ public Entry(int start, int end, CatchHandlerList handlers) { if (start < 0) { throw new IllegalArgumentException("start < 0"); } if (end <= start) { throw new IllegalArgumentException("end <= start"); } if (handlers.isMutable()) { throw new IllegalArgumentException("handlers.isMutable()"); } this.start = start; this.end = end; this.handlers = handlers; }
int size = size(); Entry entry = get(i); if ((i == (size - 1)) && catchesAll()) { sb.append("<any>"); } else {
/** {@inheritDoc} */ public int compareTo(CatchHandlerList other) { if (this == other) { // Easy out. return 0; } int thisSize = size(); int otherSize = other.size(); int checkSize = Math.min(thisSize, otherSize); for (int i = 0; i < checkSize; i++) { Entry thisEntry = get(i); Entry otherEntry = other.get(i); int compare = thisEntry.compareTo(otherEntry); if (compare != 0) { return compare; } } if (thisSize < otherSize) { return -1; } else if (thisSize > otherSize) { return 1; } return 0; }
CatchHandlerList result = new CatchHandlerList(catchSize); result.set(i, oneType, oneHandler.getAddress()); result.setImmutable(); return result;
/** * Sets the entry at the given index. * * @param n {@code >= 0, < size();} which index * @param entry {@code non-null;} the entry to set at {@code n} */ public void set(int n, Entry entry) { set0(n, entry); }