JAL-98 javadoc, third party acknowledgements (and very small code
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 17 Nov 2016 11:50:44 +0000 (11:50 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 17 Nov 2016 11:50:44 +0000 (11:50 +0000)
change)

THIRDPARTYLIBS
src/jalview/ext/android/ContainerHelpers.java
src/jalview/ext/android/SparseIntArray.java
src/jalview/ext/android/SparseShortArray.java

index 7d12783..85aa587 100644 (file)
@@ -6,8 +6,11 @@ A number of sources have also been adapted for incorporation into Jalview's sour
 
 ext.edu.ucsf.rbvi.strucviz2 includes sources originally developed by Scooter Morris and Nadezhda Doncheva for the Cytoscape StructureViz2 plugin. It is released under the Berkley license and we hereby acknowledge its original copyright is held by the UCSF Computer Graphics Laboratory
  and the software was developed with support by the NIH National Center for Research Resources, grant P41-RR01081. 
+ jalview.ext.android includes code taken from the Android Open Source Project (https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/util).
+ The Apache 2.0 Licence (http://www.apache.org/licenses/LICENSE-2.0) is acknowledged in the source code.
 
-Licencing information for each library is given below:
+Licensing information for each library is given below:
 
 JGoogleAnalytics_0.3.jar       APL 2.0 License - http://code.google.com/p/jgoogleanalytics/
 Jmol-14.2.14_2015.06.11.jar    GPL/LGPLv2 http://sourceforge.net/projects/jmol/files/
index f536819..4033dcc 100644 (file)
@@ -16,6 +16,12 @@ package jalview.ext.android;
  * limitations under the License.
  */
 
+/*
+ * Copied to Jalview September 2016.
+ * Only the members of this class required for SparseIntArray were copied.
+ * Method binarySearch(short[] array, int size, short value) added to support
+ * SparseShortArray.
+ */
 class ContainerHelpers
 {
   static final boolean[] EMPTY_BOOLEANS = new boolean[0];
@@ -83,7 +89,7 @@ class ContainerHelpers
     while (lo <= hi)
     {
       final int mid = (lo + hi) >>> 1;
-      final int midVal = array[mid];
+      final short midVal = array[mid];
       if (midVal < value)
       {
         lo = mid + 1;
index 2b9c4af..fcd4f1f 100644 (file)
@@ -40,6 +40,13 @@ package jalview.ext.android;
  * order in the case of <code>valueAt(int)<code>.
  * </p>
  */
+
+/*
+ * Imported into Jalview September 2016
+ * Change log:
+ *   Sep 2016 method add(int, int) added for more efficient increment of counts
+ *            (a single binary search, rather than one on read and one on write)
+ */
 public class SparseIntArray implements Cloneable
 {
   private int[] mKeys;
index 375d745..f961f55 100644 (file)
@@ -40,12 +40,15 @@ package jalview.ext.android;
  * order in the case of <code>valueAt(int)<code>.
  * </p>
  */
-/**
- * A copy of SparseShortArray designed to store short values (to minimise space
- * usage).
+
+/*
+ * Added to Jalview September 2016. A copy of SparseIntArray designed to store
+ * short values (to minimise space usage).
  * <p>
- * Note that operations append, put, add throw ArithmeticException if the
- * resulting value overflows the range of a short.
+ * Note that operations append, put, add throw ArithmeticException if either the
+ * key or the resulting value overflows the range of a short. Calling code
+ * should trap and handle this, for example by switching to using a
+ * SparseIntArray instead.
  */
 public class SparseShortArray implements Cloneable
 {