Protege 3.0

edu.stanford.smi.protege.storage.jdbc.framedb
Class FrameDBStorage

java.lang.Object
  extended byedu.stanford.smi.protege.storage.jdbc.framedb.FrameDBStorage
All Implemented Interfaces:
Disposable, Storage

public class FrameDBStorage
extends Object
implements Storage

Implementation of the Storage interface for in memory use. Delegates the real storage operations to FrameDB.

Author:
Ray Fergerson

Constructor Summary
FrameDBStorage()
           
 
Method Summary
 void addFrame(Frame frame)
          Add an existing frame to the frame container
 void addValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
           
 void addValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value, int index)
           
 void addValues(FrameID frame, FrameID slot, FrameID facet, boolean isTemplate, Collection values)
           
 boolean beginTransaction()
           
 boolean containsFrame(Frame frame)
           
 boolean containsFrame(String name)
           
 void dispose()
           
 boolean endTransaction(boolean doCommit)
           
static boolean equals(Object o1, Object o2)
           
 void flush()
           
 int getClsCount()
           
 int getFacetCount()
           
 Frame getFrame(FrameID id)
           
 Frame getFrame(String name)
           
 int getFrameCount()
           
 Collection getFrames()
           
 Collection getFramesWithValue(Slot slot, Facet facet, boolean isTemplate, Object value)
           
 List getLoadedValues(FrameID frame, FrameID slot, FrameID facet, boolean isTemplate)
           
 Collection getMatchingFrames(Slot slot, Facet facet, boolean isTemplate, String s, int maxMatches)
           
 Collection getRecords()
           
 Collection getRecords(Slot slot, Facet facet, boolean isTemplate, Object o, int maxReferences)
           
 Collection getReferences(Object o, int maxReferences)
           
 int getSlotCount()
           
 Object getValue(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 int getValueCount(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 ArrayList getValues(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 boolean hasValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
           
 boolean hasValueAtSomeFrame(Slot slot, Facet facet, boolean isTemplate)
           
 boolean isCaching()
           
 void moveValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, int from, int to)
           
 void moveValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value, int toIndex)
           
 void remove(Frame frame, Slot slot, Facet facet, boolean isTemplate)
           
 void removeFrame(Frame frame)
          Removes all references to a frame from storage.
 void removeSingleValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
          remove a single occurance of value from the slot/facet value
 Object removeValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, int index)
           
 void removeValues(Slot slot, Facet facet, boolean isTemplate, Cls cls)
           
 void replace(Frame from, Frame to)
          replaceValue method comment.
 void replaceValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, int index, Object value)
          replaceValue method comment.
 void replaceValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object fromValue, Object toValue)
          replaceValue method comment.
 void setCaching(boolean caching)
           
 void setUseWeakReference(boolean b)
          Used for testing only.
 void setValue(Frame frame, Slot slot, Facet facet, boolean isTemplate, Object value)
          setValue method comment.
 void setValues(FrameID frame, FrameID slot, FrameID facet, boolean isTemplate, Collection values)
          setValues method comment.
 void setValues(Frame frame, Slot slot, Facet facet, boolean isTemplate, Collection values)
          setValues method comment.
 boolean supportsTransactions()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrameDBStorage

public FrameDBStorage()
Method Detail

addFrame

public void addFrame(Frame frame)
Add an existing frame to the frame container

Specified by:
addFrame in interface Storage

addValue

public void addValue(Frame frame,
                     Slot slot,
                     Facet facet,
                     boolean isTemplate,
                     Object value)
Specified by:
addValue in interface Storage

addValue

public void addValue(Frame frame,
                     Slot slot,
                     Facet facet,
                     boolean isTemplate,
                     Object value,
                     int index)
Specified by:
addValue in interface Storage

addValues

public void addValues(FrameID frame,
                      FrameID slot,
                      FrameID facet,
                      boolean isTemplate,
                      Collection values)

beginTransaction

public boolean beginTransaction()
Specified by:
beginTransaction in interface Storage

containsFrame

public boolean containsFrame(Frame frame)
Specified by:
containsFrame in interface Storage

containsFrame

public boolean containsFrame(String name)
Specified by:
containsFrame in interface Storage

dispose

public void dispose()
Specified by:
dispose in interface Disposable

endTransaction

public boolean endTransaction(boolean doCommit)
Specified by:
endTransaction in interface Storage

flush

public void flush()

getFrame

public Frame getFrame(FrameID id)
Specified by:
getFrame in interface Storage

getFrame

public Frame getFrame(String name)
Specified by:
getFrame in interface Storage

getFrameCount

public int getFrameCount()
Specified by:
getFrameCount in interface Storage

getFacetCount

public int getFacetCount()
Specified by:
getFacetCount in interface Storage

getSlotCount

public int getSlotCount()
Specified by:
getSlotCount in interface Storage

getClsCount

public int getClsCount()
Specified by:
getClsCount in interface Storage

equals

public static boolean equals(Object o1,
                             Object o2)

getFrames

public Collection getFrames()
Specified by:
getFrames in interface Storage

getLoadedValues

public List getLoadedValues(FrameID frame,
                            FrameID slot,
                            FrameID facet,
                            boolean isTemplate)

getFramesWithValue

public Collection getFramesWithValue(Slot slot,
                                     Facet facet,
                                     boolean isTemplate,
                                     Object value)
Specified by:
getFramesWithValue in interface Storage

getMatchingFrames

public Collection getMatchingFrames(Slot slot,
                                    Facet facet,
                                    boolean isTemplate,
                                    String s,
                                    int maxMatches)
Specified by:
getMatchingFrames in interface Storage

getRecords

public Collection getRecords()

getRecords

public Collection getRecords(Slot slot,
                             Facet facet,
                             boolean isTemplate,
                             Object o,
                             int maxReferences)

getReferences

public Collection getReferences(Object o,
                                int maxReferences)
Specified by:
getReferences in interface Storage

getValue

public Object getValue(Frame frame,
                       Slot slot,
                       Facet facet,
                       boolean isTemplate)
Specified by:
getValue in interface Storage

getValueCount

public int getValueCount(Frame frame,
                         Slot slot,
                         Facet facet,
                         boolean isTemplate)
Specified by:
getValueCount in interface Storage

getValues

public ArrayList getValues(Frame frame,
                           Slot slot,
                           Facet facet,
                           boolean isTemplate)
Specified by:
getValues in interface Storage

hasValue

public boolean hasValue(Frame frame,
                        Slot slot,
                        Facet facet,
                        boolean isTemplate,
                        Object value)
Specified by:
hasValue in interface Storage

hasValueAtSomeFrame

public boolean hasValueAtSomeFrame(Slot slot,
                                   Facet facet,
                                   boolean isTemplate)
Specified by:
hasValueAtSomeFrame in interface Storage

isCaching

public boolean isCaching()

moveValue

public void moveValue(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate,
                      int from,
                      int to)
Specified by:
moveValue in interface Storage

moveValue

public void moveValue(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate,
                      Object value,
                      int toIndex)

remove

public void remove(Frame frame,
                   Slot slot,
                   Facet facet,
                   boolean isTemplate)
Specified by:
remove in interface Storage

removeFrame

public void removeFrame(Frame frame)
Removes all references to a frame from storage. This includes both places where this frame references other frames and where other places reference this frame.

Specified by:
removeFrame in interface Storage

removeSingleValue

public void removeSingleValue(Frame frame,
                              Slot slot,
                              Facet facet,
                              boolean isTemplate,
                              Object value)
Description copied from interface: Storage
remove a single occurance of value from the slot/facet value

Specified by:
removeSingleValue in interface Storage

removeValue

public Object removeValue(Frame frame,
                          Slot slot,
                          Facet facet,
                          boolean isTemplate,
                          int index)

removeValues

public void removeValues(Slot slot,
                         Facet facet,
                         boolean isTemplate,
                         Cls cls)
Specified by:
removeValues in interface Storage

replace

public void replace(Frame from,
                    Frame to)
replaceValue method comment.

Specified by:
replace in interface Storage

replaceValue

public void replaceValue(Frame frame,
                         Slot slot,
                         Facet facet,
                         boolean isTemplate,
                         int index,
                         Object value)
replaceValue method comment.


replaceValue

public void replaceValue(Frame frame,
                         Slot slot,
                         Facet facet,
                         boolean isTemplate,
                         Object fromValue,
                         Object toValue)
replaceValue method comment.


setCaching

public void setCaching(boolean caching)

setUseWeakReference

public void setUseWeakReference(boolean b)
Used for testing only. Do not call.


setValue

public void setValue(Frame frame,
                     Slot slot,
                     Facet facet,
                     boolean isTemplate,
                     Object value)
setValue method comment.

Specified by:
setValue in interface Storage

setValues

public void setValues(Frame frame,
                      Slot slot,
                      Facet facet,
                      boolean isTemplate,
                      Collection values)
setValues method comment.

Specified by:
setValues in interface Storage

setValues

public void setValues(FrameID frame,
                      FrameID slot,
                      FrameID facet,
                      boolean isTemplate,
                      Collection values)
setValues method comment.


supportsTransactions

public boolean supportsTransactions()
Specified by:
supportsTransactions in interface Storage

toString

public String toString()

Protege 3.0

Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2005 Stanford University.