cdx.scorebot.app.util
Class ScorebotInfo

java.lang.Object
  extended by cdx.scorebot.app.util.ScorebotInfo
All Implemented Interfaces:
java.io.Serializable

public class ScorebotInfo
extends java.lang.Object
implements java.io.Serializable

Stores information about a particular set of services

Author:
David Underhill
See Also:
Serialized Form

Field Summary
static ScorebotInfo REF
          stores the ScorebotInfo for everyone to access
 
Constructor Summary
ScorebotInfo()
          Instantiates a ScorebotInfo
 
Method Summary
 void addServiceInfo(ServiceInfo si)
          Adds a service to be serviceed.
 java.util.Vector<Test> getAllTestFactories()
          gets all known tests
 int getMajorNumber()
          gets the major revision number
 int getMinorNumber()
          gets the minor revision number
 java.lang.String getOptionDescription(Test t, java.lang.String optionName)
          gets the description of an option (returns "unknown option" if the requested one isn't found)
 java.lang.String getOptionIdentifier(Test t, java.lang.String optionName)
          gets the identifier of an option (returns "unknown_option" if the requested one isn't found)
 LiteralType getOptionType(Test t, java.lang.String optionName)
          gets the type of an option (returns null if the requested one isn't found)
 java.lang.String getResultDescription(Test t, java.lang.String resultName)
          gets the description of an result (returns "unknown result" if the requested one isn't found)
 java.lang.String getResultIdentifier(Test t, java.lang.String resultName)
          gets the identifier of an result (returns unknown_result if the requested one isn't found)
 LiteralType getResultType(Test t, java.lang.String resultName)
          gets the type of an result (returns null if the requested one isn't found)
 int getRevisionNumber()
          gets the revision number
 Service getServiceByName(java.lang.String name)
          gets Service by its String rep returns null if the string isn't found
 java.lang.String getServiceDescription(Service s)
          gets the description of this service (returns "unknown service" if the requested one isn't found)
 ServiceInfo getServiceInfo(int index)
          Gets the specified service
 java.util.Vector<ServiceInfo> getServiceInfos()
          gets the services in this service
 java.lang.String getServiceName(Service s)
          gets the name of a service (returns "unknown service" if the requested one isn't found)
 java.util.Vector<Service> getServices()
          gets all known services
 ServiceType getServiceType(Service s)
          gets the type of this service (returns null if the requested one isn't found)
 Test getTestByName(Service s, java.lang.String name)
          get test by a string rep of it's name returns null if the name isn't found
 java.lang.String getTestDescription(Test t)
          gets the description of this test (returns "unknown test" if the requested one isn't found)
 java.util.Vector<Test> getTestFactories(Service s)
          gets all known tests (factory instantiations) for a particular service (includes those for a generic service)
 java.util.Vector<Test> getTestFactories(Service s, boolean getGenericTestsToo)
          gets all known tests (factory instantiations) for a particular service
 java.lang.String getTestName(Test t)
          gets the name of a test (returns "unknown test" if the requested one isn't found)
 java.util.Vector<OptionInfo> getTestOptionsInfo(Test t)
          gets info about the options in this test (returns an empty vector if the requested one isn't found)
 java.util.Vector<ResultInfo> getTestResultsInfo(Test t)
          gets info about the results returned by this test (returns an empty vector if the requested one isn't found)
 java.lang.String getVersion()
          gets the version of this info
 void removeServiceInfo(int index)
          Removes the service from this service
 boolean removeServiceInfo(ServiceInfo si)
          Removes the service from this info
 void setMajorNumber(int majorNumber)
          sets the major revision number
 void setMinorNumber(int minorNumber)
          sets the minor revision number
 void setRevisionNumber(int revisionNumber)
          gets the revision number
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REF

public static ScorebotInfo REF
stores the ScorebotInfo for everyone to access

Constructor Detail

ScorebotInfo

public ScorebotInfo()
Instantiates a ScorebotInfo

Method Detail

getServices

public java.util.Vector<Service> getServices()
gets all known services


getServiceByName

public Service getServiceByName(java.lang.String name)
gets Service by its String rep returns null if the string isn't found

Parameters:
name - String representation of the service to return
Returns:
the service represented by name, or null if not found

getServiceName

public java.lang.String getServiceName(Service s)
gets the name of a service (returns "unknown service" if the requested one isn't found)


getServiceDescription

public java.lang.String getServiceDescription(Service s)
gets the description of this service (returns "unknown service" if the requested one isn't found)


getServiceType

public ServiceType getServiceType(Service s)
gets the type of this service (returns null if the requested one isn't found)


getTestFactories

public java.util.Vector<Test> getTestFactories(Service s)
gets all known tests (factory instantiations) for a particular service (includes those for a generic service)


getTestByName

public Test getTestByName(Service s,
                          java.lang.String name)
get test by a string rep of it's name returns null if the name isn't found

Parameters:
s - service that the test should run on
name - name of test to find
Returns:
should be the test represented by name, or null if not found

getAllTestFactories

public java.util.Vector<Test> getAllTestFactories()
gets all known tests

Returns:
all known Tests

getTestFactories

public java.util.Vector<Test> getTestFactories(Service s,
                                               boolean getGenericTestsToo)
gets all known tests (factory instantiations) for a particular service

Parameters:
s - the service to get tests for
getGenericTestsToo - whether or not to include all tests which work on a GenericService too
Returns:
known Tests for the specified Service

getTestName

public java.lang.String getTestName(Test t)
gets the name of a test (returns "unknown test" if the requested one isn't found)


getTestDescription

public java.lang.String getTestDescription(Test t)
gets the description of this test (returns "unknown test" if the requested one isn't found)


getTestOptionsInfo

public java.util.Vector<OptionInfo> getTestOptionsInfo(Test t)
gets info about the options in this test (returns an empty vector if the requested one isn't found)


getTestResultsInfo

public java.util.Vector<ResultInfo> getTestResultsInfo(Test t)
gets info about the results returned by this test (returns an empty vector if the requested one isn't found)


getOptionDescription

public java.lang.String getOptionDescription(Test t,
                                             java.lang.String optionName)
gets the description of an option (returns "unknown option" if the requested one isn't found)


getOptionIdentifier

public java.lang.String getOptionIdentifier(Test t,
                                            java.lang.String optionName)
gets the identifier of an option (returns "unknown_option" if the requested one isn't found)


getOptionType

public LiteralType getOptionType(Test t,
                                 java.lang.String optionName)
gets the type of an option (returns null if the requested one isn't found)


getResultDescription

public java.lang.String getResultDescription(Test t,
                                             java.lang.String resultName)
gets the description of an result (returns "unknown result" if the requested one isn't found)


getResultIdentifier

public java.lang.String getResultIdentifier(Test t,
                                            java.lang.String resultName)
gets the identifier of an result (returns unknown_result if the requested one isn't found)


getResultType

public LiteralType getResultType(Test t,
                                 java.lang.String resultName)
gets the type of an result (returns null if the requested one isn't found)


getVersion

public java.lang.String getVersion()
gets the version of this info


addServiceInfo

public void addServiceInfo(ServiceInfo si)
Adds a service to be serviceed.

Parameters:
si - the service to add to this info

removeServiceInfo

public void removeServiceInfo(int index)
                       throws java.lang.ArrayIndexOutOfBoundsException
Removes the service from this service

Parameters:
index - remove the service at the specified index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.

removeServiceInfo

public boolean removeServiceInfo(ServiceInfo si)
Removes the service from this info

Parameters:
si - the SerivceInfo to remove
Returns:
false if the specified item wasn't in the list and true otherwise

getServiceInfo

public ServiceInfo getServiceInfo(int index)
                           throws java.lang.ArrayIndexOutOfBoundsException
Gets the specified service

Returns:
the ServiceItem at the specified index in the ServiceItem vector
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index was invalid.

getServiceInfos

public java.util.Vector<ServiceInfo> getServiceInfos()
gets the services in this service


getMajorNumber

public int getMajorNumber()
gets the major revision number


setMajorNumber

public void setMajorNumber(int majorNumber)
sets the major revision number

Parameters:
majorNumber -

getMinorNumber

public int getMinorNumber()
gets the minor revision number


setMinorNumber

public void setMinorNumber(int minorNumber)
sets the minor revision number

Parameters:
minorNumber -

getRevisionNumber

public int getRevisionNumber()
gets the revision number


setRevisionNumber

public void setRevisionNumber(int revisionNumber)
gets the revision number

Parameters:
revisionNumber -