edu.ucsb.nceas.metacat
Class DocumentIdentifier

java.lang.Object
  |
  +--edu.ucsb.nceas.metacat.DocumentIdentifier

public class DocumentIdentifier
extends java.lang.Object

A class to parse document ids The docid is of the form siteCode.uniqueId.rev


Constructor Summary
DocumentIdentifier(java.lang.String docid)
          Constructor to build a docid object and parse an incoming string.
 
Method Summary
 java.lang.String getIdentifier()
          returns
 java.lang.String getRev()
          returns the revision number encoded in this docid
 java.lang.String getSeparator()
          returns the separator used in the accession number
 java.lang.String getSiteCode()
          returns the siteCode encoded in this docid
 java.lang.String getUniqueId()
          returns the uniqueId encoded in this docid
static void main(java.lang.String[] args)
          Test driver.
 java.lang.String toString()
          returns the whole docid as a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentIdentifier

public DocumentIdentifier(java.lang.String docid)
                   throws AccessionNumberException
Constructor to build a docid object and parse an incoming string.

Method Detail

getRev

public java.lang.String getRev()
returns the revision number encoded in this docid


getUniqueId

public java.lang.String getUniqueId()
returns the uniqueId encoded in this docid


getSiteCode

public java.lang.String getSiteCode()
returns the siteCode encoded in this docid


getSeparator

public java.lang.String getSeparator()
returns the separator used in the accession number


getIdentifier

public java.lang.String getIdentifier()
returns


toString

public java.lang.String toString()
returns the whole docid as a string

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
Test driver. The first command line argument is the docid you want to create an object for. For instance ">java DocumentIdentifer nceas.1.2" will return "rev: 2 \n uniqueId: 1 \n siteCode: nceas \n"



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