本文整理汇总了Java中java.time.LocalDate.MAX属性的典型用法代码示例。如果您正苦于以下问题:Java LocalDate.MAX属性的具体用法?Java LocalDate.MAX怎么用?Java LocalDate.MAX使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.time.LocalDate
的用法示例。
在下文中一共展示了LocalDate.MAX属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
@BeforeMethod
public void setUp() {
TEST_2007_07_15 = LocalDate.of(2007, 7, 15);
LocalDate max = LocalDate.MAX;
LocalDate min = LocalDate.MIN;
MAX_VALID_EPOCHDAYS = max.toEpochDay();
MIN_VALID_EPOCHDAYS = min.toEpochDay();
MAX_DATE = max;
MIN_DATE = min;
MAX_INSTANT = max.atStartOfDay(ZoneOffset.UTC).toInstant();
MIN_INSTANT = min.atStartOfDay(ZoneOffset.UTC).toInstant();
}
示例2: main
public static void main(String[] args) throws XPathExpressionException,
ParserConfigurationException, SAXException, IOException,
TransformerException {
char separator = '+';
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE;
boolean filterFrom = false;
boolean filterTo = false;
boolean applyKeywordSearch = false;
LocalDate fromDate = LocalDate.MIN;
LocalDate toDate = LocalDate.MAX;
String keyword = "";
// Load the Data into FusableDataSet
FusibleDataSet<Event, Attribute> fusibleDataSetD = new FusibleHashedDataSet<>();
// fusibleDataSetD.loadFromTSV(new File("WDI/usecase/event/input/dbpedia-1_s.tsv"),
// new EventFactory(dateTimeFormatter, filterFrom, fromDate, filterTo, toDate, applyKeywordSearch, keyword), "events/event", separator, dateTimeFormatter, false, fromDate, false, toDate, true, keyword);
FusibleDataSet<Event, Attribute> fusibleDataSetY = new FusibleHashedDataSet<>();
// fusibleDataSetY.loadFromTSV(new File("WDI/usecase/event/input/yago-1_s.tsv"),
// new EventFactory(dateTimeFormatter, filterFrom, fromDate, filterTo, toDate, applyKeywordSearch, keyword), "events/event", separator, dateTimeFormatter, false, fromDate, false, toDate, true, keyword);
runDataFusion(fusibleDataSetD,
fusibleDataSetY,
//null,
separator, dateTimeFormatter, filterFrom, fromDate, filterTo, toDate, applyKeywordSearch, keyword);
}
示例3: samples
@Override
protected List<TemporalAccessor> samples() {
TemporalAccessor[] array = {TEST_2007_07_15, LocalDate.MAX, LocalDate.MIN, };
return Arrays.asList(array);
}
示例4: testCrossSectionalReturns
@Test()
public void testCrossSectionalReturns() throws Exception {
LocalDate startDate = LocalDate.MIN;
LocalDate endDate = LocalDate.MAX;
final Index<LocalDate> rowKeys = Index.of(LocalDate.class, 100);
final Index<String> tickers = Index.of("BLK", "CSCO", "SPY", "YHOO", "VNQI", "VGLT", "VCLT");
final DataFrame<LocalDate,String> closePrices = DataFrame.ofDoubles(rowKeys, tickers);
for (String ticker : tickers) {
System.out.println("Loading data for ticker " + ticker);
final DataFrame<LocalDate,String> quotes = TestDataFrames.getQuotes(ticker);
quotes.tail(10).out().print();
closePrices.rows().addAll(quotes.rows().keyArray());
final LocalDate firstKey = quotes.rows().firstKey().get();
final LocalDate lastKey = quotes.rows().lastKey().get();
startDate = firstKey.isAfter(startDate) ? firstKey : startDate;
endDate = lastKey.isBefore(endDate) ? lastKey : endDate;
quotes.rows().forEach(row -> {
final LocalDate date = row.key();
final double price = row.getDouble("Adj Close");
closePrices.data().setDouble(date, ticker, price);
});
}
final Set<LocalDate> nanDates = new HashSet<>();
closePrices.rows().forEach(row -> row.forEachValue(v -> {
final double value = v.getDouble();
if (Double.isNaN(value)) {
final LocalDate rowKey = row.key();
nanDates.add(rowKey);
if (rowKey.getYear() == 2014) {
System.out.println(rowKey);
}
}
}));
final DataFrame<LocalDate,String> selection = closePrices.rows().select(row -> !nanDates.contains(row.key()));
final DataFrame<LocalDate,String> sorted = selection.rows().sort((row1, row2) -> row1.key().compareTo(row2.key()));
final DataFrame<LocalDate,String> returns = sorted.calc().percentChanges();
returns.rows().first().get().applyDoubles(v -> 0d);
returns.head(10).out().print();
returns.cols().stats().correlation().out().print();
}