/** {@inheritDoc} */ @Override public int compareTo(CatchTable 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); }
/** * 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); }
CatchTable result = new CatchTable(resultSz); result.set(i, resultList.get(i)); result.setImmutable(); return result;
/** * Gets the size of the tries list, in entries. * * @return {@code >= 0;} the tries list size */ public int triesSize() { finishProcessingIfNecessary(); return table.size(); }
CatchTable result = new CatchTable(resultSz); result.set(i, resultList.get(i)); result.setImmutable(); return result;
/** * Gets the size of the tries list, in entries. * * @return {@code >= 0;} the tries list size */ public int triesSize() { finishProcessingIfNecessary(); return table.size(); }
/** {@inheritDoc} */ public int compareTo(CatchTable 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; }
CatchTable result = new CatchTable(resultSz); result.set(i, resultList.get(i)); 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); }
/** * 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); }
/** * Gets the size of the tries list, in entries. * * @return {@code >= 0;} the tries list size */ public int triesSize() { finishProcessingIfNecessary(); return table.size(); }
/** {@inheritDoc} */ @Override public int compareTo(CatchTable 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; }
CatchTable result = new CatchTable(resultSz); result.set(i, resultList.get(i)); 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); }
/** * 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); }
/** * Gets the size of the tries list, in entries. * * @return {@code >= 0;} the tries list size */ public int triesSize() { finishProcessingIfNecessary(); return table.size(); }
/** {@inheritDoc} */ public int compareTo(CatchTable 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; }
CatchTable result = new CatchTable(resultSz); result.set(i, resultList.get(i)); 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); }