More extensions for List development
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 07 Oct 2013 19:16:50 +0100
branchdevelopment
changeset 2807 46f6ef83cce6
parent 2806 41d1af53f1eb
child 2808 13b4f59e3b0a
child 2810 7072f7fb65f6
More extensions for List
Java.st
JavaObject.st
Make.proto
abbrev.stc
java/extensions/java/util/AbstractList.st
java/extensions/java/util/List.st
libjava.rc
stx_libjava.st
--- a/Java.st	Mon Oct 07 11:54:25 2013 +0100
+++ b/Java.st	Mon Oct 07 19:16:50 2013 +0100
@@ -1308,14 +1308,13 @@
     sourceFile isFilename ifFalse: [
         ^ nil
     ].
-    src := sourceFile contentsOfEntireFile asString.
-    ^ src
+    ^ sourceFile readStream
 
     "
         Java classSourceOf: JAVA::java::lang::Object"
 
     "Modified: / 27-01-1999 / 20:40:30 / cg"
-    "Modified: / 19-09-2013 / 12:48:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 07-10-2013 / 17:01:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 classSourceStreamForFile: filename package: jpackage in: dirOrZipFile 
--- a/JavaObject.st	Mon Oct 07 11:54:25 2013 +0100
+++ b/JavaObject.st	Mon Oct 07 19:16:50 2013 +0100
@@ -195,6 +195,20 @@
     "Created: / 26-08-2012 / 14:07:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!JavaObject methodsFor:'comparing'!
+
+= anotherObject
+    ^ (self perform: #'equals(Ljava/lang/Object;)Z' with: anotherObject) == 1
+
+    "Created: / 07-10-2013 / 17:32:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+hash
+    ^ self perform: #'hashCode()I'
+
+    "Created: / 07-10-2013 / 17:31:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !JavaObject methodsFor:'exception handling support'!
 
 catchInDebugger
--- a/Make.proto	Mon Oct 07 11:54:25 2013 +0100
+++ b/Make.proto	Mon Oct 07 19:16:50 2013 +0100
@@ -21,7 +21,7 @@
 INCLUDE_TOP=$(TOP)/..
 
 # subdirectories where targets are to be made:
-SUBDIRS= tools experiments
+SUBDIRS= experiments tools
 
 
 # subdirectories where Makefiles are to be made:
--- a/abbrev.stc	Mon Oct 07 11:54:25 2013 +0100
+++ b/abbrev.stc	Mon Oct 07 19:16:50 2013 +0100
@@ -75,7 +75,7 @@
 JavaSourceFileWriter JavaSourceFileWriter stx:libjava 'Languages-Java-Support' 0
 JavaTestCaseProxy JavaTestCaseProxy stx:libjava 'Languages-Java-Tests-Proxies' 3
 JavaTestsLoader JavaTestsLoader stx:libjava 'Languages-Java-Tests' 0
-JavaTestsResource JavaTestsResource stx:libjava 'Languages-Java-Tests' 0
+JavaTestsResource JavaTestsResource stx:libjava 'Languages-Java-Tests' 2
 JavaTopView JavaTopView stx:libjava 'Languages-Java-Views-Support' 2
 JavaUTF8Tests JavaUTF8Tests stx:libjava 'Languages-Java-Tests' 1
 JavaUnresolvedCompilationError JavaUnresolvedCompilationError stx:libjava 'Languages-Java-Support' 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/java/extensions/java/util/AbstractList.st	Mon Oct 07 19:16:50 2013 +0100
@@ -0,0 +1,12 @@
+"{ Package: 'stx:libjava' }"
+
+!
+
+!(Java classForName:'java.util.AbstractList') methodsFor:'* instance *'!
+
+at: index
+
+    "/ Defined here (in addition to List iface) to overwrite
+    "/ Object>>at:
+    ^ self get: index - 1.
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/java/extensions/java/util/List.st	Mon Oct 07 19:16:50 2013 +0100
@@ -0,0 +1,14 @@
+"{ Package: 'stx:libjava' }"
+
+!
+
+!(Java classForName:'java.util.List') methodsFor:'* instance *'!
+
+at: index
+    ^ self get: index - 1
+! !
+!(Java classForName:'java.util.List') methodsFor:'* instance *'!
+
+at: index put: anObject
+    ^ self put: index - 1 value: anObject
+! !
--- a/libjava.rc	Mon Oct 07 11:54:25 2013 +0100
+++ b/libjava.rc	Mon Oct 07 19:16:50 2013 +0100
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\nCopyright Jan Vrany, Jan Kurs and Marcel Hlopko\n          SWING Research Group, Czech Technical University In Prague\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Fri, 04 Oct 2013 15:56:12 GMT\0"
+      VALUE "ProductDate", "Mon, 07 Oct 2013 18:14:56 GMT\0"
     END
 
   END
--- a/stx_libjava.st	Mon Oct 07 11:54:25 2013 +0100
+++ b/stx_libjava.st	Mon Oct 07 19:16:50 2013 +0100
@@ -193,8 +193,8 @@
      for those, redefine requiredPrerequisites"
 
     ^ #(
+        #'stx:libjava/experiments'
         #'stx:libjava/tools'
-        #'stx:libjava/experiments'
     )
 ! !