Examples of Unit


Examples of loop.ast.script.Unit


  @Test
  public final void emitIfStatement() throws Exception {
    Parser parser = new LexprParser(new Tokenizer("sum(cond) ->\n  if cond then 1 else 2\n").tokenize());
    Unit unit = parser.script(file);
    unit.reduceAll();

    Class<?> generated = new AsmCodeEmitter(unit).write(unit);

    // Inspect.
    inspect(generated);
View Full Code Here

Examples of model.Unit

     }
   }

  @Transactional
  public void deleteDataById(Long id) {
    Unit unit = em.find(Unit.class, id);
    if (unit != null) {
      em.remove(unit);
    }
  }
View Full Code Here

Examples of oms3.annotations.Unit

                fieldDescription = AnnotationUtilities.getLocalizedDescription(descriptionAnnot);
                if (fieldDescription == null) {
                    fieldDescription = " - ";
                }

                Unit unitAnn = field.getAnnotation(Unit.class);
                if (unitAnn != null) {
                    fieldDescription = fieldDescription + " [" + unitAnn.value() + "]";
                }
            }

            sbTmp.append("<tr>").append(NEWLINE);
            sbTmp.append("<td width=\"40%\"> <b>").append(fieldName).append("</b> </td><td width=\"60%\"> ");
View Full Code Here

Examples of org.albite.util.units.Unit

        /*
         * Converting units
         */
        UnitGroup group = UnitGroup.GROUPS[unitGroups.getSelectedIndex()];
        Unit[] units = group.units;
        Unit unitFrom = group.units[this.unitFrom.getSelectedIndex()];
        Unit unitTo = group.units[this.unitTo.getSelectedIndex()];

        double quantityFrom =
                Double.parseDouble(numberBox.getString());
        double quantityTo = round(Unit.convert(quantityFrom, unitFrom, unitTo));

View Full Code Here

Examples of org.apache.hadoop.hbase.util.PrettyPrinter.Unit

    }
    return s;
  }

  public static Unit getUnit(String key) {
    Unit unit;
      /* TTL for now, we can add more as we neeed */
    if (key.equals(HColumnDescriptor.TTL)) {
      unit = Unit.TIME_INTERVAL;
    } else {
      unit = Unit.NONE;
View Full Code Here

Examples of org.apache.sirona.counters.Unit

    @Regex("/counter/([^/]*)/([^/]*)\\?name=(.*)")
    public Template counterDetail(final String role, final String unit, final String name, final HttpServletRequest request) {
        final Counter counter = Repository.INSTANCE.getCounter(new Counter.Key(new Role(decode(role), Unit.get(unit)), name)); // name is already decoded by servlet container

        final Map<String, String[]> params = request.getParameterMap();
        final Unit timeUnit = timeUnit(params);
        final String format = format(params, HTMLFormat.NUMBER_FORMAT);

        final Map<String, Collection<String>> counters = new TreeMap<String, Collection<String>>();
        if (AggregatedCounter.class.isInstance(counter)) {
            for (final Map.Entry<String, ? extends Counter> marker : AggregatedCounter.class.cast(counter).aggregated().entrySet()) {
View Full Code Here

Examples of org.eclipse.papyrus.sysml.blocks.Unit

      if (stereotype instanceof ValueType) {
        ValueType valueType = (ValueType)stereotype;
        if (instanceSpecification.getStereotypeApplications() != null) {
          stereotype = instanceSpecification.getStereotypeApplications().get(0);
          if (stereotype instanceof Unit) {
            Unit unit = (Unit)stereotype;
            valueType.setUnit(unit);
          }
        }
      }
    }
View Full Code Here

Examples of org.fenixedu.academic.domain.organizationalStructure.Unit

            }
        }
    }

    private Set<IEctsConversionTable> processEnrolmentByCurricularYearStatus(EctsTableFilter filter) {
        final Unit ist = UnitUtils.readInstitutionUnit();
        Set<IEctsConversionTable> tables = new HashSet<IEctsConversionTable>();
        for (CycleType cycle : CycleType.getSortedValues()) {
            List<Integer> years = null;
            switch (cycle) {
            case FIRST_CYCLE:
View Full Code Here

Examples of org.freerealm.unit.Unit

    public CommandResult execute(Realm realm) {

        System.out.println(attacker + " attacks " + defender);
        CommandResult commandResult = null;
        if (attacker.canAttack()) {
            Unit winner = null;
            Unit loser = null;
            int attackPoints = attacker.getAttackPoints();
            System.out.println("Attack points : " + attackPoints);
            int defencePoints = defender.getDefencePoints();
            System.out.println("Defense points : " + defencePoints);
            attackPoints = Utility.increaseByPercent(attackPoints, attackBonusPercentage);
            System.out.println("Actual attack points : " + attackPoints);
            defenceBonusPercentage = Utility.getCoordinateDefenceBonus(realm, defender.getCoordinate());
            defencePoints = Utility.increaseByPercent(defencePoints, defenceBonusPercentage);
            System.out.println("Actual defense points : " + defencePoints);
            int total = attackPoints + defencePoints;
            Random random = new Random(System.currentTimeMillis());
            int randomInt = random.nextInt(total);
            System.out.println("Total : " + total + " Random : " + randomInt);
            if (randomInt < attackPoints) {
                System.out.println("Attacker won!");
                loser = defender;
                winner = attacker;
            } else {
                System.out.println("Defender won!");
                loser = attacker;
                winner = defender;
            }
            winner.setMovementPoints(0);
            Executor.getInstance().execute(new RemoveUnitCommand(loser.getPlayer(), loser));
            commandResult = new CommandResult(CommandResult.RESULT_OK, "", CommandResult.UNIT_ATTACKED_UPDATE);
            commandResult.addParameter(attacker);
            commandResult.addParameter(defender);
            commandResult.addParameter(winner);
            commandResult.addParameter(defender.getCoordinate());
View Full Code Here

Examples of org.jclouds.cloudwatch.domain.Unit

   public void testDescribeAlarmsForMetric() throws Exception {
      String metricName = "TestMetricName";
      String namespace = Namespaces.EC2;
      int period = 60;
      Statistics statistics = Statistics.SAMPLE_COUNT;
      Unit unit = Unit.SECONDS;
      CloudWatchApi cloudWatchApi = requestSendsResponse(
            alarmRequest(ImmutableMap.<String, String>builder()
                                     .put("Action", "DescribeAlarmsForMetric")
                                     .put("Dimensions.member.1.Name", "TestDimensionName1")
                                     .put("Dimensions.member.1.Value", "TestDimensionValue1")
                                     .put("Dimensions.member.2.Name", "TestDimensionName2")
                                     .put("Dimensions.member.2.Value", "TestDimensionValue2")
                                     .put("MetricName", metricName)
                                     .put("Namespace", namespace)
                                     .put("Period", Integer.toString(period))
                                     .put("Statistic", statistics.toString())
                                     .put("Unit", unit.toString())
                                     .put("Signature", "y%2BpU0Lp6AAO2QSrNld1VQY4DhKVHcyn44dIfnrmJhpg%3D")
                                     .build()),
            HttpResponse.builder()
                        .statusCode(200)
                        .payload(payloadFromResourceWithContentType("/DescribeAlarmsForMetricResponse.xml", "text/xml"))
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.