source: java/main/src/main/java/com/framsticks/params/CompositeParam.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: 818 bytes
Line 
1package com.framsticks.params;
2
3import javax.annotation.concurrent.Immutable;
4
5/**
6 * @author Piotr Sniegowski
7 */
8@Immutable
9public abstract class CompositeParam extends ValueParam {
10
11        protected final String containedTypeName;
12
13        public CompositeParam(ParamBuilder builder) {
14                super(builder);
15                this.containedTypeName = builder.getContainedTypeName();
16        }
17
18        public boolean isMatchingContainedName(String name) {
19                assert name != null;
20                if (containedTypeName == null) {
21                        return true;
22                }
23                return name.equals(containedTypeName);
24        }
25
26        public String getContainedTypeName() {
27                return containedTypeName;
28        }
29
30        public abstract AccessInterface prepareAccessInterface(AccessInterface access);
31
32        public abstract String computeAccessId();
33
34        public <T> T getDef(Class<T> type) throws ClassCastException {
35                return null;
36        }
37
38}
Note: See TracBrowser for help on using the repository browser.