Beispiel #1
0
  /** @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;
  }
Beispiel #2
0
 /** @see prefuse.data.util.Index#getComparator() */
 public Comparator getComparator() {
   return m_index.comparator();
 }
Beispiel #3
0
 /** @see prefuse.data.util.Index#size() */
 public int size() {
   return m_index.size();
 }
Beispiel #4
0
 /** @see prefuse.data.util.Index#allRows(int) */
 public IntIterator allRows(int type) {
   boolean ascending = (type & Index.TYPE_ASCENDING) > 0;
   return m_index.valueIterator(ascending);
 }
Beispiel #5
0
 /** @see prefuse.data.util.Index#uniqueCount() */
 public int uniqueCount() {
   return m_index.getUniqueCount();
 }
Beispiel #6
0
 /** @see prefuse.data.util.Index#median() */
 public int median() {
   return m_index.getMedian();
 }
Beispiel #7
0
 /** @see prefuse.data.util.Index#maximum() */
 public int maximum() {
   return m_index.getMaximum();
 }
Beispiel #8
0
 /** @see prefuse.data.util.Index#minimum() */
 public int minimum() {
   return m_index.getMinimum();
 }