com.softsynth.jmsl.score.transforms
Class ZipperTransform

java.lang.Object
  extended by com.softsynth.jmsl.score.BinaryCopyBufferTransform
      extended by com.softsynth.jmsl.score.transforms.ZipperTransform

public class ZipperTransform
extends BinaryCopyBufferTransform

ZipperTransform.
Operate on two copy buffers, send output to a third copyBuffer. Presumably, the third is Score.copyBuffer which is used by paste() JMSL Notation Project

Author:
Nick Didkovsky, copyright 2000 Nick Didkovsky, all rights reserved

Field Summary
static java.lang.String copyright
           
 
Constructor Summary
ZipperTransform()
           
 
Method Summary
 void operate(CopyBuffer fromBuffer1, CopyBuffer fromBuffer2, CopyBuffer toBuffer)
          Operate on CopyBuffer source1 & source2, sending result to CopyBuffer result.
 
Methods inherited from class com.softsynth.jmsl.score.BinaryCopyBufferTransform
getName, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
See Also:
Constant Field Values
Constructor Detail

ZipperTransform

public ZipperTransform()
Method Detail

operate

public void operate(CopyBuffer fromBuffer1,
                    CopyBuffer fromBuffer2,
                    CopyBuffer toBuffer)
Operate on CopyBuffer source1 & source2, sending result to CopyBuffer result. Don't forget to result.removeAllElements() first!
 
 
      Example:
 
      // interleave every other element
      public void operate(CopyBuffer fromBuffer1, CopyBuffer fromBuffer2, CopyBuffer toBuffer) {
      toBuffer.removeAllElements();
      Enumeration e1=fromBuffer1.elements();
      Enumeration e2=fromBuffer2.elements();
      
      while (e1.hasMoreElements() || e2.hasMoreElements()) {
      if (e1.hasMoreElements()) toBuffer.addElement(e1.nextElement());
      if (e2.hasMoreElements()) toBuffer.addElement(e2.nextElement());
      }
      }
 
 
      
 

Specified by:
operate in class BinaryCopyBufferTransform