|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.ucsb.nceas.morpho.datapackage.TripleCollection
This class implements a collection of triples which make up all of the relationships in a package.
Constructor Summary | |
TripleCollection()
Default Constructor |
|
TripleCollection(java.io.File triplesFile,
ClientFramework framework)
parses an xml document and pulls any triples out of it. |
|
TripleCollection(java.io.Reader xml)
read an xml file, build the collection from any triples in the xml file. |
|
TripleCollection(TripleCollection tc)
Copy constructor. |
|
TripleCollection(java.util.Vector triples)
create a collection of triples from a vector of Triple objects. |
Method Summary | |
void |
addTriple(Triple triple)
Add a single triple to this collection |
boolean |
containsTriple(Triple triple)
returns true if the collection contains triple, false otherwise |
java.util.Vector |
getCollection()
return a vector of Triple objects that represent this collection. |
java.util.Vector |
getCollectionByObject(java.lang.String object)
returns a vector of triples with the given object |
java.util.Vector |
getCollectionByRelationship(java.lang.String relationship)
returns a vector of triples with the given relationship |
java.util.Vector |
getCollectionBySubject(java.lang.String subject)
returns a vector of triples with the given subject |
org.w3c.dom.NodeList |
getNodeList()
|
static void |
main(java.lang.String[] args)
|
Triple |
removeTriple(Triple triple)
removes the specified triple from the collection and returns it. |
java.lang.String |
toFormatedXML()
returns a nicely formatted string representation of this collection in xml the xml looks like this: |
java.lang.String |
toString()
return this collection as a string |
java.lang.String |
toXML()
|
java.lang.String |
toXML(java.lang.String root)
returns a string representation of this collection in xml format. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public TripleCollection()
public TripleCollection(java.io.File triplesFile, ClientFramework framework)
public TripleCollection(TripleCollection tc)
public TripleCollection(java.io.Reader xml)
public TripleCollection(java.util.Vector triples)
Method Detail |
public void addTriple(Triple triple)
public boolean containsTriple(Triple triple)
public Triple removeTriple(Triple triple)
public java.util.Vector getCollectionBySubject(java.lang.String subject)
public java.util.Vector getCollectionByRelationship(java.lang.String relationship)
public java.util.Vector getCollectionByObject(java.lang.String object)
public java.util.Vector getCollection()
public java.lang.String toXML()
public java.lang.String toXML(java.lang.String root)
<triple><subject>some content 1</subject> <relationship>some content 2</relationship><object> some content 3</object></triple><triple> <subject>some content 1</subject><relationship> some content 2</relationship><object>some content 3 </object></triple> ..... <triple><subject>some content 1</subject> <relationship>some content 2</relationship><object> some content 3</object></triple>
public org.w3c.dom.NodeList getNodeList()
public java.lang.String toFormatedXML()
<triple> <subject>some content 1</subject> <relationship>some content 2</relationship> <object>some content 3</object> </triple> <triple> <subject>some content 1</subject> <relationship>some content 2</relationship> <object>some content 3</object> </triple> ..... <triple> <subject>some content 1</subject> <relationship>some content 2</relationship> <object>some content 3</object> </triple>without the formatting (i.e. no indents or extra spaces)
public java.lang.String toString()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |