if (tokens[8] != null & tokens[9] != null) {
if (tokens[9].equals("rest")) {
tuple.setRest(true);
} else {
tuple.addElement(tokens[8],
new PrimitiveSType(tokens[9]));
}
}
input.remove(tokens[2]);
peInputDescriptor2.setSType(tuple);
input.put(tokens[2], peInputDescriptor2);
}
if (peInputDescriptor2.getSType() instanceof ArraySType) {
ArraySType array = (ArraySType) peInputDescriptor2
.getSType();
if (array.getType() instanceof TupleSType) {
TupleSType tuple = (TupleSType) array
.getType();
if (tokens[12] != null & tokens[13] != null) {
if (tokens[13].equals("rest")) {
tuple.setRest(true);
} else {
tuple.addElement(tokens[12],
new PrimitiveSType(
tokens[13]));
}
}
input.remove(tokens[2]);
ArraySType array2 = new ArraySType(tuple,
array.getSize());
peInputDescriptor2.setSType(array2);
input.put(tokens[2], peInputDescriptor2);
}
}
if (peInputDescriptor2.getSType() instanceof ListSType) {
ListSType list = (ListSType) peInputDescriptor2
.getSType();
if (list.getChildType() instanceof TupleSType) {
TupleSType tuple = (TupleSType) list
.getChildType();
if (tokens[15] != null & tokens[16] != null) {
if (tokens[16].equals("rest")) {
tuple.setRest(true);
} else {
tuple.addElement(tokens[15],
new PrimitiveSType(
tokens[16]));
}
}
input.remove(tokens[2]);
ListSType list2 = new ListSType(tuple);
peInputDescriptor2.setSType(list2);
input.put(tokens[2], peInputDescriptor2);
}
}
}
}
} else {
input = new HashMap<String, ProcessingElementInputDescriptor>();
if (tokens[2] != null) {
ProcessingElementInputDescriptor peInputDescriptor2 = null;
// check for data source input
if (tokens[4] != null) {
if (tokens[4].equals("true")) {
peInputDescriptor2 = new ProcessingElementInputDescriptor(
tokens[2], true);
}
}
peInputDescriptor2 = new ProcessingElementInputDescriptor(
tokens[2]);
// check for input SType
if (tokens[5] != null) {
getInputSType(tokens, 5, peInputDescriptor2);
}
// check for input DType
if (tokens[6] != null) {
peInputDescriptor2.setDType(new SimpleDType(
tokens[6]));
}
input.put(peInputDescriptor2.getName(),
peInputDescriptor2);
}
peInputs.put(keyList, input.values());
}
// getting PE outputs
if (peOutputs.keySet().contains(keyList)) {
if (tokens[3] != null) {
if (!output.containsKey(tokens[3])) {
ProcessingElementOutputDescriptor peOutputDescriptor2 = new ProcessingElementOutputDescriptor(
tokens[3]);
// output STypeOut
if (tokens[17] != null) {
getOutputSType(tokens, 17, peOutputDescriptor2);
}
// output DTypeOut
if (tokens[19] != null) {
peOutputDescriptor2.setDType(new SimpleDType(
tokens[19]));
}
output.put(peOutputDescriptor2.getName(),
peOutputDescriptor2);
peOutputs.put(keyList, output.values());
} else {
// the output already exists. We have to add new
// information. We do not have to create a new
// descriptor.
ProcessingElementOutputDescriptor peOutputDescriptor2 = null;
peOutputDescriptor2 = output.get(tokens[3]);
if (peOutputDescriptor2.getSType() instanceof TupleSType) {
TupleSType tuple = (TupleSType) peOutputDescriptor2
.getSType();
if (tokens[20] != null & tokens[21] != null) {
if (tokens[21].equals("rest")) {
tuple.setRest(true);
} else {
tuple.addElement(tokens[20],
new PrimitiveSType(tokens[21]));
}
}
output.remove(tokens[3]);
peOutputDescriptor2.setSType(tuple);
output.put(tokens[3], peOutputDescriptor2);
}
if (peOutputDescriptor2.getSType() instanceof ArraySType) {
ArraySType array = (ArraySType) peOutputDescriptor2
.getSType();
if (array.getType() instanceof TupleSType) {
TupleSType tuple = (TupleSType) array
.getType();
if (tokens[24] != null & tokens[25] != null) {
if (tokens[25].equals("rest")) {
tuple.setRest(true);
} else {
tuple.addElement(tokens[24],
new PrimitiveSType(
tokens[25]));
}
tuple.addElement(tokens[24],
new PrimitiveSType(tokens[25]));
}
input.remove(tokens[3]);
ArraySType array2 = new ArraySType(tuple,
array.getSize());
peOutputDescriptor2.setSType(array2);
output.put(tokens[3], peOutputDescriptor2);
}
}
if (peOutputDescriptor2.getSType() instanceof ListSType) {
ListSType list = (ListSType) peOutputDescriptor2
.getSType();
if (list.getChildType() instanceof TupleSType) {
TupleSType tuple = (TupleSType) list
.getChildType();
if (tokens[27] != null & tokens[28] != null) {
if (tokens[28].equals("rest")) {
tuple.setRest(true);
} else {
tuple.addElement(tokens[27],
new PrimitiveSType(
tokens[28]));
}
// tuple.addElement(tokens[27],
// new PrimitiveSType(tokens[28]));
}