de.jdemo.framework
Class DemoSuite

java.lang.Object
  extended by de.jdemo.framework.DemoSuite
All Implemented Interfaces:
IDemo, IDemoSuite

public class DemoSuite
extends java.lang.Object
implements IDemoSuite


Constructor Summary
DemoSuite()
          Constructs an empty DemoSuite.
DemoSuite(java.lang.Class theClass)
          Constructs a DemoSuite from the given class.
DemoSuite(java.lang.Class theClass, java.lang.String name)
          Constructs a DemoSuite from the given class with the given name.
DemoSuite(java.lang.String name)
          Constructs an empty DemoSuite.
 
Method Summary
 void accept(IDemoVisitor visitor)
           
 void addDemo(IDemo demo)
          Adds a demo to the suite.
 void addDemoSuite(java.lang.Class demoClass)
          Adds the demos from the given class to the suite
static IDemo createDemo(java.lang.Class theClass, java.lang.String name)
          ...as the moon sets over the early morning Merlin, Oregon mountains, our intrepid adventurers type...
 IDemo getDemoAt(int index)
          Returns the demo at the given index
static java.lang.reflect.Constructor getDemoConstructor(java.lang.Class theClass)
          Gets a constructor which takes a single String as its argument or a no arg constructor.
 int getDemoCount()
          Returns the number of demos in this suite
 java.lang.String getName()
          Returns the name of the suite.
 void setName(java.lang.String name)
          Sets the name of the suite.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DemoSuite

public DemoSuite()
Constructs an empty DemoSuite.


DemoSuite

public DemoSuite(java.lang.Class theClass,
                 java.lang.String name)
Constructs a DemoSuite from the given class with the given name.

See Also:
DemoSuite(Class)

DemoSuite

public DemoSuite(java.lang.Class theClass)
Constructs a DemoSuite from the given class. Adds all the methods starting with "demo" as demo cases to the suite.


DemoSuite

public DemoSuite(java.lang.String name)
Constructs an empty DemoSuite.

Method Detail

accept

public void accept(IDemoVisitor visitor)
Specified by:
accept in interface IDemo

addDemo

public void addDemo(IDemo demo)
Adds a demo to the suite.


addDemoSuite

public void addDemoSuite(java.lang.Class demoClass)
Adds the demos from the given class to the suite


createDemo

public static IDemo createDemo(java.lang.Class theClass,
                               java.lang.String name)
...as the moon sets over the early morning Merlin, Oregon mountains, our intrepid adventurers type...


getDemoConstructor

public static java.lang.reflect.Constructor getDemoConstructor(java.lang.Class theClass)
                                                        throws java.lang.NoSuchMethodException
Gets a constructor which takes a single String as its argument or a no arg constructor.

Throws:
java.lang.NoSuchMethodException

getDemoAt

public IDemo getDemoAt(int index)
Returns the demo at the given index

Specified by:
getDemoAt in interface IDemoSuite

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setName

public void setName(java.lang.String name)
Sets the name of the suite.

Specified by:
setName in interface IDemo
Parameters:
name - The name to set

getName

public java.lang.String getName()
Returns the name of the suite. Not all demo suites have a name and this method can return null.

Specified by:
getName in interface IDemo

getDemoCount

public int getDemoCount()
Returns the number of demos in this suite

Specified by:
getDemoCount in interface IDemoSuite


JDemo homepage: http://www.jdemo.de
Copyright © 2003-2008 Markus Gebhard. All Rights Reserved.