class: TimeDuration
authorStefan Vogel <sv@exept.de>
Wed, 07 May 2014 15:36:51 +0200
changeset 16403 ddd36af8ddd7
parent 16402 e0ad30a9882d
child 16404 ebb89de51a93
class: TimeDuration added: #abs
TimeDuration.st
--- a/TimeDuration.st	Wed May 07 15:36:16 2014 +0200
+++ b/TimeDuration.st	Wed May 07 15:36:51 2014 +0200
@@ -529,6 +529,18 @@
     "
 !
 
+abs
+    timeEncoding >= 0 ifTrue:[
+        ^ self. 
+    ].
+    ^ self class new timeEncoding:(timeEncoding negated)
+
+    "
+        (TimeDuration fromSeconds:20000) abs
+        (TimeDuration fromSeconds:-20000) abs
+    "
+!
+
 negated
     ^ self class new timeEncoding:(timeEncoding negated)
 !
@@ -1077,11 +1089,11 @@
 !TimeDuration class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/TimeDuration.st,v 1.66 2014-04-16 22:30:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/TimeDuration.st,v 1.67 2014-05-07 13:36:51 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/TimeDuration.st,v 1.66 2014-04-16 22:30:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/TimeDuration.st,v 1.67 2014-05-07 13:36:51 stefan Exp $'
 ! !