Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.compoze.collab
Class Key

    java.lang.Object
      com.compoze.collab.Key

All Implemented Interfaces:
  com.compoze.collab.util.IDigestSupport, java.io.Serializable

Direct Known Subclasses:
  CustomNamedKey, MapiKey, WebdavKey

public class Key
extends java.lang.Object
implements java.io.Serializable, com.compoze.collab.util.IDigestSupport

A key for properties that are set on an item. Keys can represent normal, calculated or read-only properties. Normal properties may be read from and written to the provider. Read-only properties may not be written to the provider. Calculated properties are always read-only, and are not even retrieved from the provider.

See Also:
  Serialized Form

Field Summary
`static int` | `BASE_TYPE_MASK`
`static Key[]` | `EMPTY_KEY_ARRAY` A Key[0] array, for when needed
`static java.lang.String` | `EMPTY_STRING`
`protected static java.util.HashMap` | `s_keyMap`
`static int` | `VALUE_ARRAY` When ORed with another value type (for example `VALUE_STRING | VALUE_ARRAY`) represents an array of that value type.
`static int` | `VALUE_BINARY` The key represents binary data (a byte array).
`static int` | `VALUE_BOOLEAN` The key represents a boolean (true/false).
`static int` | `VALUE_DATE` The key represents a date and time.
`static int` | `VALUE_DOUBLE` The key represents a 64 bit floating point value.
`static int` | `VALUE_ENUMELEMENT` The key represents an enumeration value.
`static int` | `VALUE_FLOAT` The key represents a 32 bit floating point value.
`static int` | `VALUE_INTEGER` The key represents a 32 bit signed value.
`static int` | `VALUE_ITEM` The key represents another item.
`static int` | `VALUE_LONG` The key represents a 64 bit signed value.
`static int` | `VALUE_SERIALIZABLE` The key represents a serializable java object.
`static int` | `VALUE_SHORT` The key represents is a 16 bit signed value.
`static int` | `VALUE_STRING` The key represents a unicode string.
`static int` | `VALUE_UNKNOWN` The key represents a unknown data type.

Constructor Summary
`Key(java.lang.String sID, int iValueType)` Constructor (read-write key).
`Key(java.lang.String sID, int iValueType, boolean bReadOnly)` Constructor.
`Key(java.lang.String sID, int iValueType, boolean bReadOnly, boolean bCalculated, int iID)` Constructor.
`Key(java.lang.String sID, int iValueType, boolean bReadOnly, int iID)` Constructor.
`Key(java.lang.String sID, int iValueType, int iID)` Constructor (read-write key).

Method Summary
`static Key[]` | `combine(Key[] keys1, Key[] keys2)` Combines two key arrays, removing duplicates.
`boolean` | `equals(java.lang.Object obj)` Two keys are equal if they share IDs.
`static Key` | `get(java.lang.String sID)` Gets a key by its ID.
`java.lang.String` | `getID()` Gets an ID for the key that is unique across VM invocations.
`int` | `getIntID()` Get the integer ID
`int` | `getValueType()` Gets the type of values associated with this key.
`java.lang.String` | `getValueTypeName()` Gets the name of the value type of a Key.
`int` | `hashCode()`
`boolean` | `isCalculated()` Determines if the key is for a calculated property.
`boolean` | `isReadOnly()` Determines if the key is for a read-only property.
`static java.lang.String` | `staticValueTypeName(int iValueType)` Gets the name of a value type.
`java.lang.String` | `toString()`
`void` | `updateDigest(java.security.MessageDigest digest)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### EMPTY_STRING

    public static final java.lang.String EMPTY_STRING

See Also:
  Constant Field Values

### s_keyMap

    protected static final java.util.HashMap s_keyMap

### VALUE_STRING

    public static final int VALUE_STRING

  The key represents a unicode string.

  See Also:
    Constant Field Values

### VALUE_SHORT

    public static final int VALUE_SHORT

  The key represents is a 16 bit signed value.

  See Also:
    Constant Field Values

### VALUE_INTEGER

    public static final int VALUE_INTEGER

  The key represents a 32 bit signed value.

  See Also:
    Constant Field Values

### VALUE_LONG

    public static final int VALUE_LONG

  The key represents a 64 bit signed value.

  See Also:
    Constant Field Values

### VALUE_BOOLEAN

    public static final int VALUE_BOOLEAN

  The key represents a boolean (true/false).

  See Also:
    Constant Field Values

### VALUE_FLOAT

    public static final int VALUE_FLOAT

  The key represents a 32 bit floating point value.

  See Also:
    Constant Field Values

### VALUE_DOUBLE

    public static final int VALUE_DOUBLE

  The key represents a 64 bit floating point value.

  See Also:
    Constant Field Values

### VALUE_BINARY

    public static final int VALUE_BINARY

  The key represents binary data (a byte array).

  See Also:
    Constant Field Values

### VALUE_DATE

    public static final int VALUE_DATE

  The key represents a date and time.

  See Also:
    Constant Field Values

### VALUE_ITEM

    public static final int VALUE_ITEM

  The key represents another item.

  See Also:
    Constant Field Values

### VALUE_ENUMELEMENT

    public static final int VALUE_ENUMELEMENT

  The key represents an enumeration value.

  See Also:
    Constant Field Values

### VALUE_UNKNOWN

    public static final int VALUE_UNKNOWN

  The key represents a unknown data type.

  See Also:
    Constant Field Values

### VALUE_SERIALIZABLE

    public static final int VALUE_SERIALIZABLE

  The key represents a serializable java object.

  See Also:
    Constant Field Values

### VALUE_ARRAY

    public static final int VALUE_ARRAY

  When ORed with another value type (for example `VALUE_STRING | VALUE_ARRAY`) represents an array of that value type. Note that arrays of some types (VALUE_SHORT, VALUE_INTEGER, VALUE_LONG, VALUE_FLOAT, VALUE_DOUBLE, VALUE_BOOLEAN) represent arrays of the Java base type, not the Java class wrapper type, so `VALUE_INTEGER | VALUE_ARRAY` represents `int[]`, NOT as `Integer[]`, even though `VALUE_INTEGER` represents `Integer`. `VALUE_ITEM | VALUE_ARRAY` represents `IItem``[]`--an array of a subclass of `IItem` can be saved in an item array property (for example, `IRecipient``[]`) but it will be retrieved as an `IItem[]`.

  See Also:
    Constant Field Values

### BASE_TYPE_MASK

    public static final int BASE_TYPE_MASK

See Also:
  Constant Field Values

### EMPTY_KEY_ARRAY

    public static final Key[] EMPTY_KEY_ARRAY

  A Key[0] array, for when needed

Constructor Detail

### Key

    public Key(java.lang.String sID,
               int iValueType)

  Constructor (read-write key).

Parameters:
  `sID` - the key ID
  `iValueType` - the type for values associated with this key

### Key

    public Key(java.lang.String sID,
               int iValueType,
               int iID)

  Constructor (read-write key).

Parameters:
  `sID` - the key ID
  `iValueType` - the type for values associated with this key
  `iID` - the key integer ID

### Key

    public Key(java.lang.String sID,
               int iValueType,
               boolean bReadOnly)

  Constructor.

Parameters:
  `sID` - the key ID
  `iValueType` - the type for values associated with this key
  `bReadOnly` - if `true` then the key is for a read-only property

### Key

    public Key(java.lang.String sID,
               int iValueType,
               boolean bReadOnly,
               int iID)

  Constructor.

Parameters:
  `sID` - the key ID
  `iValueType` - the type for values associated with this key
  `bReadOnly` - if `true` then the key is for a read-only property
  `iID` - an internal integer ID for this key
Throws:
  `InvalidArgumentException` - if the specified int key ID has already been added

### Key

    public Key(java.lang.String sID,
               int iValueType,
               boolean bReadOnly,
               boolean bCalculated,
               int iID)

  Constructor.

Parameters:
  `sID` - the key ID
  `iValueType` - the type for values associated with this key
  `bReadOnly` - if `true` then the key is for a read-only property
  `bCalculated` - if `true` then the key is for a calculated property
  `iID` - an internal integer ID for this key
Throws:
  `InvalidArgumentException` - if the specified int key ID has already been added

Method Detail

### combine

    public static Key[] combine(Key[] keys1,
                                Key[] keys2)

  Combines two key arrays, removing duplicates.

  Parameters:
    `keys1` - the first key array (not `null`)
    `keys2` - the second key array (not `null`)
  Returns:
    the combined key array (not `null`)

### getIntID

    public int getIntID()

  Get the integer ID

  Returns:
    the int ID

### get

    public static Key get(java.lang.String sID)

  Gets a key by its ID.

  Returns:
    the key

### getID

    public java.lang.String getID()

  Gets an ID for the key that is unique across VM invocations.

  Returns:
    the key ID

### getValueType

    public int getValueType()

  Gets the type of values associated with this key.

  Returns:
    the value type (one of the `VALUE_` constants)

### isReadOnly

    public boolean isReadOnly()

  Determines if the key is for a read-only property. Read-only properties may not be written to the provider.

  Returns:
    `true` if the key is for a read-only property

### isCalculated

    public boolean isCalculated()

  Determines if the key is for a calculated property. Calculated properties are evaluated by the API itself, are always read-only and are never retrieved from the provider.

  Returns:
    `true` if the key is for a calculated property

### equals

    public boolean equals(java.lang.Object obj)

  Two keys are equal if they share IDs. Note that objects of different Key subclasses can be equal.

  Parameters:
    `obj` - the Object to test equality against
  Returns:
    `true` if the objects are equal

### hashCode

    public int hashCode()

  See Also:
    `Object.hashCode()`

### toString

    public java.lang.String toString()

  See Also:
    `Object.toString()`

### getValueTypeName

    public java.lang.String getValueTypeName()

  Gets the name of the value type of a Key. For trace and error message purposes.

  Returns:
    the name of the value type

### staticValueTypeName

    public static java.lang.String staticValueTypeName(int iValueType)

  Gets the name of a value type. For trace and error message purposes.

  Parameters:
    `iValueType` - the value type
  Returns:
    the name of the value type

### updateDigest

    public void updateDigest(java.security.MessageDigest digest)

  Specified by:
    `updateDigest` in interface `com.compoze.collab.util.IDigestSupport`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Compoze Software, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.