source: java/main/src/main/java/com/framsticks/model/f0/NeuroClass.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1package com.framsticks.model.f0;
2
3import java.util.ArrayList;
4import java.util.Collections;
5import java.util.List;
6
7import javax.annotation.concurrent.Immutable;
8
9import com.framsticks.params.FramsClass;
10import com.framsticks.params.annotations.FramsClassAnnotation;
11
12import static com.framsticks.util.Misc.throwIfNull;
13import static com.framsticks.util.Misc.returnNotNull;
14
15@Immutable
16@FramsClassAnnotation(id = "neuroclass", name = "neuroclass")
17public class NeuroClass extends FramsClass {
18
19
20        public NeuroClass(NeuroClassBuilder builder) {
21                super(builder);
22
23                preferredInputs = throwIfNull(builder.getPreferredInputs());
24                preferredOutput = throwIfNull(builder.getPreferredOutput());
25                preferredLocation = throwIfNull(builder.getPreferredLocation());
26                visualHints = returnNotNull(builder.getVisualHints(), 0);
27
28                if (builder.getSymbolGlyph() != null) {
29                        symbolGlyph = new ArrayList<>();
30                        for (String s : builder.getSymbolGlyph().split(",")) {
31                                symbolGlyph.add(Integer.valueOf(s));
32                        }
33                } else {
34                        symbolGlyph = null;
35                }
36
37        }
38
39        protected final int preferredInputs;
40
41        protected final int preferredOutput;
42
43        protected final int preferredLocation;
44
45        protected final int visualHints;
46
47        protected final List<Integer> symbolGlyph;
48
49        /**
50         * @return the preferredInputs
51         */
52        public int getPreferredInputs() {
53                return preferredInputs;
54        }
55
56        /**
57         * @return the preferredOutput
58         */
59        public int getPreferredOutput() {
60                return preferredOutput;
61        }
62
63        /**
64         * @return the preferredLocation
65         */
66        public int getPreferredLocation() {
67                return preferredLocation;
68        }
69
70        /**
71         * @return the visualHints
72         */
73        public int getVisualHints() {
74                return visualHints;
75        }
76
77        /**
78         * @return the symbolGlyph
79         */
80        public List<Integer> getSymbolGlyph() {
81                return Collections.unmodifiableList(symbolGlyph);
82        }
83
84}
Note: See TracBrowser for help on using the repository browser.