First, the Segment class : like as the name,it's defined by 2
properties {begin,end}.
And then,the TimeSlice class is declared as a special Segment
class.it's properties' type is time/date. And it contains 3 methods
{contain,plus,minus} and 2 compare operations {__cmp__,__eq__} to
support operations {>,<,==,!= ..}.
#a and b both are TimeSlice objects.
a.contain(b): 2 TimeSlice objects contain 3 status:
[a.b,a.e] [b.b,b.e] : no cross ;0
[a.b, b.b,a.e b.e] : cross;1
[a.b,b.b,b.e,a.e] : contain;2
a.plus(b): 2 TimeSlice objects can plus (merge) and a.plus(b) ==
b.plus(a),because of above and the Time's physical meaning:
no cross: TimeSlice(a),TimeSlice(b)
cross: TimeSlice(a.b,b.e)
contain: TimeSlice(a)
a.minus(b):as above:
no cross:TimeSlice(a)
cross:
a<b TimeSlice(a.b,b.b)
a>b TimeSlice(b.e,a.e)
contain:
a<b TimeSlice(a.b,b.b),TimeSlice(b.e,a.e)
a>b TimeSlice()
3th,the Period is reflected by a set of TimeSlice.it contains 3
methods{RemoveSliceByValue,GetPeriodOrder,GetPeriodMerge}.
as above,blabla...
that's all.next post lets discuss the durative hypotheses.