/** * Given the value 'n' (which represents the current value), finds the * smallest x such that: 1) x matches the specified {@link CronTab} (as * far as this field is concerned.) 2) x>=n (inclusive) * * If there's no such bit, return -1. Note that if 'n' already matches * the crontab, the same n will be returned. */ private int ceil(CronTab c, int n) { long bits = bits(c); while ((bits | (1L << n)) != bits) { if (n > 60) { return -1; } n++; } return n; }
/** * Given the value 'n' (which represents the current value), finds the smallest x such that: * 1) x matches the specified {@link CronTab} (as far as this field is concerned.) * 2) x>=n (inclusive) * * If there's no such bit, return -1. Note that if 'n' already matches the crontab, the same n will be returned. */ private int ceil(CronTab c, int n) { long bits = bits(c); while ((bits|(1L<<n))!=bits) { if (n>60) return -1; n++; } return n; }
/** * Given the value 'n' (which represents the current value), finds the smallest x such that: * 1) x matches the specified {@link CronTab} (as far as this field is concerned.) * 2) x>=n (inclusive) * * If there's no such bit, return -1. Note that if 'n' already matches the crontab, the same n will be returned. */ private int ceil(CronTab c, int n) { long bits = bits(c); while ((bits|(1L<<n))!=bits) { if (n>60) return -1; n++; } return n; }
/** * Given the value 'n' (which represents the current value), finds the smallest x such that: * 1) x matches the specified {@link CronTab} (as far as this field is concerned.) * 2) x>=n (inclusive) * * If there's no such bit, return -1. Note that if 'n' already matches the crontab, the same n will be returned. */ private int ceil(CronTab c, int n) { long bits = bits(c); while ((bits|(1L<<n))!=bits) { if (n>60) return -1; n++; } return n; }
/** * Given the value 'n' (which represents the current value), finds the smallest x such that: * 1) x matches the specified {@link CronTab} (as far as this field is concerned.) * 2) x>=n (inclusive) * * If there's no such bit, return -1. Note that if 'n' already matches the crontab, the same n will be returned. */ private int ceil(CronTab c, int n) { long bits = bits(c); while ((bits|(1L<<n))!=bits) { if (n>60) return -1; n++; } return n; }
private int floor(CronTab c, int n) { long bits = bits(c); while ((bits | (1L << n)) != bits) { if (n == 0) { return -1; } n--; } return n; }
private int floor(CronTab c, int n) { long bits = bits(c); while ((bits|(1L<<n))!=bits) { if (n==0) return -1; n--; } return n; }
private int floor(CronTab c, int n) { long bits = bits(c); while ((bits|(1L<<n))!=bits) { if (n==0) return -1; n--; } return n; }
private int floor(CronTab c, int n) { long bits = bits(c); while ((bits|(1L<<n))!=bits) { if (n==0) return -1; n--; } return n; }
private int floor(CronTab c, int n) { long bits = bits(c); while ((bits|(1L<<n))!=bits) { if (n==0) return -1; n--; } return n; }
/** * Given the value 'n' (which represents the current value), finds the smallest x such that: * 1) x matches the specified {@link CronTab} (as far as this field is concerned.) * 2) x>=n (inclusive) * * If there's no such bit, return -1. Note that if 'n' already matches the crontab, the same n will be returned. */ private int ceil(CronTab c, int n) { long bits = bits(c); while ((bits|(1L<<n))!=bits) { if (n>60) return -1; n++; } return n; }
private int floor(CronTab c, int n) { long bits = bits(c); while ((bits|(1L<<n))!=bits) { if (n==0) return -1; n--; } return n; }