source: java/main/src/main/java/com/framsticks/params/AccessInterface.java @ 86

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

HIGHLIGHTS:

  • use java annotations to mark classes and fields to be used when:
    • using java classes with ReflectionAccess? to represent remote objects with FramsClass? description found by "info ..." requests
    • to build up FramsClass? representation of objects not present at remote server
  • allow using primitive types (instead of wraping counterparts) in reflected classes
  • rework FramsClass? creation process (add FramsClassBuilder?)
  • add more tests

CHANGELOG:
Prepare model.World class.

Minor change.

Use primitive types for Genotype and Creature classes.

Use primitive types in model.Neuro* classes.

Use primitive types in model.Joint* classes.

Use primitive types in model.Part* classes.

Fix primitive values.

Extract FramsClassBuilder?.

Add tests of Model classes.

More fixes.

Refactorize out ParamCandidate?.

Several fixes.

Fix all regressions after introducing annotations.

Use annotations throughout the project.

Add exception classes.

Improve creation of FramsClass?.

More changes.

Many changes regarding annotations.

Annotate classes in com.framsticks.model package.

Remove manual FramsClass? constructor.

Construct FramsClass? for Creature. Add test.

Add default values to the ParamAnnotation?.

Add ParamBuilderTest? and ParamAnnotation?.

Add FramsClassAnnotation?.

File size: 1.4 KB
Line 
1package com.framsticks.params;
2
3import java.util.Collection;
4
5
6/**
7 * The Interface AccessInterface. It's the most general class for storing data in
8 * framsticks. In descriptions of methods names "property" and "parameter" are
9 * synonyms.
10 *
11 * @author Jarek Szymczak <name.surname@gmail.com> (please replace name and
12 *         surname with my personal data)
13 */
14public interface AccessInterface {
15
16        Param getParam(int i);
17
18        Param getParam(String id);
19
20        String getId();
21
22        Param getGroupMember(int gi, int n);
23
24        int getParamCount();
25
26        // void call(int i, Object args, Object ret);
27        // TODO: as for now it's not necessary to implement this method
28
29        <T> T get(int i, Class<T> type);
30
31        <T> T get(String id, Class<T> type);
32
33        <T> T get(ValueParam param, Class<T> type);
34
35        <T> int set(int i, T value);
36
37        <T> int set(String id, T value);
38
39        <T> int set(ValueParam param, T value);
40
41        void setDefault(boolean numericOnly);
42
43        void setDefault(int i, boolean numericOnly);
44
45        void setMin();
46
47        void setMin(int i);
48
49        void setMax();
50
51        void setMax(int i);
52
53        void copyFrom(AccessInterface src);
54
55        void save(SinkInterface sink);
56
57        void load(SourceInterface stream) throws Exception;
58
59        /**
60         * Removes all the properties values.
61         */
62        void clearValues();
63
64        AccessInterface select(Object object);
65
66        Object getSelected();
67
68        AccessInterface cloneAccess() throws ConstructionException;
69
70        Object createAccessee();
71
72        Collection<Param> getParams();
73
74        FramsClass getFramsClass();
75
76
77}
Note: See TracBrowser for help on using the repository browser.