本文整理匯總了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();
}