Package prefuse.util.collections

Examples of prefuse.util.collections.IntIterator


       
        // attempt to generate an optimized query plan
        Iterator iter = null;
        if ( ts instanceof Table ) {
            Table t = (Table)ts;
            IntIterator ii = getOptimizedIterator(t,p);
            if ( ii != null )
                iter = t.tuples(ii);
        }
       
        // optimization fails, scan the entire table
View Full Code Here


     * @param p the filter predicate
     * @return a filtered iterator over the table rows
     */
    public static IntIterator rows(Table t, Predicate p) {
        // attempt to generate an optimized query plan
        IntIterator iter = null;
        iter = getOptimizedIterator(t, p);
       
        // optimization fails, scan the entire table
        if ( iter == null ) {
            iter = new FilterRowIterator(t.rows(), t, p);
View Full Code Here

   
    protected static IntIterator getAndIterator(Table t, AndPredicate ap) {
        // possible TODO: add scoring to select best optimized iterator
        // for now just work from the end backwards and take the first
        // optimized iterator we find
        IntIterator rows = null;
        Predicate clause = null;
        for ( int i=ap.size(); --i >= 0; ) {
            clause = ap.get(i);
            if ( (rows=getOptimizedIterator(t,clause)) != null )
                break;
View Full Code Here

            m_esch.addColumn(TRGID, String.class);
        }
       
        public void endDocument() throws SAXException {
            // time to actually set up the edges
            IntIterator rows = m_edges.rows();
            while (rows.hasNext()) {
                int r = rows.nextInt();

                String src = m_edges.getString(r, SRCID);
                if (!m_nodeMap.containsKey(src)) {
                    throw new SAXException(
                        "Tried to create edge with source node id=" + src
View Full Code Here

        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();
View Full Code Here

     * @param t the input tuple
     * @return an iterator over all AggregateItems that contain the input Tuple
     */
    public Iterator getAggregates(Tuple t) {
        int hash = getHashCode(t);
        IntIterator iit = m_aggregated.getIndex(MEMBER_HASH).rows(hash);
        HashSet set = new HashSet();
        while ( iit.hasNext() ) {
            int r = iit.nextInt();
            set.add(getTuple(m_aggregated.getInt(r, AGGREGATE)));
        }
        return set.iterator();
    }
View Full Code Here

        for ( i=i1; iter.hasNext() && i <= i2; ++i ) {
            assertEquals(((Integer)iter.next()).intValue(), sort[i]);
        }
        assertTrue(!iter.hasNext() && i == i2+1);
       
        IntIterator liter = map.valueRangeIterator(loKey, true, hiKey, false);
        for ( i=i1; liter.hasNext() && i <= i2; ++i ) {
            assertEquals(liter.nextInt(), sort[i]);
        }
        assertTrue(!iter.hasNext() && i == i2+1);
    }
View Full Code Here

TOP

Related Classes of prefuse.util.collections.IntIterator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.