public class AtomicEntityExpression extends EntityExpression
Agent(id=5) (where Agent is the start entity type) or
OrgUnit(id=1).getOrgPosition() (where OrgUnit is the start entity
type).
This class is used for the object-based representations of OrgPolicies created by the parser.
| Constructor and Description |
|---|
AtomicEntityExpression(EntityType startEntityType,
Selection startSelection)
Constructs a new
AtomicEntityExpression for the given start entity
type and the associated selection. |
| Modifier and Type | Method and Description |
|---|---|
void |
appendFunction(NavFunctionInstance funcInst)
Append the given function instance to the function chain.
|
NavFunctionInstance |
appendFunction(NavFunction function,
Selection selection)
Appends the given function (and its associated selection) to the function chain.
|
NavFunctionInstance |
appendFunction(NavFunction function,
TransitivityType transitivity,
Selection selection)
Appends the given function (and its associated selection) to the function
chain.
|
AtomicEntityExpression |
duplicate()
needed for path completion where the chain forks. this is not a deep copy
and will share some objects/information with the original.
|
void |
format(java.lang.StringBuilder s)
Formats this object-based representation of an entity expression to a
(policy) string.
|
int |
getChainLength()
Returns the chain length (which is the start entity plus the number of
functions).
|
EntityType |
getEndOfChainEntityType()
A convenience method to retrieve the final entity type in the chain.
|
EntityType |
getEntityTypeAt(int chainIndex)
Returns the entity type at the given index in the chain.
|
NavFunctionInstance |
getFunctionAt(int index)
Returns the function at the given index.
|
int |
getFunctionCount()
Returns the number of functions.
|
Selection |
getSelectionAt(int chainIndex)
Returns the selection at the given index in the chain.
|
formatpublic AtomicEntityExpression(EntityType startEntityType, Selection startSelection)
AtomicEntityExpression for the given start entity
type and the associated selection.startEntityType - the start entity typestartSelection - the selection applied on the start entity typepublic NavFunctionInstance appendFunction(NavFunction function, Selection selection)
function - the function to be appendedselection - the selection associated with the functionNavFunctionInstance that is created in the processpublic NavFunctionInstance appendFunction(NavFunction function, TransitivityType transitivity, Selection selection)
function - the function to be appendedtransitivity - whether the function is applied transitively and which
variation of transitivityselection - the selection associated with the functionNavFunctionInstance that is created in the processpublic void appendFunction(NavFunctionInstance funcInst)
funcInst - the function instance to be appended to the listpublic int getChainLength()
public EntityType getEntityTypeAt(int chainIndex)
0 will return the start entity type. An index of
getChainLength() - 1 will return the final entity type in the
chain.chainIndex - the index in the chainpublic Selection getSelectionAt(int chainIndex)
0 will return the start entity type's selection. An index of
getChainLength() - 1 will return the final entity type's selection
in the chain.chainIndex - the index in the chainpublic EntityType getEndOfChainEntityType()
public int getFunctionCount()
public NavFunctionInstance getFunctionAt(int index)
index - the index of the function to returnpublic AtomicEntityExpression duplicate()
public void format(java.lang.StringBuilder s)
EntityExpressionStringBuilder.format in class EntityExpressions - the StringBuilder to which the result is appended