/** @see prefuse.data.util.Index#index() */ public void index() { m_index.clear(); // iterate over all valid values, adding them to the index int idx = getColumnIndex(); m_colidx = idx; IntIterator rows = m_rows.rows(); if (m_index instanceof IntIntSortedMap) { IntIntSortedMap map = (IntIntSortedMap) m_index; while (rows.hasNext()) { int r = rows.nextInt(); map.put(m_col.getInt(m_table.getColumnRow(r, idx)), r); } } else if (m_index instanceof LongIntSortedMap) { LongIntSortedMap map = (LongIntSortedMap) m_index; while (rows.hasNext()) { int r = rows.nextInt(); map.put(m_col.getLong(m_table.getColumnRow(r, idx)), r); } } else if (m_index instanceof FloatIntSortedMap) { FloatIntSortedMap map = (FloatIntSortedMap) m_index; while (rows.hasNext()) { int r = rows.nextInt(); map.put(m_col.getFloat(m_table.getColumnRow(r, idx)), r); } } else if (m_index instanceof DoubleIntSortedMap) { DoubleIntSortedMap map = (DoubleIntSortedMap) m_index; while (rows.hasNext()) { int r = rows.nextInt(); map.put(m_col.getDouble(m_table.getColumnRow(r, idx)), r); } } else if (m_index instanceof BooleanIntSortedMap) { BooleanIntSortedMap map = (BooleanIntSortedMap) m_index; while (rows.hasNext()) { int r = rows.nextInt(); map.put(m_col.getBoolean(m_table.getColumnRow(r, idx)), r); } } else if (m_index instanceof ObjectIntSortedMap) { ObjectIntSortedMap map = (ObjectIntSortedMap) m_index; while (rows.hasNext()) { int r = rows.nextInt(); map.put(m_col.get(m_table.getColumnRow(r, idx)), r); } } else { throw new IllegalStateException(); } m_reindex = false; }
/** @see prefuse.data.util.Index#getComparator() */ public Comparator getComparator() { return m_index.comparator(); }
/** @see prefuse.data.util.Index#size() */ public int size() { return m_index.size(); }
/** @see prefuse.data.util.Index#allRows(int) */ public IntIterator allRows(int type) { boolean ascending = (type & Index.TYPE_ASCENDING) > 0; return m_index.valueIterator(ascending); }
/** @see prefuse.data.util.Index#uniqueCount() */ public int uniqueCount() { return m_index.getUniqueCount(); }
/** @see prefuse.data.util.Index#median() */ public int median() { return m_index.getMedian(); }
/** @see prefuse.data.util.Index#maximum() */ public int maximum() { return m_index.getMaximum(); }
/** @see prefuse.data.util.Index#minimum() */ public int minimum() { return m_index.getMinimum(); }