Service Activator Toolkit
Version 1.1.0

org.eclipse.soda.sat.core.util
Class MiscUtility

java.lang.Object
  extended by org.eclipse.soda.sat.core.util.MiscUtility

public class MiscUtility
extends Object

Miscellaneous utilities.


Method Summary
 int estimateHashedCollectionSize(int capacity)
          Estimate the size of a hashed collection based on the specified capacity.
static MiscUtility getInstance()
          Public getter for the MiscUtility singleton instance.
 Object unwrapExportedServiceProxy(Object serviceProxy)
          Unwrap the specified exported service proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MiscUtility getInstance()
Public getter for the MiscUtility singleton instance.

Returns:
MiscUtility

estimateHashedCollectionSize

public int estimateHashedCollectionSize(int capacity)
Estimate the size of a hashed collection based on the specified capacity. Unlike other collections, hashed collections need to be created bigger than the number of elements they intend to hold. This method estimates how big a hashed collections must be to efficiently hold the specified number of elements without needing to grow.

Parameters:
capacity - The number of elements the hash collections must hold.
Returns:
The estimate size of the hashed collection.

unwrapExportedServiceProxy

public Object unwrapExportedServiceProxy(Object serviceProxy)
                                  throws IllegalArgumentException
Unwrap the specified exported service proxy.

Parameters:
serviceProxy - A service proxy.
Returns:
The unwrapped service.
Throws:
IllegalArgumentException - is thrown if the parameter is not a Proxy, or if the parameters is not a proxy for an exported service.
See Also:
ExportProxyServiceRecord.unwrapProxy(Object)

Service Activator Toolkit
Version 1.1.0