|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deckfour.xes.extension.XExtension
org.deckfour.xes.extension.std.XCostExtension
public class XCostExtension
This extension provides costs for traces and events. It defines five attributes: - cost:total: Contains total cost incurred for a trace or an event. The value represents the sum of all the cost amounts within the element. - cost:currecny: Any valid currency format. - cost:amount: The value contains the cost amount for a cost driver. - cost:driver: The value contains the id for the cost driver used to calculate the cost. - cost:type: The value contains the cost type (e.g., Fixed, Overhead, Materials).
Field Summary | |
---|---|
static XAttributeContinuous |
ATTR_AMOUNT
|
static XAttributeLiteral |
ATTR_CURRENCY
|
static XAttributeLiteral |
ATTR_DRIVER
|
static XAttributeContinuous |
ATTR_TOTAL
Attribute prototypes |
static XAttributeLiteral |
ATTR_TYPE
|
static URI |
EXTENSION_URI
Unique URI of this extension. |
static String |
KEY_AMOUNT
|
static String |
KEY_CURRENCY
|
static String |
KEY_DRIVER
|
static String |
KEY_TOTAL
Keys for the attributes. |
static String |
KEY_TYPE
|
Fields inherited from class org.deckfour.xes.extension.XExtension |
---|
allAttributes, eventAttributes, logAttributes, metaAttributes, name, prefix, traceAttributes, uri |
Method Summary | |
---|---|
void |
assignAmount(XAttribute attribute,
Double amount)
Assigns any attribute its cost amount, as defined by this extension's amount attribute. |
void |
assignAmounts(XEvent event,
Map<String,Double> amounts)
Assigns (to the given event) multiple amounts given their keys. |
void |
assignAmounts(XTrace trace,
Map<String,Double> amounts)
Assigns (to the given trace) multiple amounts given their keys. |
void |
assignCurrency(XEvent event,
String currency)
Assigns any event its cost currency, as defined by this extension's currency attribute. |
void |
assignCurrency(XTrace trace,
String currency)
Assigns any trace its cost currency, as defined by this extension's currency attribute. |
void |
assignDriver(XAttribute attribute,
String driver)
Assigns any attribute its cost driver, as defined by this extension's driver attribute. |
void |
assignDrivers(XEvent event,
Map<String,String> drivers)
Assigns (to the given event) multiple cost drivers given their key. |
void |
assignDrivers(XTrace trace,
Map<String,String> drivers)
Assigns (to the given trace) multiple cost drivers given their keys. |
void |
assignNestedAmounts(XEvent event,
Map<List<String>,Double> amounts)
Assigns (to the given event) multiple amounts given their key lists. |
void |
assignNestedAmounts(XTrace trace,
Map<List<String>,Double> amounts)
Assigns (to the given trace) multiple amounts given their key lists. |
void |
assignNestedDrivers(XEvent event,
Map<List<String>,String> drivers)
Assigns (to the given event) multiple cost drivers given their key lists. |
void |
assignNestedDrivers(XTrace trace,
Map<List<String>,String> drivers)
Assigns (to the given trace) multiple cost drivers given their key lists. |
void |
assignNestedTypes(XEvent event,
Map<List<String>,String> types)
Assigns (to the given event) multiple cost types given their key lists. |
void |
assignNestedTypes(XTrace trace,
Map<List<String>,String> types)
Assigns (to the given trace) multiple cost types given their key lists. |
void |
assignTotal(XEvent event,
Double total)
Assigns any event its total costs, as defined by this extension's total attribute. |
void |
assignTotal(XTrace trace,
Double total)
Assigns any trace its total costs, as defined by this extension's total attribute. |
void |
assignType(XAttribute attribute,
String type)
Assigns any attribute its cost type, as defined by this extension's type attribute. |
void |
assignTypes(XEvent event,
Map<List<String>,String> types)
Assigns (to the given event) multiple cost types given their keys. |
void |
assignTypes(XTrace trace,
Map<List<String>,String> types)
Assigns (to the given trace) multiple cost types given their keys. |
Double |
extractAmount(XAttribute attribute)
Retrieves the cost amount for an attribute, if set by this extension's amount attribute. |
Map<String,Double> |
extractAmounts(XEvent event)
Retrieves a map containing all cost amounts for all child attributes of an event. |
Map<String,Double> |
extractAmounts(XTrace trace)
Retrieves a map containing all cost amounts for all child attributes of a trace. |
String |
extractCurrency(XEvent event)
Retrieves the cost currency for an event, if set by this extension's currency attribute. |
String |
extractCurrency(XTrace trace)
Retrieves the cost currency for a trace, if set by this extension's currency attribute. |
String |
extractDriver(XAttribute attribute)
Retrieves the cost driver for an attribute, if set by this extension's driver attribute. |
Map<String,String> |
extractDrivers(XEvent event)
Retrieves a map containing all cost drivers for all child attributes of an event. |
Map<String,String> |
extractDrivers(XTrace trace)
Retrieves a map containing all cost drivers for all child attributes of a trace. |
Map<List<String>,Double> |
extractNestedAmounts(XEvent event)
Retrieves a map containing all cost amounts for all descending attributes of an event. |
Map<List<String>,Double> |
extractNestedAmounts(XTrace trace)
Retrieves a map containing all cost amounts for all descending attributes of a trace. |
Map<List<String>,String> |
extractNestedDrivers(XEvent event)
Retrieves a map containing all cost drivers for all descending attributes of an event. |
Map<List<String>,String> |
extractNestedDrivers(XTrace trace)
Retrieves a map containing all cost drivers for all descending attributes of a trace. |
Map<List<String>,String> |
extractNestedTypes(XEvent event)
Retrieves a map containing all cost types for all descending attributes of an event. |
Map<List<String>,String> |
extractNestedTypes(XTrace trace)
Retrieves a map containing all cost types for all descending attributes of a trace. |
Double |
extractTotal(XEvent event)
Retrieves the total costs of an event, if set by this extension's total attribute. |
Double |
extractTotal(XTrace trace)
Retrieves the total costs of a trace, if set by this extension's total attribute. |
String |
extractType(XAttribute attribute)
Retrieves the cost type for an attribute, if set by this extension's type attribute. |
Map<String,String> |
extractTypes(XEvent event)
Retrieves a map containing all cost types for all child attributes of an event. |
Map<String,String> |
extractTypes(XTrace trace)
Retrieves a map containing all cost types for all child attributes of a trace. |
static XCostExtension |
instance()
Provides access to the singleton instance. |
Methods inherited from class org.deckfour.xes.extension.XExtension |
---|
accept, equals, getDefinedAttributes, getEventAttributes, getLogAttributes, getMetaAttributes, getName, getPrefix, getTraceAttributes, getUri, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final URI EXTENSION_URI
public static final String KEY_TOTAL
public static final String KEY_CURRENCY
public static final String KEY_AMOUNT
public static final String KEY_DRIVER
public static final String KEY_TYPE
public static XAttributeContinuous ATTR_TOTAL
public static XAttributeLiteral ATTR_CURRENCY
public static XAttributeContinuous ATTR_AMOUNT
public static XAttributeLiteral ATTR_DRIVER
public static XAttributeLiteral ATTR_TYPE
Method Detail |
---|
public static XCostExtension instance()
public Double extractTotal(XTrace trace)
trace
- Trace to retrieve total costs for.
public Double extractTotal(XEvent event)
event
- Event to retrieve total costs for.
public void assignTotal(XTrace trace, Double total)
trace
- Trace to assign total costs to.total
- The total costs to be assigned.public void assignTotal(XEvent event, Double total)
event
- Event to assign total costs to.total
- The total costs to be assigned.public String extractCurrency(XTrace trace)
trace
- Trace to retrieve currency for.
public String extractCurrency(XEvent event)
event
- Event to retrieve currency for.
public void assignCurrency(XTrace trace, String currency)
trace
- Trace to assign cost currency to.currency
- The currency to be assigned.public void assignCurrency(XEvent event, String currency)
event
- Event to assign cost currency to.currency
- The currency to be assigned.public Double extractAmount(XAttribute attribute)
attribute
- Attribute element to retrieve cost amount for.
public Map<String,Double> extractAmounts(XTrace trace)
<trace>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
<string key="b" value="">
<float key="cost:amount" value="20.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="30.00"/>
</string>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</trace>
should result into the following:
[[a 10.00] [b 15.00] [c 25.00]]
trace
- Trace to retrieve all cost amounts for.
public Map<String,Double> extractAmounts(XEvent event)
<event>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
<string key="b" value="">
<float key="cost:amount" value="20.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="30.00"/>
</string>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</event>
should result into the following:
[[a 10.00] [b 15.00] [c 25.00]]
event
- Event to retrieve all cost amounts for.
public Map<List<String>,Double> extractNestedAmounts(XTrace trace)
<trace>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
<string key="b" value="">
<float key="cost:amount" value="20.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="30.00"/>
</string>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</trace>
should result into the following:
[[[a] 10.00] [[a b] 20.00] [[a c] 30.00] [[b] 15.00] [[c] 25.00]]
trace
- Trace to retrieve all cost amounts for.
public Map<List<String>,Double> extractNestedAmounts(XEvent event)
<event>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
<string key="b" value="">
<float key="cost:amount" value="20.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="30.00"/>
</string>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</event>
should result into the following:
[[[a] 10.00] [[a b] 20.00] [[a c] 30.00] [[b] 15.00] [[c] 25.00]]
event
- Event to retrieve all cost amounts for.
public void assignAmount(XAttribute attribute, Double amount)
attribute
- Attribute to assign cost amount to.amount
- The cost amount to be assigned.public void assignAmounts(XTrace trace, Map<String,Double> amounts)
assignAmounts(trace, [[a 10.00] [b 15.00] [c 25.00]])should result into the following XES fragment:
<trace>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</trace>
trace
- Trace to assign the amounts to.amounts
- Mapping from keys to amounts which are to be assigned.public void assignAmounts(XEvent event, Map<String,Double> amounts)
assignAmounts(event, [[a 10.00] [b 15.00] [c 25.00]])should result into the following XES fragment:
<event>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</event>
event
- Event to assign the amounts to.amounts
- Mapping from keys to amounts which are to be assigned.public void assignNestedAmounts(XTrace trace, Map<List<String>,Double> amounts)
assignAmounts(trace, [[[a] 10.00] [[a b] 20.00] [[a c] 30.00] [[b] 15.00] [[c] 25.00]])should result into the following XES fragment:
<trace>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
<string key="b" value="">
<float key="cost:amount" value="20.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="30.00"/>
</string>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</trace>
trace
- Trace to assign the amounts to.amounts
- Mapping from key lists to amounts which are to be assigned.public void assignNestedAmounts(XEvent event, Map<List<String>,Double> amounts)
assignAmounts(event, [[[a] 10.00] [[a b] 20.00] [[a c] 30.00] [[b] 15.00] [[c] 25.00]])should result into the following XES fragment:
<event>
<string key="a" value="">
<float key="cost:amount" value="10.00"/>
<string key="b" value="">
<float key="cost:amount" value="20.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="30.00"/>
</string>
</string>
<string key="b" value="">
<float key="cost:amount" value="15.00"/>
</string>
<string key="c" value="">
<float key="cost:amount" value="25.00"/>
</string>
</event>
event
- Event to assign the amounts to.amounts
- Mapping from key lists to amounts which are to be assigned.public String extractDriver(XAttribute attribute)
attribute
- Attribute element to retrieve cost driver for.
public Map<String,String> extractDrivers(XTrace trace)
trace
- Trace to retrieve all cost drivers for.
extractAmounts(XTrace)
public Map<String,String> extractDrivers(XEvent event)
event
- Event to retrieve all cost drivers for.
extractAmounts(XEvent)
public Map<List<String>,String> extractNestedDrivers(XTrace trace)
trace
- Trace to retrieve all cost drivers for.
extractNestedAmounts(XTrace)
public Map<List<String>,String> extractNestedDrivers(XEvent event)
event
- Event to retrieve all cost drivers for.
extractNestedDrivers(XEvent)
public void assignDriver(XAttribute attribute, String driver)
attribute
- Attribute to assign cost driver to.driver
- The cost driver to be assigned.public void assignDrivers(XTrace trace, Map<String,String> drivers)
trace
- Trace to assign the cost drivers to.drivers
- Mapping from keys to cost drivers which are to be assigned.assignAmounts(XTrace, Map)
public void assignDrivers(XEvent event, Map<String,String> drivers)
event
- Event to assign the cost drivers to.drivers
- Mapping from keys to cost drivers which are to be assigned.assignAmounts(XEvent, Map)
public void assignNestedDrivers(XTrace trace, Map<List<String>,String> drivers)
trace
- Trace to assign the cost drivers to.drivers
- Mapping from key lists to cost drivers which are to be
assigned.assignNestedAmounts(XTrace, Map)
public void assignNestedDrivers(XEvent event, Map<List<String>,String> drivers)
event
- Event to assign the cost drivers to.drivers
- Mapping from key lists to cost drivers which are to be
assigned.assignNestedAmounts(XEvent, Map)
public String extractType(XAttribute attribute)
attribute
- Attribute element to retrieve cost type for.
public Map<String,String> extractTypes(XTrace trace)
trace
- Trace to retrieve all cost types for.
extractAmounts(XTrace)
public Map<String,String> extractTypes(XEvent event)
event
- Event to retrieve all cost types for.
extractAmounts(XEvent)
public Map<List<String>,String> extractNestedTypes(XTrace trace)
trace
- Trace to retrieve all cost types for.
extractNestedAmounts(XTrace)
public Map<List<String>,String> extractNestedTypes(XEvent event)
event
- Event to retrieve all cost types for.
extractNestedAmounts(XEvent)
public void assignType(XAttribute attribute, String type)
attribute
- Attribute to assign cost type to.type
- The cost type to be assigned.public void assignTypes(XTrace trace, Map<List<String>,String> types)
trace
- Trace to assign the cost types to.types
- Mapping from keys to cost types which are to be assigned.assignAmounts(XTrace, Map)
public void assignTypes(XEvent event, Map<List<String>,String> types)
event
- Event to assign the cost types to.types
- Mapping from keys to cost types which are to be assigned.assignAmounts(XEvent, Map)
public void assignNestedTypes(XTrace trace, Map<List<String>,String> types)
trace
- Trace to assign the cost types to.types
- Mapping from key lists to cost types which are to be assigned.assignNestedAmounts(XTrace, Map)
public void assignNestedTypes(XEvent event, Map<List<String>,String> types)
event
- Event to assign the cost types to.types
- Mapping from key lists to cost types which are to be assigned.assignNestedAmounts(XEvent, Map)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |