Examples of TimeUnit


Examples of org.goobi.production.flow.statistics.enums.TimeUnit

    Calendar cal2 = Calendar.getInstance();
    cal1.set(2009, 01, 01, 0, 0, 0);
    cal1.set(Calendar.MILLISECOND, 0);
    cal2.set(2009, 03, 31, 0, 0, 0);
    cal2.set(Calendar.MILLISECOND, 0);
    TimeUnit sourceTimeUnit = TimeUnit.months;
    CalculationUnit targetCalculationUnit = CalculationUnit.volumes;
    ResultOutput targetResultOutput = ResultOutput.chart;
    testManager.setSourceDateFrom(cal1.getTime());
    testManager.setShowAverage(false);
    testManager.setSourceDateTo(cal2.getTime());
View Full Code Here

Examples of org.jquantlib.time.TimeUnit

   *
   * @param str
   * @return period derived from str
   */
  public static Period parse(String str) {
    TimeUnit units = null;
    int index = -1;
    if ((index = str.indexOf('d')) > 0
        || (index = str.indexOf('D')) > 0) {
      units = TimeUnit.DAYS;
      enforceUnit(index,str,units);
View Full Code Here

Examples of org.ocpsoft.prettytime.TimeUnit

   @Test
   public void testCustomFormat() throws Exception
   {
      PrettyTime t = new PrettyTime(new Date(0));
      TimeUnit unit = new TimeUnit()
      {
         @Override
         public long getMaxQuantity()
         {
            return 0;
View Full Code Here

Examples of org.rhq.coregui.client.components.form.TimeUnit

                        long delay;
                        if (MSG.view_admin_plugins_update_on_agents_now().equals(scheduling.getSelected())) {
                            delay = 0;
                        } else if (MSG.view_admin_plugins_update_on_agents_delayed().equals(scheduling.getSelected())) {
                            Integer value = (Integer) startDelay.getValue();
                            TimeUnit u = startDelay.getValueUnit();

                            if (value == null) {
                                CoreGUI.getErrorHandler()
                                    .handleError(MSG.view_admin_plugins_update_on_agents_no_time_specified());
                                w.hide();
View Full Code Here

Examples of org.rhq.enterprise.gui.common.metric.MetricComponent.TimeUnit

    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        ResponseWriter writer = context.getResponseWriter();

        MetricComponent metric = (MetricComponent) component;
        MetricRangePreferences rangePreferences = metric.getMetricRangePreferences();
        TimeUnit preferencesUnit = null;
        int lastN = 0;

        writer.startElement("b", null);
        writer.write("Metric Display Range:");
        writer.endElement("b");
        writer.write(" ");
        if (rangePreferences.readOnly) {
            writer.write(new Date(rangePreferences.begin) + " to " + new Date(rangePreferences.end));
            writer.write(" ");
        } else {
            preferencesUnit = TimeUnit.getUnitByMetricOrdinal(rangePreferences.unit);
            lastN = rangePreferences.lastN;
            writer.write("Last :");

            writer.write(" ");

            writer.startElement("select", metric);
            writer.writeAttribute("id", MetricComponent.VALUE, null);
            writer.writeAttribute("name", MetricComponent.VALUE, null);

            List<Integer> timeIntervals = new ArrayList<Integer>(timeIntervalValues);
            if (!timeIntervals.contains(Integer.valueOf(lastN))) {
                timeIntervals.add(lastN);
            }
            Collections.sort(timeIntervals);

            for (int timeIntervalOption : timeIntervals) {
                writer.startElement("option", metric);
                writer.writeAttribute("value", timeIntervalOption, MetricComponent.VALUE);
                if (timeIntervalOption == lastN) {
                    // this doesn't work in all browsers, we have javascript below to close the gaps
                    writer.writeAttribute("SELECTED", "SELECTED", null);
                }
                writer.write(String.valueOf(timeIntervalOption));
                writer.endElement("option");
            }
            writer.endElement("select");

            writer.write(" ");

            writer.startElement("select", metric);
            writer.writeAttribute("id", MetricComponent.UNIT, null);
            writer.writeAttribute("name", MetricComponent.UNIT, null);

            for (TimeUnit unit : metric.getUnitOptions()) {
                writer.startElement("option", metric);
                writer.writeAttribute("value", unit.name(), MetricComponent.UNIT);
                if (unit.equals(preferencesUnit)) {
                    // this doesn't work in all browsers, we have javascript below to close the gaps
                    writer.writeAttribute("SELECTED", "SELECTED", null);
                }
                writer.write(unit.getDisplayName());
                writer.endElement("option");
            }
            writer.endElement("select");

            writer.write(" ");
        }
        writer.write(" ");

        writer.startElement("a", null);
        writer.writeAttribute("href", "#", null);
        writer.writeAttribute("onclick",
            "javascript:window.open('/rhq/common/metric/advanced.xhtml','Metric Display Range Settings','"
                + getWindowOptions() + "');", null);
        if (rangePreferences.readOnly) {
            writer.write("Edit Settings...");
        } else {
            writer.write("Advanced Settings...");
        }
        writer.endElement("a");
        if (rangePreferences.readOnly) {
            writer.write(" | ");
        }

        writer.startElement("script", null);
        writer.writeAttribute("type", "text/javascript", null);
        if (rangePreferences.readOnly == false) {
            // both dropdowns needs to be updated when we're NOT in readOnly mode
            writer.write("changeComboBox('" + MetricComponent.VALUE + "','" + lastN + "');");
            writer.write("changeComboBox('" + MetricComponent.UNIT + "','" + preferencesUnit.name() + "');");
        }

        writer.endElement("script");
    }
View Full Code Here

Examples of ucar.nc2.units.TimeUnit

    } catch (Exception e) {
      // ok
    }

    try {
      new TimeUnit(unit);
      return "time";
    } catch (Exception e) {
      // ok
    }
View Full Code Here

Examples of ucar.nc2.units.TimeUnit

   */
  public TimeUnit getTimeResolution() throws Exception {
    String tUnits = getUnitsString();
    StringTokenizer stoker = new StringTokenizer(tUnits);
    double tResolution = getIncrement();
    return new TimeUnit(tResolution, stoker.nextToken());
  }
View Full Code Here

Examples of ucar.nc2.units.TimeUnit

  }

  private double getOlderThanFilter(List<MFileFilter> filters, String olderThan) {
    if (olderThan != null) {
      try {
        TimeUnit tu = new TimeUnit(olderThan);
        double olderThanV = tu.getValueInSeconds();
        filters.add( new LastModifiedLimit((long) (1000 * olderThanV)));
        return olderThanV;
      } catch (Exception e) {
        logger.error(collectionName + ": Invalid time unit for olderThan = {}", olderThan);
      }
View Full Code Here

Examples of ucar.nc2.units.TimeUnit

  }

  private TimeUnit makeRecheck(String recheckS) {
    if (recheckS != null) {
      try {
        return new TimeUnit(recheckS);
      } catch (Exception e) {
        logger.error(collectionName+": Invalid time unit for recheckEvery = {}", recheckS);
      }
    }
    return null;
View Full Code Here

Examples of ucar.nc2.units.TimeUnit

    else if (suffix != null)
      filters.add(new WildcardMatchOnPath("*" + suffix+"$"));

    if (olderS != null) {
      try {
        TimeUnit tu = new TimeUnit(olderS);
        filters.add(new LastModifiedLimit((long) (1000 * tu.getValueInSeconds())));
      } catch (Exception e) {
        logger.error(collectionName+": Invalid time unit for olderThan = {}", olderS);
      }
    }

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.