org.bolson.vote
Class VotingSystemFactory

java.lang.Object
  extended by org.bolson.vote.VotingSystemFactory

public class VotingSystemFactory
extends java.lang.Object

VoteSouce with Options Store configuration for a VoteSource ready to produce one when numc is known.


Field Summary
 java.lang.String[] argv
           
 java.lang.reflect.Constructor f
           
 java.lang.String name
           
 boolean onDef
           
 java.lang.String shortOpt
           
static VotingSystemFactory[] standardVotingSystemList
          Suggestion: take a .clone() of this array and set the onDef flags
 
Constructor Summary
VotingSystemFactory(java.lang.Class vsClass, java.lang.String soIn)
           
VotingSystemFactory(java.lang.Class vsClass, java.lang.String soIn, boolean onDefIn)
           
VotingSystemFactory(java.lang.Class vsClass, java.lang.String nameIn, java.lang.String soIn)
           
VotingSystemFactory(java.lang.Class vsClass, java.lang.String soIn, java.lang.String[] argvIn)
           
VotingSystemFactory(java.lang.Class vsClass, java.lang.String soIn, java.lang.String[] argvIn, boolean onDefIn)
           
VotingSystemFactory(java.lang.Class vsClass, java.lang.String nameIn, java.lang.String soIn, java.lang.String[] argvIn)
           
VotingSystemFactory(java.lang.Class vsClass, java.lang.String nameIn, java.lang.String soIn, java.lang.String[] argvIn, boolean onDefIn)
           
VotingSystemFactory(VotingSystem vsIn, java.lang.String soIn)
           
VotingSystemFactory(VotingSystem vsIn, java.lang.String[] argvIn, java.lang.String soIn)
           
VotingSystemFactory(VotingSystem vsIn, java.lang.String[] argvIn, java.lang.String soIn, boolean on)
           
 
Method Summary
 VotingSystem build(int numc)
           
static VotingSystem[] buildAll(VotingSystemFactory[] vsl, int numc)
          convenience function
static VotingSystem[] buildEnabled(VotingSystemFactory[] vsl, int numc)
          return array of VotingSystem for which vsl[].onDef is true
 java.lang.String desc()
           
static VotingSystemFactory fromDesc(java.lang.String d)
           
static void main(java.lang.String[] argv)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name

f

public java.lang.reflect.Constructor f

argv

public java.lang.String[] argv

shortOpt

public java.lang.String shortOpt

onDef

public boolean onDef

standardVotingSystemList

public static final VotingSystemFactory[] standardVotingSystemList
Suggestion: take a .clone() of this array and set the onDef flags

Constructor Detail

VotingSystemFactory

public VotingSystemFactory(java.lang.Class vsClass,
                           java.lang.String soIn)
                    throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

VotingSystemFactory

public VotingSystemFactory(java.lang.Class vsClass,
                           java.lang.String soIn,
                           boolean onDefIn)
                    throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

VotingSystemFactory

public VotingSystemFactory(java.lang.Class vsClass,
                           java.lang.String nameIn,
                           java.lang.String soIn)
                    throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

VotingSystemFactory

public VotingSystemFactory(java.lang.Class vsClass,
                           java.lang.String nameIn,
                           java.lang.String soIn,
                           java.lang.String[] argvIn)
                    throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

VotingSystemFactory

public VotingSystemFactory(java.lang.Class vsClass,
                           java.lang.String soIn,
                           java.lang.String[] argvIn)
                    throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

VotingSystemFactory

public VotingSystemFactory(java.lang.Class vsClass,
                           java.lang.String nameIn,
                           java.lang.String soIn,
                           java.lang.String[] argvIn,
                           boolean onDefIn)
                    throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

VotingSystemFactory

public VotingSystemFactory(java.lang.Class vsClass,
                           java.lang.String soIn,
                           java.lang.String[] argvIn,
                           boolean onDefIn)
                    throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

VotingSystemFactory

public VotingSystemFactory(VotingSystem vsIn,
                           java.lang.String soIn)
                    throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

VotingSystemFactory

public VotingSystemFactory(VotingSystem vsIn,
                           java.lang.String[] argvIn,
                           java.lang.String soIn)
                    throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

VotingSystemFactory

public VotingSystemFactory(VotingSystem vsIn,
                           java.lang.String[] argvIn,
                           java.lang.String soIn,
                           boolean on)
                    throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException
Method Detail

toString

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

desc

public java.lang.String desc()

fromDesc

public static VotingSystemFactory fromDesc(java.lang.String d)

build

public VotingSystem build(int numc)

buildAll

public static VotingSystem[] buildAll(VotingSystemFactory[] vsl,
                                      int numc)
convenience function


buildEnabled

public static VotingSystem[] buildEnabled(VotingSystemFactory[] vsl,
                                          int numc)
return array of VotingSystem for which vsl[].onDef is true


main

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