org.universAAL.ontology.reasoner.util
Class ElementModel<P extends Resource>
java.lang.Object
org.universAAL.ontology.reasoner.util.ElementModel<P>
- Type Parameters:
P
- Class the be managed. Need to be a sibling of Persistent
- Direct Known Subclasses:
- RuleModel
public class ElementModel<P extends Resource>
- extends Object
It is a pattern for the Reasoner that its elements need to be saved/loaded
and added/removed/returned. To encapsulate the redundant parts this class
provides the basic methods to hold object of type P during runtime and
save/load them from the file-system using the capabilities of the middlewares
serializer.
- Author:
- amarinc
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ElementModel
public ElementModel(Class<P> elementClass,
MessageContentSerializer serializer,
String rootPath)
- Creates a new model to manage objects of type P
- Parameters:
elementClass
- Class object of type Pserializer
- serializer to be used for the classes of type ProotPath
- Absolute path to the root of the bundle-config-home (without
ending "/")
saveElements
public boolean saveElements()
save
public boolean save(P element)
getPersistentElementIndex
public int getPersistentElementIndex(P element)
loadElements
public void loadElements()
load
public P load(File file)
add
public P add(P element)
remove
public boolean remove(P dElement)
getElement
public P getElement(String uri)
getElement
public P getElement(P compareElement)
getElements
public ArrayList<P> getElements()
Copyright © 2014 universAAL Consortium. All Rights Reserved.