Tools__LintAnnotation.st
author Stefan Vogel <sv@exept.de>
Fri, 06 Jun 2014 09:30:25 +0200
changeset 14467 b048bbcddb92
parent 13857 f60d162c2af2
child 14995 9dc92bd11831
permissions -rw-r--r--
Sending of Image>>#clearMaskedPixels moved to Image >> #asFormOnDevice:

"
 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
    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintAnnotation.st,v 1.1 2014-02-05 18:59:56 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintAnnotation.st,v 1.1 2014-02-05 18:59:56 cg Exp $'
! !