com.sun.mdm.index.matching.converter
Class MatchTupleConverter

java.lang.Object
  extended bycom.sun.mdm.index.matching.converter.MatchTupleConverter
All Implemented Interfaces:
SystemObjectConverter

public class MatchTupleConverter
extends java.lang.Object
implements SystemObjectConverter

Converts the matchfields configured for a SystemObject into a flat tuple structure (Array of array)


Nested Class Summary
(package private)  class MatchTupleConverter.ChildInfo
          Utility class to return structured info from methods regarding the object node type of a child, mapping from the object node type to the corresponding ePath The lack of accessors is by design for performance reasons.
(package private)  class MatchTupleConverter.FieldInfo
          Utility class to return structured info from methods regarding relevant fields on an object node, mapping from the field name to the corresponding ePath
(package private)  class MatchTupleConverter.TokenInfo
          Utility class to return structured info from methods regarding EPath tokens The lack of accessors is by design for performance reasons.
(package private)  class MatchTupleConverter.TupleInfo
          Utility class to return structured info from methods regarding the tuples and the ePaths corresponding to each tuple column
 
Constructor Summary
MatchTupleConverter()
          Creates a new instance of MatchTupleConverter
 
Method Summary
 MatchTuples convert(SystemObject base)
          Converts the matchfields configured for a SystemObject into a flat tuple structure (Array of array)
(package private)  java.util.ArrayList createTuples(java.util.ArrayList first, java.util.ArrayList second)
          Given two ArrayLists of ArrayLists, create all the possible combinations
(package private)  java.util.ArrayList getChildEPaths(MatchTupleConverter.ChildInfo[] childrenMatchFields, java.lang.String tag)
           
(package private)  MatchTupleConverter.TupleInfo getMatchTuples(ObjectNode objNode, java.util.ArrayList ePaths, int ePathNodePos)
          Recursive method to obtain all the tuples of the match columns of an object node and it's children.
(package private)  java.util.ArrayList getMatchTuplesIter(ObjectNode objNode, java.util.ArrayList ePaths, java.util.ArrayList validEPaths, int ePathNodePos, int initialChildFlag)
           
(package private)  MatchTupleConverter.TokenInfo getRelevantTokens(java.util.ArrayList ePaths, int parentEPathNodePos)
          Looks at the ePaths at the given position and figures out what direct children are present in the ePath and what fields are present.
 void setDateConversionFormat(java.text.DateFormat aFormat)
          Sets the format for converting java.util.Date fields into Strings to convert into the the String array tuple.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchTupleConverter

public MatchTupleConverter()
                    throws java.lang.InstantiationException
Creates a new instance of MatchTupleConverter

Throws:
java.lang.InstantiationException - if Configuration Service can not be instantiated
Method Detail

convert

public MatchTuples convert(SystemObject base)
                    throws ObjectException,
                           EPathException
Converts the matchfields configured for a SystemObject into a flat tuple structure (Array of array)

Parameters:
base - the base SystemObject to convert into tuples
Returns:
the MatchTuples which contains the tuples and the metadata describing the tuple structure
Throws:
ObjectException - If retrieving the SystemObject values fails
EPathException - If the configured EPaths for matching are invalid

createTuples

java.util.ArrayList createTuples(java.util.ArrayList first,
                                 java.util.ArrayList second)
Given two ArrayLists of ArrayLists, create all the possible combinations

Parameters:
first - the first ArrayList to combine with the second
second - the second ArrayList to combine with the first
Returns:
an ArrayList with all the tuple combinations

getChildEPaths

java.util.ArrayList getChildEPaths(MatchTupleConverter.ChildInfo[] childrenMatchFields,
                                   java.lang.String tag)

getMatchTuples

MatchTupleConverter.TupleInfo getMatchTuples(ObjectNode objNode,
                                             java.util.ArrayList ePaths,
                                             int ePathNodePos)
                                       throws ObjectException
Recursive method to obtain all the tuples of the match columns of an object node and it's children. The column order of the tuples returned does not correspond to the order of the passed in ePaths

Returns:
all the tuples of that object node and it's relevant children, as well as the ePaths describing the order of the returned columns in the tuples.
Throws:
ObjectException - if the data for the match fields could not be retrieved from the ObjectNode

getMatchTuplesIter

java.util.ArrayList getMatchTuplesIter(ObjectNode objNode,
                                       java.util.ArrayList ePaths,
                                       java.util.ArrayList validEPaths,
                                       int ePathNodePos,
                                       int initialChildFlag)
                                 throws ObjectException
Throws:
ObjectException

getRelevantTokens

MatchTupleConverter.TokenInfo getRelevantTokens(java.util.ArrayList ePaths,
                                                int parentEPathNodePos)
Looks at the ePaths at the given position and figures out what direct children are present in the ePath and what fields are present.

Returns:
The TokenInfo with The map from object node type of the child, to the corresponding EPath it came from and the fieldName on the current node as well as the corresponding ePath

setDateConversionFormat

public void setDateConversionFormat(java.text.DateFormat aFormat)
Sets the format for converting java.util.Date fields into Strings to convert into the the String array tuple. The default format is yyyyMMdd

Parameters:
aFormat - the new DateFormat to use for conversion


Sun Microsystems, Inc.