JavaObjectDictionary.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 24 May 2013 17:55:42 +0100
branchbuiltin-class-support
changeset 2629 cedb88626902
parent 2429 ebece4dcaab9
child 2711 a00302fe5083
permissions -rw-r--r--
Closing branch.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     1
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     2
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
     3
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
     4
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
     5
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     6
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     7
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     8
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
     9
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    10
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    11
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    12
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    13
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    14
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    15
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    16
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    17
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    18
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    19
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    20
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    21
"{ Package: 'stx:libjava' }"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    22
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    23
Object subclass:#JavaObjectDictionary
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    24
	instanceVariableNames:'dictionary'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    25
	classVariableNames:'Instance'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    26
	poolDictionaries:''
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    27
	category:'Languages-Java-Support'
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    28
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    29
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    30
!JavaObjectDictionary class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    31
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    32
copyright
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    33
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    34
 COPYRIGHT (c) 1996-2011 by Claus Gittinger
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    35
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    36
 New code and modifications done at SWING Research Group [1]:
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    37
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    38
 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    39
                            SWING Research Group, Czech Technical University in Prague
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    40
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    41
 This software is furnished under a license and may be used
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    42
 only in accordance with the terms of that license and with the
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    43
 inclusion of the above copyright notice.   This software may not
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    44
 be provided or otherwise made available to, or used by, any
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    45
 other person.  No title to or ownership of the software is
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    46
 hereby transferred.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    47
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    48
 [1] Code written at SWING Research Group contains a signature
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    49
     of one of the above copright owners. For exact set of such code,
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    50
     see the differences between this version and version stx:libjava
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
    51
     as of 1.9.2010
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    52
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    53
"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    54
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    55
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
    56
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    57
!JavaObjectDictionary class methodsFor:'instance creation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    58
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    59
instance
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    60
    Instance ifNil: [
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    61
        Instance := self basicNew initialize.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    62
    ].
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    63
    ^ Instance.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    64
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    65
    "Created: / 09-01-2011 / 20:48:16 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    66
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    67
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    68
new 
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    69
    "Currently singleton but in future Query may be more suitable"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    70
    ^ self instance.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    71
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    72
    "Created: / 09-01-2011 / 20:48:16 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    73
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    74
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
    75
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    76
!JavaObjectDictionary methodsFor:'accessing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    77
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    78
hasReflection: stClassName
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    79
    "return true if stClassName has reflection in Java World"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    80
    ^ (dictionary at: stClassName ifAbsent:  [ nil ]) notNil
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    81
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    82
    "Created: / 17-01-2011 / 19:20:58 / kursjan <kursjan@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    83
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    84
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    85
reflectionOf: stClassName
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    86
    ^ dictionary at: stClassName ifAbsent:  [ NoReflectionObject new ]
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    87
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    88
    "Created: / 09-01-2011 / 21:03:24 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    89
    "Modified: / 17-01-2011 / 10:39:43 / kursjan <kursjan@fit.cvut.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    90
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    91
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
    92
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    93
!JavaObjectDictionary methodsFor:'adding & removing'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    94
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    95
flush
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    96
    dictionary removeAll.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    97
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    98
    "Created: / 09-01-2011 / 21:44:04 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
    99
!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   100
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   101
registerJavaObject: aJavaClass toStObject: aStObject
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   102
    dictionary at: aStObject name asSymbol put: aJavaClass.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   103
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   104
    "Created: / 09-01-2011 / 21:40:00 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   105
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   106
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   107
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   108
!JavaObjectDictionary methodsFor:'initialization'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   109
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   110
initialize
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   111
    "Use StCounter instead of Counter"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   112
    dictionary := IdentityDictionary new.
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   113
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   114
    "Modified: / 09-01-2011 / 21:36:58 / Jan Kurs <kurs.jan@post.cz>"
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   115
! !
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   116
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   117
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   118
!JavaObjectDictionary class methodsFor:'documentation'!
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   119
2247
53ef1760305b added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   120
version_CVS
2396
fadc6d7a2f5b Updated to rev 009a0df3afce
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2353
diff changeset
   121
    ^ '$Header: /cvs/stx/stx/libjava/JavaObjectDictionary.st,v 1.4 2013-02-25 11:15:31 vrany Exp $'
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
   122
!
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
   123
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
   124
version_HG
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
   125
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
   126
    ^ '$Changeset: <not expanded> $'
2247
53ef1760305b added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   127
!
53ef1760305b added: #version_CVS
Claus Gittinger <cg@exept.de>
parents: 2152
diff changeset
   128
749
e898eaeff091 Synchronized with CVS repository at:
vranyj1
parents:
diff changeset
   129
version_SVN
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
   130
    ^ '§Id§'
2152
1cbdfbcc685c Jan's version
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 749
diff changeset
   131
! !
2353
fa7400d022a0 Updated to https://swing.fit.cvut.cz/hg/stx.libjava/rev/31f8b995905e
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 2247
diff changeset
   132