Examples of Statement


Examples of com.google.api.ads.dfp.jaxws.v201311.Statement

   * builder.
   *
   * @return the {@link Statement}
   */
  public Statement toStatement() {
    Statement statement = new Statement();
    statement.setQuery(queryBuilder.buildQuery());
    statement.getValues().addAll(
        Maps.toList(queryBuilder.getBindVariableMap(), StringValueMapEntry.class));
    return statement;
  }
View Full Code Here

Examples of com.google.api.ads.dfp.v201208.Statement

      UserTeamAssociationServiceInterface userTeamAssociationService =
          user.getService(DfpService.V201208.USER_TEAM_ASSOCIATION_SERVICE);

      // Set defaults for page and filterStatement.
      UserTeamAssociationPage page = new UserTeamAssociationPage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all user team associations.
        filterStatement.setQuery("LIMIT 500 OFFSET " + offset);

        // Get user team associations by statement.
        page = userTeamAssociationService.getUserTeamAssociationsByStatement(filterStatement);

        if (page.getResults() != null) {
View Full Code Here

Examples of com.google.api.ads.dfp.v201211.Statement

      // Get content browse custom targeting key ID.
      long contentBrowseCustomTargetingKeyId =
          networkService.getCurrentNetwork().getContentBrowseCustomTargetingKeyId();

      // Create a statement to select the categories matching the name comedy.
      Statement categoryFilterStatement = new StatementBuilder(
          "WHERE customTargetingKeyId = :contentBrowseCustomTargetingKeyId " +
          " and name = :category LIMIT 1")
          .putValue("contentBrowseCustomTargetingKeyId", contentBrowseCustomTargetingKeyId)
          .putValue("category", "comedy").toStatement();

      // Get categories matching the filter statement.
      CustomTargetingValuePage customTargetingValuePage =
          customTargetingService.getCustomTargetingValuesByStatement(categoryFilterStatement);

      // Get the custom targeting value ID for the comedy category.
      long categoryCustomTargetingValueId = customTargetingValuePage.getResults()[0].getId();

      // Set defaults for page and filterStatement.
      ContentPage page = new ContentPage();
      Statement filterStatement = new Statement();
      int offset = 0;

      do {
        // Create a statement to get all active content.
        filterStatement.setQuery("WHERE status = 'ACTIVE' LIMIT 500 OFFSET " + offset);

        // Get content by statement.
        page = contentService.getContentByStatementAndCustomTargetingValue(filterStatement,
            categoryCustomTargetingValueId);
View Full Code Here

Examples of com.google.api.ads.dfp.v201302.Statement

   * builder.
   *
   * @return the {@link Statement}
   */
  public Statement toStatement() {
    return new Statement(query,
        MapUtils.toArray(valueMap, new String_ValueMapEntry[] {}));
  }
View Full Code Here

Examples of com.google.api.ads.dfp.v201306.Statement

   * builder.
   *
   * @return the {@link Statement}
   */
  public Statement toStatement() {
    return new Statement(query,
        MapUtils.toArray(valueMap, new String_ValueMapEntry[] {}));
  }
View Full Code Here

Examples of com.google.api.ads.dfp.v201308.Statement

      // Get InventoryService.
      InventoryServiceInterface inventoryService =
          user.getService(DfpService.V201308.INVENTORY_SERVICE);

      // Create statement object to only select web ad unit sizes.
      Statement filterStatement = new StatementBuilder("WHERE targetPlatform = :targetPlatform")
          .putValue("targetPlatform", TargetPlatform.WEB.toString()).toStatement();

      // Get all ad unit sizes.
      AdUnitSize[] adUnitSizes = inventoryService.getAdUnitSizesByStatement(filterStatement);
View Full Code Here

Examples of com.google.api.ads.dfp.v201311.Statement

      // Create statement to select only active custom fields that apply to
      // line items.
      String statementText =
          "WHERE entityType = :entityType and isActive = :isActive LIMIT 500";
      Statement filterStatement =
          new StatementBuilder(statementText)
              .putValue("entityType", CustomFieldEntityType.LINE_ITEM.toString())
              .putValue("isActive", true)
              .toStatement();

      // Set defaults for page and offset.
      CustomFieldPage page = new CustomFieldPage();
      int offset = 0;
      int i = 0;
      List<Long> customFieldIds = new ArrayList<Long>();

      do {
        // Create a statement to page through custom fields.
        filterStatement.setQuery(statementText + " OFFSET " + offset);

        // Get custom fields by statement.
        page = customFieldService.getCustomFieldsByStatement(filterStatement);

        if (page.getResults() != null) {
          for (CustomField customField : page.getResults()) {
            System.out.println(i + ") Custom field with ID \""
                + customField.getId() + "\" and name \"" + customField.getName()
                + "\" will be deactivated.");
            customFieldIds.add(customField.getId());
            i++;
          }
        }

        offset += 500;
      } while (offset < page.getTotalResultSetSize());

      System.out.println("Number of custom fields to be deactivated: " + customFieldIds.size());

      if (customFieldIds.size() > 0) {
        // Modify statement for action.
        filterStatement.setQuery("WHERE id IN (" + StringUtils.join(customFieldIds, ",") + ")");

        // Create action.
        DeactivateCustomFields action = new DeactivateCustomFields();

        // Perform action.
View Full Code Here

Examples of com.google.caja.parser.js.Statement

          propData.add(Pair.pair((CssSchema.CssPropertyInfo) null, fnData));
        }
      }
    }

    Statement poolDecls = null;
    if (!stringPool.isEmpty()) {
      poolDecls = joinDeclarations(
          poolDecls,
          new Declaration(unk, new Identifier(unk, "s"),
              new ArrayConstructor(unk, stringPool)));
View Full Code Here

Examples of com.google.dart.engine.ast.Statement

    if (!isDebugConstant(conditionExpression)) {
      ValidResult result = getConstantBooleanValue(conditionExpression);
      if (result != null) {
        if (result.isTrue()) {
          // report error on else block: if(true) {} else {!}
          Statement elseStatement = node.getElseStatement();
          if (elseStatement != null) {
            errorReporter.reportErrorForNode(HintCode.DEAD_CODE, elseStatement);
            safelyVisit(node.getThenStatement());
            return null;
          }
View Full Code Here

Examples of com.google.gwt.dev.generator.ast.Statement

    ForLoop loop = new ForLoop("int numLoops = 1", "true", "");
    benchStatements.add(loop);
    List<Statements> loopStatements = loop.getStatements();

    loopStatements.add(new Statement("long start = System.currentTimeMillis()"));
    ForLoop runLoop = new ForLoop("int i = 0", "i < numLoops", "++i", stmts);
    loopStatements.add(runLoop);

    // Put the rest of the code in 1 big statement to simplify things
    String benchCode = "long duration = System.currentTimeMillis() - start;\n\n"
        +

        "if ( duration < 150 ) {\n"
        + "  numLoops += numLoops;\n"
        + "  continue;\n"
        + "}\n\n"
        +

        "double durationMillis = duration * 1.0;\n"
        + "double numLoopsAsDouble = numLoops * 1.0;\n"
        + timeMillisName
        + " = durationMillis / numLoopsAsDouble";

    loopStatements.add(new Statement(benchCode));

    if (recordCode != null) {
      loopStatements.add(recordCode);
    }

    if (bound != 0) {
      loopStatements.add(new Statement("if ( numLoops == 1 && duration > "
          + bound + " ) {\n" + breakCode.toString() + "\n" + "}\n\n"));
    }

    loopStatements.add(new Statement("break"));

    return benchmarkCode;
  }
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.