org.optimizationservices.oscommon.representationparser
Class OSRepositoryWriter

java.lang.Object
  extended by org.optimizationservices.oscommon.representationparser.OSgLWriter
      extended by org.optimizationservices.oscommon.representationparser.OSRepositoryWriter

public class OSRepositoryWriter
extends OSgLWriter

The OSRepositoryWriter class is used to construct an instance that follows the OSRepository format.

Since:
OS 1.0
Version:
1.0, 03/14/2004
Author:
Robert Fourer, Jun Ma, Kipp Martin

Field Summary
 
Fields inherited from class org.optimizationservices.oscommon.representationparser.OSgLWriter
m_document
 
Constructor Summary
OSRepositoryWriter()
          Constructor.
 
Method Summary
 boolean addInstance(RepositoryInstance instance)
          Add an OSRepository instance.
 boolean addNewsElement(java.util.GregorianCalendar time, java.lang.String value)
          Add a news element.
 boolean deleteInstance(java.lang.String instanceName)
          Delete an OSRepository instance.
static void main(java.lang.String[] argv)
          main for test purposes.
 boolean setDescription(java.lang.String description)
          Set the description element.
 boolean setInstances(RepositoryInstance[] instances)
          Set the OSRepository instances.
 boolean setNews(NewsElement[] newsElements)
          Set the OSRepository news.
 boolean setOSRepository(OSRepository osRepository)
          set the OSRepository, a standard os repository data structure.
 
Methods inherited from class org.optimizationservices.oscommon.representationparser.OSgLWriter
getDocument, setDocument, writeToFile, writeToSring, writeToStandardOutput
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSRepositoryWriter

public OSRepositoryWriter()
Constructor.

Method Detail

setOSRepository

public boolean setOSRepository(OSRepository osRepository)
                        throws java.lang.Exception
set the OSRepository, a standard os repository data structure.

Parameters:
osRepository - holds the standard os repository data structure.
Returns:
whether the OSRepository is set successfully.
Throws:
java.lang.Exception

setDescription

public boolean setDescription(java.lang.String description)
Set the description element. If the element is already there, it will reset it. If the element is not there (e.g. optional element), it will add it.

Parameters:
description - holds the description of the os repository.
Returns:
whether the description is set successfully.

addNewsElement

public boolean addNewsElement(java.util.GregorianCalendar time,
                              java.lang.String value)
Add a news element.

Parameters:
time - holds the time.
value - holds the news element value.
Returns:
whether the news is added successfully.

setNews

public boolean setNews(NewsElement[] newsElements)
Set the OSRepository news.

Returns:
whether the news is set successfully or not.
See Also:
NewsElement

setInstances

public boolean setInstances(RepositoryInstance[] instances)
Set the OSRepository instances.

Returns:
whether the instances are set successfully or not.
See Also:
RepositoryInstance

addInstance

public boolean addInstance(RepositoryInstance instance)
Add an OSRepository instance.

Returns:
whether the instance is added successfully or not.
See Also:
RepositoryInstance

deleteInstance

public boolean deleteInstance(java.lang.String instanceName)
Delete an OSRepository instance.

Returns:
whether the instance is deleted successfully or not.
See Also:
RepositoryInstance

main

public static void main(java.lang.String[] argv)
main for test purposes.

Parameters:
argv - command line arguments.