org.ontobox.fast.box
Class FastBoxWorker

java.lang.Object
  extended by org.ontobox.box.base.BaseBoxWorker
      extended by org.ontobox.fast.box.FastBoxWorker
All Implemented Interfaces:
BoxWorker

public class FastBoxWorker
extends BaseBoxWorker

Author:
Anton Malykh

Field Summary
 
Fields inherited from class org.ontobox.box.base.BaseBoxWorker
EMPTY_INT, EMPTY_LONG, EMPTY_STRING
 
Constructor Summary
FastBoxWorker(FastBox box, boolean ro, boolean autocommit)
           
 
Method Summary
protected  java.lang.String[] annamesForEntity(int id)
           
protected  java.lang.String annoForEntity(int id, java.lang.String name)
           
protected  int[] classesDirectForClass(int id)
           
protected  int[] classesDirectForObject(int id)
           
protected  int[] classesDirectForOntology(int id)
           
protected  int[] classesForClass(int id)
           
protected  int[] classesForObject(int id)
           
protected  int[] classesForOntology(int id)
           
<T> T
clientDirect(BoxDirectClient<T> client)
           
 void close()
          Close and roll back uncommited changes if any
 void commit()
          Commit changes
protected  java.lang.Integer domainForOProperty(int id)
           
protected  java.lang.Integer domainForTProperty(int id)
           
 Entity entity(int id)
          Get entity type
 java.lang.Integer id(java.lang.String name)
          Get id by name
protected  int[] intsForObject(int id, int prop)
           
protected  int[] intsForTProperty(int id)
           
 boolean isTransaction()
          Verify if transaction worker
protected  long[] longsForObject(int id, int prop)
           
protected  long[] longsForTProperty(int id)
           
 java.lang.String name(int id)
          Get name by id
protected  int[] objectsDirectForClass(int id)
           
protected  int[] objectsForClass(int id)
           
protected  int[] objectsForOntology(int id)
           
 int[] ontologies()
          Get all ontologies
protected  int[] opropsDirectForClass(int id)
           
protected  int[] opropsForClass(int id)
           
protected  int[] opropsForObject(int id)
           
protected  int[] opropsForOntology(int id)
           
protected  int[] ovaluesForObject(int id, int prop)
           
protected  int[] ownersForOProperty(int prop, int value)
           
protected  int[] ownersForTProperty(int prop, java.lang.String value)
           
protected  java.lang.Integer rangeForOProperty(int id)
           
protected  java.lang.Integer rangeForTProperty(int id)
           
 void rollback()
          Roll back uncommited changes
protected  java.lang.String[] stringsForObject(int id, int prop)
           
protected  java.lang.String[] stringsForTProperty(int id)
           
protected  int[] subclassesDirectForClass(int id)
           
protected  int[] subclassesForClass(int id)
           
protected  int[] tpropsDirectForClass(int fn)
           
protected  int[] tpropsForClass(int id)
           
protected  int[] tpropsForObject(int id)
           
protected  int[] tpropsForOntology(int id)
           
protected  int[] typesForOntology(int id)
           
 BoxWriter write()
          Get the writer for write actions
 
Methods inherited from class org.ontobox.box.base.BaseBoxWorker
annames, anno, assertDomain, booleans, booleans, booleansForObject, booleansForTProperty, classes, classesDirect, dateTimes, dateTimes, dateTimesForObject, dateTimesForTProperty, domain, entity, extractEntity, extractEntity, extractEntity, extractEntity, ints, ints, local, longs, longs, name, objects, objects, objectsDirect, ontology, oprops, opropsDirect, owners, owners, owners, owners, range, resolve, resolve, strings, strings, subclasses, subclassesDirect, tprops, tpropsDirect, types
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastBoxWorker

public FastBoxWorker(FastBox box,
                     boolean ro,
                     boolean autocommit)
Method Detail

write

public BoxWriter write()
Description copied from interface: BoxWorker
Get the writer for write actions

Returns:
writer

name

public java.lang.String name(int id)
Description copied from interface: BoxWorker
Get name by id

Parameters:
id - entity id
Returns:
entity name, null if id is unknown

id

public java.lang.Integer id(java.lang.String name)
Description copied from interface: BoxWorker
Get id by name

Parameters:
name - entity name
Returns:
entity id, null if name is unknown

entity

public Entity entity(int id)
Description copied from interface: BoxWorker
Get entity type

Parameters:
id - entity id
Returns:
entity type, null if not found
See Also:
Entity

ontologies

public int[] ontologies()
Description copied from interface: BoxWorker
Get all ontologies

Returns:
ontologies

objectsForOntology

protected int[] objectsForOntology(int id)
Specified by:
objectsForOntology in class BaseBoxWorker

objectsForClass

protected int[] objectsForClass(int id)
Specified by:
objectsForClass in class BaseBoxWorker

objectsDirectForClass

protected int[] objectsDirectForClass(int id)
Specified by:
objectsDirectForClass in class BaseBoxWorker

classesForClass

protected int[] classesForClass(int id)
Specified by:
classesForClass in class BaseBoxWorker

classesForObject

protected int[] classesForObject(int id)
Specified by:
classesForObject in class BaseBoxWorker

classesForOntology

protected int[] classesForOntology(int id)
Specified by:
classesForOntology in class BaseBoxWorker

classesDirectForClass

protected int[] classesDirectForClass(int id)
Specified by:
classesDirectForClass in class BaseBoxWorker

classesDirectForObject

protected int[] classesDirectForObject(int id)
Specified by:
classesDirectForObject in class BaseBoxWorker

classesDirectForOntology

protected int[] classesDirectForOntology(int id)
Specified by:
classesDirectForOntology in class BaseBoxWorker

subclassesForClass

protected int[] subclassesForClass(int id)
Specified by:
subclassesForClass in class BaseBoxWorker

subclassesDirectForClass

protected int[] subclassesDirectForClass(int id)
Specified by:
subclassesDirectForClass in class BaseBoxWorker

typesForOntology

protected int[] typesForOntology(int id)
Specified by:
typesForOntology in class BaseBoxWorker

tpropsForClass

protected int[] tpropsForClass(int id)
Specified by:
tpropsForClass in class BaseBoxWorker

tpropsForObject

protected int[] tpropsForObject(int id)
Specified by:
tpropsForObject in class BaseBoxWorker

tpropsForOntology

protected int[] tpropsForOntology(int id)
Specified by:
tpropsForOntology in class BaseBoxWorker

tpropsDirectForClass

protected int[] tpropsDirectForClass(int fn)
Specified by:
tpropsDirectForClass in class BaseBoxWorker

opropsForClass

protected int[] opropsForClass(int id)
Specified by:
opropsForClass in class BaseBoxWorker

opropsForObject

protected int[] opropsForObject(int id)
Specified by:
opropsForObject in class BaseBoxWorker

opropsForOntology

protected int[] opropsForOntology(int id)
Specified by:
opropsForOntology in class BaseBoxWorker

opropsDirectForClass

protected int[] opropsDirectForClass(int id)
Specified by:
opropsDirectForClass in class BaseBoxWorker

stringsForTProperty

protected java.lang.String[] stringsForTProperty(int id)
Specified by:
stringsForTProperty in class BaseBoxWorker

intsForTProperty

protected int[] intsForTProperty(int id)
Overrides:
intsForTProperty in class BaseBoxWorker

longsForTProperty

protected long[] longsForTProperty(int id)
Overrides:
longsForTProperty in class BaseBoxWorker

stringsForObject

protected java.lang.String[] stringsForObject(int id,
                                              int prop)
Specified by:
stringsForObject in class BaseBoxWorker

intsForObject

protected int[] intsForObject(int id,
                              int prop)
Overrides:
intsForObject in class BaseBoxWorker

longsForObject

protected long[] longsForObject(int id,
                                int prop)
Overrides:
longsForObject in class BaseBoxWorker

ovaluesForObject

protected int[] ovaluesForObject(int id,
                                 int prop)
Specified by:
ovaluesForObject in class BaseBoxWorker

ownersForOProperty

protected int[] ownersForOProperty(int prop,
                                   int value)
Specified by:
ownersForOProperty in class BaseBoxWorker

ownersForTProperty

protected int[] ownersForTProperty(int prop,
                                   java.lang.String value)
Specified by:
ownersForTProperty in class BaseBoxWorker

rangeForTProperty

protected java.lang.Integer rangeForTProperty(int id)
Specified by:
rangeForTProperty in class BaseBoxWorker

rangeForOProperty

protected java.lang.Integer rangeForOProperty(int id)
Specified by:
rangeForOProperty in class BaseBoxWorker

domainForTProperty

protected java.lang.Integer domainForTProperty(int id)
Specified by:
domainForTProperty in class BaseBoxWorker

domainForOProperty

protected java.lang.Integer domainForOProperty(int id)
Specified by:
domainForOProperty in class BaseBoxWorker

annoForEntity

protected java.lang.String annoForEntity(int id,
                                         java.lang.String name)
Specified by:
annoForEntity in class BaseBoxWorker

annamesForEntity

protected java.lang.String[] annamesForEntity(int id)
Specified by:
annamesForEntity in class BaseBoxWorker

clientDirect

public <T> T clientDirect(BoxDirectClient<T> client)

isTransaction

public boolean isTransaction()
Description copied from interface: BoxWorker
Verify if transaction worker

Returns:
true if transaction worker

commit

public void commit()
Description copied from interface: BoxWorker
Commit changes


rollback

public void rollback()
Description copied from interface: BoxWorker
Roll back uncommited changes


close

public final void close()
Description copied from interface: BoxWorker
Close and roll back uncommited changes if any