Code example for NavigableSet

Methods: ceilingfirst

0
    public ValueResult getTimeAfter(final Calendar afterTimeCalendar) {
 
        ValueResult valueResult = new ValueResult();
        int currentFieldValue = afterTimeCalendar.get(getCalendarField());
 
        Integer foundValue = this.allValues.ceiling(currentFieldValue);
        if (foundValue != null) {
            valueResult.setResult(foundValue.intValue());
        } else { 
            // use the next first available value 
            valueResult.setResult(this.allValues.first());
            valueResult.setNeedsIncrement(true);
        } 
        return valueResult;
    } 
 
 
 
    /** 
     * @return string representation