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

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

Add new java codebase.

File size: 2.2 KB
Line 
1package com.framsticks.params;
2
3import java.util.Collection;
4import java.util.List;
5
6
7/**
8 * The Interface AccessInterface. It's the most general class for storing data in
9 * framsticks. In descriptions of methods names "property" and "parameter" are
10 * synonyms.
11 *
12 * @author Jarek Szymczak <name.surname@gmail.com> (please replace name and
13 *         surname with my personal data)
14 */
15public interface AccessInterface {
16
17        Param getParam(int i);
18
19        Param getParam(String id);
20
21        String getId();
22
23
24    /*
25        String getName();
26
27    * This method provides more verbose (but not strict) names of classes.
28     *
29     * e.g. for a list it will return l Type, and if name of FramsClass missing,
30     * it's id will be used
31     *
32    String getNiceName();
33    */
34
35        Param getGroupMember(int gi, int n);
36
37        int getParamCount();
38
39        // void call(int i, Object args, Object ret);
40        // TODO: as for now it's not necessary to implement this method
41
42        <T> T get(int i, Class<T> type);
43
44        <T> T get(String id, Class<T> type);
45
46        <T> T get(Param param, Class<T> type);
47
48        <T> int set(int i, T value);
49
50        <T> int set(String id, T value);
51
52        <T> int set(Param param, T value);
53
54        void setDefault(boolean numericOnly);
55
56        void setDefault(int i, boolean numericOnly);
57
58        void setMin();
59
60        void setMin(int i);
61
62        void setMax();
63
64        void setMax(int i);
65
66        void copyFrom(AccessInterface src);
67
68        void save(SinkInterface sink);
69
70        void load(SourceInterface stream) throws Exception;
71
72        /**
73         * Return as a single line String.
74         *
75         * @param omitDefaultValues
76         *            the omit default values
77         * @return the string
78         */
79        String save2(boolean omitDefaultValues);
80
81        /**
82         * Load values from single line String.
83         *
84         * @param line
85         *            the line with values
86         * @return the list of not severe exceptions which occurred while loading
87         * @throws Exception
88         *             the severe exception occurred while loading
89         */
90        List<Exception> load2(String line) throws Exception;
91
92        /**
93         * Removes all the properties values.
94         */
95        void clearValues();
96
97        void select(Object object);
98
99        Object getSelected();
100
101        AccessInterface cloneAccess();
102
103    Object createAccessee();
104
105    Collection<Param> getParams();
106
107    FramsClass getFramsClass();
108
109}
Note: See TracBrowser for help on using the repository browser.