|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.xqhs.graphs.matchingPlatform.TrackingGraph.Transaction
public static class TrackingGraph.Transaction
The class contains information on one or more changes (operations) to apply to a graph. Each change is a pair of
a GraphComponent
instance and one of TrackingGraph.Operation
. The changes are not ordered in any guaranteed
manner.
The implementation is optimized so that single-operation transactions are represented in a more simple manner. The conversion between single- and multi-operation transactions is done transparently.
The class implements most operations of Map
, but some are available only if the transaction is
multi-operation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
(package private) boolean |
empty
true if the transaction is empty (no operation contained). |
(package private) java.util.Map<GraphComponent,TrackingGraph.Operation> |
multipleOperations
For multi-operation transactions, the map of operations. |
(package private) boolean |
singleOperation
true if and inly if it is single-operation (is not true for empty transactions). |
(package private) GraphComponent |
singleOperationComponent
For single-operation transactions, the component contained in the operation. |
(package private) TrackingGraph.Operation |
singleOperationOperation
For single-operation transactions, the operation to perform. |
Constructor Summary | |
---|---|
TrackingGraph.Transaction()
Creates an empty transaction. |
|
TrackingGraph.Transaction(GraphComponent component,
TrackingGraph.Operation operation)
Creates a single-operation transaction. |
Method Summary | |
---|---|
void |
clear()
Resets the transaction to an empty transaction. |
protected void |
compact()
Compacts a multi-operation transaction in case it is in fact empty or single-operation. |
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
The method is unsupported. |
java.util.Set<java.util.Map.Entry<GraphComponent,TrackingGraph.Operation>> |
entrySet()
Unsupported operation for empty or single-operation transactions. |
TrackingGraph.Operation |
get(java.lang.Object component)
|
GraphComponent |
getComponent()
For single-operation transactions only, retrieves the component contained in the operation. |
TrackingGraph.Operation |
getOperation()
For single-operation transactions only, retrieves the operation to perform. |
boolean |
isEmpty()
|
boolean |
isSingleOperation()
|
java.util.Set<GraphComponent> |
keySet()
Unsupported operation for empty or single-operation transactions. |
TrackingGraph.Operation |
put(GraphComponent component,
TrackingGraph.Operation operation)
Adds a new operation to the transaction. |
void |
putAll(java.util.Map<? extends GraphComponent,? extends TrackingGraph.Operation> operations)
|
TrackingGraph.Transaction |
putR(GraphComponent component,
TrackingGraph.Operation operation)
The method is identical to #put(GraphComponent, Operation) , with the exception that it returns the
instance itself. |
TrackingGraph.Operation |
remove(java.lang.Object component)
|
int |
size()
|
protected void |
toMultipleOperations()
Converts an empty or single-operation transaction into a multi-operation transaction. |
java.util.Map<GraphComponent,TrackingGraph.Operation> |
toOperationMap()
Retrieves the operations in this transaction as a (copy) Map of GraphComponent →
TrackingGraph.Operation . |
java.lang.String |
toString()
|
java.util.Collection<TrackingGraph.Operation> |
values()
The method is unsupported. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
boolean singleOperation
true
if and inly if it is single-operation (is not true for empty transactions).
boolean empty
true
if the transaction is empty (no operation contained).
GraphComponent singleOperationComponent
TrackingGraph.Operation singleOperationOperation
java.util.Map<GraphComponent,TrackingGraph.Operation> multipleOperations
Constructor Detail |
---|
public TrackingGraph.Transaction(GraphComponent component, TrackingGraph.Operation operation)
component
- - the component contained in the operation.operation
- - the operation to perform.public TrackingGraph.Transaction()
Method Detail |
---|
public GraphComponent getComponent()
java.lang.UnsupportedOperationException
- if the method is called for an empty or multi-operation transaction.public TrackingGraph.Operation getOperation()
java.lang.UnsupportedOperationException
- if the method is called for an empty or multi-operation transaction.public boolean isSingleOperation()
true
if the transaction contains exactly one operation.protected void compact()
protected void toMultipleOperations()
public TrackingGraph.Operation put(GraphComponent component, TrackingGraph.Operation operation)
If the transaction was empty, it is now single-operation. If it was single-operation, it is now multi-operation.
put
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public TrackingGraph.Transaction putR(GraphComponent component, TrackingGraph.Operation operation)
#put(GraphComponent, Operation)
, with the exception that it returns the
instance itself.
component
- - the component contained in the operation.operation
- - the operation to perform.
public void putAll(java.util.Map<? extends GraphComponent,? extends TrackingGraph.Operation> operations)
putAll
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public TrackingGraph.Operation get(java.lang.Object component)
get
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public java.util.Collection<TrackingGraph.Operation> values()
values
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public void clear()
clear
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public boolean isEmpty()
isEmpty
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public int size()
size
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public java.util.Set<java.util.Map.Entry<GraphComponent,TrackingGraph.Operation>> entrySet()
entrySet
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public java.util.Set<GraphComponent> keySet()
keySet
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public TrackingGraph.Operation remove(java.lang.Object component)
remove
in interface java.util.Map<GraphComponent,TrackingGraph.Operation>
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Map<GraphComponent,TrackingGraph.Operation> toOperationMap()
Map
of GraphComponent
→
TrackingGraph.Operation
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |