com.dxfeed.ipf.transform
Class InstrumentProfileTransform

java.lang.Object
  extended by com.dxfeed.ipf.transform.InstrumentProfileTransform

public class InstrumentProfileTransform
extends java.lang.Object

Reads, compiles and executes instrument profile transform programs. Please see Instrument Profile Format documentation for complete description.

The correct way to use InstrumentProfileTransform is as follows:

 // Create new instance and read some transform:
 InstrumentProfileTransform transform = new InstrumentProfileTransform();
 transform.readFromFile(file);
 // Execute transform and optionally print statistics as many times as needed:
 profiles = transform.transform(profiles);
 for (String s : transform.getStatistics())
     System.out.println(s);
 


Constructor Summary
InstrumentProfileTransform()
           
 
Method Summary
 java.util.List<java.lang.String> getStatistics()
          Returns execution statistics of the transform.
 void read(java.io.InputStream in)
          Reads transform from specified stream.
 void readFromFile(java.lang.String file)
          Reads transform from specified file.
 java.util.List<InstrumentProfile> transform(java.util.List<InstrumentProfile> profiles)
          Executes compiled transform on specified instrument profiles and returns transformed profiles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstrumentProfileTransform

public InstrumentProfileTransform()
Method Detail

readFromFile

public void readFromFile(java.lang.String file)
                  throws java.io.IOException,
                         TransformCompilationException
Reads transform from specified file.

Throws:
TransformCompilationException - if input stream does not conform to the transform syntax
java.io.IOException - If an I/O error occurs

read

public void read(java.io.InputStream in)
          throws java.io.IOException,
                 TransformCompilationException
Reads transform from specified stream.

Throws:
TransformCompilationException - if input stream does not conform to the transform syntax
java.io.IOException - If an I/O error occurs

transform

public java.util.List<InstrumentProfile> transform(java.util.List<InstrumentProfile> profiles)
Executes compiled transform on specified instrument profiles and returns transformed profiles. All profiles that require modification are copied beforehand.


getStatistics

public java.util.List<java.lang.String> getStatistics()
Returns execution statistics of the transform. The statistics is presented as a list of lines of original transform program each preceded with a counter of how many times modifying statements on that line were applied to instrument profiles.