Examples of Bid


Examples of auction.model.Bid

@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class ItemDAOBean extends GenericEJB3DAO<Item, Long> implements ItemDAO {

    public Bid getMaxBid(Item item) {
        // TODO: em.getSingleResult() doesn't return null but throws an exception, how inconvenient
        Bid currentMaxBid = null;
        List result = getEntityManager()
                            .createNamedQuery("Item-getMaxBid")
                             .setParameter("itemId", item.getId())
                             .getResultList();
        if (result.size() > 0) currentMaxBid = (Bid)result.get(0);
View Full Code Here

Examples of auction.model.Bid

        return currentMaxBid;
    }

    public Bid getMinBid(Item item) {
        // TODO: em.getSingleResult() doesn't return null but throws an exception, how inconvenient
        Bid currentMinBid = null;
        List result = getEntityManager()
                             .createNamedQuery("Item-getMinBid")
                             .setParameter("itemId", item.getId())
                             .getResultList();
        if (result.size() > 0) currentMinBid = (Bid)result.get(0);
View Full Code Here

Examples of com.google.api.adwords.v200909.cm.Bid

        if (adGroups != null && j < adGroups.length) {
          adGroup = adGroups[j];
        } else {
          adGroup = new AdGroup();
          adGroup.setName("AdGroup " + (j + 1));
          adGroup.setBids(new ManualCPCAdGroupBids(null, new Bid(new Money("USD",
              generator.nextInt(10) * 50000L + 50000L)), null, null));
          adGroup.setCampaignId(campaign.getId());

          AdGroupReturnValue adGroupReturnValue =
              adGroupService.mutate(new AdGroupOperation[] {new AdGroupOperation(Operator.ADD,
View Full Code Here

Examples of com.google.api.adwords.v201008.cm.Bid

    adGroup.setStatus(AdGroupStatus.ENABLED);
    adGroup.setCampaignId(campaignId);

    // Create ad group bid.
    ManualCPCAdGroupBids adGroupBids = new ManualCPCAdGroupBids();
    adGroupBids.setKeywordMaxCpc(new Bid(new Money(null, 10000000L)));
    adGroup.setBids(adGroupBids);

    // Create operations.
    AdGroupOperation operation = new AdGroupOperation();
    operation.setOperand(adGroup);
View Full Code Here

Examples of com.google.api.adwords.v201008.cm.Bid

    adGroup.setStatus(AdGroupStatus.PAUSED);
    adGroup.setCampaignId(campaignId);

    // Create ad group bid.
    ManualCPCAdGroupBids adGroupBids = new ManualCPCAdGroupBids();
    adGroupBids.setKeywordMaxCpc(new Bid(new Money(null, 1000000L)));
    adGroup.setBids(adGroupBids);

    // Create operations.
    AdGroupOperation operation = new AdGroupOperation();
    operation.setOperand(adGroup);
View Full Code Here

Examples of com.google.api.adwords.v201008.cm.Bid

    AdGroup adGroup = new AdGroup();
    adGroup.setId(adGroupId);

    // Create updated ad group bid.
    ManualCPCAdGroupBids adGroupBids = new ManualCPCAdGroupBids();
    adGroupBids.setKeywordMaxCpc(new Bid(new Money(null, 2000000L)));
    adGroup.setBids(adGroupBids);

    // Create operations.
    AdGroupOperation operation = new AdGroupOperation();
    operation.setOperand(adGroup);
View Full Code Here

Examples of com.google.api.adwords.v201008.cm.Bid

    criterion.setUserStatus(UserStatus.PAUSED);
    criterion.setDestinationUrl("http://www.example.com");

    // Create bids.
    ManualCPCAdGroupCriterionBids bids = new ManualCPCAdGroupCriterionBids();
    bids.setMaxCpc(new Bid(new Money(null, 10000L)));
    criterion.setBids(bids);

    // Create operations.
    AdGroupCriterionOperation keywordAdGroupCriterionOperation = new AdGroupCriterionOperation();
    keywordAdGroupCriterionOperation.setOperand(criterion);
View Full Code Here

Examples of com.svanloon.game.wizard.client.player.Bid

    }
    return false;
  }

  private Bid bid(Card trump, int lead, int cardsDealt, Round round) {
    Bid bid = new Bid();
    int minBid = 0;
    int playerCount = 0;
    for (Player player: new PlayerIterator(_playerCollection, lead)) {
      int notAllowedToBid = -1;

      if(playerCount == this._playerCollection.size() - 1) {
        boolean isPlayerWinning = isPlayerWinning(player.getId());
        boolean isEven = isPlayerWinning && go.getBidType().equals(BidType.EVEN);
        boolean isCanadian = isPlayerWinning &&  go.getBidType().equals(BidType.CANADIAN);
        boolean isHardCore = cardsDealt > 3 && go.getBidType().equals(BidType.HARDCORE);
   
        if(isEven || isCanadian || isHardCore) {
          int bidSoFar = bid.bidSoFar();
          if(cardsDealt - bidSoFar >= 0) {
            notAllowedToBid = cardsDealt - bidSoFar;
            // in canadian rules, zero is always allowed.
            if(isCanadian && notAllowedToBid == 0 ) {
              notAllowedToBid = -1;
            }
          }
          //else they can bid anything

        }
      }

      int bidInt = player.bid(trump, minBid, cardsDealt, notAllowedToBid);
      if(bidInt == notAllowedToBid) {
        System.err.print("illegal bid");
        throw new RuntimeException("illegal bid");
      }
      bid.addIndividualBid(new IndividualBid(player, bidInt));
      if(go.getBidType().equals(BidType.STANDARD) ||
        go.getBidType().equals(BidType.EVEN) ||
        go.getBidType().equals(BidType.CANADIAN) ||
        go.getBidType().equals(BidType.HARDCORE)
      ) {
View Full Code Here

Examples of com.svanloon.game.wizard.client.player.Bid

        trump = new Card(null, trumpPicker.pickTrump(), -1);
        gameEventNotifier.notify(new NewTrumpEvent(trump));
        round.setTrump(trump);
      }
      int cardsDealt = roundId;
      Bid bid = bid(trump, lead, cardsDealt, round);
      if(go.getBidType().equals(BidType.HIDDEN)) {
        for(IndividualBid individualBid :bid.getBids()) {
          gameEventNotifier.notify(new PlayerBidEvent(individualBid.getPlayer().getId(), individualBid.getBid()));
          round.setBid(individualBid.getPlayer().getId(), individualBid.getBid());
        }
      }
      RoundSummary roundSummary = new RoundSummary();
      for (int i = 0; i < roundId; i++) {
        TrickTracker trickTracker = playTrick(trump, lead, round);
        roundSummary.addTrickTracker(trickTracker);
        int playerIdWhoWon = trickTracker.winningPlay().getPlayerId();
        lead = findPlayerIndex(playerIdWhoWon);
      }
      if(go.getBidType().equals(BidType.SECRET)) {
        for(IndividualBid individualBid :bid.getBids()) {
          gameEventNotifier.notify(new PlayerBidEvent(individualBid.getPlayer().getId(), individualBid.getBid()));
          round.setBid(individualBid.getPlayer().getId(), individualBid.getBid());
        }
      }
      scoreRound(roundSummary, bid, _game);
View Full Code Here

Examples of org.apache.openjpa.trader.domain.Bid

        return ask;
    }

    @Override
    public Bid bid(Trader trader, Stock stock, int volume, double price) {
        Bid bid = new Bid(trader, stock, price, volume);
        _bids.add(bid);
        log("Added new " + bid + " " + counter++);
        return bid;
    }
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.