Package net.sf.eBus.util
Contains supporting utility Java classes for
net.sf.eBus. These utilities either provide
capabilities not provided by the Java standard edition or
extend existing Java classes:
-
SequentialTask: If tasks associated with the same object must execute in chronological order,SequentialTaskguarantees that ordering. Tasks associated with different objects can execute in parallel. -
HexDump: Binary data hex dump generator. -
IndexCache: Stores the latest index value in a specified file. This class is used when a unique index value must be maintained across an application's separate executions. IndexCache does not support index sharing by multiple applications running simultaneously. It is designed to work with a single application only. -
IndexPool: Tracks which integer indices are in use and returns to the caller the minimum index available. For example, if you need to use an index value between 0 and 99 inclusive and indices 0, 1 and 3 are in use, thenIndexPool.nextIndex()returns 2. The application is responsible for informingIndexPoolwhen an index in no longer in use by callingIndexPool.returnIndex(int). -
MultiKey: Allows multiple objects to be used as a single Java map key. Obviates the need for nested maps.The multikey code belongs to Howard Lewis Ship and Stephen Colebourne and is under the Apache license.
-
Properties: Extendsjava.lang.Propertiesclass. Provides access to multiple property files and additional methods for retrievingboolean,int,doubleandString[]arrays from a properties list or placing into the properties list. Also providesProperties.addListener(PropertiesListener)andProperties.removeListener(PropertiesListener)methods. When the underlying properties file changes, Properties reloads the file and then informs all registeredPropertiesListeners. -
TernarySearchTree: Implements the Bentley, Sedgewick ternary search tree (TST) as a Java map. Keys are restricted to Java character sequences. TST only partially follows the Java Map interface. The keySet, values and entrySet methods return collections that are not backed by the map. Modifying these returned collections does not modify the map. -
TimerTask: Extendsjava.util.TimerTask. Associates aTimerTaskListenerwith theTimerTask. When the timer expires,handleTimeout(TimerEvent)is called.
-
Interface Summary Interface Description PropertiesListener Classes which want to be asynchronously informed about properties changes should implement this interface and add themselves to the properties listeners by callingProperties.addListener(PropertiesListener).TimerTaskListener Classes usingTimerTaskshould implement this interface. -
Class Summary Class Description DirectExecutor Performs direct, synchronous runnable task execution in the current thread.HexDump HexDump.dump(byte[], String)generates a standard hexdump textual representation of binary data.IndexCache Persists a one or more 4-byte, integer index values to a specified file.IndexCache.Index Tracks the individual index parameters and its location within the cache file.IndexPool IndexPoolprovides integer index value reuse.JarFileLoader This class extendsURLClassLoader, providing the ability to load a class from a Java jar file introduced after JVM starts.MultiKey Allows multi-valued keys to be used in Java's single keyMapcollections.MultiKey2<K1,K2> ThisMultiKeysubclass uses generics to guarantee key type and order.MultiKey3<K1,K2,K3> ThisMultiKeysubclass uses generics to guarantee key type and order.MultiKey4<K1,K2,K3,K4> ThisMultiKeysubclass uses generics to guarantee key type and order.Properties Propertiesextendsjava.util.Propertiesto include: Loading properties from a named file and returning anet.sf.eBus.util.Propertiesobject.PropertiesEvent Contains the updatedPropertiesobject as event source.SequentialTask When using a thread pool to execute tasks there is no guarantee the tasks will be executed in the same sequential order as offered to the pool.ShutdownHook Provides a simple way for an console-based, Java application main thread to wait until the virtual machine terminates.TernarySearchTree<V> Ternary search tree (TST)-based implementation of theMapinterface.TimerEvent TimerTask AneBus.util.TimerTaskassociates a timer task with aTimerTaskListener.