本文整理汇总了Java中org.jfree.data.time.Second类的典型用法代码示例。如果您正苦于以下问题:Java Second类的具体用法?Java Second怎么用?Java Second使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Second类属于org.jfree.data.time包,在下文中一共展示了Second类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testGetFirstMillisecondWithTimeZone
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Some checks for the getFirstMillisecond(TimeZone) method.
*/
public void testGetFirstMillisecondWithTimeZone() {
Second s = new Second(50, 59, 15, 1, 4, 1950);
TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
assertEquals(-623289610000L, s.getFirstMillisecond(zone));
// try null calendar
boolean pass = false;
try {
s.getFirstMillisecond((TimeZone) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
示例2: testGetFirstMillisecondWithCalendar
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Some checks for the getFirstMillisecond(TimeZone) method.
*/
public void testGetFirstMillisecondWithCalendar() {
Second s = new Second(55, 40, 2, 15, 4, 2000);
GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
assertEquals(955762855000L, s.getFirstMillisecond(calendar));
// try null calendar
boolean pass = false;
try {
s.getFirstMillisecond((Calendar) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
示例3: testGetLastMillisecondWithTimeZone
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Some checks for the getLastMillisecond(TimeZone) method.
*/
public void testGetLastMillisecondWithTimeZone() {
Second s = new Second(55, 1, 2, 7, 7, 1950);
TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
assertEquals(-614962684001L, s.getLastMillisecond(zone));
// try null calendar
boolean pass = false;
try {
s.getLastMillisecond((TimeZone) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
示例4: testGetLastMillisecondWithCalendar
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Some checks for the getLastMillisecond(TimeZone) method.
*/
public void testGetLastMillisecondWithCalendar() {
Second s = new Second(50, 45, 21, 21, 4, 2001);
GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
assertEquals(987885950999L, s.getLastMillisecond(calendar));
// try null calendar
boolean pass = false;
try {
s.getLastMillisecond((Calendar) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
示例5: createDatasetNumberRequestsUntampered
import org.jfree.data.time.Second; //导入依赖的package包/类
private IntervalXYDataset createDatasetNumberRequestsUntampered()
{
Date currentDate;
long currentMsTs;
final TimeSeries series = new TimeSeries( "Sent Untampered Requests per Second" );
if ( model.getMapLogEntryIntervalUntampered() != null )
{
for ( Map.Entry<Integer, LogEntryInterval> log : model.getMapLogEntryIntervalUntampered().entrySet() )
{
// Create TS from model.startTime and log.getIntervalNumber();
currentMsTs = model.getTsAttackStart() + log.getValue().getIntervalNumber();
currentDate = new Date( currentMsTs );
series.add( new Second( currentDate ), ( log.getValue().getNumberRequests() ) );
}
}
final TimeSeriesCollection dataset = new TimeSeriesCollection( series );
dataset.setXPosition( TimePeriodAnchor.MIDDLE );
return dataset;
}
示例6: createDatasetNumberRequestsTampered
import org.jfree.data.time.Second; //导入依赖的package包/类
private IntervalXYDataset createDatasetNumberRequestsTampered()
{
Date currentDate;
long currentMsTs;
final TimeSeries series = new TimeSeries( "Sent Tampered Requests per Second" );
if ( model.getMapLogEntryIntervalTampered() != null )
{
for ( Map.Entry<Integer, LogEntryInterval> log : model.getMapLogEntryIntervalTampered().entrySet() )
{
// Create TS from model.startTime and log.getIntervalNumber();
currentMsTs = model.getTsAttackStart() + log.getValue().getIntervalNumber();
currentDate = new Date( currentMsTs );
series.add( new Second( currentDate ), ( log.getValue().getNumberRequests() ) );
}
}
final TimeSeriesCollection dataset = new TimeSeriesCollection( series );
dataset.setXPosition( TimePeriodAnchor.MIDDLE );
return dataset;
}
示例7: testGetFirstMillisecondWithTimeZone
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Some checks for the getFirstMillisecond(TimeZone) method.
*/
public void testGetFirstMillisecondWithTimeZone() {
Second s = new Second(50, 59, 15, 1, 4, 1950);
TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
Calendar c = new GregorianCalendar(zone);
assertEquals(-623289610000L, s.getFirstMillisecond(c));
// try null calendar
boolean pass = false;
try {
s.getFirstMillisecond((Calendar) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
示例8: testGetFirstMillisecondWithCalendar
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Some checks for the getFirstMillisecond(TimeZone) method.
*/
public void testGetFirstMillisecondWithCalendar() {
Second s = new Second(55, 40, 2, 15, 4, 2000);
GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));
assertEquals(955766455000L, s.getFirstMillisecond(calendar));
// try null calendar
boolean pass = false;
try {
s.getFirstMillisecond((Calendar) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
示例9: testGetLastMillisecondWithTimeZone
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Some checks for the getLastMillisecond(TimeZone) method.
*/
public void testGetLastMillisecondWithTimeZone() {
Second s = new Second(55, 1, 2, 7, 7, 1950);
TimeZone zone = TimeZone.getTimeZone("America/Los_Angeles");
Calendar c = new GregorianCalendar(zone);
assertEquals(-614962684001L, s.getLastMillisecond(c));
// try null calendar
boolean pass = false;
try {
s.getLastMillisecond((Calendar) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
示例10: testGetLastMillisecondWithCalendar
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Some checks for the getLastMillisecond(TimeZone) method.
*/
public void testGetLastMillisecondWithCalendar() {
Second s = new Second(50, 45, 21, 21, 4, 2001);
GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));
assertEquals(987889550999L, s.getLastMillisecond(calendar));
// try null calendar
boolean pass = false;
try {
s.getLastMillisecond((Calendar) null);
}
catch (NullPointerException e) {
pass = true;
}
assertTrue(pass);
}
示例11: createDataset
import org.jfree.data.time.Second; //导入依赖的package包/类
private XYDataset createDataset(TimeSeries timeseries[], TimeSeries timeSeriesSensibilidad[]){
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.setDomainIsPointsInTime(true);
for(int i = 0; i < timeseries.length;i++){
timeseries[i] = new TimeSeries("Path" + (i+1), Second.class);
//path1.add(new Second(0, 0, 0, 7, 12, 2011), 0.0);
dataset.addSeries(timeseries[i]);
}
for(int i = 0; i < timeSeriesSensibilidad.length;i++){
timeSeriesSensibilidad[i] = new TimeSeries("Sensibilidad Rx", Second.class);
//path1.add(new Second(0, 0, 0, 7, 12, 2011), 0.0);
dataset.addSeries(timeSeriesSensibilidad[i]);
}
/*
fecha = new Date();
timeSeriesSensibilidad.addOrUpdate(new Second(fecha.getSeconds(), fecha.getMinutes(), fecha.getHours(),
fecha.getDate(), fecha.getMonth()+1, 2012), -80);
*/
return dataset;
}
示例12: createTimeDataset
import org.jfree.data.time.Second; //导入依赖的package包/类
private XYDataset createTimeDataset(ChartValue[] values)
{
TimeSeries series = null;
TimeSeriesCollection seriesCollection = new TimeSeriesCollection();
for (int i = 0; i < values.length; i++)
{
TimeChartValue value = (TimeChartValue) values[i];
if (series == null || !series.getKey().equals(value.getSeries()))
{
if (series != null)
{
seriesCollection.addSeries(series);
}
series = new TimeSeries(value.getSeries(), Second.class);
}
series.add(new Second(value.getTime()), value.getValue());
}
seriesCollection.addSeries(series);
return seriesCollection;
}
示例13: createAdditionalDataset
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Builds an additional JFreeChart dataset from a ta4j time series.
* @param series a time series
* @return an additional dataset
*/
private static TimeSeriesCollection createAdditionalDataset(TimeSeries series) {
ClosePriceIndicator indicator = new ClosePriceIndicator(series);
TimeSeriesCollection dataset = new TimeSeriesCollection();
org.jfree.data.time.TimeSeries chartTimeSeries = new org.jfree.data.time.TimeSeries("Btc price");
for (int i = 0; i < series.getTickCount(); i++) {
Tick tick = series.getTick(i);
chartTimeSeries.add(new Second(new Date(tick.getEndTime().toEpochSecond() * 1000)), indicator.getValue(i).toDouble());
}
dataset.addSeries(chartTimeSeries);
return dataset;
}
示例14: testEquals
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Tests the equals method.
*/
public void testEquals() {
final Day day1 = new Day(29, SerialDate.MARCH, 2002);
final Hour hour1 = new Hour(15, day1);
final Minute minute1 = new Minute(15, hour1);
final Second second1 = new Second(34, minute1);
final Millisecond milli1 = new Millisecond(999, second1);
final Day day2 = new Day(29, SerialDate.MARCH, 2002);
final Hour hour2 = new Hour(15, day2);
final Minute minute2 = new Minute(15, hour2);
final Second second2 = new Second(34, minute2);
final Millisecond milli2 = new Millisecond(999, second2);
assertTrue(milli1.equals(milli2));
}
示例15: testEquals
import org.jfree.data.time.Second; //导入依赖的package包/类
/**
* Tests the equals method.
*/
public void testEquals() {
final Day day1 = new Day(29, SerialDate.MARCH, 2002);
final Hour hour1 = new Hour(15, day1);
final Minute minute1 = new Minute(15, hour1);
final Second second1 = new Second(34, minute1);
final Day day2 = new Day(29, SerialDate.MARCH, 2002);
final Hour hour2 = new Hour(15, day2);
final Minute minute2 = new Minute(15, hour2);
final Second second2 = new Second(34, minute2);
assertTrue(second1.equals(second2));
}