com.sun.mdm.index.objects.epath
Class EPath

java.lang.Object
  extended bycom.sun.mdm.index.objects.epath.EPath
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class EPath
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Represents a parsed EPath string and encapsulates the operations needed to access the object represented by the EPath string. Primary.Field Primary.Secondary[@someKey=somevalue,@somemorekey=somemorevalue].* returns the secondary object named Secondary and has key "someKey" of somevalue. Primary.Secondary[1].* access the secondary object by index AObject.BObject[2].CObject[3].* supports multiple levels of access for now, this method does not support Primary.Secondary[*].Field For now, EPath does not support Primary.Secondary[*].Field

See Also:
Serialized Form

Field Summary
(package private)  Filter[][] filters
          filters
(package private)  int[] indices
          indices
(package private)  java.lang.String[] keys
          keys
static int OP_ALL_FIELD
          op code - all fields return as object
static int OP_ALL_SECONDARY
          op code - all secondary object as list
static int OP_FIELD
          op code - field accessor
static int OP_NOOP
          op code
static int OP_SECONDARY_BY_FILTER
          op code - secondary by filter
static int OP_SECONDARY_BY_INDEX
          op code - secondary by index
static int OP_SECONDARY_BY_KEY
          op code - secondary by key
(package private)  int[] ops
          operations
(package private)  java.lang.String[] tokenQueue
          tokens.
(package private)  boolean wildCard
           
 
Constructor Summary
protected EPath()
          disable default constructor
(package private) EPath(java.lang.String name, int len)
          Creates new EPath Object.
 
Method Summary
 java.lang.Object clone()
          clones the epath
(package private)  boolean containsFilters()
          Does this Epath contain any filter
 boolean equals(EPath e)
          if two EPath objects has the same path, then they are considered equal
 java.lang.String getFieldTag()
          getter for the field tag
(package private)  Filter[][] getFilterPaths()
          gets list of non-null filters Each token in a Epath can be associated with list of filters.
 Filter[][] getFilters()
           
 int[] getIndices()
           
 java.lang.String[] getKeys()
           
 java.lang.String getLastChildName()
           
 java.lang.String getLastChildPath()
           
 java.lang.String getName()
          getter for name
(package private)  java.lang.String[] getObjectPaths()
          Return Fully qualified path names for each Object in this EPath.
 int[] getOps()
           
(package private)  java.lang.String getPath(int pathLen)
           
 java.lang.String getTag(int tokenPos)
          get the token tag given the position
 java.lang.String[] getTokenQueue()
           
(package private)  java.lang.String[] getTokenStrings()
          get all token strings
 boolean getWildCard()
          getter for the field wildCard
 int hashCode()
          hash code
 boolean isFieldToken(int tokenPos)
          is the token a field
 boolean isTokenExists(int tokenPos)
          is there a token at the position
 void setFilters(Filter[][] filters)
           
 void setIndices(int[] indices)
           
 void setKeys(java.lang.String[] keys)
           
 void setOps(int[] ops)
           
 void setTokenQueue(java.lang.String[] tokenQueue)
           
 java.lang.String toFieldName()
          returns the field name represented by this EPath object
 java.lang.String toString()
          return a string
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

filters

Filter[][] filters
filters


indices

int[] indices
indices


keys

java.lang.String[] keys
keys


OP_ALL_FIELD

public static final int OP_ALL_FIELD
op code - all fields return as object

See Also:
Constant Field Values

OP_ALL_SECONDARY

public static final int OP_ALL_SECONDARY
op code - all secondary object as list

See Also:
Constant Field Values

OP_FIELD

public static final int OP_FIELD
op code - field accessor

See Also:
Constant Field Values

OP_NOOP

public static final int OP_NOOP
op code

See Also:
Constant Field Values

OP_SECONDARY_BY_FILTER

public static final int OP_SECONDARY_BY_FILTER
op code - secondary by filter

See Also:
Constant Field Values

OP_SECONDARY_BY_INDEX

public static final int OP_SECONDARY_BY_INDEX
op code - secondary by index

See Also:
Constant Field Values

OP_SECONDARY_BY_KEY

public static final int OP_SECONDARY_BY_KEY
op code - secondary by key

See Also:
Constant Field Values

ops

int[] ops
operations


tokenQueue

java.lang.String[] tokenQueue
tokens. After parsing is complete, tokenQueue only contains names. Any associated index or filter will be contained in indices/filters arrays. So if Epath is Enterprise.SystemObject.Person[firstName=foo]. Then tokenQueue contains strings Enterprise, Systemobject, Person and * filters[][] will contain one Filter element (firstName,foo) in 3rd element of filters[]. The rest of elements in filters[] will be null


wildCard

boolean wildCard
Constructor Detail

EPath

protected EPath()
disable default constructor


EPath

EPath(java.lang.String name,
      int len)
Creates new EPath Object. Package access only, use EPathBuilder to create an EPath object

Parameters:
name - qualified field name
len - length
Method Detail

clone

public java.lang.Object clone()
clones the epath

Returns:
a clone

containsFilters

boolean containsFilters()
Does this Epath contain any filter

Returns:
true if contains filters

equals

public boolean equals(EPath e)
if two EPath objects has the same path, then they are considered equal

Parameters:
e - another EPath object
Returns:
true if both points to the same field, false otherwise

getFieldTag

public java.lang.String getFieldTag()
getter for the field tag

Returns:
field tag value

getFilterPaths

Filter[][] getFilterPaths()
gets list of non-null filters Each token in a Epath can be associated with list of filters. So the returned filters is array of array of Filter for associated token. If a token has no filters, then the filter[] for that token is null The name in Filter is a path name (instead of just a name that is normally used in a Filter)

Returns:
list of non-null filters

getFilters

public Filter[][] getFilters()
Returns:
the filters

getIndices

public int[] getIndices()
Returns:
the indices

getKeys

public java.lang.String[] getKeys()
Returns:
the keys

getLastChildName

public java.lang.String getLastChildName()

getLastChildPath

public java.lang.String getLastChildPath()

getName

public java.lang.String getName()
getter for name

Returns:
name value

getObjectPaths

java.lang.String[] getObjectPaths()
Return Fully qualified path names for each Object in this EPath.

Returns:
full qualified path names for each object in this EPath.

getOps

public int[] getOps()
Returns:
the ops

getPath

java.lang.String getPath(int pathLen)

getTag

public java.lang.String getTag(int tokenPos)
get the token tag given the position

Parameters:
tokenPos - position
Returns:
The tag of the token at the given position, can represent the object type for object nodes or field names for fields.

getTokenQueue

public java.lang.String[] getTokenQueue()
Returns:
the tokenQueue

getTokenStrings

java.lang.String[] getTokenStrings()
get all token strings

Returns:
all token strings

getWildCard

public boolean getWildCard()
getter for the field wildCard

Returns:
field wildCard value

hashCode

public int hashCode()
hash code

Returns:
int hash code

isFieldToken

public boolean isFieldToken(int tokenPos)
is the token a field

Parameters:
tokenPos - token position
Returns:
whether the token the given position represents a field

isTokenExists

public boolean isTokenExists(int tokenPos)
is there a token at the position

Parameters:
tokenPos - position
Returns:
whether a token exists at the given position

setFilters

public void setFilters(Filter[][] filters)
Parameters:
filters - the filters to set

setIndices

public void setIndices(int[] indices)
Parameters:
indices - the indices to set

setKeys

public void setKeys(java.lang.String[] keys)
Parameters:
keys - the keys to set

setOps

public void setOps(int[] ops)
Parameters:
ops - the ops to set

setTokenQueue

public void setTokenQueue(java.lang.String[] tokenQueue)
Parameters:
tokenQueue - the tokenQueue to set

toFieldName

public java.lang.String toFieldName()
returns the field name represented by this EPath object

Returns:
the field name represented by this EPath object

toString

public java.lang.String toString()
return a string

Returns:
string representation


Sun Microsystems, Inc.