source: java/main/src/main/java/com/framsticks/params/Param.java @ 102

Last change on this file since 102 was 102, checked in by psniegowski, 11 years ago

HIGHLIGHTS:

for Joinables running

CHANGELOG:
Add WorkPackageLogic? and classes representing prime experiment state.

Add classes for PrimeExperiment? state.

Extract single netload routine in Simulator.

Working netload with dummy content in PrimeExperiment?.

More development with NetLoadSaveLogic? and PrimeExperiment?.

Improvement around prime.

Improve BufferedDispatcher?.isActive logic.

Add prime-all.xml configuration.

Manual connecting to existing simulators from GUI.

Guard in SimulatorConnector? against expdef mismatch.

Guard against empty target dispatcher in BufferedDispatcher?.

Make BufferedDispatcher? a Dispatcher (and Joinable).

Minor improvements.

Done StackedJoinable?, improve Experiment.

Develop StackedJoinable?.

Add StackedJoinable? utility joinables controller.

Add dependency on apache-commons-lang.

Add ready ListChange? on Simulators.

Improve hints in ListChange?.

Several improvements.

Found bug with dispatching in Experiment.

Minor improvements.

Fix bug with early finishing Server.

Many changes in Dispatching.

Fix bug with connection.

Do not obfuscate log with socket related exceptions.

Add SocketClosedException?.

Add SimulatorConnector?.

Work out conception of experiment composing of logics building blocks.

Rename SinkInterface? to Sink.

Move saving of Accesses into AccessOperations?.

Some improvements to Experiment.

Improve joinables.

Fix issue with joinables closing.

Add direct and managed consoles to popup menu.

File size: 2.2 KB
Line 
1package com.framsticks.params;
2
3
4import javax.annotation.concurrent.Immutable;
5
6import com.framsticks.params.annotations.FramsClassAnnotation;
7import com.framsticks.params.annotations.ParamAnnotation;
8
9/**
10 * Based on c++ struct ParamEntry located in cpp/gdk/param.h
11 * Here  it is a root of Param hierarchy.
12 *
13 * @author Jarek Szymczak <name.surname@gmail.com>, Mateusz Jarus
14 * (please replace name and surname with my personal data)
15 *
16 * @author Piotr Śniegowski
17 */
18@Immutable
19@FramsClassAnnotation(id = "prop", name = "prop", order = {"id", "name", "type", "flags", "help", "group", "extra"})
20public abstract class Param {
21
22        /** The parameter id. */
23        protected final String id;
24
25        /** The parameter name. */
26        protected final String name;
27
28        /** The help (description) concerning parameter. */
29        protected final String help;
30
31        /** The number of group, that parameter belongs to. */
32        protected final Integer group;
33
34        /** The getFlags stored as a bit sum. */
35        protected final int flags;
36
37        /** The variable determining whether the parameter is an extra parameter. */
38        protected final int extra;
39
40        public Param(ParamBuilder builder) {
41                id = builder.getId();
42                name = builder.getName();
43                help = builder.getHelp();
44                group = builder.getGroup();
45                flags = builder.getFlags();
46                extra = builder.getExtra();
47        }
48
49        @ParamAnnotation
50        public String getId() {
51                return id;
52        }
53
54        @ParamAnnotation
55        public String getName() {
56                return name;
57        }
58
59        @ParamAnnotation
60        public String getHelp() {
61                return help;
62        }
63
64        @ParamAnnotation
65        public Integer getGroup() {
66                return group;
67        }
68
69        @ParamAnnotation(def = "0")
70        public Integer getFlags() {
71                return flags;
72        }
73
74        @ParamAnnotation(id = "type")
75        public abstract String getFramsTypeName();
76
77        @ParamAnnotation
78        public Integer getExtra() {
79                return extra;
80        }
81
82        @Override
83        public String toString() {
84                return getId() + ":" + this.getClass().getSimpleName();
85        }
86
87        public boolean isNumeric() {
88                return false;
89        }
90
91        public abstract Class<?> getStorageType();
92
93        public boolean hasFlag(int flag) {
94                return (flags & flag) != 0;
95        }
96
97        public static ParamBuilder build() {
98                return new ParamBuilder();
99        }
100
101        public static ParamBuilder build(FramsClassBuilder builder) {
102                return new ParamBuilder(builder);
103        }
104
105}
Note: See TracBrowser for help on using the repository browser.