es.unex.sextante.core
Class OutputObjectsSet

java.lang.Object
  extended by es.unex.sextante.core.OutputObjectsSet

public class OutputObjectsSet
extends java.lang.Object


Constructor Summary
OutputObjectsSet()
           
 
Method Summary
 void add(Output output)
          adds a new output to the set.
 boolean containsKey(java.lang.String key)
          Return true if the set contains an object associated to the passed key
 OutputObjectsSet getNewInstance()
          Returns a new instance of the set and all its elements
 Output getOutput(int iIndex)
          Returns an output of the set, identified by its index in it
 Output getOutput(java.lang.String sName)
          Returns an output of the set, identified by its name
 int getOutputDataObjectsCount()
          Returns the number of data objects (layers and tables) in the set
 int getOutputLayersCount()
          Returns the number of output layers in the set
 int getOutputObjectsCount()
          Returns the total number of output objects
 boolean hasDataObjects()
          Returns true if the set contains output layers or tables
 boolean hasLayers()
          Return true if the set contains output layers
 boolean remove(Output out)
          Removes an output object from the set
 boolean remove(java.lang.String sName)
          Removes an output object from the set
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputObjectsSet

public OutputObjectsSet()
Method Detail

add

public void add(Output output)
adds a new output to the set. If an output with the same name exists, it will change its attributes

Parameters:
output - the output object

getOutput

public Output getOutput(java.lang.String sName)
                 throws WrongOutputIDException
Returns an output of the set, identified by its name

Parameters:
sName - the name of the output object
Returns:
the output object
Throws:
WrongOutputIDException - if no output with the specified name exists in the set

getOutput

public Output getOutput(int iIndex)
                 throws java.lang.ArrayIndexOutOfBoundsException
Returns an output of the set, identified by its index in it

Parameters:
iIndex - the index of the output in the set
Returns:
the output object
Throws:
java.lang.ArrayIndexOutOfBoundsException - if iIndex is not a valid array index

getOutputDataObjectsCount

public int getOutputDataObjectsCount()
Returns the number of data objects (layers and tables) in the set

Returns:
the number of data objects in the set

hasDataObjects

public boolean hasDataObjects()
Returns true if the set contains output layers or tables

Returns:
true if the set contains output layers or tables

hasLayers

public boolean hasLayers()
Return true if the set contains output layers

Returns:
true if the set contains output layers

getOutputLayersCount

public int getOutputLayersCount()
Returns the number of output layers in the set

Returns:
the number of output layers in the set

remove

public boolean remove(Output out)
Removes an output object from the set

Parameters:
out - the output to remove
Returns:
true if the given output was found in the set

remove

public boolean remove(java.lang.String sName)
Removes an output object from the set

Parameters:
sName - the name of output to remove
Returns:
true if the given output was found in the set

getNewInstance

public OutputObjectsSet getNewInstance()
Returns a new instance of the set and all its elements

Returns:
a new instance of the set

getOutputObjectsCount

public int getOutputObjectsCount()
Returns the total number of output objects

Returns:
the total number of output objects

containsKey

public boolean containsKey(java.lang.String key)
Return true if the set contains an object associated to the passed key

Parameters:
key - a string key
Returns:
true if the set contains the key