1 | package com.framsticks.model.f0; |
---|
2 | |
---|
3 | import java.util.ArrayList; |
---|
4 | import java.util.Collections; |
---|
5 | import java.util.List; |
---|
6 | |
---|
7 | import javax.annotation.concurrent.Immutable; |
---|
8 | |
---|
9 | import com.framsticks.params.FramsClass; |
---|
10 | import com.framsticks.params.annotations.FramsClassAnnotation; |
---|
11 | |
---|
12 | import static com.framsticks.util.Misc.throwIfNull; |
---|
13 | import static com.framsticks.util.Misc.returnNotNull; |
---|
14 | |
---|
15 | @Immutable |
---|
16 | @FramsClassAnnotation(id = "neuroclass", name = "neuroclass") |
---|
17 | public 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 | } |
---|