jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1127460 - in /incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib: ByteBufferLib.java Lib.java
Date Wed, 25 May 2011 10:13:37 GMT
Author: andy
Date: Wed May 25 10:13:36 2011
New Revision: 1127460

URL: http://svn.apache.org/viewvc?rev=1127460&view=rev
Log: (empty)

Modified:
    incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib/ByteBufferLib.java
    incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib/Lib.java

Modified: incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib/ByteBufferLib.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib/ByteBufferLib.java?rev=1127460&r1=1127459&r2=1127460&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib/ByteBufferLib.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib/ByteBufferLib.java Wed May 25
10:13:36 2011
@@ -62,6 +62,15 @@ public class ByteBufferLib
 //            out.print(" ...") ;
         out.println();
     }
+    
+    public static boolean sameValue(ByteBuffer bb1, ByteBuffer bb2)
+    {
+        if ( bb1.capacity() != bb2.capacity() ) return false ;
+        
+        for ( int i = 0 ; i < bb1.capacity() ; i++ )
+            if ( bb1.get(i) != bb2.get(i) ) return false ;
+        return true ;
+    }
 
     /** Copy of a ByteBuffer - the contents are copied (unlike ByteBuffer.duplicate) */
     final public static ByteBuffer duplicate(ByteBuffer bb)

Modified: incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib/Lib.java
URL: http://svn.apache.org/viewvc/incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib/Lib.java?rev=1127460&r1=1127459&r2=1127460&view=diff
==============================================================================
--- incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib/Lib.java (original)
+++ incubator/jena/Jena2/ARQ/trunk/src/org/openjena/atlas/lib/Lib.java Wed May 25 10:13:36
2011
@@ -24,6 +24,7 @@ public class Lib
             ((Sync)object).sync() ;
     }
     
+    /** Return true if obj1 and obj are both null or are .equals, else return false */
     public static final <T> boolean equal(T obj1, T obj2)
     {
         if ( obj1 == null )
@@ -34,6 +35,12 @@ public class Lib
         return obj1.equals(obj2) ;
     }
     
+    /** Return true if obj1 and obj are ! equal */
+    public static final <T> boolean notEqual(T obj1, T obj2)
+    {
+        return ! equal(obj1, obj2) ;
+    }
+
     static public final String className(Object obj)
     { return classShortName(obj.getClass()) ; }
     



Mime
View raw message