本文整理匯總了Java中java.time.YearMonth.isAfter方法的典型用法代碼示例。如果您正苦於以下問題:Java YearMonth.isAfter方法的具體用法?Java YearMonth.isAfter怎麽用?Java YearMonth.isAfter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.time.YearMonth
的用法示例。
在下文中一共展示了YearMonth.isAfter方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isExtendedMonth
import java.time.YearMonth; //導入方法依賴的package包/類
/**
* A simple check to see if the given month is part of the extended months.
*
* @param month the month to check
* @return true if the given month is part of the extended months
* @see #setExtendedViewUnit(ViewUnit)
* @see #setExtendedUnitsBackward(int)
* @see #setExtendedUnitsForward(int)
*/
public final boolean isExtendedMonth(YearMonth month) {
if (month != null) {
YearMonth extendedStart = getExtendedStartMonth();
if ((month.equals(extendedStart) || month.isAfter(extendedStart)) && month.isBefore(getStartMonth())) {
return true;
}
YearMonth extendedEnd = getExtendedEndMonth();
if ((month.equals(extendedEnd) || month.isBefore(extendedEnd)) && month.isAfter(getEndMonth())) {
return true;
}
}
return false;
}
示例2: buildCells
import java.time.YearMonth; //導入方法依賴的package包/類
private void buildCells() {
positionToDateCellMap.clear();
dateToPositionMap.clear();
cellMap.clear();
YearMonth start = getSkinnable().getExtendedStartMonth();
YearMonth end = getSkinnable().getExtendedEndMonth();
int colIndex = 0;
grid.getColumnConstraints().clear();
grid.getChildren().clear();
while (!start.isAfter(end)) {
ColumnConstraints columnConstraints = new ColumnConstraints();
columnConstraints.setFillWidth(true);
columnConstraints.setMinWidth(Region.USE_PREF_SIZE);
columnConstraints.setMaxWidth(Double.MAX_VALUE);
grid.getColumnConstraints().add(columnConstraints);
buildCells(start, colIndex);
start = start.plusMonths(1);
colIndex++;
}
grid.getColumnConstraints().forEach(con -> con.setPercentWidth(100d / (double) grid.getColumnConstraints().size()));
updateEntries("cells were rebuild");
updateToday();
updateSelected();
}