org.activemath.omdocjdom.slumb.data
Class Theory

java.lang.Object
  extended by org.activemath.omdocjdom.slumb.data.Theory
All Implemented Interfaces:
SlumbConstants

public class Theory
extends Object
implements SlumbConstants

Denotes a theory element inside a file.


Field Summary
 
Fields inherited from interface org.activemath.omdocjdom.slumb.SlumbConstants
COLL_NAMES_book_list, COLL_NAMES_collection_info, COLL_NAMES_collection_info_sole_text, COLL_NAMES_collection_metadata, COLL_NAMES_course_generation_menu, COLL_NAMES_reserved_names, FIELD_attributes, FIELD_colAndRelPath, FIELD_collection, FIELD_columnNumber, FIELD_commonname, FIELD_containedIds, FIELD_dcmetadata, FIELD_elt_absPath, FIELD_elt_relpath, FIELD_file_absPath, FIELD_file_relpath, FIELD_fileNameFromId, FIELD_fmp, FIELD_id, FIELD_importStrings, FIELD_lastModification, FIELD_lineNumber, FIELD_metadata, FIELD_name, FIELD_relSourceId, FIELD_relTargetId, FIELD_textualContent, FIELD_theoryId, FIELD_theoryName, FIELD_type, FIELD_xmlContent, FIELDVALUE_type_fileObject, FIELDVALUE_type_itemObject, FIELDVALUE_type_theoryObject, modifDateFormat
 
Constructor Summary
Theory(org.apache.lucene.document.Document doc)
          A somewhat greedy loader...
Theory(ID id, File sourceFile)
           
 
Method Summary
 ID absolutizeId(ID id, TheoryCollection colls, Set theoriesVisited)
           
 boolean addContainedId(String idName, String fileName)
           
 void addImports(Attributes atts)
           
 void addImports(ID importTarget, boolean global)
           
 org.apache.lucene.document.Document asLuceneDocument(SlumbIndex index)
           
 void clearContainedIds(String path)
           
 boolean containsId(ID id)
           
 Collection getContainedIds()
           
 IID getId()
           
 File getSourceFile()
           
 boolean isNew()
           
 Iterator listContainedIds()
           
 ID resolveId(ID baseId, String relativePath, TheoryCollection colls)
          Uses the imports elements to compute the absolute ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Theory

public Theory(ID id,
              File sourceFile)

Theory

public Theory(org.apache.lucene.document.Document doc)
A somewhat greedy loader...

Method Detail

getSourceFile

public File getSourceFile()

asLuceneDocument

public org.apache.lucene.document.Document asLuceneDocument(SlumbIndex index)

getId

public IID getId()

isNew

public boolean isNew()

getContainedIds

public Collection getContainedIds()

clearContainedIds

public void clearContainedIds(String path)

addImports

public void addImports(ID importTarget,
                       boolean global)

addImports

public void addImports(Attributes atts)

addContainedId

public boolean addContainedId(String idName,
                              String fileName)
Returns:
true if the id was there already

listContainedIds

public Iterator listContainedIds()

containsId

public boolean containsId(ID id)

absolutizeId

public ID absolutizeId(ID id,
                       TheoryCollection colls,
                       Set theoriesVisited)

resolveId

public ID resolveId(ID baseId,
                    String relativePath,
                    TheoryCollection colls)
Uses the imports elements to compute the absolute ID.

Parameters:
baseId - the id of the element that we take a referene from
relativePath - the relative expression
colls - a coll of theories which can provide maps of other theories
Returns:
either null if not found or the expanded ID