SmallSense__UnknownType.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 17 Sep 2013 17:18:14 +0100
changeset 88 4db839c0a78f
parent 67 020b7461b15e
child 174 3e08d765d86f
permissions -rw-r--r--
Fix in CompletionWindow>>complete Fixed completion in cases where completed text does not start with typed text. i.e, original source is `1 fa` but completing `1 exponent`.

"{ Package: 'jv:smallsense' }"

"{ NameSpace: SmallSense }"

Type subclass:#UnknownType
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'SmallSense-Smalltalk-Types'
!

UnknownType class instanceVariableNames:'theOneAndOnlyInstance'

"
 No other class instance variables are inherited by this class.
"
!


!UnknownType class methodsFor:'instance creation'!

flushSingleton
    "flushes the cached singleton"

    theOneAndOnlyInstance := nil

    "
     self flushSingleton
    "
!

new
    "returns a singleton"

    ^ self theOneAndOnlyInstance.
!

theOneAndOnlyInstance
    "returns a singleton"

    theOneAndOnlyInstance isNil ifTrue:[
        theOneAndOnlyInstance := self basicNew initialize.
    ].
    ^ theOneAndOnlyInstance.
! !

!UnknownType methodsFor:'accessing'!

trustfullness
    "Return an integer value in <1..100>, higher value
     means the object is more likely of that type."

    ^ 1

    "Modified: / 17-05-2012 / 19:20:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

trustfullness: anInteger
    "Nothing to do here"

    "Created: / 17-05-2012 / 19:44:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!UnknownType methodsFor:'comparing'!

= another
    "superclass SmallSenseType says that I am responsible to implement this method"

    ^self == another

    "Modified: / 16-12-2011 / 13:37:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

hash
    "superclass SmallSenseType says that I am responsible to implement this method"

    ^ self identityHash

    "Modified: / 16-12-2011 / 13:37:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!UnknownType methodsFor:'enumerating'!

classesDo:aBlock
    "Enumerate all classes that this type represents"

    ^ aBlock value: Object

    "Modified: / 16-12-2011 / 13:34:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!UnknownType methodsFor:'operations'!

classSide
    "superclass SmallSenseType says that I am responsible to implement this method"

    ^ self class new

    "Modified: / 16-12-2011 / 13:21:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

instanceSide
    "superclass SmallSenseType says that I am responsible to implement this method"

    ^ self class new

    "Modified: / 16-12-2011 / 13:21:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

union: anotherType

    ^anotherType

    "Created: / 16-12-2011 / 02:20:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!UnknownType methodsFor:'printing & storing'!

printWithoutAnglesOn:aStream
    "superclass SmallSenseType says that I am responsible to implement this method"

    ^ aStream nextPut:$?

    "Modified: / 16-12-2011 / 02:19:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!UnknownType methodsFor:'testing'!

isUnknownType

    ^true

    "Created: / 16-12-2011 / 13:29:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!UnknownType class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_SVN
    ^ '$Id: SmallSenseUnknownType.st 8000 2012-05-17 23:16:11Z vranyj1 $'
! !