Ignore:
Timestamp:
06/28/13 11:56:03 (11 years ago)
Author:
psniegowski
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/core/ListChange.java

    r85 r87  
    11package com.framsticks.core;
    22
    3 import com.framsticks.params.FramsClass;
    4 import com.framsticks.params.Param;
    5 import com.framsticks.params.types.DecimalParam;
    6 import com.framsticks.params.types.EnumParam;
    7 import com.framsticks.params.types.StringParam;
     3import com.framsticks.params.annotations.FramsClassAnnotation;
     4import com.framsticks.params.annotations.ParamAnnotation;
    85import com.framsticks.util.lang.Strings;
    9 
    10 import java.util.Arrays;
    116
    127/**
    138 * @author Piotr Sniegowski
    149 */
     10@FramsClassAnnotation
    1511public class ListChange {
    1612
     
    3127                Remove,
    3228                Modify
     29                // Add(0),
     30                // Remove(1),
     31                // Modify(2);
     32
     33                // public final int value;
     34
     35                // /**
     36                //  * @param value
     37                //  */
     38                // Action(int value) {
     39                //      this.value = value;
     40                // }
     41
    3342        }
    3443
    35         private Action action;
    36         private Integer position;
    37         private String identifier;
     44        public Action action = Action.Add;
     45        @ParamAnnotation(id = "pos")
     46        public Integer position;
     47        @ParamAnnotation(id = "id")
     48        public String identifier;
    3849
     50        @ParamAnnotation
    3951        public Integer getType() { return action.ordinal(); }
     52        @ParamAnnotation
    4053        public void setType(Integer type) { action = Action.values()[type]; }
    41 
    42         public Integer getPos() { return position; }
    43         public void setPos(Integer pos) { position = pos; }
    44 
    45         public String getId() { return identifier; }
    46         public void setId(String id) { identifier = id; }
    4754
    4855        public String getBestIdentifier() {
     
    5360        }
    5461
    55         public static FramsClass getFramsClass() {
    56                 return new FramsClass("ListChange", "ListChange", null)
    57                                 .append(Param.build().id("type").name("type").type(new EnumParam(Arrays.asList("Add", "Remove", "Modify"))))
    58                                 .append(Param.build().id("id").name("identifier").type(StringParam.class))
    59                                 .append(Param.build().id("pos").name("position").type(DecimalParam.class));
    60         }
    61 
    6262        @Override
    6363        public String toString() {
Note: See TracChangeset for help on using the changeset viewer.