de.unihalle.informatik.MiToBo.core.datatypes
Class MTBRegion2DSetBag

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDData
      extended by de.unihalle.informatik.MiToBo.core.datatypes.MTBRegion2DSetBag

public class MTBRegion2DSetBag
extends de.unihalle.informatik.Alida.operator.ALDData

A datatype to store multiple MTBRegion2D sets

Author:
Oliver Gress

Field Summary
(package private)  java.util.Vector<MTBRegion2DSet> regionsets
          the container of the region sets
 
Constructor Summary
MTBRegion2DSetBag()
          Constructor to create an empty bag of region sets
MTBRegion2DSetBag(int capacity)
          Constructor to create an empty bag of region sets with the given capacity
MTBRegion2DSetBag(java.lang.String filename)
          Construct a bag of region sets from a xml-file that was written by the write method of this class.
 
Method Summary
 void add(MTBRegion2DSet regionset)
          Add a region set to this bag
 MTBRegion2DSet get(int idx)
           
 java.util.Iterator<MTBRegion2DSet> iterator()
           
 MTBRegion2DSet remove(int idx)
          Remove a region set from this bag by its index
 boolean remove(MTBRegion2DSet regionset)
          Remove a region set from this bag
 void set(int idx, MTBRegion2DSet regionset)
           
 int size()
          Number of region sets in this bag
 void write(java.lang.String filename)
          Write this bag of region sets to disk in XML format using MiToBo's xml-scheme MTBRegion2DSetBag.xsd
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDData
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

regionsets

java.util.Vector<MTBRegion2DSet> regionsets
the container of the region sets

Constructor Detail

MTBRegion2DSetBag

public MTBRegion2DSetBag()
Constructor to create an empty bag of region sets


MTBRegion2DSetBag

public MTBRegion2DSetBag(int capacity)
Constructor to create an empty bag of region sets with the given capacity


MTBRegion2DSetBag

public MTBRegion2DSetBag(java.lang.String filename)
                  throws org.apache.xmlbeans.XmlException,
                         java.io.IOException
Construct a bag of region sets from a xml-file that was written by the write method of this class. (These xml-files conform to xml-scheme MTBXMLRegion2DSetBag.xsd defined for MiToBo)

Parameters:
filename - path to the xml-file
Throws:
java.io.IOException - thrown if parsing of xml-file failed
org.apache.xmlbeans.XmlException - thrown if parsing of xml-file failed
Method Detail

add

public void add(MTBRegion2DSet regionset)
Add a region set to this bag


get

public MTBRegion2DSet get(int idx)

iterator

public java.util.Iterator<MTBRegion2DSet> iterator()

remove

public MTBRegion2DSet remove(int idx)
Remove a region set from this bag by its index

Parameters:
idx - index of the region set to remove
Returns:
region set that was removed or null if it was not present

remove

public boolean remove(MTBRegion2DSet regionset)
Remove a region set from this bag

Parameters:
regionset - set to remove
Returns:
true if the region set existed in this bag and was removed, false if it was not present

set

public void set(int idx,
                MTBRegion2DSet regionset)

size

public int size()
Number of region sets in this bag


write

public void write(java.lang.String filename)
           throws java.io.IOException,
                  de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException,
                  de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Write this bag of region sets to disk in XML format using MiToBo's xml-scheme MTBRegion2DSetBag.xsd

Throws:
java.io.IOException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException