MCPcopy Index your code
hub / github.com/PCGen/pcgen / ChoiceSet

Class ChoiceSet

code/src/java/pcgen/cdom/base/ChoiceSet.java:48–240  ·  view source on GitHub ↗

A ChoiceSet is a named container of a Collection of objects (stored in a PrimitiveChoiceSet). It is expected that a ChoiceSet will be useful in situations where a pre-defined list of choices is available. If the set of choices is dynamic, consider using the List infrastructure, including classes l

Source from the content-addressed store, hash-verified

46 * the Class contained within this ChoiceSet
47 */
48public class ChoiceSet<T> extends ConcretePrereqObject implements SelectableSet<T>
49{
50
51 /**
52 * The PrimitiveChoiceSet containing the Collection of Objects in this
53 * ChoiceSet
54 */
55 private final PrimitiveChoiceSet<T> pcs;
56
57 /**
58 * The name of this ChoiceSet
59 */
60 private final String setName;
61
62 /**
63 * The title (presented to the user) of this ChoiceSet
64 */
65 private String title = null;
66
67 /**
68 * An identifier to check if the ChoiceSet (and the underlying
69 * PrimitiveChoiceSet) should use the "ANY" identifier (vs. "ALL") when
70 * referring to the global collection of objects of a certain type.
71 */
72 private final boolean useAny;
73
74 /**
75 * Creates a new ChoiceSet with the given name and given underlying
76 * PrimitiveChoiceSet.
77 *
78 * @param name
79 * The name of this ChoiceSet
80 * @param choice
81 * The PrimitiveChoiceSet indicating the Collection of objects
82 * for this ChoiceSet
83 * @throws IllegalArgumentException
84 * if the given name or PrimitiveChoiceSet is null
85 */
86 public ChoiceSet(String name, PrimitiveChoiceSet<T> choice)
87 {
88 this(name, choice, false);
89 }
90
91 /**
92 * Creates a new ChoiceSet with the given name and given underlying
93 * PrimitiveChoiceSet.
94 *
95 * @param name
96 * The name of this ChoiceSet
97 * @param choice
98 * The PrimitiveChoiceSet indicating the Collection of objects
99 * for this ChoiceSet
100 * @param any
101 * Use "ANY" for the "ALL" reference if true
102 * @throws IllegalArgumentException
103 * if the given name or PrimitiveChoiceSet is null
104 */
105 public ChoiceSet(String name, PrimitiveChoiceSet<T> choice, boolean any)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected