com.apama.event.parser
Class DictionaryFieldType<K,V>

java.lang.Object
  extended by com.apama.event.parser.FieldType<java.util.Map<K,V>>
      extended by com.apama.event.parser.DictionaryFieldType<K,V>
Type Parameters:
K - The Java type used for the keys of this dictionary.
V - The Java type used for the values of this dictionary.

public class DictionaryFieldType<K,V>
extends FieldType<java.util.Map<K,V>>

Represents the Apama dictionary<key,item> type, for which values are specified as Map objects.


Constructor Summary
DictionaryFieldType(FieldType<K> keyType, FieldType<V> valueType)
          Construct a new field type representing a dictionary whose keys are values are of specified field types.
 
Method Summary
 void assertAssignable(java.lang.Object c, java.lang.String fieldName)
          This method is intended for internal use only and may be removed at any time - do not use.
 FieldType<K> getKeyType()
          Get the type of the keys
 FieldType<V> getValueType()
          Get the type of the values
 java.util.Map<K,V> parse(java.lang.String value)
          Convert a value of this type from the format used in Apama event strings, into a Map object.
 java.lang.String toString()
          Returns a String representation of the field type.
 
Methods inherited from class com.apama.event.parser.FieldType
format, getName, getTypeClass, newField
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DictionaryFieldType

public DictionaryFieldType(FieldType<K> keyType,
                           FieldType<V> valueType)
Construct a new field type representing a dictionary whose keys are values are of specified field types. This constructor is provided for backwards compatibility, the recommended way to construct this field type is with FieldTypes.dictionary(FieldType, FieldType).

Parameters:
keyType - type of keys this dictionary contains
valueType - type of values this dictionary contains
See Also:
FieldTypes.dictionary(FieldType, FieldType)
Method Detail

getKeyType

public FieldType<K> getKeyType()
Get the type of the keys

Returns:
the FieldType of the keys

getValueType

public FieldType<V> getValueType()
Get the type of the values

Returns:
the FieldType of the values

assertAssignable

public void assertAssignable(java.lang.Object c,
                             java.lang.String fieldName)
Description copied from class: FieldType
This method is intended for internal use only and may be removed at any time - do not use.

Specified by:
assertAssignable in class FieldType<java.util.Map<K,V>>

parse

public java.util.Map<K,V> parse(java.lang.String value)
                         throws ParserRuntimeException
Convert a value of this type from the format used in Apama event strings, into a Map object.

Overrides:
parse in class FieldType<java.util.Map<K,V>>
Parameters:
value - the value to parse.
Returns:
an object specifying the value of the string that was parsed.
Throws:
ParserRuntimeException - If the specified value string cannot be parsed.

toString

public java.lang.String toString()
Description copied from class: FieldType
Returns a String representation of the field type. Note that this representation will use the Java toString() method to format the results, and is not valid monitorscript.

Overrides:
toString in class FieldType<java.util.Map<K,V>>


Submit a bug or feature
Copyright (c) 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG