Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private TimeInterval StartTime,EndTime;
- public TimeInterval(Time time,Time time2){
- StartTime = (TimeInterval) time; //cannot convert from Time to TimeInterval
- EndTime = (TimeInterval) time2; //cannot convert from Time to TimeInterval
- }
- @Override
- public int compareTo(TimeInterval that) {
- if (StartTime.compareTo(that.EndTime) > 0) {
- return 1;
- }
- if (EndTime.compareTo(that.StartTime) < 0) {
- return -1;
- }
- return 0;
- }
- private Time StartTime,EndTime;
- public TimeInterval(Time time,Time time2){
- StartTime = time;
- EndTime = time2;
- }
- @Override
- public int compareTo(TimeInterval that) {
- if (((TimeInterval)StartTime).compareTo((TimeInterval)that.EndTime) > 0) {
- return 1;
- }
- if (((TimeInterval)EndTime).compareTo((TimeInterval)that.StartTime) < 0) {
- return -1;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment