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