class SemanticPropUtil {

	public static SingleInputSemanticProperties createProjectionPropertiesSingle(int[] fields, CompositeType<?> inType)
	{

		Character.isJavaIdentifierStart(1);

		SingleInputSemanticProperties ssp = new SingleInputSemanticProperties();

		int[] sourceOffsets = new int[inType.getArity()];
		sourceOffsets[0] = 0;
		for(int i=1; i<inType.getArity(); i++) {
			sourceOffsets[i] = inType.getTypeAt(i-1).getTotalFields() + sourceOffsets[i-1];
		}

		int targetOffset = 0;
		for(int i=0; i<fields.length; i++) {
			int sourceOffset = sourceOffsets[fields[i]];
			int numFieldsToCopy = inType.getTypeAt(fields[i]).getTotalFields();

			for(int j=0; j<numFieldsToCopy; j++) {
				ssp.addForwardedField(sourceOffset+j, targetOffset+j);
			}
			targetOffset += numFieldsToCopy;
		}

		return ssp;
	}

	private  SemanticPropUtil();

}