source: java/main/src/main/java/com/framsticks/params/ListAccess.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.3 KB
Line 
1package com.framsticks.params;
2
3
4
5
6import com.framsticks.params.types.EventParam;
7import com.framsticks.params.types.ProcedureParam;
8
9/**
10 * @author Piotr Sniegowski
11 */
12public abstract class ListAccess implements Access {
13
14        final Access elementAccess;
15        final String containedTypeName;
16
17        protected final ParamBuilder paramBuilder;
18
19        public ListAccess(Access elementAccess) {
20                this.elementAccess = elementAccess;
21                this.containedTypeName = elementAccess.getId();
22                paramBuilder = elementAccess.buildParam(new ParamBuilder());
23        }
24
25        // @Override
26        // public Param getGroupMember(int gi, int n) {
27        //      return null;
28        // }
29
30
31        public Access getElementAccess() {
32                return elementAccess;
33        }
34
35        /**
36         * @return the containedTypeName
37         */
38        public String getContainedTypeName() {
39                return containedTypeName;
40        }
41
42        @Override
43        public final FramsClass getFramsClass() {
44                return elementAccess.getFramsClass();
45        }
46
47        @Override
48        public void tryAutoAppend(Object object) {
49                throw new InvalidOperationException().msg("It could actually be used also, the Access.select could be used to check whether type is correct");
50        }
51
52        @Override
53        public Object call(String id, Object[] arguments) {
54                throw new InvalidOperationException().msg("list access does not support calling methods").arg("id", id).arg("access", this);
55        }
56
57        @Override
58        public Object call(ProcedureParam param, Object[] arguments) {
59                throw new InvalidOperationException().msg("list access does not support calling methods").arg("param", param).arg("access", this);
60        }
61
62        @Override
63        public void reg(EventParam param, EventListener<?> listener) {
64                throw new InvalidOperationException().msg("list access does not support registering events").arg("param", param).arg("access", this);
65        }
66
67        @Override
68        public void regRemove(EventParam param, EventListener<?> listener) {
69                throw new InvalidOperationException().msg("list access does not support registering events").arg("param", param).arg("access", this);
70        }
71
72
73        @Override
74        public String toString() {
75                StringBuilder b = new StringBuilder();
76                b.append("list of ").append(containedTypeName);
77                if (getSelected() != null) {
78                        b.append("[").append(getParamCount()).append("]");
79                }
80                return b.toString();
81        }
82
83        public CompositeParam prepareParamFor(String id) {
84                return paramBuilder.id(id).finish(CompositeParam.class);
85        }
86};
Note: See TracBrowser for help on using the repository browser.