org.optimizationservices.oscommon.localinterface
Class OSBenchmark

java.lang.Object
  extended by org.optimizationservices.oscommon.localinterface.OSBenchmark

public class OSBenchmark
extends java.lang.Object

The OSBenchmark class is a local interface for storing Optimization Services benchmark. Its design follows the Optimization Services benchmark Language (OSbL). All the data structures in this class are standards specified in OSbL.

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

Field Summary
 BenchmarkData benchmarkData
          benchmarkData holds the second child of the OSBenchmark specified by the OSbL Schema.
 BenchmarkHeader benchmarkHeader
          benchmarkHeader holds the first child of the OSBenchmark specified by the OSbL Schema.
 
Constructor Summary
OSBenchmark()
          Default constructor.
 
Method Summary
 java.lang.String getBenchmarkMessage()
          Get the benchmark message.
 BenchmarkScores getBenchmarkScores()
          Get the benchmark scores.
 BenchmarkStatistics getBenchmarkStatistics()
          Get the benchmark statistics.
 java.util.GregorianCalendar getBenchmarkTime()
          Get time of the last benchmark.
 OptimizationBenchmark getOptimizationBenchmark()
          Get the optimization benchmark information.
 java.util.Hashtable<java.lang.String,java.lang.String> getOtherBenchmarkDescriptions()
          get a hashmap of other benchmark descriptions.
 java.lang.String[] getOtherBenchmarkNames()
          get a string array of names of other benchmarks.
 java.util.Hashtable<java.lang.String,java.lang.String> getOtherBenchmarkValues()
          get a hashmap of other benchmark values.
 java.lang.String getServiceName()
          Get service name.
 java.lang.String getServiceURI()
          Get service uri.
static void main(java.lang.String[] args)
          main for test purposes.
 OSBenchmark readOSbL(java.lang.String osbl, boolean isFile, boolean validate)
          read an OSbL instance and return and OSBenchmark object.
 boolean setBenchmarkMessage(java.lang.String message)
          Set the benchmark message.
 boolean setBenchmarkScores(BenchmarkScores scores)
          Set the benchmark scores.
 boolean setBenchmarkStatistics(BenchmarkStatistics benchmarkStatistics)
          Set the benchmark statistics.
 boolean setBenchmarkTime(java.util.GregorianCalendar time)
          Set time of the last benchmark.
 boolean setOptimizationBenchmark(OptimizationBenchmark optimizationBenchmark)
          Set the optimization benchmark information.
 boolean setOtherBenchmarks(java.lang.String[] names, java.lang.String[] descriptions, java.lang.String[] values)
          set other benchmarks, with their names (required), descriptions (optional) and values (optional).
 boolean setServiceName(java.lang.String serviceName)
          Set service name.
 boolean setServiceURI(java.lang.String serviceURI)
          Set service uri.
 java.lang.String writeOSbL()
          write the OSBenchmark to an osbl xml string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

benchmarkHeader

public BenchmarkHeader benchmarkHeader
benchmarkHeader holds the first child of the OSBenchmark specified by the OSbL Schema.


benchmarkData

public BenchmarkData benchmarkData
benchmarkData holds the second child of the OSBenchmark specified by the OSbL Schema.

Constructor Detail

OSBenchmark

public OSBenchmark()
Default constructor.

Method Detail

readOSbL

public OSBenchmark readOSbL(java.lang.String osbl,
                            boolean isFile,
                            boolean validate)
                     throws java.lang.Exception
read an OSbL instance and return and OSBenchmark object.

Parameters:
osbl - holds the optimization benchmark in a string which format follows the Optimization Services benchmark Language (OSbL) schema.
isFile - holds whether the osbl string is a file name or a string that literally holds the osbl contents.
validate - holds whether the reader should be validating against the schema or not.
Returns:
the OSBenchmark object constructed from the OSbL String.
Throws:
java.lang.Exception - if there are errors in reading the string or setting the OSBenchmark.

writeOSbL

public java.lang.String writeOSbL()
                           throws java.lang.Exception
write the OSBenchmark to an osbl xml string.

Returns:
the osbl xml string.
Throws:
java.lang.Exception - if there are errors in writing the osbl string.

getServiceName

public java.lang.String getServiceName()
Get service name.

Returns:
the service name.

setServiceName

public boolean setServiceName(java.lang.String serviceName)
Set service name.

Parameters:
serviceName - holds the name of the service.
Returns:
whether the service name is set successfully.

getServiceURI

public java.lang.String getServiceURI()
Get service uri.

Returns:
the service uri.

setServiceURI

public boolean setServiceURI(java.lang.String serviceURI)
Set service uri.

Parameters:
serviceURI - holds the uri of the service.
Returns:
whether the service uri is set successfully.

getBenchmarkTime

public java.util.GregorianCalendar getBenchmarkTime()
Get time of the last benchmark.

Returns:
the time of the last benchmark.

setBenchmarkTime

public boolean setBenchmarkTime(java.util.GregorianCalendar time)
Set time of the last benchmark.

Parameters:
time - holds the time of the last benchmark.
Returns:
whether benchmark time is set successfully.

getBenchmarkMessage

public java.lang.String getBenchmarkMessage()
Get the benchmark message.

Returns:
the benchmark message.

setBenchmarkMessage

public boolean setBenchmarkMessage(java.lang.String message)
Set the benchmark message.

Parameters:
message - holds the benchmark message.
Returns:
whether benchmark message is set successfully.

getBenchmarkScores

public BenchmarkScores getBenchmarkScores()
Get the benchmark scores.

Returns:
the benchmark scores.

setBenchmarkScores

public boolean setBenchmarkScores(BenchmarkScores scores)
Set the benchmark scores.

Parameters:
scores - holds the benchmark scores.
Returns:
whether the benchmark scores is set successfully.

getBenchmarkStatistics

public BenchmarkStatistics getBenchmarkStatistics()
Get the benchmark statistics.

Returns:
the benchmark statistics.

setBenchmarkStatistics

public boolean setBenchmarkStatistics(BenchmarkStatistics benchmarkStatistics)
Set the benchmark statistics.

Parameters:
benchmarkStatistics - holds the benchmark statistics.
Returns:
whether the benchmark statistics is set successfully.

getOptimizationBenchmark

public OptimizationBenchmark getOptimizationBenchmark()
Get the optimization benchmark information.

Returns:
the optimization benchmark information.

setOptimizationBenchmark

public boolean setOptimizationBenchmark(OptimizationBenchmark optimizationBenchmark)
Set the optimization benchmark information.

Parameters:
optimizationBenchmark - holds the optimization benchmark information.
Returns:
whether optimization benchmark information is set successfully.

getOtherBenchmarkNames

public java.lang.String[] getOtherBenchmarkNames()
get a string array of names of other benchmarks.

Returns:
a string array of names of other benchmarks, null if no other benchmarks.

getOtherBenchmarkDescriptions

public java.util.Hashtable<java.lang.String,java.lang.String> getOtherBenchmarkDescriptions()
get a hashmap of other benchmark descriptions. The keys of the hashmap are the benchmark names, and the values of the hashmap are the benchmark descriptions.

Returns:
a hashmap of other benchmark descriptions, null if no other benchmarks.

getOtherBenchmarkValues

public java.util.Hashtable<java.lang.String,java.lang.String> getOtherBenchmarkValues()
get a hashmap of other benchmark values. The keys of the hashmap are the benchmark names, and the values of the hashmap are the benchmark values.

Returns:
a hashmap of other benchmark values, null if no other benchmarks.

setOtherBenchmarks

public boolean setOtherBenchmarks(java.lang.String[] names,
                                  java.lang.String[] descriptions,
                                  java.lang.String[] values)
set other benchmarks, with their names (required), descriptions (optional) and values (optional).

Parameters:
names - holds the names of the other benchmarks; it is required.
descriptions - holds the descriptions of the other benchmarks; null if none.
values - holds the values of the other benchmarks; null if none.
Returns:
whether the other anlysis information is set successfully.

main

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

Parameters:
argv - command line arguments.