|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectconcurrency.LockMode
This class represents the locking modes (share or exclusive).
Field Summary | |
static byte |
EXCLUSIVE
The byte representation of exclusive mode. |
static LockMode |
EXCLUSIVE_MODE
The exclusive mode. |
static byte |
SHARE
The byte representation of share mode. |
static LockMode |
SHARE_MODE
The share mode. |
Constructor Summary | |
LockMode()
Constructa a new locking mode (share mode); |
|
LockMode(byte lockMode)
Constructs a new locking mode with a specified value. |
|
LockMode(LockMode lockMode)
Constructs a new locking mode as a copy of other. |
Method Summary | |
byte |
getMode()
Returns the byte representation of the locking mode. |
boolean |
isCompatible(LockMode mode)
Checks if this lock is compatible with oter. |
boolean |
isExclusive()
Checks if the mode is exclusive. |
boolean |
isShare()
Checks if the mode is share. |
void |
setExclusive()
Changes the mode to exclusive. |
void |
setMode(byte lockMode)
Changes the mode. |
void |
setMorePowerful(byte lockMode)
Try to change the mode preserving the greater (exclusive is greater than share). |
void |
setMorePowerful(LockMode lockMode)
Try to change the mode preserving the greater (exclusive is greater than share). |
void |
setShare()
Changes the mode to share. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte EXCLUSIVE
public static final byte SHARE
public static final LockMode EXCLUSIVE_MODE
public static final LockMode SHARE_MODE
Constructor Detail |
public LockMode(byte lockMode)
public LockMode(LockMode lockMode)
public LockMode()
Method Detail |
public byte getMode()
public boolean isExclusive()
public boolean isShare()
public void setMode(byte lockMode)
public void setMorePowerful(byte lockMode)
public void setMorePowerful(LockMode lockMode)
public void setExclusive()
public void setShare()
public boolean isCompatible(LockMode mode)
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |