org.ontobox.box.base
Class BaseBoxWorker

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

public abstract class BaseBoxWorker
extends java.lang.Object
implements BoxWorker

Author:
Anton Malykh

Field Summary
protected static int[] EMPTY_INT
           
protected static long[] EMPTY_LONG
           
protected static java.lang.String[] EMPTY_STRING
           
 
Constructor Summary
BaseBoxWorker()
           
 
Method Summary
 java.lang.String[] annames(int id)
           
protected abstract  java.lang.String[] annamesForEntity(int id)
           
 java.lang.String anno(int id, java.lang.String name)
           
protected abstract  java.lang.String annoForEntity(int id, java.lang.String name)
           
protected  void assertDomain(int object, int prop)
           
 boolean[] booleans(int id)
           
 boolean[] booleans(int id, int prop)
           
protected  boolean[] booleansForObject(int id, int prop)
           
protected  boolean[] booleansForTProperty(int id)
           
 int[] classes(int id)
           
 int[] classesDirect(int id)
           
protected abstract  int[] classesDirectForClass(int id)
           
protected abstract  int[] classesDirectForObject(int id)
           
protected abstract  int[] classesDirectForOntology(int id)
           
protected abstract  int[] classesForClass(int id)
           
protected abstract  int[] classesForObject(int id)
           
protected abstract  int[] classesForOntology(int id)
           
 java.util.Date[] dateTimes(int id)
           
 java.util.Date[] dateTimes(int id, int prop)
           
protected  java.util.Date[] dateTimesForObject(int id, int prop)
           
protected  java.util.Date[] dateTimesForTProperty(int id)
           
 java.lang.Integer domain(int id)
           
protected abstract  java.lang.Integer domainForOProperty(int id)
           
protected abstract  java.lang.Integer domainForTProperty(int id)
           
 Entity entity(java.lang.String name)
          Get entity type
protected  Entity extractEntity(int id)
           
protected  Entity extractEntity(int id, Entity type)
           
protected  Entity extractEntity(int id, Entity type1, Entity type2)
           
protected  Entity extractEntity(int id, Entity type1, Entity type2, Entity type3)
           
 int[] ints(int id)
           
 int[] ints(int id, int prop)
           
protected  int[] intsForObject(int id, int prop)
           
protected  int[] intsForTProperty(int id)
           
 java.lang.String local(int fn)
          Get short/local name of entity
 long[] longs(int id)
           
 long[] longs(int id, int prop)
           
protected  long[] longsForObject(int id, int prop)
           
protected  long[] longsForTProperty(int id)
           
 java.lang.String name(int uri, java.lang.String local)
          Generate full name for ontology and short/local name.
 int[] objects(int id)
           
 int[] objects(int id, int prop)
           
 int[] objectsDirect(int id)
           
protected abstract  int[] objectsDirectForClass(int id)
           
protected abstract  int[] objectsForClass(int id)
           
protected abstract  int[] objectsForOntology(int id)
           
 int ontology(int fn)
          Get ontology of entity
 int[] oprops(int id)
           
 int[] opropsDirect(int id)
           
protected abstract  int[] opropsDirectForClass(int id)
           
protected abstract  int[] opropsForClass(int id)
           
protected abstract  int[] opropsForObject(int id)
           
protected abstract  int[] opropsForOntology(int id)
           
protected abstract  int[] ovaluesForObject(int id, int prop)
           
 int[] owners(int obj)
           
 int[] owners(int prop, int value)
           
 int[] owners(int prop, java.lang.String value)
           
 int[] owners(java.lang.String value)
           
protected abstract  int[] ownersForOProperty(int prop, int value)
           
protected abstract  int[] ownersForTProperty(int prop, java.lang.String value)
           
 java.lang.Integer range(int id)
           
protected abstract  java.lang.Integer rangeForOProperty(int id)
           
protected abstract  java.lang.Integer rangeForTProperty(int id)
           
 int resolve(java.lang.String name)
          Get entity id, throws exception if there is no such entity
 int resolve(java.lang.String name, Entity type)
          Get entity id, throws exception if there is no such entity or entity type is not expected
 java.lang.String[] strings(int id)
           
 java.lang.String[] strings(int id, int prop)
           
protected abstract  java.lang.String[] stringsForObject(int id, int prop)
           
protected abstract  java.lang.String[] stringsForTProperty(int id)
           
 int[] subclasses(int id)
           
 int[] subclassesDirect(int id)
           
protected abstract  int[] subclassesDirectForClass(int id)
           
protected abstract  int[] subclassesForClass(int id)
           
 int[] tprops(int id)
           
 int[] tpropsDirect(int id)
           
protected abstract  int[] tpropsDirectForClass(int fn)
           
protected abstract  int[] tpropsForClass(int id)
           
protected abstract  int[] tpropsForObject(int id)
           
protected abstract  int[] tpropsForOntology(int id)
           
 int[] types(int id)
           
protected abstract  int[] typesForOntology(int id)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ontobox.box.BoxWorker
clientDirect, close, commit, entity, id, isTransaction, name, ontologies, rollback, write
 

Field Detail

EMPTY_INT

protected static final int[] EMPTY_INT

EMPTY_LONG

protected static final long[] EMPTY_LONG

EMPTY_STRING

protected static final java.lang.String[] EMPTY_STRING
Constructor Detail

BaseBoxWorker

public BaseBoxWorker()
Method Detail

resolve

public int resolve(java.lang.String name)
Description copied from interface: BoxWorker
Get entity id, throws exception if there is no such entity

Specified by:
resolve in interface BoxWorker
Parameters:
name - entity name
Returns:
entity id

resolve

public int resolve(java.lang.String name,
                   Entity type)
Description copied from interface: BoxWorker
Get entity id, throws exception if there is no such entity or entity type is not expected

Specified by:
resolve in interface BoxWorker
Parameters:
name - entity name
type - expected entity type
Returns:
entity id

entity

public Entity entity(java.lang.String name)
Description copied from interface: BoxWorker
Get entity type

Specified by:
entity in interface BoxWorker
Parameters:
name - entity name
Returns:
entity type, null if not found
See Also:
Entity

extractEntity

protected final Entity extractEntity(int id)

extractEntity

protected final Entity extractEntity(int id,
                                     Entity type)

extractEntity

protected final Entity extractEntity(int id,
                                     Entity type1,
                                     Entity type2)

extractEntity

protected final Entity extractEntity(int id,
                                     Entity type1,
                                     Entity type2,
                                     Entity type3)

name

public java.lang.String name(int uri,
                             java.lang.String local)
Description copied from interface: BoxWorker
Generate full name for ontology and short/local name.

Specified by:
name in interface BoxWorker
Parameters:
uri - ontology
local - short/local name (may be new for ontobase)
Returns:
full name

ontology

public int ontology(int fn)
Description copied from interface: BoxWorker
Get ontology of entity

Specified by:
ontology in interface BoxWorker
Parameters:
fn - entity (but ontology)
Returns:
ontology

local

public java.lang.String local(int fn)
Description copied from interface: BoxWorker
Get short/local name of entity

Specified by:
local in interface BoxWorker
Parameters:
fn - entity (but ontology)
Returns:
short/local name

objectsForOntology

protected abstract int[] objectsForOntology(int id)

objectsForClass

protected abstract int[] objectsForClass(int id)

objects

public int[] objects(int id)
Specified by:
objects in interface BoxWorker

objectsDirectForClass

protected abstract int[] objectsDirectForClass(int id)

objectsDirect

public int[] objectsDirect(int id)
Specified by:
objectsDirect in interface BoxWorker

classesForClass

protected abstract int[] classesForClass(int id)

classesForObject

protected abstract int[] classesForObject(int id)

classesForOntology

protected abstract int[] classesForOntology(int id)

classes

public int[] classes(int id)
Specified by:
classes in interface BoxWorker

classesDirectForClass

protected abstract int[] classesDirectForClass(int id)

classesDirectForObject

protected abstract int[] classesDirectForObject(int id)

classesDirectForOntology

protected abstract int[] classesDirectForOntology(int id)

classesDirect

public int[] classesDirect(int id)
Specified by:
classesDirect in interface BoxWorker

subclassesForClass

protected abstract int[] subclassesForClass(int id)

subclasses

public int[] subclasses(int id)
Specified by:
subclasses in interface BoxWorker

subclassesDirectForClass

protected abstract int[] subclassesDirectForClass(int id)

subclassesDirect

public int[] subclassesDirect(int id)
Specified by:
subclassesDirect in interface BoxWorker

typesForOntology

protected abstract int[] typesForOntology(int id)

types

public int[] types(int id)
Specified by:
types in interface BoxWorker

tpropsForClass

protected abstract int[] tpropsForClass(int id)

tpropsForObject

protected abstract int[] tpropsForObject(int id)

tpropsForOntology

protected abstract int[] tpropsForOntology(int id)

tprops

public int[] tprops(int id)
Specified by:
tprops in interface BoxWorker

tpropsDirectForClass

protected abstract int[] tpropsDirectForClass(int fn)

tpropsDirect

public int[] tpropsDirect(int id)
Specified by:
tpropsDirect in interface BoxWorker

opropsForClass

protected abstract int[] opropsForClass(int id)

opropsForObject

protected abstract int[] opropsForObject(int id)

opropsForOntology

protected abstract int[] opropsForOntology(int id)

oprops

public int[] oprops(int id)
Specified by:
oprops in interface BoxWorker

opropsDirectForClass

protected abstract int[] opropsDirectForClass(int id)

opropsDirect

public int[] opropsDirect(int id)
Specified by:
opropsDirect in interface BoxWorker

stringsForTProperty

protected abstract java.lang.String[] stringsForTProperty(int id)

strings

public java.lang.String[] strings(int id)
Specified by:
strings in interface BoxWorker

intsForTProperty

protected int[] intsForTProperty(int id)

ints

public int[] ints(int id)
Specified by:
ints in interface BoxWorker

longsForTProperty

protected long[] longsForTProperty(int id)

longs

public long[] longs(int id)
Specified by:
longs in interface BoxWorker

dateTimesForTProperty

protected java.util.Date[] dateTimesForTProperty(int id)

dateTimes

public java.util.Date[] dateTimes(int id)
Specified by:
dateTimes in interface BoxWorker

booleansForTProperty

protected boolean[] booleansForTProperty(int id)

booleans

public boolean[] booleans(int id)
Specified by:
booleans in interface BoxWorker

assertDomain

protected void assertDomain(int object,
                            int prop)

stringsForObject

protected abstract java.lang.String[] stringsForObject(int id,
                                                       int prop)

strings

public final java.lang.String[] strings(int id,
                                        int prop)
Specified by:
strings in interface BoxWorker

intsForObject

protected int[] intsForObject(int id,
                              int prop)

ints

public final int[] ints(int id,
                        int prop)
Specified by:
ints in interface BoxWorker

longsForObject

protected long[] longsForObject(int id,
                                int prop)

longs

public final long[] longs(int id,
                          int prop)
Specified by:
longs in interface BoxWorker

dateTimesForObject

protected java.util.Date[] dateTimesForObject(int id,
                                              int prop)

dateTimes

public final java.util.Date[] dateTimes(int id,
                                        int prop)
Specified by:
dateTimes in interface BoxWorker

booleansForObject

protected boolean[] booleansForObject(int id,
                                      int prop)

booleans

public final boolean[] booleans(int id,
                                int prop)
Specified by:
booleans in interface BoxWorker

ovaluesForObject

protected abstract int[] ovaluesForObject(int id,
                                          int prop)

objects

public final int[] objects(int id,
                           int prop)
Specified by:
objects in interface BoxWorker

ownersForOProperty

protected abstract int[] ownersForOProperty(int prop,
                                            int value)

owners

public int[] owners(int prop,
                    int value)
Specified by:
owners in interface BoxWorker

owners

public int[] owners(int obj)
Specified by:
owners in interface BoxWorker

owners

public int[] owners(java.lang.String value)
Specified by:
owners in interface BoxWorker

ownersForTProperty

protected abstract int[] ownersForTProperty(int prop,
                                            java.lang.String value)

owners

public int[] owners(int prop,
                    java.lang.String value)
Specified by:
owners in interface BoxWorker

rangeForTProperty

protected abstract java.lang.Integer rangeForTProperty(int id)

rangeForOProperty

protected abstract java.lang.Integer rangeForOProperty(int id)

range

public java.lang.Integer range(int id)
Specified by:
range in interface BoxWorker

domainForTProperty

protected abstract java.lang.Integer domainForTProperty(int id)

domainForOProperty

protected abstract java.lang.Integer domainForOProperty(int id)

domain

public java.lang.Integer domain(int id)
Specified by:
domain in interface BoxWorker

annoForEntity

protected abstract java.lang.String annoForEntity(int id,
                                                  java.lang.String name)

anno

public java.lang.String anno(int id,
                             java.lang.String name)
Specified by:
anno in interface BoxWorker

annamesForEntity

protected abstract java.lang.String[] annamesForEntity(int id)

annames

public java.lang.String[] annames(int id)
Specified by:
annames in interface BoxWorker