source: java/main/src/main/java/com/framsticks/params/ListAccess.java @ 105

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

HIGHLIGHTS:

  • import refactorization: move Tree, Path, etc.

from core to structure package

  • initial serialization implementation
  • improve PrimeExperiment? test
  • many organizational changes and convenience improvements

CHANGELOG:
Make registry in AbstractTree? final.

Move most classes from core to structure package.

Minor changes.

Switch names of Future and FutureHandler?.

Rename ExceptionResultHandler? to ExceptionHandler?.

Rename ExceptionHandler? to ExceptionDispatcherHandler?.

Fix bug in ParamCandidate? cache.

Add missing synchronization to the BufferedDispatcher?.

Develop @Serialized support.

Rework serialization further.

Add serialization/deserialization interface to ValueParam?.

Move getStorageType and isNumeric from Param down to params hierarchy.

Minor changes.

Improve param type induction.

Add TestSerializedClass? for testing new serialization.

Add info files gor GenePool? and Population.

Add standard.expt exemplary netfile.

Add type name field to PropertiesObject?.

Use PropertiesObject? for PropertiesAccess? instead of ordinary map.

Hide getFramsClass is several more places.

More unification accross FramsClass?, Access and Path.

Add ParamCollection?.

Simplify interface for getting params from FramsClass?, Access
or Path.

Make Access.call() interface variadic.

Add arguments(args) convenience wrapper around new Object[] {args}.

Upgrade to apache.commons.lang version 3.1

Minor improvement with Response constructors.

Develop proper result printing in ClientAtServer?.

Add experimentNetsave to PrimeExperiment?.

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.getTypeId();
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.