Examples of Rate


Examples of com.projity.datatype.Rate

  private boolean isAssignmentListEmpty() {
    return (assignments == null) || assignments.size() == 0;
  }
 
  public Rate getRate() {
    Rate commonValue = (Rate) Assignment.getRateField().getCommonValue(assignments,false,false);
    if (commonValue == null) {
      if (isAssignmentListEmpty()) {
        if (getResource().isLabor())
          return ClassUtils.defaultRate;
        else
View Full Code Here

Examples of com.projity.datatype.Rate

      }
    }
   
    double percent = 1.0D;
    Resource resource = (Resource)(parameters.isLeftAssociation() ? found : parameters.getThisObject());
    Rate rate = null;
    if (matcher.group(2) != null) { // if text was empty use default
      if (!getParameters().isAllowDetailsEntry())
        throw new ParseException(Messages.getString("Message.cannotEnterUnits"),0);
      RateFormat format = resource.getRateFormat();
      rate = (Rate) format.parseObject(matcher.group(2));
      percent = rate.getValue();
//      Number percentNumber;
//      if (resource.isLabor())
//        percentNumber = percentFormat.parse(matcher.group(2)+ Settings.PERCENT); // force a percent sign at the end for labor.  If there are two, it is ignored
//      else //TODO allow parsing values like 3/d for material resources
//        percentNumber = NumberFormat.getInstance().parse(matcher.group(2));
//     
//      if (percentNumber == null)
//        throw new ParseException(getErrorMessage(string), pos.getIndex());
//      percent = percentNumber.doubleValue();
    } else if (resource.isMaterial()) {
      rate = new Rate(1,TimeUnit.NON_TEMPORAL);
    }
    Assignment ass = Assignment.getInstance((Task) (parameters.isLeftAssociation() ? parameters.getThisObject() : found),
                    resource,
                      percent,
                    0);
View Full Code Here

Examples of com.projity.datatype.Rate

* @param from Assignment to copy from
*/
  public void usePropertiesOf(Assignment from) {
    boolean compatibleTypes = isLabor() == from.isLabor();
    double units = getUnits();
    Rate r = getRate();
    Resource resource = getResource();
    detail = (AssignmentDetail) from.detail.clone();
      detail.replaceResourceAndUnits(units,resource);

    if (!compatibleTypes) // don't want to set units if not compatible
View Full Code Here

Examples of com.projity.datatype.Rate

        value = NumberFormat.getInstance().parseObject(editor.getTextField().getText());
    } catch (ParseException e) {
      return null;
    }
    if (field.isRate())
      value = new Rate(((Number)value).doubleValue());
    return value;
  }
View Full Code Here

Examples of com.projity.datatype.Rate

    boolean oldIsLabor = isLabor();
    this.resourceType = resourceType;

    // if resource type changes to/from labor, then initialize rates
    if (oldIsLabor != isLabor()) {
      setStandardRate(new Rate());
      setOvertimeRate(new Rate());

      if (!isLabor()) { // Non labor resources have no time unit
        getStandardRate().setTimeUnit(TimeUnit.NON_TEMPORAL);
        getOvertimeRate().setTimeUnit(TimeUnit.NON_TEMPORAL);
      }
View Full Code Here

Examples of com.ryp.bo.Rate

        Place place = getIgeliPlace();

        String ratingComment = "somecomment";
        Rating rating = new Rating();
        rating.setComment(ratingComment);
        Rate r1 = Rate.R10;
        rating.setRate(r1);

        service.ratePlace(place, rating);

        rating = new Rating();
        rating.setComment(ratingComment);
        Rate r2 = Rate.R5;
        rating.setRate(r2);

        service.ratePlace(place, rating);

        rating = new Rating();
        rating.setComment(ratingComment);
        Rate r3 = Rate.R3;
        rating.setRate(r3);
       
        service.ratePlace(place, rating);

        int avgRate = ((r1.getValue() + r2.getValue() + r3.getValue()) / 3);
        Rate totalRate = Rate.valueOf(avgRate);
       
        TotalRating totalRating = service.getTotalRating(place);
       
        assertEquals(totalRate, totalRating.getRate());
    }
View Full Code Here

Examples of edu.indiana.extreme.xbaya.monitor.KarmaClient.Rate

    }

    private void setConfiguration() {
        String urlAsString = this.urlTextField.getText();
        String idAsString = this.idTextField.getText();
        Rate rate = Rate.BATCH;
        if (this.originalButton.isSelected()) {
            rate = Rate.ORIGINAL;
        } else if (this.periodicButton.isSelected()) {
            rate = Rate.PERIODIC;
        } else if (this.batchButton.isSelected()) {
View Full Code Here

Examples of models.Rate

        }
        else
        {
            List<ModuleVersion> moduleVersions = ModuleVersion.findByModule(module);
            User user = currentUser();
            Rate rate = null;
            Vote vote = null;

            if (user != null)
            {
                rate = CollectionUtils.filterFirst(user.rates,
View Full Code Here

Examples of models.Rate

                result = badRequest("Module does not exist");
            }
            else
            {
                User user = currentUser();
                Rate rate = null;

                if (user != null)
                {
                    // user shouldn't be null because of @RoleHolderPresent
                    rate = CollectionUtils.filterFirst(user.rates,
                                                       new Filter<Rate>()
                                                       {
                                                           @Override
                                                           public boolean isAcceptable(Rate rate)
                                                           {
                                                               return rate.playModule.id.equals(module.id);
                                                           }
                                                       });
                    if (rate != null)
                    {
                        module.rating.subtract(rate);
                    }
                    else
                    {
                        rate = new Rate();
                        rate.playModule = module;
                        user.rates.add(rate);
                    }
                    rate.rating = ratingForm.rating;
                    module.rating.add(rate);
View Full Code Here

Examples of net.sf.mpxj.Rate

                     break;
                  }

                  case RATE :
                  {
                     result = new Rate(MPPUtility.getDouble(data, m_fixedDataOffset), TimeUnit.HOURS);
                     break;
                  }

                  case WORK :
                  {
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.