Changeset 18 for timeline/src/main/java
- Timestamp:
- 06/11/20 16:34:40 (4 years ago)
- Location:
- timeline/src/main/java/geniusweb/progress
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
timeline/src/main/java/geniusweb/progress/Progress.java
r1 r18 34 34 * eye on {@link #getTerminationTime()}. 35 35 */ 36 Double get( long currentTimeMs);36 Double get(Long currentTimeMs); 37 37 38 38 /** … … 51 51 * @return true iff the progress has passed the deadline. 52 52 */ 53 boolean isPastDeadline( long currentTimeMs);53 boolean isPastDeadline(Long currentTimeMs); 54 54 } -
timeline/src/main/java/geniusweb/progress/ProgressRounds.java
r12 r18 9 9 /** 10 10 * progress in terms of number of rounds. The round has to be updated by the 11 * user of this class, calling {@link #advance()}. 11 * user of this class, calling {@link #advance()}. immutable. 12 12 */ 13 13 @JsonTypeName("rounds") … … 49 49 /** 50 50 * 51 * @return the current round. First round is 0. It is not recommended to use 52 * this, as this may make your code working with rounds only. 51 * @return the current round. First round is 0. It is recommended that you 52 * use the functions in {@link Progress} instead of this, to ensure 53 * your code works with all implementations of Progress including 54 * future developments. 53 55 */ 54 56 public Integer getCurrentRound() { … … 58 60 /** 59 61 * 60 * @return total number of rounds. It is not recommended to use this, as 61 * this may make your code working with rounds only. 62 * @return total number of rounds. It is recommended that you use the 63 * functions in {@link Progress} instead of this, to ensure your 64 * code works with all implementations of Progress including future 65 * developments. 62 66 */ 63 67 public Integer getTotalRounds() { … … 66 70 67 71 @Override 68 public Double get( long currentTimeMs) {72 public Double get(Long currentTimeMs) { 69 73 // deadline and current both are limited to MAXINT is 32 bits; double 70 74 // fits 52 … … 79 83 80 84 @Override 81 public boolean isPastDeadline( long currentTimeMs) {85 public boolean isPastDeadline(Long currentTimeMs) { 82 86 return currentRound >= duration || currentTimeMs > endtime.getTime(); 83 87 } -
timeline/src/main/java/geniusweb/progress/ProgressTime.java
r1 r18 51 51 52 52 @Override 53 public Double get( long currentTimeMs) {53 public Double get(Long currentTimeMs) { 54 54 long delta = currentTimeMs - start.getTime(); 55 55 // double should have ~53 digits of precision, and we're computing … … 66 66 67 67 @Override 68 public boolean isPastDeadline( long currentTimeMs) {68 public boolean isPastDeadline(Long currentTimeMs) { 69 69 return currentTimeMs > start.getTime() + duration; 70 70 }
Note:
See TracChangeset
for help on using the changeset viewer.