org.basex.core
Class Datas

java.lang.Object
  extended by org.basex.core.Datas

public final class Datas
extends java.lang.Object

This class organizes all currently opened databases.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Constructor Summary
Datas()
           
 
Method Summary
 void add(Data d)
          Adds an already pinned data reference to the pool.
 void pin(Data data)
          Pins a data reference.
 Data pin(java.lang.String db)
          Pins and returns an existing data reference for the specified database, or returns null.
 int pins(java.lang.String db)
          Returns the number of pins for the specified database, or 0 if the database is not opened.
 boolean unpin(Data data)
          Unpins a data reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Datas

public Datas()
Method Detail

pin

public Data pin(java.lang.String db)
Pins and returns an existing data reference for the specified database, or returns null.

Parameters:
db - name of the database
Returns:
data reference

pin

public void pin(Data data)
Pins a data reference.

Parameters:
data - data reference

unpin

public boolean unpin(Data data)
Unpins a data reference.

Parameters:
data - data reference
Returns:
true if reference was removed from the pool

add

public void add(Data d)
Adds an already pinned data reference to the pool.

Parameters:
d - data reference

pins

public int pins(java.lang.String db)
Returns the number of pins for the specified database, or 0 if the database is not opened.

Parameters:
db - name of the database
Returns:
number of references