edu.ucsb.nceas.morpho.datapackage
Class AccessionNumber

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

public class AccessionNumber
extends java.lang.Object

Class that implements Accession Number utility functions for morpho


Constructor Summary
AccessionNumber(ClientFramework cf)
           
 
Method Summary
 java.lang.String getNextId()
          returns the next local id from the config file returns null if configXML was unable to increment the id number
 java.util.Vector getParts(java.lang.String id)
          Returns a vector with all components of the accession number.
 java.lang.String incRev(java.lang.String id)
          returns an id with an incremented id.
 java.lang.String incRev(java.lang.String id, boolean addOne)
          parses id and adds a revision number to it.
 java.lang.String incRevInTriples(java.io.File xmlfile, java.lang.String oldid, java.lang.String newid)
          searches an xml file for triples.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessionNumber

public AccessionNumber(ClientFramework cf)
Method Detail

getNextId

public java.lang.String getNextId()
returns the next local id from the config file returns null if configXML was unable to increment the id number

incRev

public java.lang.String incRev(java.lang.String id)
returns an id with an incremented id.

incRev

public java.lang.String incRev(java.lang.String id,
                               boolean addOne)
parses id and adds a revision number to it. if addOne is true and there is already a revision number then one is added to the existing revision number
Parameters:
id - the id to parse
addOne - true adds one to a existing revision number false does not.

incRevInTriples

public java.lang.String incRevInTriples(java.io.File xmlfile,
                                        java.lang.String oldid,
                                        java.lang.String newid)
searches an xml file for triples. If it finds oldid it increments its revision number with the newid provided.
Parameters:
xmlfile - the xml file that you want to search
oldid - the id that you want incremented.
newid - the id that you want oldid to be replaced with
Returns:
returns the newly created triples file with the updated triples

getParts

public java.util.Vector getParts(java.lang.String id)
Returns a vector with all components of the accession number. The vector looks like: [scope, id, rev, separator] ex: [nceas, 5, 2, .]
Parameters:
id - the id to return the parts of


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