opale.tools
Class OpaleSet

java.lang.Object
  |
  +--opale.tools.OpaleSet
Direct Known Subclasses:
ODE, Pack2D

public class OpaleSet
extends java.lang.Object

This class represents a group of Opale object. It makes it possible to store these objects attributing them an identificator and it is also possible to read/write them in a stream.

Since:
Opale-tools 0.14 (OpaleV1b5)

Constructor Summary
OpaleSet()
          Construct a new OpaleSet.
 
Method Summary
 void add(OpaleObject o)
          Add a new Opale object.
 void add(OpaleObject o, java.lang.String id)
          Add a new Opale object specifying its id.
 void check()
           
 void clear()
          Removes all Opale object of this set.
 boolean contains(OpaleObject o)
           
 boolean contains(java.lang.String id)
           
 java.lang.String getNameObject(java.lang.String username)
          Renvoie le nom de la classe d'un objet OpaleObject à partir de son nom utilisateur.
 OpaleObject getObject(java.lang.String id)
           
 java.lang.String getUserName(java.lang.String objname)
          Renvoie le nom utilisateur d'une classe d'un objet Object à partir de son nom de classe en Java.
 java.lang.String[] getUserNameObject()
          Renvoie un tableau de String qui contient tous les noms utilisateurs des objets.
 boolean isEmpty()
           
 java.util.Collection objects()
           
 void read(java.io.Reader r)
          Reads a set of Opale objects in a stream.
 void read(java.io.StreamTokenizer f)
          Reads a set of Opale objects in a stream.
 void remove(java.lang.String id)
           
 int size()
           
 void write(java.io.PrintWriter f)
          Write the objects contained in this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpaleSet

public OpaleSet()
Construct a new OpaleSet.
Method Detail

add

public void add(OpaleObject o)
Add a new Opale object. If the object hasn't an identificator (setId in the class OpaleObject) then this method throw an instance of the runtime exception InvalidIdException.
Parameters:
OpaleObject, - the object to add.

add

public void add(OpaleObject o,
                java.lang.String id)
Add a new Opale object specifying its id. If the id specified is null then this method throw an instance of the runtime exception InvalidIdException. If the object has already an id, it is added with its id.
Parameters:
OpaleObject, - the object to add.
String, - its id.

clear

public void clear()
Removes all Opale object of this set.

size

public int size()

remove

public void remove(java.lang.String id)

objects

public java.util.Collection objects()

getObject

public OpaleObject getObject(java.lang.String id)

contains

public boolean contains(OpaleObject o)

contains

public boolean contains(java.lang.String id)

isEmpty

public boolean isEmpty()

getUserNameObject

public java.lang.String[] getUserNameObject()
Renvoie un tableau de String qui contient tous les noms utilisateurs des objets.
Returns:
String[] le tableau de noms.

getNameObject

public java.lang.String getNameObject(java.lang.String username)
Renvoie le nom de la classe d'un objet OpaleObject à partir de son nom utilisateur.
Parameters:
String - le nom utilisateur.
Returns:
String le nom de la classe.

getUserName

public java.lang.String getUserName(java.lang.String objname)
Renvoie le nom utilisateur d'une classe d'un objet Object à partir de son nom de classe en Java.
Parameters:
String - le nom de la classe.
Returns:
String le nom utilisateur.

read

public void read(java.io.Reader r)
          throws InvalidFormatException
Reads a set of Opale objects in a stream.
Parameters:
Reader - r, an Reader object to read.

read

public void read(java.io.StreamTokenizer f)
          throws InvalidFormatException
Reads a set of Opale objects in a stream.
Parameters:
StreamTokenizer - f, a StreamTokenizer object to read.

write

public void write(java.io.PrintWriter f)
           throws InvalidFormatException
Write the objects contained in this class.
Parameters:
PrintWriter - f, a stream.

check

public void check()