Examples of Flag


Examples of org.jquantlib.testsuite.util.Flag

        // define Stock
        final RelinkableHandle<Quote> h = new RelinkableHandle<Quote>(new SimpleQuote(iniPrice));
        final Instrument s = new Stock(h);

        // attach an Observer to Stock
        final Flag priceChange = new Flag();
        s.addObserver(priceChange);

        // verify initial price
        if (iniPrice != s.NPV()) {
            fail("stock quote valuation failed");
        }

        // set a new price
        h.linkTo(new SimpleQuote(newPrice));

        // Observer must detect price change
        if (!priceChange.isUp()) {
            fail("Observer was not notified of instrument change");
        }

        if (newPrice != s.NPV()) {
            fail("stock quote havent changed value");
View Full Code Here

Examples of org.jquantlib.testsuite.util.Flag

        final SimpleQuote me1 = new SimpleQuote(0.0);
        final RelinkableHandle<Quote>  h = new RelinkableHandle<Quote>(me1);
        final Instrument s = new Stock(h);

        final Flag f = new Flag();
        s.addObserver(f); //f.registerWith(s);

        s.NPV();
        me1.setValue(3.14);
        if (!f.isUp()) {
            fail("Observer was not notified of instrument change");
        }

        s.NPV();
        f.lower();
        final SimpleQuote me2 = new SimpleQuote(0.0);

        h.linkTo(me2);
        if (!f.isUp()) {
            fail("Observer was not notified of instrument change");
        }

        f.lower();
        s.freeze();
        s.NPV();
        me2.setValue(2.71);
        if (f.isUp()) {
            fail("Observer was notified of frozen instrument change");
        }

        s.NPV();
        s.unfreeze();
        if (!f.isUp()) {
            fail("Observer was not notified of instrument change");
        }
    }
View Full Code Here

Examples of org.jredis.connector.Connection.Flag

   */
  @Test
  public void testConnectionFlags() {
    log.info("TEST:CONNECTOR spec sematics - ConnectionFlags");
   
    Flag flags[] = {Flag.CONNECT_IMMEDIATELY, Flag.SHARED, Flag.RELIABLE};
        int bitset = Flag.bitset(flags);
        for(Flag f : flags)
          assertTrue(Flag.isSet(bitset, f), "%s should have been set!\n", f.name());
        int oldbitset = bitset;
       
View Full Code Here

Examples of org.jredis.protocol.Command.Flag

    }
  }
  @Test
  public void testCommandFlags() {
    log.info("TEST:PROTOCOL Command sematics - CommandFlags");
    Flag flags[] = {TEST, FOO, BAR};
        int bitset = Flag.bitset(flags);
        for(Flag f : flags)
          Assert.assertTrue(Flag.isSet(bitset, f), String.format("%s should have been set!\n", f.name()));
        int oldbitset = bitset;
       
View Full Code Here

Examples of org.keyczar.enums.Flag

        for (String arg : args) {
          if (arg.startsWith("--")) {
            arg = arg.substring(2); // Trim off the leading dashes
            String[] nameValuePair = arg.split("=");
            if (nameValuePair.length > 1) {
              Flag f = Flag.getFlag(nameValuePair[0]);
              flagMap.put(f, nameValuePair[1]);
            }
          }
        }
View Full Code Here

Examples of org.mcsg.survivalgames.commands.Flag

    commands.put("leave", new Leave());
    commands.put("setlobbyspawn", new SetLobbySpawn());
    commands.put("setlobbywall", new SetLobbyWall());
    commands.put("resetspawns", new ResetSpawns());
    commands.put("delarena", new DelArena());
    commands.put("flag", new Flag());
    commands.put("spectate", new Spectate());
    commands.put("lq", new LeaveQueue());
    commands.put("leavequeue", new LeaveQueue());
    commands.put("list", new ListPlayers());
    commands.put("tp", new Teleport());
View Full Code Here

Examples of tv.porst.splib.binaryparser.Flag

  public static ActionGetURL2 parse(final SWFBinaryParser parser, final UINT8 actionCode, final String fieldName) throws SWFParserException {
    final UINT16 length = parseUINT16(parser, 0x00006, fieldName + "::Length");
    final UBits sendVarsMethod = parseUBits(parser, 2, 0x00006, fieldName + "::SendVarsMethod");
    final UBits reserved = parseUBits(parser, 4, 0x00006, fieldName + "::Reserved");
    final Flag loadTargetFlag = parseFlag(parser, 0x00006, fieldName + "::LoadTargetFlag");
    final Flag loadVariablesFlag = parseFlag(parser, 0x00006, fieldName + "::LoadVariablesFlag");

    return new ActionGetURL2(actionCode, length, sendVarsMethod, reserved, loadTargetFlag, loadVariablesFlag);
  }
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.