Package org.basex.core.locks
Class LockList
java.lang.Object
org.basex.core.locks.LockList
List with strings that serve as lock keys.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a local lock if no global lock has been added.voidAdds another lock list.voidSets a global lock.booleanChecks if the specified lock is found in the list.voidFinishes the lock list.get(int index) Returns the element at the specified position.booleanglobal()Indicates if a global lock exists.iterator()booleanlocal()Indicates if local locks exist.booleanlocking()Indicates if any lock exists.voidRemoves all locks from the specified list.voidreset()Resets the lock list.intsize()Returns the number of local locks.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
LockList
public LockList()
-
-
Method Details
-
add
Adds a local lock if no global lock has been added.- Parameters:
lock- lock to be added- Returns:
- self reference
-
local
public boolean local()Indicates if local locks exist.- Returns:
- result of check
-
addGlobal
public void addGlobal()Sets a global lock. All existing and following local locks will be ignored. -
reset
public void reset()Resets the lock list. -
global
public boolean global()Indicates if a global lock exists.- Returns:
- result of check
-
locking
public boolean locking()Indicates if any lock exists.- Returns:
- result of check
-
add
Adds another lock list. A global lock will be adopted.- Parameters:
locks- lock list
-
remove
Removes all locks from the specified list.- Parameters:
locks- lock list
-
get
Returns the element at the specified position.- Parameters:
index- element index- Returns:
- element
-
contains
Checks if the specified lock is found in the list.- Parameters:
lock- lock to be found- Returns:
- result of check
-
size
public int size()Returns the number of local locks.- Returns:
- number of local locks
-
finish
Finishes the lock list. Locks of typeLocking.COLLECTIONandLocking.CONTEXTwill be replaced with the name of the current database, if it exists, or deleted otherwise. The resulting list will be sorted, and duplicates will be removed.- Parameters:
name- name of currently opened database
-
iterator
-
toString
-