/** * Creates a new unit. * * The {@code rollUnitType} and {@code rollCount} are intended to roll the date forward when it falls on a "hidden" part of the DateAxis. For example, if the tick size is 1 week (7 days), but Saturday and Sunday are hidden, if the ticks happen to fall on Saturday, none of them will be visible. A sensible {@code rollUnitType}/{@code rollCount} would be 1 day, so that the date would roll forward to the following Monday, which is visible. * * @param unitType the unit. * @param multiple the multiple. * @param rollUnitType the roll unit. * @param rollMultiple the roll multiple. * @param formatter the date formatter ({@code null} not permitted). * * @since 1.0.13 */ public DateTickUnit(DateTickUnitType unitType, int multiple, DateTickUnitType rollUnitType, int rollMultiple, DateFormat formatter) { super(DateTickUnit.getMillisecondCount(unitType, multiple)); Args.nullNotPermitted(formatter, "formatter"); if (multiple <= 0) { throw new IllegalArgumentException("Requires 'multiple' > 0."); } if (rollMultiple <= 0) { throw new IllegalArgumentException("Requires 'rollMultiple' > 0."); } this.unitType = unitType; this.count = multiple; this.rollUnitType = rollUnitType; this.rollCount = rollMultiple; this.formatter = formatter; }
DateTickUnitType rollUnitType, int rollMultiple, DateFormat formatter) { super(DateTickUnit.getMillisecondCount(unitType, multiple)); if (formatter == null) { throw new IllegalArgumentException("Null 'formatter' argument.");