| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
package h; |
| 47 |
|
| 48 |
import smetana.core.CString; |
| 49 |
import smetana.core.UnsupportedStructAndPtr; |
| 50 |
import smetana.core.__ptr__; |
| 51 |
import smetana.core.__struct__; |
| 52 |
import smetana.core.amiga.StarStruct; |
| 53 |
|
| 54 |
public class ST_Agrec_s extends UnsupportedStructAndPtr implements WithParent { |
| 55 |
|
| 56 |
public CString name; |
| 57 |
public ST_Agrec_s next; |
| 58 |
|
| 59 |
private final StarStruct parent; |
| 60 |
|
| 61 |
@Override |
| 62 |
public void copyDataFrom(__struct__ other) { |
| 63 |
if (other instanceof ST_Agedgeinfo_t && parent instanceof ST_Agedgeinfo_t) { |
| 64 |
parent.copyDataFrom(other); |
| 65 |
return; |
| 66 |
} |
| 67 |
ST_Agrec_s this2 = (ST_Agrec_s) other; |
| 68 |
this.name = this2.name; |
| 69 |
this.next = this2.next; |
| 70 |
} |
| 71 |
|
| 72 |
public ST_Agrec_s() { |
| 73 |
this(null); |
| 74 |
} |
| 75 |
|
| 76 |
public ST_Agrec_s(StarStruct parent) { |
| 77 |
this.parent = parent; |
| 78 |
} |
| 79 |
|
| 80 |
public StarStruct getParent() { |
| 81 |
return parent; |
| 82 |
} |
| 83 |
|
| 84 |
@Override |
| 85 |
public boolean isSameThan(StarStruct other) { |
| 86 |
ST_Agrec_s other2 = (ST_Agrec_s) other; |
| 87 |
return this == other2; |
| 88 |
} |
| 89 |
|
| 90 |
@Override |
| 91 |
public __ptr__ castTo(Class dest) { |
| 92 |
if (dest == ST_Agdatadict_s.class && getParent() instanceof ST_Agdatadict_s) { |
| 93 |
return (ST_Agdatadict_s) getParent(); |
| 94 |
} |
| 95 |
if (dest == ST_Agattr_s.class && getParent() instanceof ST_Agattr_s) { |
| 96 |
return (ST_Agattr_s) getParent(); |
| 97 |
} |
| 98 |
if (dest == ST_Agraphinfo_t.class && getParent() instanceof ST_Agraphinfo_t) { |
| 99 |
return (ST_Agraphinfo_t) getParent(); |
| 100 |
} |
| 101 |
if (dest == ST_Agnodeinfo_t.class && getParent() instanceof ST_Agnodeinfo_t) { |
| 102 |
return (ST_Agnodeinfo_t) getParent(); |
| 103 |
} |
| 104 |
if (dest == ST_Agedgeinfo_t.class && getParent() instanceof ST_Agedgeinfo_t) { |
| 105 |
return (ST_Agedgeinfo_t) getParent(); |
| 106 |
} |
| 107 |
System.err.println("dest=" + dest); |
| 108 |
System.err.println("getParent=" + getParent().getClass()); |
| 109 |
return super.castTo(dest); |
| 110 |
} |
| 111 |
|
| 112 |
public ST_Agnodeinfo_t castTo_ST_Agnodeinfo_t() { |
| 113 |
if (getParent() instanceof ST_Agnodeinfo_t) { |
| 114 |
return (ST_Agnodeinfo_t) getParent(); |
| 115 |
} |
| 116 |
throw new UnsupportedOperationException(); |
| 117 |
} |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
public ST_Agraphinfo_t castTo_ST_Agraphinfo_t() { |
| 122 |
if (getParent() instanceof ST_Agraphinfo_t) { |
| 123 |
return (ST_Agraphinfo_t) getParent(); |
| 124 |
} |
| 125 |
throw new UnsupportedOperationException(); |
| 126 |
} |
| 127 |
|
| 128 |
@Override |
| 129 |
public __ptr__ setPtr(String fieldName, __ptr__ newData) { |
| 130 |
if (fieldName.equals("name")) { |
| 131 |
this.name = (CString) newData; |
| 132 |
return name; |
| 133 |
} |
| 134 |
if (fieldName.equals("next")) { |
| 135 |
if (newData instanceof ST_Agrec_s) { |
| 136 |
this.next = (ST_Agrec_s) newData; |
| 137 |
} |
| 138 |
return next; |
| 139 |
} |
| 140 |
return super.setPtr(fieldName, newData); |
| 141 |
} |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
} |
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|