edu.ucsb.nceas.morpho.datapackage
Class Triple

java.lang.Object
  |
  +--edu.ucsb.nceas.morpho.datapackage.Triple

public class Triple
extends java.lang.Object

This class implements one triple which defines one relationship inside of a package. This class will probably be used most in a collection of triples that represents all of the relationships in package


Constructor Summary
Triple()
          create an initialized, blank Triple object
Triple(java.lang.String subject, java.lang.String relationship, java.lang.String object)
          create a new triple with the specified subject relationship and object
Triple(Triple t)
          Copy constructor.
 
Method Summary
 java.lang.String getObject()
          get the object of this triple
 java.lang.String getRelationship()
          get the relationship of this triple
 java.lang.String getSubject()
          get the subject of this triple
 java.util.Vector getTriple()
          return this triple as a vector of strings
 void setObject(java.lang.String object)
          Set the object of this triple
 void setRelationship(java.lang.String relationship)
          Set the relationship of this triple
 void setSubject(java.lang.String subject)
          Set the subject of this triple
 java.lang.String toFormatedXML()
          return this triple in xml format with easy to read formatting.
 java.lang.String toString()
          return this triple as a string
 java.lang.String toXML()
          return this triple in xml format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Triple

public Triple()
create an initialized, blank Triple object

Triple

public Triple(java.lang.String subject,
              java.lang.String relationship,
              java.lang.String object)
create a new triple with the specified subject relationship and object

Triple

public Triple(Triple t)
Copy constructor. creates a new triple object that is a copy of the given triple
Method Detail

setSubject

public void setSubject(java.lang.String subject)
Set the subject of this triple

setRelationship

public void setRelationship(java.lang.String relationship)
Set the relationship of this triple

setObject

public void setObject(java.lang.String object)
Set the object of this triple

getSubject

public java.lang.String getSubject()
get the subject of this triple

getRelationship

public java.lang.String getRelationship()
get the relationship of this triple

getObject

public java.lang.String getObject()
get the object of this triple

getTriple

public java.util.Vector getTriple()
return this triple as a vector of strings

toXML

public java.lang.String toXML()
return this triple in xml format. The xml looks like:
 <triple><subject>some content 1</subject>
 <relationship>some content 2</relationship>
 <object>some content 3</object></triple>
 

toFormatedXML

public java.lang.String toFormatedXML()
return this triple in xml format with easy to read formatting. The xml looks like:
 <triple>
   <subject>some content 1</subject>
   <relationship>some content 2</relationship>
   <object>some content 3</object>
 </triple>
 

toString

public java.lang.String toString()
return this triple as a string
Overrides:
toString in class java.lang.Object


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.