@Override public int hashCode() { return hashCodeObject(car()) ^ hashCodeObject(cdr())<<1 ; }
/** * Prints version information for all registered classes to the given writer * @param writer Writer to print version information to */ public void print(IndentedWriter writer) { for ( Class<?> c : classes ) { String x = Lib.classShortName( c ); fields( writer, x, c ); } }
public void finishMessage() { // Elapsed. long timePoint = timer.getTimeInterval(); // *1000L is milli to second conversion if ( timePoint != 0 ) { double time = timePoint / 1000.0; long runAvgRate = (counterTotal * 1000L) / timePoint; print("Finished: %,d %s %.2fs (Avg: %,d)", counterTotal, label, time, runAvgRate); } else print("Finished: %,d %s (Avg: ----)", counterTotal, label); }
private void checkNotClosed() { if ( closed ) throw new InternalErrorException(Lib.className(this)+" : already closed") ; }
/** Decode a string into a ByteBuffer */ public static String fromByteBuffer(ByteBuffer bb) { //return BlockUTF8.toString(bb) ; // To be removed (Dec 2011) CharsetDecoder dec = Chars.allocDecoder(); String x = fromByteBuffer(bb, dec) ; Chars.deallocDecoder(dec) ; return x ; }
/** Check caches to see if we can map a Node to a NodeId. Returns null on no cache entry. */ private NodeId cacheLookup(Node node) { // Remember things known (currently) not to exist. // Does not matter if notPresent is being updated elsewhere. if ( notPresent != null && notPresent.contains(node) ) return null ; if ( node2id_Cache == null ) return null ; return node2id_Cache.getIfPresent(node) ; }
/** Encode a string into a ByteBuffer : on return position is the end of the encoding */ public static int toByteBuffer(CharSequence s, ByteBuffer bb) { //BlockUTF8.fromChars(s, bb) ; CharsetEncoder enc = Chars.allocEncoder(); int x = toByteBuffer(s, bb, enc) ; Chars.deallocEncoder(enc) ; return x ; }
static void test(String x, String z) { String y = StrUtils.encodeHex(x, marker, esc) ; if ( z != null ) assertEquals(z, y) ; String x2 = StrUtils.decodeHex(y, marker) ; assertEquals(x, x2) ; }
private static void search(IntBuffer b, int k) { int idx1 = Alg.linearSearch(b, k) ; int idx2 = Alg.binarySearch(b, k) ; assertEquals(idx1, idx2) ; }
private static void filenameToIRI(String string, String result) { String r = IRILib.filenameToIRI(string) ; assertEquals(result, r) ; } }
/** Decode a string into a ByteBuffer */ public static String fromByteBuffer(ByteBuffer bb) { //return BlockUTF8.toString(bb) ; // To be removed (Dec 2011) CharsetDecoder dec = Chars.allocDecoder(); String x = fromByteBuffer(bb, dec) ; Chars.deallocDecoder(dec) ; return x ; }
/** * Check caches to see if we can map a Node to a NodeId. Returns null on no * cache entry. */ private NodeId cacheLookup(Node node) { // Remember things known (currently) not to exist. // Does not matter if notPresent is being updated elsewhere. if ( notPresent != null && notPresent.contains(node) ) return null ; if ( node2id_Cache == null ) return null ; return node2id_Cache.getIfPresent(node) ; }
/** Encode a string into a ByteBuffer : on return position is the end of the encoding */ public static int toByteBuffer(CharSequence s, ByteBuffer bb) { //BlockUTF8.fromChars(s, bb) ; CharsetEncoder enc = Chars.allocEncoder(); int x = toByteBuffer(s, bb, enc) ; Chars.deallocEncoder(enc) ; return x ; }
/** * Prints version information for all registered classes to the given writer * @param writer Writer to print version information to */ public void print(IndentedWriter writer) { for ( Class<?> c : classes ) { String x = Lib.classShortName( c ); fields( writer, x, c ); } }
private static void search(IntBuffer b, int k, int low, int high) { int idx1 = Alg.linearSearch(b, low, high, k) ; int idx2 = Alg.binarySearch(b, low, high, k) ; assertEquals(idx1, idx2) ; } }
public void finishMessage() { // Elapsed. long timePoint = timer.getTimeInterval(); // *1000L is milli to second conversion if ( timePoint != 0 ) { double time = timePoint / 1000.0; long runAvgRate = (counterTotal * 1000L) / timePoint; print("Finished: %,d %s %.2fs (Avg: %,d)", counterTotal, label, time, runAvgRate); } else print("Finished: %,d %s (Avg: ----)", counterTotal, label); }
/** Decode a string into a ByteBuffer */ public static String fromByteBuffer(ByteBuffer bb) { //return BlockUTF8.toString(bb) ; // To be removed (Dec 2011) CharsetDecoder dec = Chars.allocDecoder(); String x = fromByteBuffer(bb, dec) ; Chars.deallocDecoder(dec) ; return x ; }