private List < IAtom > getUnion ( List < IAtom > list1 , List < IAtom > list2 ) { // FIXME: the JavaDoc does not describe what happens: that vec1 gets to be the union! // jm: pretty sure retainAll would do the trick here but don't want to change the // functionality as item only present in list1 are not removed (i.e. not union) List < IAtom > is = new ArrayList < IAtom > ( list1 ) ; for ( int f = list2 . size ( ) - 1 ; f > - 1 ; f -- ) { if ( ! list1 . contains ( list2 . get ( f ) ) ) is . add ( list2 . get ( f ) ) ; } return is ; }
Returns a Vector that contains the union of Vectors vec1 and vec2