if (!(inputType instanceof RecordType)) {
return BaseType.UNKNOWN;
}
RecordType recordType = (RecordType) inputType;
Map outputMap = new HashMap();
Set recordLabels = recordType.labelSet();
Iterator iterator = recordLabels.iterator();
while (iterator.hasNext()) {
String label = (String) iterator.next();
Type type = recordType.get(label);
outputMap.put(label, type);
}
List inputPorts = inputPortList();
iterator = inputPorts.iterator();
while (iterator.hasNext()) {
TypedIOPort port = (TypedIOPort) iterator.next();
if (port != input) {
outputMap.put(port.getName(), port.getType());
}
}
// Construct the RecordType
Object[] labelsObj = outputMap.keySet().toArray();
String[] labels = new String[labelsObj.length];
Type[] types = new Type[labelsObj.length];
for (int i = 0; i < labels.length; i++) {
labels[i] = (String) labelsObj[i];
types[i] = (Type) outputMap.get(labels[i]);
}
return new RecordType(labels, types);
}