| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Coalescer | |
| public static Coalescer | createCoalescer(boolean
if true, the Coalescer will use WeakReferences to hold
its canonical instances, allowing them to be garbage
collected if they are nowhere in use. weak, boolean if true, access to the Coalescer will be automatically
synchronized. if set to false, then users must manually
synchronize access. synced)Creates a "Coalescer" that coalesces Objects according to their equals() method. |
| public static Coalescer | createCoalescer(CoalesceChecker
CoalesceChecker that will be used to determine whether two
objects are equivalent and can be coalesced. [If cc is null, then two
objects will be coalesced iff o1.equals( o2 ).] cc, boolean if true, the Coalescer will use WeakReferences to hold
its canonical instances, allowing them to be garbage
collected if they are nowhere in use. weak, boolean if true, access to the Coalescer will be automatically
synchronized. if set to false, then users must manually
synchronize access. synced)Creates a "Coalescer" that coalesces Objects according to the checkCoalesce() method of a "CoalesceChecker". |
| CoalescerFactory | back to summary |
|---|---|
| public CoalescerFactory() | |
| createCoalescer | back to summary |
|---|---|
| public static Coalescer createCoalescer() Creates a "Coalescer" that coalesces Objects according to their equals() method. Given a set of n Objects among whom equals() would return true, calling coalescer.coalesce() in any order on any sequence of these Objects will always return a single "canonical" instance. This method creates a weak, synchronized coalesecer, safe for use by multiple Threads. | |
| createCoalescer | back to summary |
|---|---|
| public static Coalescer createCoalescer(boolean weak, boolean synced) Creates a "Coalescer" that coalesces Objects according to their equals() method. Given a set of n Objects among whom equals() would return true, calling coalescer.coalesce() in any order on any sequence of these Objects will always return a single "canonical" instance.
| |
| createCoalescer | back to summary |
|---|---|
| public static Coalescer createCoalescer(CoalesceChecker cc, boolean weak, boolean synced) Creates a "Coalescer" that coalesces Objects according to the checkCoalesce() method of a "CoalesceChecker". Given a set of n Objects among whom calling cc.checkCoalesce() on any pair would return true, calling coalescer.coalesce() in any order on any sequence of these Objects will always return a single "canonical" instance. This allows one to define immutable value Objects whose equals() method is a mere identity test -- one can use a Coalescer in a factory method to ensure that no two instances with the same values are made available to clients.
| |