當前位置: 首頁>>代碼示例>>Java>>正文


Java Millisecond類代碼示例

本文整理匯總了Java中org.jfree.data.time.Millisecond的典型用法代碼示例。如果您正苦於以下問題:Java Millisecond類的具體用法?Java Millisecond怎麽用?Java Millisecond使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Millisecond類屬於org.jfree.data.time包,在下文中一共展示了Millisecond類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testGetFirstMillisecondWithTimeZone

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithTimeZone() {
    Millisecond m = new Millisecond(500, 50, 59, 15, 1, 4, 1950);
    TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
    assertEquals(-623289609500L, m.getFirstMillisecond(zone));
    
    // try null calendar
    boolean pass = false;
    try {
        m.getFirstMillisecond((TimeZone) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);            
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:19,代碼來源:MillisecondTests.java

示例2: testGetFirstMillisecondWithCalendar

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Millisecond m = new Millisecond(500, 55, 40, 2, 15, 4, 2000);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(955762855500L, m.getFirstMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        m.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:19,代碼來源:MillisecondTests.java

示例3: testGetLastMillisecondWithTimeZone

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithTimeZone() {
    Millisecond m = new Millisecond(750, 55, 1, 2, 7, 7, 1950);
    TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
    assertEquals(-614962684250L, m.getLastMillisecond(zone));
    
    // try null calendar
    boolean pass = false;
    try {
        m.getLastMillisecond((TimeZone) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);            
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:19,代碼來源:MillisecondTests.java

示例4: testGetLastMillisecondWithCalendar

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Millisecond m = new Millisecond(250, 50, 45, 21, 21, 4, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(987885950250L, m.getLastMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        m.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:19,代碼來源:MillisecondTests.java

示例5: update

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
public void update(WorkerStat ws){
	cpuSet.getSeries(CPU_USAGE).add(new Millisecond(), ws.cpuUsage);//FIXME
	memSet.getSeries(MEM_USED).add(new Millisecond(), ws.memUsed);//FIXME
	netSet.getSeries(BW_USAGE).add(new Millisecond(), ws.bwUsageUS/1E6);//FIXME
	
	subpubCountSet.setValue(ws.localSubscriberCount, LOCAL_SUB_COUNT, SUB_PUB_COUNT_CATEGORY);
	subpubCountSet.setValue(ws.remoteSubscriberCount, REMOTE_SUB_COUNT, SUB_PUB_COUNT_CATEGORY);
	subpubCountSet.setValue(ws.localPublisherCount, LOCAL_PUB_COUNT, SUB_PUB_COUNT_CATEGORY);
	subpubCountSet.setValue(ws.remotePublisherCount, REMOTE_PUB_COUNT, SUB_PUB_COUNT_CATEGORY);
	
	oprCountSet.setValue(ws.filterCount, FILTER_COUNT, OPR_COUNT_CATEGORY);
	oprCountSet.setValue(ws.filterCompCount, FILTER_COMP_COUNT, OPR_COUNT_CATEGORY);
	oprCountSet.setValue(ws.patternCount, PATTERN_COUNT, OPR_COUNT_CATEGORY);
	oprCountSet.setValue(ws.patternCompCount, PATTERN_COMP_COUNT, OPR_COUNT_CATEGORY);
	oprCountSet.setValue(ws.joinCount, JOIN_COUNT, OPR_COUNT_CATEGORY);
	oprCountSet.setValue(ws.joinCompCount, JOIN_COMP_COUNT, OPR_COUNT_CATEGORY);
	oprCountSet.setValue(ws.rootCount, ROOT_COUNT, OPR_COUNT_CATEGORY);
	oprCountSet.setValue(ws.rawStatsCount, RAW_STAT_COUNT, OPR_COUNT_CATEGORY);
	
	timeSet.setValue(ws.filterCondProcTimeUS, FILTER_COND_PROC_TIME, TIME_CATEGORY);
	timeSet.setValue(ws.joinCondProcTimeUS, JOIN_COND_PROC_TIME, TIME_CATEGORY);
	timeSet.setValue(ws.sendBaseTimeUS, SEND_BASE_TIME, TIME_CATEGORY);
	timeSet.setValue(ws.sendByteRateUS, SEND_BYTE_RATE, TIME_CATEGORY);
}
 
開發者ID:HoratiusTang,項目名稱:EsperDist,代碼行數:25,代碼來源:StatComposite.java

示例6: recordDelta

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
/**
 * Record the given {@link NetworkSnapshot} delta, updating
 * {@link TimeSeries} and summary statistics.
 *
 * @param time Timestamp when delta was observed.
 * @param deltaMillis Time duration covered by delta, in milliseconds.
 */
public void recordDelta(Millisecond time, long deltaMillis, NetworkSnapshot.Entry delta) {
    final long rxBytesPerSecond = (delta.rxBytes * 1000) / deltaMillis;
    final long txBytesPerSecond = (delta.txBytes * 1000) / deltaMillis;

    // record values under correct series
    if (isTotal()) {
        mRxTotalSeries.addOrUpdate(time, rxBytesPerSecond);
        mTxTotalSeries.addOrUpdate(time, -txBytesPerSecond);
    } else {
        mRxDetailDataset.addValue(rxBytesPerSecond, time, label);
        mTxDetailDataset.addValue(-txBytesPerSecond, time, label);
    }

    rxBytes += delta.rxBytes;
    rxPackets += delta.rxPackets;
    txBytes += delta.txBytes;
    txPackets += delta.txPackets;
}
 
開發者ID:utds3lab,項目名稱:SMVHunter,代碼行數:26,代碼來源:NetworkPanel.java

示例7: testGetFirstMillisecondWithTimeZone

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithTimeZone() {
    Millisecond m = new Millisecond(500, 50, 59, 15, 1, 4, 1950);
    TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
    Calendar c = new GregorianCalendar(zone);
    assertEquals(-623289609500L, m.getFirstMillisecond(c));

    // try null calendar
    boolean pass = false;
    try {
        m.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:20,代碼來源:MillisecondTests.java

示例8: testGetFirstMillisecondWithCalendar

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Millisecond m = new Millisecond(500, 55, 40, 2, 15, 4, 2000);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));
    assertEquals(955766455500L, m.getFirstMillisecond(calendar));

    // try null calendar
    boolean pass = false;
    try {
        m.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:20,代碼來源:MillisecondTests.java

示例9: testGetLastMillisecondWithTimeZone

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithTimeZone() {
    Millisecond m = new Millisecond(750, 55, 1, 2, 7, 7, 1950);
    TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
    Calendar c = new GregorianCalendar(zone);
    assertEquals(-614962684250L, m.getLastMillisecond(c));

    // try null calendar
    boolean pass = false;
    try {
        m.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:20,代碼來源:MillisecondTests.java

示例10: testGetLastMillisecondWithCalendar

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Millisecond m = new Millisecond(250, 50, 45, 21, 21, 4, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));
    assertEquals(987889550250L, m.getLastMillisecond(calendar));

    // try null calendar
    boolean pass = false;
    try {
        m.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:20,代碼來源:MillisecondTests.java

示例11: updateAnnotation

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
void updateAnnotation(RasterDataNode raster) {
    removeAnnotation();

    final AbstractTimeSeries timeSeries = getTimeSeries();
    TimeCoding timeCoding = timeSeries.getRasterTimeMap().get(raster);
    if (timeCoding != null) {
        final ProductData.UTC startTime = timeCoding.getStartTime();
        final Millisecond timePeriod = new Millisecond(startTime.getAsDate(),
                ProductData.UTC.UTC_TIME_ZONE,
                Locale.getDefault());

        double millisecond = timePeriod.getFirstMillisecond();
        Range valueRange = null;
        for (int i = 0; i < timeSeriesPlot.getRangeAxisCount(); i++) {
            valueRange = Range.combine(valueRange, timeSeriesPlot.getRangeAxis(i).getRange());
        }
        if (valueRange != null) {
            XYAnnotation annotation = new XYLineAnnotation(millisecond, valueRange.getLowerBound(), millisecond,
                    valueRange.getUpperBound());
            timeSeriesPlot.addAnnotation(annotation, true);
        }
    }
}
 
開發者ID:senbox-org,項目名稱:snap-desktop,代碼行數:24,代碼來源:TimeSeriesGraphModel.java

示例12: computeSingleTimeSeries

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
private TimeSeries computeSingleTimeSeries(final List<Band> bandList, int pixelX, int pixelY, int currentLevel, String positionName) {
    final Band firstBand = bandList.get(0);
    final String firstBandName = firstBand.getName();
    final int lastUnderscore = firstBandName.lastIndexOf("_");
    final String suffix = positionName.isEmpty()?positionName: "_" + positionName;
    final String timeSeriesName = firstBandName.substring(0, lastUnderscore);
    final TimeSeries timeSeries = new TimeSeries(timeSeriesName + suffix);
    for (Band band : bandList) {
        final TimeCoding timeCoding = this.timeSeries.getRasterTimeMap().get(band);
        if (timeCoding != null) {
            final ProductData.UTC startTime = timeCoding.getStartTime();
            final Millisecond timePeriod = new Millisecond(startTime.getAsDate(),
                                                           ProductData.UTC.UTC_TIME_ZONE,
                                                           Locale.getDefault());
            final double value = getValue(band, pixelX, pixelY, currentLevel);
            timeSeries.add(new TimeSeriesDataItem(timePeriod, value));
        }
    }
    return timeSeries;
}
 
開發者ID:senbox-org,項目名稱:snap-desktop,代碼行數:21,代碼來源:TimeSeriesGraphUpdater.java

示例13: createTimeSeries

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
/**
 * Returns data with series 0 = current and 1 = baseline. This method assumes there is exactly one
 * metric in the response data.
 */
private TimeSeriesCollection createTimeSeries(final TimeOnTimeComparisonResponse data) {
  final TimeSeries baseline = new TimeSeries(BASELINE_LABEL);
  final TimeSeries current = new TimeSeries(CURRENT_LABEL);
  for (int i = 0; i < data.getNumRows(); i++) {
    Row row = data.getRow(i);
    // Plot the baseline data as an overlay on the corresponding current data point.
    // long baselineStart = row.getBaselineStart().getMillis();
    long currentStart = row.getCurrentStart().getMillis();
    Date date = new Date(currentStart);
    RegularTimePeriod timePeriod = new Millisecond(date);
    Metric metric = row.getMetrics().get(0);
    baseline.add(timePeriod, metric.getBaselineValue());
    current.add(timePeriod, metric.getCurrentValue());
  }

  final TimeSeriesCollection dataset = new TimeSeriesCollection();
  dataset.addSeries(current);
  dataset.addSeries(baseline);
  return dataset;
}
 
開發者ID:linkedin,項目名稱:pinot,代碼行數:25,代碼來源:AnomalyGraphGenerator.java

示例14: reportValues

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
@SuppressWarnings({"unchecked", "rawtypes"})
public void reportValues(Map vars, MarketEvent event) {
	Millisecond time = new Millisecond(new Date(event.getPhysicalTime()));

	ArrayList list = new ArrayList(vars.keySet());
	Iterator i = list.iterator();
	while (i.hasNext()) {
		ReportVariable var = (ReportVariable) i.next();
		Object value = vars.get(var);
		if (value instanceof Number) {
			double v = ((Number) value).doubleValue();
			if (!Double.isNaN(v)) {
				reportValue(var.getName(), new TimePeriodValue(time, v));
			}
		} else if (value instanceof Boolean) {
			reportValue(var.getName(), new TimePeriodValue(time, ((Boolean) value)
			    .booleanValue() ? 1 : 0));
		}
	}
}
 
開發者ID:phelps-sg,項目名稱:jasa,代碼行數:21,代碼來源:ReportVariableBoard.java

示例15: createDataSet

import org.jfree.data.time.Millisecond; //導入依賴的package包/類
private XYDataset createDataSet() {
	
	TimeSeriesCollection dataSet = new TimeSeriesCollection(TimeZone.getTimeZone("UTC"));
	
	TimeSeries s1 = new TimeSeries("Total Capital");
	TimeSeries s2 = new TimeSeries("Industry Wallet");
	TimeSeries s3 = new TimeSeries("Material Value");
	TimeSeries s4 = new TimeSeries("Market Orders Value");
	
	for (IndustryStatsEntry iS : cdb.getIndustryStats()) {
		s1.add(new Millisecond(iS.getDate()), iS.getTotalCapital());
		s2.add(new Millisecond(iS.getDate()), iS.getIndustryWallet());
		s3.add(new Millisecond(iS.getDate()), iS.getMaterialValue());
		s4.add(new Millisecond(iS.getDate()), iS.getMarketOrdersValue());
	}
	
	dataSet.addSeries(s1);
	dataSet.addSeries(s2);
	dataSet.addSeries(s3);
	dataSet.addSeries(s4);
	
	return dataSet;
}
 
開發者ID:johwerm,項目名稱:project-bacon,代碼行數:24,代碼來源:StatsPanel.java


注:本文中的org.jfree.data.time.Millisecond類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。