org.biojava.bio.seq.ragbag
Class RagbagMap

java.lang.Object
  extended byorg.biojava.utils.stax.StAXContentHandlerBase
      extended byorg.biojava.bio.seq.ragbag.RagbagMap
All Implemented Interfaces:
StAXContentHandler

public class RagbagMap
extends StAXContentHandlerBase

This class is an object that encapsulates all information present in a Map file in a Ragbag directory.

Author:
David Huen, Thomas Down

Nested Class Summary
 class RagbagMap.MapElement
          class that represents a single mapping in mapFile
 class RagbagMap.MapEnum
          Enumeration object for RagbagMap.
 
Constructor Summary
RagbagMap(java.io.File mapFile)
          create a RagbagMap from the specified File
 
Method Summary
 void endElement(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, StAXContentHandler delegate)
           
 void endTree()
           
 int getDstLength()
           
 java.util.Enumeration getEnumeration(java.lang.String filename)
           
 java.lang.String getRef(java.lang.String filename)
          gets reference string for a given filename
 void parse()
          Parse the specified mapping file for this object now.
 void startElement(java.lang.String nsURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attrs, DelegationManager dm)
           
 
Methods inherited from class org.biojava.utils.stax.StAXContentHandlerBase
characters, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, startTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RagbagMap

public RagbagMap(java.io.File mapFile)
create a RagbagMap from the specified File

Parameters:
mapFile - XML file containing map data.
Method Detail

parse

public void parse()
           throws java.io.FileNotFoundException,
                  java.io.IOException,
                  org.xml.sax.SAXException
Parse the specified mapping file for this object now.

Throws:
java.io.FileNotFoundException
java.io.IOException
org.xml.sax.SAXException

getRef

public java.lang.String getRef(java.lang.String filename)
gets reference string for a given filename

Returns:
String value of reference. Returns empty string if it doesn't exist.

getEnumeration

public java.util.Enumeration getEnumeration(java.lang.String filename)
Returns:
an enumeration object for mappings for a file of given filename.

getDstLength

public int getDstLength()
Returns:
the minimum destination sequence length needed to represent the mapping.

endTree

public void endTree()
Specified by:
endTree in interface StAXContentHandler
Overrides:
endTree in class StAXContentHandlerBase

startElement

public void startElement(java.lang.String nsURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs,
                         DelegationManager dm)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface StAXContentHandler
Overrides:
startElement in class StAXContentHandlerBase
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String nsURI,
                       java.lang.String localName,
                       java.lang.String qName,
                       StAXContentHandler delegate)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface StAXContentHandler
Overrides:
endElement in class StAXContentHandlerBase
Throws:
org.xml.sax.SAXException