private void addCombinedOccurence(List<AttributeSource> originalAttributeSources,List<Attribute> unionAttributeList,MemoryExampleTable unionTable,Example leftExample,Example rightExample){
  double[] unionDataRow=new double[unionAttributeList.size()];
  int attributeIndex=0;
  for (  AttributeSource attributeSource : originalAttributeSources) {
    if (attributeSource.getSource() == AttributeSource.FIRST_SOURCE) {
      unionDataRow[attributeIndex]=leftExample.getValue(attributeSource.getAttribute());
    }
 else     if (attributeSource.getSource() == AttributeSource.SECOND_SOURCE) {
      unionDataRow[attributeIndex]=rightExample.getValue(attributeSource.getAttribute());
    }
    attributeIndex++;
  }
  unionTable.addDataRow(new DoubleArrayDataRow(unionDataRow));
}

private void addCombinedOccurence ( List < AttributeSource > originalAttributeSources , List < Attribute > unionAttributeList , MemoryExampleTable unionTable , Example leftExample , Example rightExample ) { double [ ] unionDataRow = new double [ unionAttributeList . size ( ) ] ; int attributeIndex = 0 ; for ( AttributeSource attributeSource : originalAttributeSources ) { if ( attributeSource . getSource ( ) == AttributeSource . FIRST_SOURCE ) { unionDataRow [ attributeIndex ] = leftExample . getValue ( attributeSource . getAttribute ( ) ) ; } else if ( attributeSource . getSource ( ) == AttributeSource . SECOND_SOURCE ) { unionDataRow [ attributeIndex ] = rightExample . getValue ( attributeSource . getAttribute ( ) ) ; } attributeIndex ++ ; } unionTable . addDataRow ( new DoubleArrayDataRow ( unionDataRow ) ) ; }
creates an example which consists of the combination of leftexample an rightexample . only those attributes are added , which are present in originalattributesources . the newly constructed example is added to uniontable .
