source: java/main/src/main/java/com/framsticks/params/Group.java @ 87

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

HIGHLIGHTS:

  • FramsClass? and contained Param are now immutable classes (like String),

which allows to refer to them concurrently without synchronization
(which for example in turn simplifies GUI management)

  • also make Path immutable (which was earlier only assumed)
  • add global cache for FramsClasses? created solely and automatically

on base of Java classes.

representations basing on given FramsClass?

  • above changes greatly improved GUI responsivness during browsing
  • furtherly improve Param class hierarchy
  • allow to inject actions on state changes into MultiParamLoader?
  • add more tests

CHANGELOG:

Add StatusListener? to MultiParamLoader?.

Minor refactorization in MultiParamLoader?.

First step with auto append.

Add SchemaTest?.

Improve Registry.

Clean up in Registry.

Work out Registry.

Use annotations for Param.

Fix ListChange?.

Improve fluent interface of the FramsClassBuilder?.

Done caching of ReflectionAccess?.Backend

Fix hashCode of Pair.

A step on a way to cache ReflectionAccess?.Backend

Make SimpleAbstractAccess?.framsClass a final field.

Add static cache for FramsClasses? based on java.

Only classes created strictly and automatically
based on java classes are using this cache.

Make all Params immutable.

Many improvement to make Param immutable.

Make PrimitiveParam? generic type.

Several changes to make Param immutable.

Make FramsClass? immutable.

Another improvement to Path immutability.

Several improvements to Path.

Improve PathTest?.

Configurarable MutabilityDetector?.

File size: 926 bytes
Line 
1package com.framsticks.params;
2
3import java.util.ArrayList;
4import java.util.List;
5
6import com.framsticks.params.annotations.FramsClassAnnotation;
7import com.framsticks.params.annotations.ParamAnnotation;
8
9/**
10 * @author Piotr Sniegowski
11 */
12@FramsClassAnnotation
13public class Group {
14
15        @ParamAnnotation
16        protected String name;
17
18        /**
19         * Group members.
20         */
21        List<Param> params = new ArrayList<Param>();
22
23        public Group(String name) {
24                this.name = name;
25        }
26
27        /**
28         * Adds new group member.
29         *
30         * @param p the new group member
31         */
32        void addProperty(Param p) {
33                params.add(p);
34        }
35
36        /**
37         * Gets the property.
38         *
39         * @param i the i
40         * @return the property
41         */
42        Param getProperty(int i) {
43                if (i < 0 || i >= params.size())
44                        return null;
45                return params.get(i);
46        }
47
48        @Override
49        public String toString() {
50                return name;
51        }
52
53        /**
54         * @return the name
55         */
56        @ParamAnnotation
57        public String getName() {
58                return name;
59        }
60
61}
Note: See TracBrowser for help on using the repository browser.