org.strbio.util.db
Class Data

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by org.strbio.util.db.Data
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class Data
extends java.util.Vector

This is a very simple database, containing a collection of Info elements. It could be rewritten to use a real DB.

  Version 1.11, 1/3/03 - fixed bug in IE.hasMoreElements
  Version 1.1, 12/6/99 - added some clear functions, fixed ordering
    of subclass searches
  Version 1.0, 7/21/99 - original version.
  

Version:
1.11, 1/3/03
Author:
JMC
See Also:
Serialized Form

Nested Class Summary
static class Data.InfoEnumeration
          An enumeration that strips out all info of a certain type.
 
Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Data()
           
 
Method Summary
 void addInfo(Info x)
          Add some info to this set.
 void clear()
          clear all info.
 int clearInfo(java.lang.Class x)
          Removes all info of a certain type.
 java.util.Enumeration getAllInfo()
          Return an enumeration of all the info.
 Info getFirstInfo(java.lang.Class x)
          Get first info of a certain type, or null if there is none.
 java.util.Enumeration getInfo(java.lang.Class x)
          Return an enumeration of all info of a certain type.
 boolean hasInfo(java.lang.Class x)
          Does the data include any info of a certain type?
 int n()
          How many elements of data are there?
 void processYAPF(java.lang.String buffer)
          process a line of info from a YAPF file.
 void readYAPF(java.io.BufferedReader infile)
          read info from a YAPF file.
 void readYAPF(java.lang.String fileName)
          read info from a YAPF file.
 void writeYAPF(Printf outfile)
          write all info to a Printf.
 void writeYAPF(java.lang.String fileName)
          write all info to a file.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

Data

public Data()
Method Detail

n

public int n()
How many elements of data are there?


getAllInfo

public java.util.Enumeration getAllInfo()
Return an enumeration of all the info.


clear

public void clear()
clear all info.

Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List
Overrides:
clear in class java.util.Vector

hasInfo

public boolean hasInfo(java.lang.Class x)
Does the data include any info of a certain type?


getInfo

public java.util.Enumeration getInfo(java.lang.Class x)
Return an enumeration of all info of a certain type.


clearInfo

public int clearInfo(java.lang.Class x)
Removes all info of a certain type. Returns how many were removed.


getFirstInfo

public Info getFirstInfo(java.lang.Class x)
Get first info of a certain type, or null if there is none.


addInfo

public void addInfo(Info x)
Add some info to this set.


writeYAPF

public void writeYAPF(Printf outfile)
               throws java.io.IOException
write all info to a Printf.

Throws:
java.io.IOException

writeYAPF

public void writeYAPF(java.lang.String fileName)
               throws java.io.IOException
write all info to a file.

Throws:
java.io.IOException

processYAPF

public void processYAPF(java.lang.String buffer)
process a line of info from a YAPF file.


readYAPF

public void readYAPF(java.io.BufferedReader infile)
              throws java.io.IOException
read info from a YAPF file.

Throws:
java.io.IOException

readYAPF

public void readYAPF(java.lang.String fileName)
              throws java.io.IOException
read info from a YAPF file.

Throws:
java.io.IOException