|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.UCL.xmiddle.framework.tree.Tree | +--edu.UCL.xmiddle.tree.LatestTree
LatestTree.java LatestTree is the basic structure under which the xmiddle hosts store their data. It is called "LatestTree" because the Document that this unit encapsulates always stores the latest version of the tree. It is organised as a series of branches, each representing an exported element. Editions are then added to these branches as they are created. Created: Tue Aug 7 17:25:37 2001
Field Summary |
Fields inherited from class edu.UCL.xmiddle.framework.tree.Tree |
appID, branches, document, linktable, policy, primaryID |
Constructor Summary | |
LatestTree(java.lang.Integer appID)
|
|
LatestTree(java.lang.Integer appID,
org.w3c.dom.Document doc)
|
Method Summary | |
void |
addEdition(java.lang.String path,
Branch branch)
Adds an Edition to the Tree. |
void |
addEdition(java.lang.String path,
Version version,
org.w3c.dom.Element data)
Add an edition to the Tree. |
void |
addVersion(java.lang.String path,
org.w3c.dom.Element data)
|
org.w3c.dom.Element |
getEarliestEdition(java.lang.String path)
Returns the earliest edition of an element. |
Branch |
getEarliestEditionBranch(java.lang.String path)
Returns the Branch holding the earliest edition of an named element. |
org.w3c.dom.Element |
getEditionNumber(java.lang.String path,
int number)
Returns the edition having the given edition number for an named element. |
Branch |
getEditionNumberBranch(java.lang.String path,
int number)
Returns the Branch holding the given edition number for an named element. |
java.util.Enumeration |
getEditions(java.lang.String path)
Return an Enumeration of all editions under the named path. |
org.w3c.dom.Element |
getLatestEdition(java.lang.String path)
Returns the latest edition of an element. |
Branch |
getLatestEditionBranch(java.lang.String path)
Returns the Branch holding the latest edition of the named element. |
int |
getLatestEditionNumber(java.lang.String path)
Returns the latest edition number kept for a version in this tree. |
org.w3c.dom.Element |
getLatestVersion(java.lang.String path)
Returns the latest version of the data from the tree. |
boolean |
hasVersion(java.lang.String path)
Returns true if this path has an
associated version with it. |
boolean |
lock(org.w3c.dom.Element element,
java.lang.Object source)
Lock an element in the Tree. |
boolean |
lock(java.lang.String path,
java.lang.Object source)
Lock a named element in the Tree. |
void |
newBranch(java.lang.Object primaryID,
org.w3c.dom.Element element)
Add a new element branch to the LatestTree. |
void |
removeAllEditions()
Removes all editions from every path in this tree. |
void |
removeAllEditions(org.w3c.dom.Element element)
Removes all editions under the given Element. |
void |
removeAllEditions(java.lang.String path)
Removes all editions under the named path. |
boolean |
removeEdition(Branch branch)
FIXME: does nothing. |
void |
unlock(org.w3c.dom.Element element)
Unlock an element in the Tree. |
void |
unlock(java.lang.String path)
Unlock a named element in the Tree. |
void |
unlockAll()
Unlock all elements in the Tree. |
Methods inherited from class edu.UCL.xmiddle.framework.tree.Tree |
getAppID, getDocument, setDocument, setLinkTable, setPrimaryID |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LatestTree(java.lang.Integer appID)
public LatestTree(java.lang.Integer appID, org.w3c.dom.Document doc)
Method Detail |
public org.w3c.dom.Element getLatestVersion(java.lang.String path)
getLatestVersion
in class Tree
path
- The path of the element required.public boolean hasVersion(java.lang.String path)
true
if this path has an
associated version with it.
Ie. it has been modified since last release.
hasVersion
in class Tree
public java.util.Enumeration getEditions(java.lang.String path)
getEditions
in class Tree
path
- The path under which to return data on the elements.
public org.w3c.dom.Element getEditionNumber(java.lang.String path, int number)
null
is returned.
getEditionNumber
in class Tree
path
- The path of the element.number
- The number of the edition to return.
null
.public Branch getEditionNumberBranch(java.lang.String path, int number)
null
is returned.
getEditionNumberBranch
in class Tree
path
- The path of the element.number
- The number of the edition to return.
null
.public org.w3c.dom.Element getEarliestEdition(java.lang.String path)
getEarliestEdition
in class Tree
path
- The path of the element.
public Branch getEarliestEditionBranch(java.lang.String path)
getEarliestEditionBranch
in class Tree
path
- The path of the element.
public org.w3c.dom.Element getLatestEdition(java.lang.String path)
getLatestEdition
in class Tree
path
- The path of the element.
public Branch getLatestEditionBranch(java.lang.String path)
getLatestEditionBranch
in class Tree
path
- The path of the element.
public int getLatestEditionNumber(java.lang.String path)
getLatestEditionNumber
in class Tree
public void newBranch(java.lang.Object primaryID, org.w3c.dom.Element element)
newBranch
in class Tree
primaryID
- The primaryID of the creator.element
- The element to add to the tree.public void addVersion(java.lang.String path, org.w3c.dom.Element data)
addVersion
in class Tree
public void addEdition(java.lang.String path, Version version, org.w3c.dom.Element data)
addEdition
in class Tree
path
- The path at which to add the edition.version
- The Version code of the edition.data
- The Element data of the edition.public void addEdition(java.lang.String path, Branch branch)
addEdition
in class Tree
path
- The path at which to add the branch.branch
- The Branch to be added.public void removeAllEditions()
removeAllEditions
in class Tree
public void removeAllEditions(java.lang.String path)
removeAllEditions
in class Tree
path
- The path from which to clear edition data.public void removeAllEditions(org.w3c.dom.Element element)
removeAllEditions
in class Tree
public boolean removeEdition(Branch branch)
removeEdition
in class Tree
branch
- The Branch from which to remove the edition.
true
if the edition was removed,
otherwise false
.public boolean lock(org.w3c.dom.Element element, java.lang.Object source)
lock
in class Tree
source
- The object which is the source of the lock.
boolean
set to true
if the lock was obtained, else false
.public boolean lock(java.lang.String path, java.lang.Object source)
lock
in class Tree
path
- The path of the element to lock.source
- The object which is the source of the lock.
boolean
set to true
if the lock was obtained, else false
.public void unlock(org.w3c.dom.Element element)
unlock
in class Tree
public void unlock(java.lang.String path)
unlock
in class Tree
public void unlockAll()
unlockAll
in class Tree
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |