SemanticPropUtil { public static DualInputSemanticProperties addSourceFieldOffsets(DualInputSemanticProperties props, int numInputFields1, int numInputFields2, int offset1, int offset2) { DualInputSemanticProperties offsetProps = new DualInputSemanticProperties(); if(props.getReadFields(0) != null) { FieldSet offsetReadFields = new FieldSet(); for(int r : props.getReadFields(0)) { offsetReadFields = offsetReadFields.addField(r+offset1); } offsetProps.addReadFields(0, offsetReadFields); } if(props.getReadFields(1) != null) { FieldSet offsetReadFields = new FieldSet(); for(int r : props.getReadFields(1)) { offsetReadFields = offsetReadFields.addField(r+offset2); } offsetProps.addReadFields(1, offsetReadFields); } for(int s = 0; s < numInputFields1; s++) { FieldSet targetFields = props.getForwardingTargetFields(0, s); for(int t : targetFields) { offsetProps.addForwardedField(0, s + offset1, t); } } for(int s = 0; s < numInputFields2; s++) { FieldSet targetFields = props.getForwardingTargetFields(1, s); for(int t : targetFields) { offsetProps.addForwardedField(1, s + offset2, t); } } return offsetProps; } private  SemanticPropUtil(); static SingleInputSemanticProperties createProjectionPropertiesSingle(int[] fields, CompositeType<?> inType); static DualInputSemanticProperties createProjectionPropertiesDual(
			int[] fields, boolean[] isFromFirst, TypeInformation<?> inType1, TypeInformation<?> inType2); static SingleInputSemanticProperties addSourceFieldOffset(SingleInputSemanticProperties props,
																		int numInputFields, int offset); static DualInputSemanticProperties addSourceFieldOffsets(DualInputSemanticProperties props,
																	int numInputFields1, int numInputFields2,
																	int offset1, int offset2); static SingleInputSemanticProperties getSemanticPropsSingle(
			Set<Annotation> set, TypeInformation<?> inType, TypeInformation<?> outType); static DualInputSemanticProperties getSemanticPropsDual(
			Set<Annotation> set, TypeInformation<?> inType1, TypeInformation<?> inType2, TypeInformation<?> outType); static void getSemanticPropsSingleFromString(SingleInputSemanticProperties result,
														String[] forwarded, String[] nonForwarded, String[] readSet,
														TypeInformation<?> inType, TypeInformation<?> outType); static void getSemanticPropsSingleFromString(SingleInputSemanticProperties result,
			String[] forwarded, String[] nonForwarded, String[] readSet,
			TypeInformation<?> inType, TypeInformation<?> outType,
			boolean skipIncompatibleTypes); static void getSemanticPropsDualFromString(DualInputSemanticProperties result,
			String[] forwardedFirst, String[] forwardedSecond,
			String[] nonForwardedFirst, String[] nonForwardedSecond, String[]
			readFieldsFirst, String[] readFieldsSecond,
			TypeInformation<?> inType1, TypeInformation<?> inType2, TypeInformation<?> outType); static void getSemanticPropsDualFromString(DualInputSemanticProperties result,
			String[] forwardedFirst, String[] forwardedSecond,
			String[] nonForwardedFirst, String[] nonForwardedSecond, String[]
			readFieldsFirst, String[] readFieldsSecond,
			TypeInformation<?> inType1, TypeInformation<?> inType2, TypeInformation<?> outType,
			boolean skipIncompatibleTypes);  }
@Test public void testAddSourceFieldOffsets() { DualInputSemanticProperties semProps = new DualInputSemanticProperties(); semProps.addForwardedField(0, 0, 1); semProps.addForwardedField(0, 3, 3); semProps.addForwardedField(1, 1, 2); semProps.addForwardedField(1, 1, 4); semProps.addReadFields(0, new FieldSet(1, 2)); semProps.addReadFields(1, new FieldSet(0, 3, 4)); DualInputSemanticProperties offsetProps = SemanticPropUtil.addSourceFieldOffsets(semProps, 4, 3, 1, 2); assertTrue(offsetProps.getForwardingTargetFields(0, 0).size() == 0); assertTrue(offsetProps.getForwardingTargetFields(0, 1).size() == 1); assertTrue(offsetProps.getForwardingTargetFields(0, 1).contains(1)); assertTrue(offsetProps.getForwardingTargetFields(0, 2).size() == 0); assertTrue(offsetProps.getForwardingTargetFields(0, 3).size() == 0); assertTrue(offsetProps.getForwardingTargetFields(0, 4).size() == 1); assertTrue(offsetProps.getForwardingTargetFields(0, 4).contains(3)); assertTrue(offsetProps.getForwardingTargetFields(1, 0).size() == 0); assertTrue(offsetProps.getForwardingTargetFields(1, 1).size() == 0); assertTrue(offsetProps.getForwardingTargetFields(1, 2).size() == 0); assertTrue(offsetProps.getForwardingTargetFields(1, 3).size() == 2); assertTrue(offsetProps.getForwardingTargetFields(1, 3).contains(2)); assertTrue(offsetProps.getForwardingTargetFields(1, 3).contains(4)); assertTrue(offsetProps.getReadFields(0).size() == 2); assertTrue(offsetProps.getReadFields(0).contains(2)); assertTrue(offsetProps.getReadFields(0).contains(3)); assertTrue(offsetProps.getReadFields(1).size() == 3); assertTrue(offsetProps.getReadFields(1).contains(2)); assertTrue(offsetProps.getReadFields(1).contains(5)); assertTrue(offsetProps.getReadFields(1).contains(6)); semProps = new DualInputSemanticProperties(); SemanticPropUtil.addSourceFieldOffsets(semProps, 4, 3, 2, 2); }