source: java/main/src/main/java/com/framsticks/structure/Node.java @ 105

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

HIGHLIGHTS:

  • import refactorization: move Tree, Path, etc.

from core to structure package

  • initial serialization implementation
  • improve PrimeExperiment? test
  • many organizational changes and convenience improvements

CHANGELOG:
Make registry in AbstractTree? final.

Move most classes from core to structure package.

Minor changes.

Switch names of Future and FutureHandler?.

Rename ExceptionResultHandler? to ExceptionHandler?.

Rename ExceptionHandler? to ExceptionDispatcherHandler?.

Fix bug in ParamCandidate? cache.

Add missing synchronization to the BufferedDispatcher?.

Develop @Serialized support.

Rework serialization further.

Add serialization/deserialization interface to ValueParam?.

Move getStorageType and isNumeric from Param down to params hierarchy.

Minor changes.

Improve param type induction.

Add TestSerializedClass? for testing new serialization.

Add info files gor GenePool? and Population.

Add standard.expt exemplary netfile.

Add type name field to PropertiesObject?.

Use PropertiesObject? for PropertiesAccess? instead of ordinary map.

Hide getFramsClass is several more places.

More unification accross FramsClass?, Access and Path.

Add ParamCollection?.

Simplify interface for getting params from FramsClass?, Access
or Path.

Make Access.call() interface variadic.

Add arguments(args) convenience wrapper around new Object[] {args}.

Upgrade to apache.commons.lang version 3.1

Minor improvement with Response constructors.

Develop proper result printing in ClientAtServer?.

Add experimentNetsave to PrimeExperiment?.

File size: 1.1 KB
Line 
1package com.framsticks.structure;
2
3import javax.annotation.Nonnull;
4import javax.annotation.concurrent.Immutable;
5
6import com.framsticks.params.CompositeParam;
7import com.framsticks.util.FramsticksException;
8// import com.framsticks.params.ParamBuilder;
9import com.framsticks.util.lang.Strings;
10
11/**
12 * @author Piotr Sniegowski
13 */
14@Immutable
15public class Node {
16
17        protected final Tree tree;
18        protected final CompositeParam param;
19        protected final Object object;
20
21        public Node(Tree tree, @Nonnull CompositeParam param, Object object) {
22                assert param != null;
23                assert tree != null;
24                this.tree = tree;
25                this.param = param;
26                this.object = object;
27        }
28
29
30        public final Tree getTree() {
31                return tree;
32        }
33
34        public final CompositeParam getParam() {
35                return param;
36        }
37
38        public final Object getObject() {
39                return object;
40        }
41
42        @Override
43        public String toString() {
44                return param.toString() + ":" + Strings.toStringNullProof(object, "<null>");
45        }
46
47        public final boolean isResolved() {
48                return object != null;
49        }
50
51        public Node assureResolved() {
52                if (!isResolved()) {
53                        throw new FramsticksException().msg("path is not resolved").arg("node", this);
54                }
55                return this;
56        }
57
58}
Note: See TracBrowser for help on using the repository browser.