Examples of moveToFirst()


Examples of android.database.Cursor.moveToFirst()

     * Store highest image id from image table
     */
    private void setMaxIdFromDatabase() {
        String columns[] = new String[]{Media._ID, Media.DISPLAY_NAME, Media.MINI_THUMB_MAGIC};
        Cursor cursor = managedQuery( Media.EXTERNAL_CONTENT_URI, columns, null, null, Media._ID + " DESC" );
        maxId = cursor.moveToFirst() ? cursor.getInt( cursor.getColumnIndex( Media._ID ) ) : -1;
    }

    /**
     * Set highest image id
     *
 
View Full Code Here

Examples of android.database.Cursor.moveToFirst()

    public int getId() {
        String[] columns = new String[]{Media._ID, Media.ORIENTATION};
        Cursor cursor = application.managedQuery( Media.EXTERNAL_CONTENT_URI, columns, null, null, Media._ID + " DESC" );

        // check if table has any rows at all
        if( !cursor.moveToFirst() ) {
            return -1;
        }

        // get latest id from db and stored id in application
        latestId = cursor.getInt( cursor.getColumnIndex( Media._ID ) );
View Full Code Here

Examples of android.database.Cursor.moveToFirst()

            // get latest image from table
            Uri image = ContentUris.withAppendedId( Media.EXTERNAL_CONTENT_URI, latestId );
            Cursor cursor = application.managedQuery( image, columns, null, null, null );

            // check if cursus has rows, if not break and exit loop
            if( cursor.moveToFirst() ) {
                // get thumbnail field
                String imageThumb = cursor.getString( cursor.getColumnIndex( Media.MINI_THUMB_MAGIC ) );

                // if thumbnail field is not null it means image is written to sdcard
                // create new image item and break loop otherwise restart loop to check again
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

    // /////////////////////////////////////////////////////////////////////////
    // Use an iterator to move forwards and backwards and make sure the
    // sequence
    // remains constant.
    it = setIndex.iterator();
    it.moveToFirst(); // This is redundant.
    current = 1;
    // System.out.println("Codes: " + v);
    while (current < (v.size() - 1)) {
      it.moveToNext();
      assertTrue(it.isValid());
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

    // }

    assertTrue(sortedIndex.size() == 100);
    v = new IntVector();
    it = sortedIndex.iterator();
    it.moveToFirst();
    b = null;
    while (it.isValid()) {
      a = (AnnotationFS) it.get();
      // System.out.println(a);
      assertTrue(a != null);
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

    assertTrue(sortedIndex.size() == v.size());

    // Test moveTo()
    ArrayList list = new ArrayList();
    it = this.cas.getAnnotationIndex().iterator();
    for (it.moveToFirst(); it.isValid(); it.moveToNext()) {
      list.add(it.get());
    }
    // AnnotationFS an;
    for (int i = 0; i < list.size(); i++) {
      // System.out.println("Iteration: " + i);
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

      list.add(it.get());
    }
    // AnnotationFS an;
    for (int i = 0; i < list.size(); i++) {
      // System.out.println("Iteration: " + i);
      it.moveToFirst();
      it.moveTo((FeatureStructure) list.get(i));
      assertTrue(((AnnotationFS) it.get()).getBegin() == ((AnnotationFS) list.get(i)).getBegin());
      assertTrue(((AnnotationFS) it.get()).getEnd() == ((AnnotationFS) list.get(i)).getEnd());
    }
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

    // /////////////////////////////////////////////////////////////////////////
    // Use an iterator to move forwards and backwards and make sure the
    // sequence
    // remains constant.
    it = sortedIndex.iterator();
    it.moveToFirst(); // This is redundant.
    current = 1;
    // System.out.println("Codes: " + v);
    while (current < (v.size() - 1)) {
      it.moveToNext();
      assertTrue(it.isValid());
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

    // /////////////////////////////////////////////////////////////////////////
    // Use an iterator to move forwards and backwards and make sure the
    // sequence
    // remains constant.
    it = bagIndex.iterator();
    it.moveToFirst(); // This is redundant.
    current = 1;
    // System.out.println("Codes: " + v);
    while (current < (v.size() - 1)) {
      it.moveToNext();
      assertTrue(it.isValid());
View Full Code Here

Examples of org.apache.uima.cas.FSIterator.moveToFirst()

    // Test iterator copy.
    FSIterator source, copy;
    source = this.cas.getAnnotationIndex().iterator();
    // Count items.
    int count = 0;
    for (source.moveToFirst(); source.isValid(); source.moveToNext()) {
      ++count;
    }

    final int max = count;
    count = 0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.