org.openrdf.sesame.sailimpl.nativerdf
Class NamespaceStore

java.lang.Object
  extended byorg.openrdf.sesame.sailimpl.nativerdf.NamespaceStore

public class NamespaceStore
extends Object

An in-memory store for namespace information that uses a file for persistence. Namespaces are encoded in the file as records as follows:

 byte 1 - 3     : internal namespace ID
 byte 4         : reserved byte for storing some boolean properties
 byte 5 - 6     : the length of the encoded namespace prefix
 byte 7 - A     : the UTF-8 encoded namespace prefix
 byte A+1 - A+2 : the length of the encoded namespace name
 byte A+3 - end : the UTF-8 encoded namespace name
 

Version:
$Revision: 1.9.4.3 $
Author:
Arjohn Kampman

Constructor Summary
NamespaceStore(File dataDir)
           
 
Method Summary
 void clear()
           
 void close()
           
 void commitTransaction()
           
 int getID(String namespace)
           
 int getID(String namespace, boolean dirtyReads)
           
 org.openrdf.sesame.sailimpl.nativerdf.Namespace getNamespace(int id)
           
 org.openrdf.sesame.sailimpl.nativerdf.Namespace getNamespace(int id, boolean dirtyReads)
           
 String getNamespaceName(int id)
           
 String getNamespaceName(int id, boolean dirtyReads)
           
 NamespaceIterator getNamespaces()
           
static void main(String[] args)
           
 void rollbackTransaction()
           
 void setNamespacePrefix(String prefix, String name)
           
 void startTransaction()
           
 int storeNamespace(String namespace)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamespaceStore

public NamespaceStore(File dataDir)
               throws IOException
Method Detail

getID

public int getID(String namespace)

getID

public int getID(String namespace,
                 boolean dirtyReads)

getNamespace

public org.openrdf.sesame.sailimpl.nativerdf.Namespace getNamespace(int id)

getNamespace

public org.openrdf.sesame.sailimpl.nativerdf.Namespace getNamespace(int id,
                                                                    boolean dirtyReads)

getNamespaceName

public String getNamespaceName(int id)

getNamespaceName

public String getNamespaceName(int id,
                               boolean dirtyReads)

getNamespaces

public NamespaceIterator getNamespaces()

startTransaction

public void startTransaction()

commitTransaction

public void commitTransaction()
                       throws IOException
Throws:
IOException

rollbackTransaction

public void rollbackTransaction()

close

public void close()

clear

public void clear()

storeNamespace

public int storeNamespace(String namespace)

setNamespacePrefix

public void setNamespacePrefix(String prefix,
                               String name)

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.