Examples of Cursor


Examples of ae.java.awt.Cursor

        }
        return enabled;
    }

    public static Cursor getCursor_NoClientCode(Component c) {
        Cursor cursor = null;

        try {
            cursor = (Cursor) methodGetCursorNoClientCode.invoke(c, (Object[]) null);
        }
        catch (IllegalAccessException e)
View Full Code Here

Examples of android.database.Cursor

    return update(statement, args, argFieldTypes);
  }

  public <T> Object queryForOne(String statement, Object[] args, FieldType[] argFieldTypes,
      GenericRowMapper<T> rowMapper) throws SQLException {
    Cursor cursor = null;

    try {
      cursor = db.rawQuery(statement, toStrings(args));
      AndroidDatabaseResults results = new AndroidDatabaseResults(cursor);
      if (!results.next()) {
        return null;
      } else {
        T first = rowMapper.mapRow(results);
        if (results.next()) {
          return MORE_THAN_ONE;
        } else {
          return first;
        }
      }
    } catch (android.database.SQLException e) {
      throw SqlExceptionUtil.create("queryForOne from database failed: " + statement, e);
    } finally {
      if (cursor != null) {
        cursor.close();
      }
    }
  }
View Full Code Here

Examples of br.com.digilabs.jqplot.elements.Cursor

   *
   * @return the cursor
   */
  public Cursor cursorInstance() {
    if (cursor == null) {
      cursor = new Cursor();
    }
    return cursor;
  }
View Full Code Here

Examples of com.asakusafw.compiler.batch.ResourceRepository.Cursor

            ResourceRepository repo, JarOutputStream jar, Set<Location> saw,
            boolean allowFrameworkInfo) throws IOException {
        assert repo != null;
        assert jar != null;
        assert saw != null;
        Cursor cursor = repo.createCursor();
        try {
            while (cursor.next()) {
                Location location = cursor.getLocation();
                if (allowFrameworkInfo == false
                        && (FRAMEWORK_INFO.isPrefixOf(location) || MANIFEST_FILE.isPrefixOf(location))) {
                    LOG.debug("Skipped adding a framework info: {}", location);
                    continue;
                }
                if (saw.contains(location)) {
                    LOG.warn("{} is already added to JAR", location);
                    continue;
                }
                saw.add(location);
                addEntry(jar, cursor.openResource(), location);
            }
        } finally {
            cursor.close();
        }
    }
View Full Code Here

Examples of com.asakusafw.dmdl.source.DmdlSourceRepository.Cursor

                    return false;
                }
                Set<String> saw = new TreeSet<String>();
                try {
                    DmdlSourceRepository repo = (DmdlSourceRepository) target;
                    Cursor cursor = repo.createCursor();
                    try {
                        while (cursor.next()) {
                            String path = cursor.getIdentifier().getRawPath();
                            if (path.endsWith("/")) {
                                path = path.substring(0, path.length() - 1);
                            }
                            String file = path.substring(path.lastIndexOf('/') + 1);
                            saw.add(file);
                        }
                    } finally {
                        cursor.close();
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    return false;
                }
View Full Code Here

Examples of com.cloudera.flume.handlers.text.TailSource.Cursor

          return;
        }

        // Add a new file to the multi tail.
        LOG.info("added file " + f);
        Cursor c;
        if (startFromEnd && !dirChecked) {
          // init cursor positions on first dir check when startFromEnd is set
          // to true
          c = new Cursor(tail.sync, f, f.length(), f.length(), f.lastModified());
          try {
            c.initCursorPos();
          } catch (InterruptedException e) {
            LOG.error("Initializing of cursor failed", e);
            c.close();
            return;
          }
        } else {
          c = new Cursor(tail.sync, f);
        }

        curmap.put(f.getPath(), c);
        tail.addCursor(c);
        filesAdded.incrementAndGet();
      }

      @Override
      public void fileDeleted(File f) {
        LOG.debug("handling deletion of file " + f);
        String fileName = f.getPath();
        // we cannot just check here with f.isDirectory() because f was deleted
        // and f.isDirectory() will return false always
        DirWatcher watcher = subdirWatcherMap.remove(fileName);
        if (watcher != null) {
          LOG.info("removed dir " + f);
          LOG.info("stopping watcher for dir: " + f);
          // stop is not thread-safe, but since this watcher belongs only to
          // this current thread it is safe to call it
          watcher.stop();
          // calling check explicitly to notify about deleted subdirs,
          // so that subdirs watchers can be stopped
          watcher.check();
          subdirsDeleted.incrementAndGet();
          return;
        }

        Cursor c = curmap.remove(fileName);
        // this check may seem unneeded but there are cases which it handles,
        // e.g. if unwatched subdirectory was removed c is null.
        if (c != null) {
          LOG.info("removed file " + f);
          tail.removeCursor(c);
View Full Code Here

Examples of com.espertech.esper.epl.join.rep.Cursor

        Iterator<Cursor> it = repository.getCursors(fromStream);

        // Loop over all events for that stream
        for (;it.hasNext();)
        {
            Cursor cursor = it.next();
            EventBean lookupEvent = cursor.getTheEvent();
            int streamCount = 0;

            // For that event, lookup in all required streams
            while (streamCount < requiredSubStreams.length)
            {
View Full Code Here

Examples of com.foundationdb.qp.operator.Cursor

                    groupScan_Default(group),
                    n),
                tRowType,
                ordering,
                SortOption.PRESERVE_DUPLICATES);
        Cursor cursor = cursor(plan, queryContext, queryBindings);
        cursor.openTopLevel();
        while (cursor.next() != null) {
        }
        cursor.closeTopLevel();
        if (print) {
            System.out.println("---------------------------------------------------------------------");
            System.out.println(String.format("Sort %s on field %s", n, field == 0 ? "id" : "rand"));
            TapReport[] reports = Tap.getReport(OPERATOR_TAPS);
            for (TapReport report : reports) {
View Full Code Here

Examples of com.google.appengine.api.datastore.Cursor

            // activates the GaeCtx now that it is initialised
            gaeCtx.activate();
            // sets the current cursor (in stateful mode, cursor is always kept for further use)
            if(pag.isPaginating()){
              Cursor cursor = entities.getCursor();
              if(cursor!=null){
                gaeCtx.addCursor(cursor.toWebSafeString());
              }
            }else{
              Cursor cursor = entities.getCursor();
              if(cursor!=null){
                gaeCtx.addAndMoveCursor(entities.getCursor().toWebSafeString());
              }
              // keeps track of the offset anyway if not paginating
              gaeCtx.realOffset+=entities.size();
            }                     
           
            return new GaeSienaFutureListMapper<T>(
                this, entities, query, GaeSienaFutureListMapper.MapType.KEYS_ONLY);
          }
        case NORMAL:
        default:
          {
            PreparedQuery pq = prepare(query);
            if(!gaeCtx.useCursor){
              // then uses offset (in case of IN or != operators)
              //if(offset.isActive()){
              //  fetchOptions.offset(offset.offset);
              //}
              fetchOptions.offset(gaeCtx.realOffset);             
            }
            // we can't use real asynchronous function with cursors
            // so the page is extracted at once and wrapped into a SienaFuture
            QueryResultList<Entity> entities = pq.asQueryResultList(fetchOptions);
           
            // activates the GaeCtx now that it is initialised
            gaeCtx.activate();
            // sets the current cursor (in stateful mode, cursor is always kept for further use)
            //if(gaeCtx.useCursor){
            if(pag.isPaginating()){
              Cursor cursor = entities.getCursor();
              if(cursor!=null){
                gaeCtx.addCursor(cursor.toWebSafeString());
              }
            }else{
              Cursor cursor = entities.getCursor();
              if(cursor!=null){
                gaeCtx.addAndMoveCursor(entities.getCursor().toWebSafeString());
              }
              // keeps track of the offset anyway if not paginating
              gaeCtx.realOffset+=entities.size();
            }
            //}
           
            return new GaeSienaFutureListMapper<T>(this, entities, query);
          }
        }
       
      }else {
        switch(fetchType.fetchType){
        case KEYS_ONLY:
          {
            // we prepare the query each time
            PreparedQuery pq = prepareKeysOnly(query);
            QueryResultList<Entity> entities;
            if(!gaeCtx.useCursor){
              // then uses offset (in case of IN or != operators)
              //if(offset.isActive()){
              //  fetchOptions.offset(offset.offset);
              //}
              fetchOptions.offset(gaeCtx.realOffset);
              // we can't use real asynchronous function with cursors
              // so the page is extracted at once and wrapped into a SienaFuture
              entities = pq.asQueryResultList(fetchOptions);
            }else {
              // we can't use real asynchronous function with cursors
              // so the page is extracted at once and wrapped into a SienaFuture
              String cursor = gaeCtx.currentCursor();
              if(cursor!=null){
                entities = pq.asQueryResultList(
                  fetchOptions.startCursor(Cursor.fromWebSafeString(cursor)));
              }
              else {
                entities = pq.asQueryResultList(fetchOptions);
              }
            }
           
            // sets the current cursor (in stateful mode, cursor is always kept for further use)
            //if(gaeCtx.useCursor){
            if(pag.isPaginating()){
              Cursor cursor = entities.getCursor();
              if(cursor!=null){
                gaeCtx.addCursor(cursor.toWebSafeString());
              }
            }else{
              Cursor cursor = entities.getCursor();
              if(cursor!=null){
                gaeCtx.addAndMoveCursor(entities.getCursor().toWebSafeString());
              }
              // keeps track of the offset anyway if not paginating
              gaeCtx.realOffset+=entities.size();
            }
            //}
           
            return new GaeSienaFutureListMapper<T>(
                this, entities, query, GaeSienaFutureListMapper.MapType.KEYS_ONLY);
          }
        case NORMAL:
        default:
          {
            PreparedQuery pq = prepare(query);
            QueryResultList<Entity> entities;
            if(!gaeCtx.useCursor){
              // then uses offset (in case of IN or != operators)
              //if(offset.isActive()){
              //  fetchOptions.offset(offset.offset);
              //}
              fetchOptions.offset(gaeCtx.realOffset);
              // we can't use real asynchronous function with cursors
              // so the page is extracted at once and wrapped into a SienaFuture
              entities = pq.asQueryResultList(fetchOptions);
            }else {
              // we can't use real asynchronous function with cursors
              // so the page is extracted at once and wrapped into a SienaFuture
              String cursor = gaeCtx.currentCursor();
              if(cursor!=null){
                entities = pq.asQueryResultList(
                  fetchOptions.startCursor(Cursor.fromWebSafeString(gaeCtx.currentCursor())));
              }else {
                entities = pq.asQueryResultList(fetchOptions);
              }
            }
           
            // sets the current cursor (in stateful mode, cursor is always kept for further use)
            //if(gaeCtx.useCursor){
            if(pag.isPaginating()){
              Cursor cursor = entities.getCursor();
              if(cursor!=null){
                gaeCtx.addCursor(cursor.toWebSafeString());
              }
            }else{
              Cursor cursor = entities.getCursor();
              if(cursor!=null){
                gaeCtx.addAndMoveCursor(entities.getCursor().toWebSafeString());
              }
              // keeps track of the offset anyway
              gaeCtx.realOffset+=entities.size();
View Full Code Here

Examples of com.google.gwt.dom.client.Style.Cursor

  }

  @UiHandler(value = "cursorListBox")
  public void onCursorChange(ChangeEvent e) {
    Cursor c = Cursor.valueOf(cursorListBox.getValue(cursorListBox
        .getSelectedIndex()));
    getOptions().setCursor(c);

  }
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.