public SetOperation build ( final Family family , final WritableMemory dstMem ) { SetOperation setOp = null ; switch ( family ) { case UNION : { if ( dstMem == null ) { setOp = UnionImpl . initNewHeapInstance ( bLgNomLongs , bSeed , bP , bRF ) ; } else { setOp = UnionImpl . initNewDirectInstance ( bLgNomLongs , bSeed , bP , bRF , bMemReqSvr , dstMem ) ; } break ; } case INTERSECTION : { if ( dstMem == null ) { setOp = IntersectionImpl . initNewHeapInstance ( bSeed ) ; } else { setOp = IntersectionImpl . initNewDirectInstance ( bSeed , dstMem ) ; } break ; } case A_NOT_B : { if ( dstMem == null ) { setOp = new HeapAnotB ( bSeed ) ; } else { throw new SketchesArgumentException ( "AnotB is a stateless operation and cannot be persisted." ) ; } break ; } default : throw new SketchesArgumentException ( "Given Family cannot be built as a SetOperation: " + family . toString ( ) ) ; } return setOp ; }
Returns a SetOperation with the current configuration of this Builder the given Family and the given destination memory . Note that the destination memory cannot be used with AnotB .