本文整理汇总了Java中org.jfree.data.time.RegularTimePeriod.next方法的典型用法代码示例。如果您正苦于以下问题:Java RegularTimePeriod.next方法的具体用法?Java RegularTimePeriod.next怎么用?Java RegularTimePeriod.next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.time.RegularTimePeriod
的用法示例。
在下文中一共展示了RegularTimePeriod.next方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSerialization4
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Serialize a time seroes chart, restore it, and check for equality.
*/
@Test
public void testSerialization4() {
RegularTimePeriod t = new Day();
TimeSeries series = new TimeSeries("Series 1");
series.add(t, 36.4);
t = t.next();
series.add(t, 63.5);
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(series);
JFreeChart c1 = ChartFactory.createTimeSeriesChart("Test", "Date",
"Value", dataset);
JFreeChart c2 = (JFreeChart) TestUtilities.serialised(c1);
assertEquals(c1, c2);
}
示例2: testEquals
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Tests the equals method.
*/
public void testEquals() {
final TimePeriodValues s1 = new TimePeriodValues("Time Series 1");
final TimePeriodValues s2 = new TimePeriodValues("Time Series 2");
final boolean b1 = s1.equals(s2);
assertFalse("b1", b1);
s2.setName("Time Series 1");
final boolean b2 = s1.equals(s2);
assertTrue("b2", b2);
final RegularTimePeriod p1 = new Day();
final RegularTimePeriod p2 = p1.next();
s1.add(p1, 100.0);
s1.add(p2, 200.0);
final boolean b3 = s1.equals(s2);
assertFalse("b3", b3);
s2.add(p1, 100.0);
s2.add(p2, 200.0);
final boolean b4 = s1.equals(s2);
assertTrue("b4", b4);
}
示例3: createDataset
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Creates a sample dataset.
*
* @param name the dataset name.
* @param base the starting value.
* @param start the starting period.
* @param count the number of values to generate.
*
* @return The dataset.
*/
private static XYDataset createDataset(String name, double base,
RegularTimePeriod start, int count) {
TimeSeries series = new TimeSeries(name, start.getClass());
RegularTimePeriod period = start;
double value = base;
for (int i = 0; i < count; i++) {
series.add(period, value);
period = period.next();
value = value * (1 + (Math.random() - 0.495) / 10.0);
}
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(series);
return dataset;
}
示例4: createDataset
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Creates a sample dataset.
*
* @param name the dataset name.
* @param base the starting value.
* @param start the starting period.
* @param count the number of values to generate.
*
* @return The dataset.
*/
private static XYDataset createDataset(String name, double base,
RegularTimePeriod start, int count) {
TimeSeries series = new TimeSeries(name);
RegularTimePeriod period = start;
double value = base;
for (int i = 0; i < count; i++) {
series.add(period, value);
period = period.next();
value = value * (1 + (Math.random() - 0.495) / 10.0);
}
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(series);
return dataset;
}
示例5: testSerialization4
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Serialize a time seroes chart, restore it, and check for equality.
*/
@Test
public void testSerialization4() {
RegularTimePeriod t = new Day();
TimeSeries series = new TimeSeries("Series 1");
series.add(t, 36.4);
t = t.next();
series.add(t, 63.5);
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(series);
JFreeChart c1 = ChartFactory.createTimeSeriesChart("Test", "Date",
"Value", dataset);
JFreeChart c2 = (JFreeChart) TestUtils.serialised(c1);
assertEquals(c1, c2);
}
示例6: createSeries
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Creates a time series for testing.
*
* @return a time series.
*/
private TimeSeries createSeries() {
RegularTimePeriod t = new Day();
final TimeSeries series = new TimeSeries("Test");
series.add(t, 1.0);
t = t.next();
series.add(t, 2.0);
t = t.next();
series.add(t, null);
t = t.next();
series.add(t, 4.0);
return series;
}
示例7: testEquals
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Tests the equals method.
*/
public void testEquals() {
final TimeSeries s1 = new TimeSeries("Time Series 1");
final TimeSeries s2 = new TimeSeries("Time Series 2");
final boolean b1 = s1.equals(s2);
assertFalse("b1", b1);
s2.setName("Time Series 1");
final boolean b2 = s1.equals(s2);
assertTrue("b2", b2);
final RegularTimePeriod p1 = new Day();
final RegularTimePeriod p2 = p1.next();
s1.add(p1, 100.0);
s1.add(p2, 200.0);
final boolean b3 = s1.equals(s2);
assertFalse("b3", b3);
s2.add(p1, 100.0);
s2.add(p2, 200.0);
final boolean b4 = s1.equals(s2);
assertTrue("b4", b4);
s1.setMaximumItemCount(100);
final boolean b5 = s1.equals(s2);
assertFalse("b5", b5);
s2.setMaximumItemCount(100);
final boolean b6 = s1.equals(s2);
assertTrue("b6", b6);
s1.setHistoryCount(100);
final boolean b7 = s1.equals(s2);
assertFalse("b7", b7);
s2.setHistoryCount(100);
final boolean b8 = s1.equals(s2);
assertTrue("b8", b8);
}
示例8: createSeries
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Creates a time series for testing.
*
* @return A time series.
*/
private TimeSeries createSeries() {
RegularTimePeriod t = new Day();
TimeSeries series = new TimeSeries("Test");
series.add(t, 1.0);
t = t.next();
series.add(t, 2.0);
t = t.next();
series.add(t, null);
t = t.next();
series.add(t, 4.0);
return series;
}
示例9: test1161329
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* A test for bug report 1161329.
*/
public void test1161329() {
TimePeriodValues tpv = new TimePeriodValues("Test");
RegularTimePeriod t = new Day();
tpv.add(t, 1.0);
t = t.next();
tpv.add(t, 2.0);
tpv.delete(0, 1);
assertEquals(0, tpv.getItemCount());
tpv.add(t, 2.0);
assertEquals(1, tpv.getItemCount());
}
示例10: testEquals
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Tests the equals method.
*/
public void testEquals() {
TimeSeries s1 = new TimeSeries("Time Series 1");
TimeSeries s2 = new TimeSeries("Time Series 2");
boolean b1 = s1.equals(s2);
assertFalse("b1", b1);
s2.setKey("Time Series 1");
boolean b2 = s1.equals(s2);
assertTrue("b2", b2);
RegularTimePeriod p1 = new Day();
RegularTimePeriod p2 = p1.next();
s1.add(p1, 100.0);
s1.add(p2, 200.0);
boolean b3 = s1.equals(s2);
assertFalse("b3", b3);
s2.add(p1, 100.0);
s2.add(p2, 200.0);
boolean b4 = s1.equals(s2);
assertTrue("b4", b4);
s1.setMaximumItemCount(100);
boolean b5 = s1.equals(s2);
assertFalse("b5", b5);
s2.setMaximumItemCount(100);
boolean b6 = s1.equals(s2);
assertTrue("b6", b6);
s1.setMaximumItemAge(100);
boolean b7 = s1.equals(s2);
assertFalse("b7", b7);
s2.setMaximumItemAge(100);
boolean b8 = s1.equals(s2);
assertTrue("b8", b8);
}
示例11: testSerialization4
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Serialize a time seroes chart, restore it, and check for equality.
*/
public void testSerialization4() {
RegularTimePeriod t = new Day();
TimeSeries series = new TimeSeries("Series 1");
series.add(t, 36.4);
t = t.next();
series.add(t, 63.5);
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(series);
JFreeChart c1 = ChartFactory.createTimeSeriesChart("Test", "Date",
"Value", dataset, true, true, true);
JFreeChart c2 = null;
try {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(buffer);
out.writeObject(c1);
out.close();
ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(
buffer.toByteArray()));
c2 = (JFreeChart) in.readObject();
in.close();
}
catch (Exception e) {
e.printStackTrace();
}
assertEquals(c1, c2);
}
示例12: getDataset
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public Dataset getDataset() {
Map<String, TimePeriodCollater> seriesToPeriodMap = new HashMap<String, TimePeriodCollater>();
TimeTableXYDataset dataset = new TimeTableXYDataset();
for (ResultsSummary summary : getResultsList())
{
String[] seriesKeys = getSeriesKeys(summary);
if (seriesKeys != null) {
for (int i = 0; (i < seriesKeys.length); i++) {
String key = seriesKeys[i];
Date buildDate = summary.getBuildDate();
TimePeriodCollater collaterForSeries = (TimePeriodCollater) seriesToPeriodMap.get(key);
if (collaterForSeries == null) {
collaterForSeries = createCollater(getPeriod(buildDate, getPeriodRange()), key);
collaterForSeries.addResult(summary);
seriesToPeriodMap.put(key, collaterForSeries);
} else if (isInPeriod(collaterForSeries.getPeriod(), buildDate)) {
collaterForSeries.addResult(summary);
} else {
writeCollaterToDataSet(dataset, collaterForSeries);
RegularTimePeriod nextPeriod = collaterForSeries.getPeriod().next();
while (!isInPeriod(nextPeriod, buildDate)) {
nextPeriod = nextPeriod.next();
}
collaterForSeries = createCollater(nextPeriod, key);
collaterForSeries.addResult(summary);
seriesToPeriodMap.put(key, collaterForSeries);
}
}
}
}
Collection<TimePeriodCollater> finalPeriods = seriesToPeriodMap.values();
TimePeriodCollater timePeriodCollater;
for (Iterator<TimePeriodCollater> iterator = finalPeriods.iterator(); iterator.hasNext(); writeCollaterToDataSet(dataset, timePeriodCollater)) {
timePeriodCollater = iterator.next();
}
return dataset;
}
开发者ID:javiergutites,项目名称:bamboo-checkstyle-plugin,代码行数:39,代码来源:AbstractMultiSeriesTimePeriodCollector.java
示例13: testSerialization4
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Serialize a time seroes chart, restore it, and check for equality.
*/
public void testSerialization4() {
RegularTimePeriod t = new Day();
TimeSeries series = new TimeSeries("Series 1");
series.add(t, 36.4);
t = t.next();
series.add(t, 63.5);
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(series);
JFreeChart c1 = ChartFactory.createTimeSeriesChart("Test", "Date",
"Value", dataset, true);
JFreeChart c2 = null;
try {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutput out = new ObjectOutputStream(buffer);
out.writeObject(c1);
out.close();
ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(
buffer.toByteArray()));
c2 = (JFreeChart) in.readObject();
in.close();
}
catch (Exception e) {
e.printStackTrace();
}
assertEquals(c1, c2);
}
示例14: createSeries
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Creates a time series for testing.
*
* @return A time series.
*/
private TimeSeries createSeries() {
RegularTimePeriod t = new Day();
TimeSeries series = new TimeSeries("Test");
series.add(t, 1.0);
t = t.next();
series.add(t, 2.0);
t = t.next();
series.add(t, null);
t = t.next();
series.add(t, 4.0);
return series;
}
示例15: testEquals
import org.jfree.data.time.RegularTimePeriod; //导入方法依赖的package包/类
/**
* Tests the equals method.
*/
public void testEquals() {
TimePeriodValues s1 = new TimePeriodValues("Time Series 1");
TimePeriodValues s2 = new TimePeriodValues("Time Series 2");
boolean b1 = s1.equals(s2);
assertFalse("b1", b1);
s2.setKey("Time Series 1");
boolean b2 = s1.equals(s2);
assertTrue("b2", b2);
// domain description
s1.setDomainDescription("XYZ");
assertFalse(s1.equals(s2));
s2.setDomainDescription("XYZ");
assertTrue(s1.equals(s2));
// domain description - null
s1.setDomainDescription(null);
assertFalse(s1.equals(s2));
s2.setDomainDescription(null);
assertTrue(s1.equals(s2));
// range description
s1.setRangeDescription("XYZ");
assertFalse(s1.equals(s2));
s2.setRangeDescription("XYZ");
assertTrue(s1.equals(s2));
// range description - null
s1.setRangeDescription(null);
assertFalse(s1.equals(s2));
s2.setRangeDescription(null);
assertTrue(s1.equals(s2));
RegularTimePeriod p1 = new Day();
RegularTimePeriod p2 = p1.next();
s1.add(p1, 100.0);
s1.add(p2, 200.0);
boolean b3 = s1.equals(s2);
assertFalse("b3", b3);
s2.add(p1, 100.0);
s2.add(p2, 200.0);
boolean b4 = s1.equals(s2);
assertTrue("b4", b4);
}