本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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));
}
}
}
示例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;
}