Examples of toInteger()


Examples of org.apache.wicket.util.string.StringValue.toInteger()

  {
    final StringValue sval = parameters.get(name);
    if (sval == null || sval.isNull() == true) {
      return null;
    } else {
      return sval.toInteger();
    }
  }

  public static int getAsInt(final PageParameters parameters, final String name, final int defaultValue)
  {
View Full Code Here

Examples of org.apache.wicket.util.string.StringValue.toInteger()

    } else if (objectType.isAssignableFrom(Integer.class) == true) {
      final StringValue sval = pageParameters.get(key);
      if (sval.isNull() == true) {
        return null;
      }
      return sval.toInteger();
    } else if (objectType.isAssignableFrom(String.class) == true) {
      return pageParameters.get(key).toString();
    } else if (objectType.isAssignableFrom(TimePeriod.class) == true) {
      final String sValue = pageParameters.get(key).toString();
      if (sValue == null) {
View Full Code Here

Examples of org.apache.wicket.util.string.StringValue.toInteger()

     * Reads target contract id from the page parameters.
     */
    protected Integer getContractId() {
        StringValue sContractId = getPageParameters().get(PARAM_CONTRACT_ID);
        if(!sContractId.isEmpty()) {
            return sContractId.toInteger();
        }
        return null;
    }


View Full Code Here

Examples of org.apache.wicket.util.string.StringValue.toInteger()

        }
        T resource = resourceModel.getObject();
        if(resource == null) {
            StringValue sResourceId = getPageParameters().get(PARAM_RESOURCE_ID);
            if(!sResourceId.isEmpty()) {
                resource = resourceReader.<T>getResource(sResourceId.toInteger());
                resourceModel.setObject(resource);
            } else {
                try {
                    @SuppressWarnings("unchecked")
                    Class<T> resourceSubclass = (Class<T>) Class.forName(
View Full Code Here

Examples of org.apache.wicket.util.string.StringValue.toInteger()

                    @SuppressWarnings("unchecked")
                    Class<T> resourceSubclass = (Class<T>) Class.forName(
                            getPage().getPageParameters().get(PARAM_RESOURCE_TYPE).toString());
                    StringValue sContractId = getPage().getPageParameters().get(PARAM_CONTRACT_ID);
                    T editingResource = resourcesFactory.createResource(resourceSubclass,
                            authorizedUserService.getCurrentUserId(), sContractId.toInteger());
                    resourceModel.setObject(editingResource);
                } catch (ClassNotFoundException e) {
                    throw new RuntimeException("Cannot create new resource instance", e);
                }
            }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.INumber.toInteger()

    for(IValue v : dataValues){
      ITuple t = (ITuple) v;
      INumber exp = (INumber) t.get(0);
      INumber obs = (INumber) t.get(1);
      expected[i] = (long) exp.toReal().doubleValue();
      observed[i] = obs.toInteger().longValue();
     
      if(expected[i] < 0 || observed[i] < 0) throw RuntimeExceptionFactory.illegalArgument(dataValues, null, null, "Chi test requires positive values");
      i++;
    }
  }
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.