/** * Returns the number of columns in the table. * * @return The column count. */ public int getColumnCount() { int last = lastCategoryIndex(); if (last == -1) { return 0; } else { return Math.max(last - this.firstCategoryIndex + 1, 0); } }
/** * Returns the number of columns in the table. * * @return The column count. */ @Override public int getColumnCount() { int last = lastCategoryIndex(); if (last == -1) { return 0; } else { return Math.max(last - this.firstCategoryIndex + 1, 0); } }
/** * Returns the index for the specified column key. * * @param key the key. * * @return The column index, or -1 if the key is not recognised. */ public int getColumnIndex(Comparable key) { int index = this.underlying.getColumnIndex(key); if (index >= this.firstCategoryIndex && index <= lastCategoryIndex()) { return index - this.firstCategoryIndex; } return -1; // we didn't find the key }
/** * Returns the index for the specified column key. * * @param key the key. * * @return The column index, or -1 if the key is not recognised. */ @Override public int getColumnIndex(Comparable key) { int index = this.underlying.getColumnIndex(key); if (index >= this.firstCategoryIndex && index <= lastCategoryIndex()) { return index - this.firstCategoryIndex; } return -1; // we didn't find the key }
/** * Returns the column keys. * * @return The keys. * * @see #getColumnKey(int) */ public List getColumnKeys() { List result = new java.util.ArrayList(); int last = lastCategoryIndex(); for (int i = this.firstCategoryIndex; i <= last; i++) { result.add(this.underlying.getColumnKey(i)); } return Collections.unmodifiableList(result); }
/** * Returns the column keys. * * @return The keys. * * @see #getColumnKey(int) */ @Override public List getColumnKeys() { List result = new java.util.ArrayList(); int last = lastCategoryIndex(); for (int i = this.firstCategoryIndex; i <= last; i++) { result.add(this.underlying.getColumnKey(i)); } return Collections.unmodifiableList(result); }