Top Description Constructors Methods
java.util.concurrent

pack-priv Class Helpers

extends Object
Class Inheritance
Imports
java.util.Collection

Shared implementation code for java.util.concurrent.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static String
collectionToString(Collection<?> c)

An implementation of Collection.toString() suitable for classes with locks.

pack-priv static String
mapEntryToString(Object key, Object val)

Optimized form of: key + "=" + val

private static String
pack-priv static String
toString(Object[] a, int size, int charLength)

Like Arrays.toString(), but caller guarantees that size > 0, each element with index 0 <= i < size is a non-null String, and charLength is the sum of the lengths of the input Strings.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Helpersback to summary
private Helpers()

Method Detail

collectionToStringback to summary
pack-priv static String collectionToString(Collection<?> c)

An implementation of Collection.toString() suitable for classes with locks. Instead of holding a lock for the entire duration of toString(), or acquiring a lock for each call to Iterator.next(), we hold the lock only during the call to toArray() (less disruptive to other threads accessing the collection) and follows the maxim "Never call foreign code while holding a lock".

mapEntryToStringback to summary
pack-priv static String mapEntryToString(Object key, Object val)

Optimized form of: key + "=" + val

objectToStringback to summary
private static String objectToString(Object x)
toStringback to summary
pack-priv static String toString(Object[] a, int size, int charLength)

Like Arrays.toString(), but caller guarantees that size > 0, each element with index 0 <= i < size is a non-null String, and charLength is the sum of the lengths of the input Strings.