java.lang.Object
de.grogra.graph.GraphBase
- Direct Known Subclasses:
GraphFilter
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface de.grogra.util.Lockable
Lockable.DeadLockException
-
Field Summary
Fields inherited from interface de.grogra.graph.Graph
BRANCH_EDGE, CONTAINMENT_EDGE, CONTAINMENT_END_EDGE, EDGENODE_IN_EDGE, EDGENODE_OUT_EDGE, ELLIPSE_SYMBOL, IGNORED_EDGE, INSTANTIATION_EDGE, MAIN_GRAPH, MARK_EDGE, MIN_NORMAL_BIT_INDEX, MIN_UNUSED_EDGE, MIN_UNUSED_EDGE_BIT, NOTIFIES_EDGE, PERSISTENT, PERSISTENT_DELETED, RECTANGLE_SYMBOL, REFINEMENT_EDGE, RHOMBUS_SYMBOL, ROUND_RECTANGLE_SYMBOL, SPECIAL_EDGE_MASK, SPECIAL_EDGE_OF_SOURCE_BIT, STD_EDGE_5, STD_EDGE_6, SUCCESSOR_EDGE, TRANSIENT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addAttributeChangeListener
(Object object, boolean asNode, AttributeChangeListener l) void
void
void
addEdgeChangeListener
(Object object, boolean asNode, EdgeChangeListener l) protected abstract GraphBase.State
void
execute
(LockProtectedRunnable task, boolean write) Asynchronously executes atask
such that it possesses a lock on thisLockable
.void
execute
(LockProtectedRunnable task, Lock retained) Asynchronously executes atask
using a lock which has been retained before within another task.void
executeForcedly
(LockProtectedRunnable task, boolean write) Synchronously executes atask
such that it possesses a lock on thisLockable
.void
executeForcedly
(LockProtectedRunnable task, Lock retained) Synchronously executes atask
using a lock which has been retained before within another task.Returns the main graph state.long
Returns the waiting time of the pending task which is waiting longest, or-1
if there is no pending task.int
Returns the current number of tasks which are waiting for locked execution.protected void
init()
boolean
isLocked
(boolean write) Determines if the current thread has a lock for thisLockable
.void
void
removeAttributeChangeListener
(Object object, boolean asNode, AttributeChangeListener l) void
void
void
removeEdgeChangeListener
(Object object, boolean asNode, EdgeChangeListener l) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.grogra.graph.Graph
accept, createBooleanMap, createObjectMap, getAccessor, getAttributes, getColor, getDependent, getDescription, getEdgeBits, getFirstEdge, getId, getInstantiator, getLifeCycleState, getName, getNextEdge, getNodeForId, getObjectForName, getParentAttribute, getRoot, getRootKeys, getSourceNode, getSpecialEdgeDescriptors, getStamp, getSymbol, getTargetNode, getTreePattern
-
Constructor Details
-
GraphBase
-
-
Method Details
-
init
protected void init() -
createMainState
-
getMainState
Description copied from interface:Graph
Returns the main graph state. The main graph state is the only graph state within which modifications to the graph may be done. The notification of event listeners is done in the context of this state, too.- Specified by:
getMainState
in interfaceGraph
- Returns:
- this graph's main graph state
- See Also:
-
addChangeBoundaryListener
- Specified by:
addChangeBoundaryListener
in interfaceGraph
-
removeChangeBoundaryListener
- Specified by:
removeChangeBoundaryListener
in interfaceGraph
-
addAttributeChangeListener
- Specified by:
addAttributeChangeListener
in interfaceGraph
-
addEdgeChangeListener
- Specified by:
addEdgeChangeListener
in interfaceGraph
-
removeAttributeChangeListener
- Specified by:
removeAttributeChangeListener
in interfaceGraph
-
removeEdgeChangeListener
- Specified by:
removeEdgeChangeListener
in interfaceGraph
-
addAttributeChangeListener
- Specified by:
addAttributeChangeListener
in interfaceGraph
-
removeAttributeChangeListener
- Specified by:
removeAttributeChangeListener
in interfaceGraph
-
addEdgeChangeListener
- Specified by:
addEdgeChangeListener
in interfaceGraph
-
removeEdgeChangeListener
- Specified by:
removeEdgeChangeListener
in interfaceGraph
-
execute
Description copied from interface:Lockable
Asynchronously executes atask
such that it possesses a lock on thisLockable
. Note that the execution is asynchronous, so that the thread in which the task will actually be executed may differ from the current thread. -
execute
Description copied from interface:Lockable
Asynchronously executes atask
using a lock which has been retained before within another task. Note that the execution is asynchronous, so that the thread in which the task will actually be executed may differ from the current thread. -
executeForcedly
public void executeForcedly(LockProtectedRunnable task, boolean write) throws InterruptedException, Lockable.DeadLockException Description copied from interface:Lockable
Synchronously executes atask
such that it possesses a lock on thisLockable
. The execution is performed in the current thread.- Specified by:
executeForcedly
in interfaceLockable
- Parameters:
task
- the task to executewrite
- shall a write lock be obtained?- Throws:
InterruptedException
Lockable.DeadLockException
-
executeForcedly
Description copied from interface:Lockable
Synchronously executes atask
using a lock which has been retained before within another task. The execution is performed in the current thread.- Specified by:
executeForcedly
in interfaceLockable
- Parameters:
task
- the task to executeretained
- the previously retained lock- Throws:
InterruptedException
- See Also:
-
isLocked
public boolean isLocked(boolean write) Description copied from interface:Lockable
Determines if the current thread has a lock for thisLockable
. -
getQueueLength
public int getQueueLength()Description copied from interface:Lockable
Returns the current number of tasks which are waiting for locked execution.- Specified by:
getQueueLength
in interfaceLockable
- Returns:
- current number of waiting tasks
-
getMaxWaitingTime
public long getMaxWaitingTime()Description copied from interface:Lockable
Returns the waiting time of the pending task which is waiting longest, or-1
if there is no pending task.- Specified by:
getMaxWaitingTime
in interfaceLockable
- Returns:
- current maximum waiting time of pending tasks
-
getStateMap
- Specified by:
getStateMap
in interfaceGraph
-