public void apply(final double[] src,int srcPos,double[] target,int targetPos,int off,int len){
  if (len < 0 || off < 0 || off + len > window.length)   throw new IllegalArgumentException("Requested offset " + off + " or length "+ len+ " does not fit into window length "+ window.length);
  if (target.length < targetPos + len)   throw new IllegalArgumentException("Target array cannot hold enough data");
  int start, end;
  start=srcPos;
  if (start < 0) {
    start=0;
    Arrays.fill(target,targetPos,targetPos + (start - srcPos),0);
  }
  end=srcPos + len;
  if (end > src.length) {
    end=src.length;
    Arrays.fill(target,targetPos + end - srcPos,targetPos + len,0);
  }
  for (int i=start; i < end; i++) {
    target[targetPos + i - srcPos]=src[i] * window[off + i - srcPos];
  }
}

public void apply ( final double [ ] src , int srcPos , double [ ] target , int targetPos , int off , int len ) { if ( len < 0 || off < 0 || off + len > window . length ) throw new IllegalArgumentException ( "Requested offset " + off + " or length " + len + " does not fit into window length " + window . length ) ; if ( target . length < targetPos + len ) throw new IllegalArgumentException ( "Target array cannot hold enough data" ) ; int start , end ; start = srcPos ; if ( start < 0 ) { start = 0 ; Arrays . fill ( target , targetPos , targetPos + ( start - srcPos ) , 0 ) ; } end = srcPos + len ; if ( end > src . length ) { end = src . length ; Arrays . fill ( target , targetPos + end - srcPos , targetPos + len , 0 ) ; } for ( int i = start ; i < end ; i ++ ) { target [ targetPos + i - srcPos ] = src [ i ] * window [ off + i - srcPos ] ; } }
apply a part of this window on the given source data array , at the given position . for example , by setting off to getlength ( ) / 2 and len to getlength ( ) / 2 , only the right half of the window will be applied . this method returns the resulting data in the given target array , at the target position given by targetpos . if src has less than len data points left at srcpos , zeros are added at the end .
