public class MagicCookie extends java.lang.Object implements Immutable
<b>magic cookie</b> [UNIX] n. 1. Something passed between routines
or programs that enables the receiver to perform some operation;
a capability ticket or opaque identifier. Especially used of small
data objects that contain data encoded in a strange or intrinsically
machine-dependent way.
...
The phrase <i>it hands you a magic cookie</i> means it returns
a result whose contents are not defined but which can be passed
back to the same or some other program later.
I generally use MagicCookies as objects whose only property is their own identity; this is useful when, for instance, traversing directed acyclic (or heck, cyclic) digraphs when you need some mechanism of tracking whether this traversal has already happened at a node without actually saving a list of traversed nodes. Also use it when a data source/model is updated asynchronously to its display/viewing, but you need a quick verification of whether the source has changed.
Be sure to use the equals() function to check if two cookies match; it is currently done based on object identity but that will change if I start passing them across memory spaces for some reason.
Copyright 1997-2006 Partner Software, Inc.
| Constructor and Description |
|---|
MagicCookie() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object nother) |