Debian Codegraph @

src/h/ST_Agsubnode_s.java

raw symbols SCIP
1 /* ========================================================================
2 * PlantUML : a free UML diagram generator
3 * ========================================================================
4 *
5 * Project Info: http://plantuml.com
6 *
7 * If you like this project or if you find it useful, you can support us at:
8 *
9 * http://plantuml.com/patreon (only 1$ per month!)
10 * http://plantuml.com/paypal
11 *
12 * This file is part of Smetana.
13 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
14 *
15 * (C) Copyright 2009-2020, Arnaud Roques
16 *
17 * This translation is distributed under the same Licence as the original C program:
18 *
19 *************************************************************************
20 * Copyright (c) 2011 AT&T Intellectual Property
21 * All rights reserved. This program and the accompanying materials
22 * are made available under the terms of the Eclipse Public License v1.0
23 * which accompanies this distribution, and is available at
24 * http://www.eclipse.org/legal/epl-v10.html
25 *
26 * Contributors: See CVS logs. Details at http://www.graphviz.org/
27 *************************************************************************
28 *
29 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
30 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
31 *
32 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
33 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
34 *
35 * You may obtain a copy of the License at
36 *
37 * http://www.eclipse.org/legal/epl-v10.html
38 *
39 * Unless required by applicable law or agreed to in writing, software
40 * distributed under the License is distributed on an "AS IS" BASIS,
41 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42 * See the License for the specific language governing permissions and
43 * limitations under the License.
44 *
45 */
46 package h;
47
48 import smetana.core.HardcodedStruct;
49 import smetana.core.OFFSET;
50 import smetana.core.UnsupportedStructAndPtr;
51 import smetana.core.__ptr__;
52 import smetana.core.amiga.StarStruct;
53
54 public class ST_Agsubnode_s extends UnsupportedStructAndPtr implements HardcodedStruct {
55
56 public final ST_dtlink_s seq_link = new ST_dtlink_s(this);
57 public final ST_dtlink_s id_link = new ST_dtlink_s(this);
58 public ST_Agnode_s node;
59 public ST_dtlink_s in_id;
60 public ST_dtlink_s out_id;
61 public ST_dtlink_s in_seq;
62 public ST_dtlink_s out_seq;
63
64 public ST_Agsubnode_s() {
65 this(null);
66 }
67
68 public ST_Agsubnode_s(StarStruct parent) {
69 }
70
71 public ST_Agsubnode_s from_id_link(ST_dtlink_s from) {
72 if (from == id_link) {
73 return this;
74 }
75 throw new IllegalArgumentException();
76 }
77
78 public ST_Agsubnode_s from_seq_link(ST_dtlink_s from) {
79 if (from == seq_link) {
80 return this;
81 }
82 throw new IllegalArgumentException();
83 }
84
85 @Override
86 public boolean isSameThan(StarStruct other) {
87 return this == (ST_Agsubnode_s) other;
88 }
89
90 @Override
91 public Object addVirtualBytes(int virtualBytes) {
92 if (virtualBytes == 0) {
93 return this;
94 }
95 final OFFSET offset = OFFSET.fromInt(virtualBytes);
96 if (offset.toString().equals("h.ST_Agsubnode_s::id_link")) {
97 return id_link;
98 }
99 if (offset.toString().equals("h.ST_Agsubnode_s::seq_link")) {
100 return seq_link;
101 }
102 System.err.println("virtualBytes=" + virtualBytes);
103 System.err.println("offset=" + offset);
104 return super.addVirtualBytes(virtualBytes);
105 }
106
107 @Override
108 public __ptr__ castTo(Class dest) {
109 if (dest == ST_Agsubnode_s.class) {
110 return ST_Agsubnode_s.this;
111 }
112 System.err.println("dest=" + dest);
113 return super.castTo(dest);
114 }
115
116 @Override
117 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
118 if (fieldName.equals("node")) {
119 this.node = (ST_Agnode_s) newData;
120 return node;
121 }
122 if (fieldName.equals("in_id")) {
123 this.in_id = (h.ST_dtlink_s) newData;
124 return in_id;
125 }
126 if (fieldName.equals("out_seq")) {
127 this.out_seq = (h.ST_dtlink_s) newData;
128 return out_seq;
129 }
130 if (fieldName.equals("out_id")) {
131 this.out_id = (h.ST_dtlink_s) newData;
132 return out_id;
133 }
134 if (fieldName.equals("seq_link")) {
135 this.seq_link.copyDataFrom(newData);
136 return seq_link;
137 }
138 if (fieldName.equals("in_seq")) {
139 this.in_seq = (h.ST_dtlink_s) newData;
140 return in_seq;
141 }
142 return super.setPtr(fieldName, newData);
143 }
144
145
146 // public interface ST_Agsubnode_s extends __ptr__ {
147 // public static List<String> DEFINITION = Arrays.asList(
148 // "struct Agsubnode_s",
149 // "{",
150 // "Dtlink_t seq_link",
151 // "Dtlink_t id_link",
152 // "Agnode_t *node",
153 // "Dtlink_t *in_id, *out_id",
154 // "Dtlink_t *in_seq, *out_seq",
155 // "}");
156 }
157
158 // struct Agsubnode_s { /* the node-per-graph-or-subgraph record */
159 // Dtlink_t seq_link; /* must be first */
160 // Dtlink_t id_link;
161 // Agnode_t *node; /* the object */
162 // Dtlink_t *in_id, *out_id; /* by node/ID for random access */
163 // Dtlink_t *in_seq, *out_seq; /* by node/sequence for serial access */
164 // };