Tools__LintAnnotation.st
branchjv
changeset 12128 a7ff7d66ee85
child 12431 9f0c59c742d5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tools__LintAnnotation.st	Mon Jan 30 17:49:41 2012 +0000
@@ -0,0 +1,134 @@
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+"{ Package: 'stx:libtool' }"
+
+"{ NameSpace: Tools }"
+
+Object subclass:#LintAnnotation
+	instanceVariableNames:'startPosition endPosition line rule'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Interface-Lint'
+!
+
+!LintAnnotation class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+! !
+
+!LintAnnotation class methodsFor:'instance creation'!
+
+from: start to: end rule: rule
+
+    ^self new
+        startPosition: start;
+        endPosition: end;
+        rule: rule;
+        yourself.
+
+    "Created: / 30-01-2012 / 15:23:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!LintAnnotation methodsFor:'accessing'!
+
+endPosition
+    ^ endPosition
+!
+
+endPosition:anInteger
+    endPosition := anInteger.
+!
+
+line
+    ^ line
+!
+
+line:anInteger
+    line := anInteger.
+!
+
+rule
+    ^ rule
+!
+
+rule:anRBLintRule
+    self assert: anRBLintRule isComposite not.
+    rule := anRBLintRule.
+
+    "Modified: / 30-01-2012 / 15:22:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+startPosition
+    ^ startPosition
+!
+
+startPosition:anInteger
+    startPosition := anInteger.
+! !
+
+!LintAnnotation methodsFor:'comparing'!
+
+< anObject
+
+    anObject isNumber ifTrue:[^startPosition < anObject].
+    anObject class == self class ifFalse:[^false].
+
+    ^endPosition < anObject startPosition
+
+    "Created: / 14-02-2010 / 13:39:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+<= aMagnitude
+    "return true, if the argument is greater or equal than the receiver"
+
+    ^ (aMagnitude < self) not
+!
+
+= anObject
+
+    anObject class == self class ifFalse:[^false].
+
+    ^startPosition == (anObject startPosition) and:
+        [endPosition == (anObject endPosition) and:
+            [rule = anObject rule]]
+
+    "Created: / 14-02-2010 / 13:33:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+> aMagnitude
+    "return true, if the argument is less than the receiver"
+
+    ^ aMagnitude < self
+!
+
+>= aMagnitude
+    "return true, if the argument is less or equal than the receiver"
+
+    ^ (self < aMagnitude) not
+! !
+
+!LintAnnotation class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id: Tools__LintAnnotation.st 7854 2012-01-30 17:49:41Z vranyj1 $'
+! !