Package prefuse.data

Examples of prefuse.data.Tuple


     */
    public Object next() {
        if ( !hasNext() ) {
            throw new NoSuchElementException("No more elements");
        }
        Tuple retval = next;
        next = advance();
        return retval;
    }
View Full Code Here


   
    /**
     * @see java.util.Iterator#next()
     */
    public Object next() {       
        Tuple t = (Tuple)m_queue.removeFirst();

        switch ( m_traversal ) {
       
        case Constants.NODE_TRAVERSAL:
        case Constants.NODE_AND_EDGE_TRAVERSAL:
View Full Code Here

        m_tuples.clear();
        m_cmp = c;
       
        // populate tuple list
        while ( iter.hasNext() ) {
            Tuple t = (Tuple)iter.next();
            m_tuples.add(t);
        }
        // sort tuple list
        Collections.sort(m_tuples, m_cmp);
        // create sorted iterator
View Full Code Here

        m_asynch = false;
       
        String loc = null;
        while ( iter.hasNext() && imageCache.size() <= m_imageCacheSize ) {
            // get the string describing the image location
            Tuple t = (Tuple)iter.next();
            loc = t.getString(field);
            if ( loc != null ) {
                getImage(loc);
            }
        }
        m_asynch = synch;
View Full Code Here

        }
        public boolean hasNext() {
            return m_next != null;
        }
        public Object next() {
            Tuple retval = m_next;
            advance();
            return retval;
        }
View Full Code Here

            return retval;
        }
        private void advance() {
            while ( m_rows.hasNext() ) {
                int ar = m_rows.nextInt();
                Tuple t = (Tuple)m_aggregated.get(ar, MEMBER);
                if ( t.isValid() ) {
                    m_next = t;
                    return;
                } else {
                    m_aggregated.removeRow(ar);
                }
View Full Code Here

            if ( TestConfig.verbose() )
                System.err.println(tpls[i]);
        }
        Comparator cmp = DefaultLiteralComparator.getInstance();
        for ( int i=0; i<tpls.length-1; ++i ) {
            Tuple t1 = tpls[i], t2 = tpls[i+1];
            int c = cmp.compare(t1.get(h1), t2.get(h1));
            assertTrue(c<=0);
            if ( c == 0 ) {
                c = cmp.compare(t1.get(h2), t2.get(h2));
                assertTrue(c>=0);
            }
               
        }
    }
View Full Code Here

       
        m_lucene.setReadMode(true);
        try {
            Hits hits = m_lucene.search(query);
            for ( int i=0; i < hits.length(); i++ ) {
                Tuple t = getMatchingTuple(hits.doc(i));
                addInternal(t);
            }
            Tuple[] add = getTupleCount() > 0 ? toArray() : null;
            fireTupleEvent(add, rem);
        } catch (ParseException e) {
View Full Code Here

     * @throws ClassCastException is a non-Tuple instance is
     * encountered in the iteration.
     */
    public void index(Iterator tuples, String field) {
        while ( tuples.hasNext() ) {
            Tuple t = (Tuple)tuples.next();
            index(t, field);
        }
    }
View Full Code Here

            String field = (String)fields.next();
            TupleSet ts = (TupleSet)m_source.get(field);
           
            Iterator tuples = ts.tuples();
            while ( tuples.hasNext() ) {
                Tuple t = (Tuple)tuples.next();
                String text = t.getString(field);
                if ( !m_caseSensitive )
                    text = text.toLowerCase();
               
                if ( pattern.matcher(text).matches() )
                    addInternal(t);
View Full Code Here

TOP

Related Classes of prefuse.data.Tuple

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.