edu.rice.cs.cunit.record.graph
Class LockInfo

java.lang.Object
  extended by edu.rice.cs.cunit.record.graph.LockInfo

public class LockInfo
extends java.lang.Object

Information about a lock.

Author:
Mathias Ricken

Field Summary
(package private)  java.lang.String _description
          Description of this lock.
(package private)  java.lang.Long _owningThreadId
          Unique id of thread that owns this lock.
(package private)  long _uniqueId
          Unique id of this object.
(package private)  java.util.Set<java.lang.Long> _waitingThreadIds
          Set of unique ids of the threads that wait for this lock.
 
Constructor Summary
LockInfo(java.lang.Long uniqueId, java.lang.String description, long owningThreadId, java.util.Set<java.lang.Long> waitingThreadIds)
          Constructor for lock information.
LockInfo(com.sun.jdi.ObjectReference objRef)
          Constructor for lock information.
 
Method Summary
 java.lang.String getDescription()
          Returns the description.
 java.lang.Long getOwningThreadId()
          Returns the unique id of the owning thread, or null if not owned.
 long getUniqueId()
          Returns the unique id.
 java.util.Set<java.lang.Long> getWaitingThreadIds()
          Returns a list of unique ids of the threads waiting for this lock
 void setOwningThreadId(java.lang.Long owningThreadId)
          Sets the unique id of the owning thread, or null if not owned.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_uniqueId

long _uniqueId
Unique id of this object.


_description

java.lang.String _description
Description of this lock.


_owningThreadId

java.lang.Long _owningThreadId
Unique id of thread that owns this lock.


_waitingThreadIds

java.util.Set<java.lang.Long> _waitingThreadIds
Set of unique ids of the threads that wait for this lock.

Constructor Detail

LockInfo

public LockInfo(java.lang.Long uniqueId,
                java.lang.String description,
                long owningThreadId,
                java.util.Set<java.lang.Long> waitingThreadIds)
Constructor for lock information.

Parameters:
uniqueId - lock's unique id
description - description of the lock
owningThreadId - unique id of thread owning this lock
waitingThreadIds - set of unique ids of the threads waiting for this lock

LockInfo

public LockInfo(com.sun.jdi.ObjectReference objRef)
Constructor for lock information.

Parameters:
objRef - ObjectReference for lock
Method Detail

getUniqueId

public long getUniqueId()
Returns the unique id.

Returns:
unique id

getOwningThreadId

public java.lang.Long getOwningThreadId()
Returns the unique id of the owning thread, or null if not owned.

Returns:
owning thread id, or null if not owned

setOwningThreadId

public void setOwningThreadId(java.lang.Long owningThreadId)
Sets the unique id of the owning thread, or null if not owned.

Parameters:
owningThreadId - owning thread id, or null if not owned

getWaitingThreadIds

public java.util.Set<java.lang.Long> getWaitingThreadIds()
Returns a list of unique ids of the threads waiting for this lock

Returns:
set of unique ids

getDescription

public java.lang.String getDescription()
Returns the description.

Returns:
description.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.