org.plasma.sdo.access.provider.common
Class TraversalMap

java.lang.Object
  extended by org.plasma.sdo.access.provider.common.TraversalMap

public class TraversalMap
extends Object

This class stores hashed key-value pairs where the key is one of 2 formats. The first key format represents a traversal path and is delimited by the defined delimiter. See Path Oriented examples below. Each path element is a reference property name. This path-oriented key format is necessary because within an object graph there can be multiple paths to different occurrences of the same entity. For one occurrence along a particular path, the user may want to return a different set of properties than for another occurrence along another path. The second key format assumes that the same properties will be returned for every occurrence of an entity. So the key is simply the namespace qualified entity name. For both key formats, each value is a java.lang.String array where each element is a non-reference MOM property name. ------------------------------- Path Oriented Format Examples -------------------------------- key value(properties) -------------------------------- / [r,s] /a/ [x,y,z] /a/b/ [x,y] /a/b/c/ [*] /g/h/i/j/ [u,v] /n/o/p/q/r/ [*] /u/v/a/ [y,z] /gbloc1/org/ [*] /gbloc2/org/ [*] ------------------------------- Namespace Qualified Entity Name Oriented Format Examples -------------------------------- key value(properties) -------------------------------- http://my.namespace/foo#Person [name,ssn,id] http://my.namespace/foo#Org [name,dunsNumber]


Field Summary
static String DELIM_PATH
           
static String WILDCARD
           
 
Constructor Summary
TraversalMap(DataAccessProviderName providerName)
           
 
Method Summary
 void add(String key, String value)
          Appends the given string value to an underlying array of values for the given key.
 void add(String key, String[] values)
          Appends or merges the given values to an underlying array of values for the given key.
 String[] asFieldArray()
           
 int calculateDepth()
           
 int count(String key)
           
 String dump()
           
 String[] get(String key)
           
 Iterator<String> iterator()
           
 Map<Object,String[]> toClassMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIM_PATH

public static String DELIM_PATH

WILDCARD

public static String WILDCARD
Constructor Detail

TraversalMap

public TraversalMap(DataAccessProviderName providerName)
Method Detail

iterator

public Iterator<String> iterator()

calculateDepth

public int calculateDepth()

count

public int count(String key)

add

public void add(String key,
                String[] values)
Appends or merges the given values to an underlying array of values for the given key. For clients where only a single value is to be added, use of the below method with a key and single string is more efficient, as a merge is not required

Parameters:
key - the string key mapped to an array
value - the string value

add

public void add(String key,
                String value)
Appends the given string value to an underlying array of values for the given key. A convenience method for use where a client knows a single value is to be added.

Parameters:
key - the string key mapped to an array
value - the string value

get

public String[] get(String key)

asFieldArray

public String[] asFieldArray()

toClassMap

public Map<Object,String[]> toClassMap()

dump

public String dump()


Copyright © 2014. All rights reserved.