com.bigdata.btree.keys
Class DefaultKeyBuilderFactory

java.lang.Object
  extended by com.bigdata.btree.keys.DefaultKeyBuilderFactory
All Implemented Interfaces:
IKeyBuilderFactory, Serializable

public class DefaultKeyBuilderFactory
extends Object
implements IKeyBuilderFactory, Serializable

Default factory for Unicode IKeyBuilders. This does NOT generate thread-local instances. The factory serializes all properties that were required to generate a configuration so that the same configuration may be materialized on another JVM or host by de-serializing an instance of this factory.

Version:
$Id: DefaultKeyBuilderFactory.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
See Also:
ThreadLocalKeyBuilderFactory, Serialized Form

Field Summary
static String ICU_NOT_AVAILABLE
          Text of the exception thrown when the ICU library is required but is not available.
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
DefaultKeyBuilderFactory(Properties properties)
          Create a factory for IKeyBuilder instances configured according to the specified properties.
 
Method Summary
 CollatorEnum getCollator()
          The selected collator.
 DecompositionEnum getDecompositionMode()
          The selected decomposition mode (MAY be null, which means no override).
 int getInitialCapacity()
          The initial buffer capacity (the actual capacity grows as needed at runtime).
 IKeyBuilder getKeyBuilder()
          Return an instance of the configured IKeyBuilder.
 Locale getLocale()
          The selected Locale.
 Object getStrength()
          The selected collator strength.
static boolean isICUAvailable()
          Figures out whether or not the ICU library is available.
 String toString()
          Representation includes all aspects of the Serializable state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final transient org.apache.log4j.Logger log

ICU_NOT_AVAILABLE

public static final String ICU_NOT_AVAILABLE
Text of the exception thrown when the ICU library is required but is not available.

See Also:
Constant Field Values
Constructor Detail

DefaultKeyBuilderFactory

public DefaultKeyBuilderFactory(Properties properties)
Create a factory for IKeyBuilder instances configured according to the specified properties. Any properties NOT explicitly given will be defaulted from System.getProperties(). The pre-defined properties KeyBuilder.Options.USER_LANGUAGE, KeyBuilder.Options.USER_COUNTRY, and KeyBuilder.Options.USER_VARIANT MAY be overridden. The factory will support Unicode unless CollatorEnum.ASCII is explicitly specified for the KeyBuilder.Options.COLLATOR property.

Parameters:
properties - The properties to be used (optional). When null the System properties are used.
Throws:
UnsupportedOperationException -

The ICU library was required but was not located. Make sure that the ICU JAR is on the classpath. See KeyBuilder.Options.COLLATOR.

Note: If you are trying to use ICU4JNI then that has to be locatable as a native library. How you do this is different for Windows and Un*x.

See Also:
KeyBuilder.Options
Method Detail

getInitialCapacity

public final int getInitialCapacity()
The initial buffer capacity (the actual capacity grows as needed at runtime).


getCollator

public final CollatorEnum getCollator()
The selected collator.


getLocale

public final Locale getLocale()
The selected Locale.


getStrength

public final Object getStrength()
The selected collator strength.

Returns:
Either a StrengthEnum, an Integer, or null (which means no override).

getDecompositionMode

public final DecompositionEnum getDecompositionMode()
The selected decomposition mode (MAY be null, which means no override).


toString

public String toString()
Representation includes all aspects of the Serializable state.

Overrides:
toString in class Object

getKeyBuilder

public IKeyBuilder getKeyBuilder()
Description copied from interface: IKeyBuilderFactory
Return an instance of the configured IKeyBuilder.

Specified by:
getKeyBuilder in interface IKeyBuilderFactory

isICUAvailable

public static boolean isICUAvailable()
Figures out whether or not the ICU library is available.

Returns:
true iff the ICU library is available.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.