Package be.ac.ulg.montefiore.run.jahmm.io

Source Code of be.ac.ulg.montefiore.run.jahmm.io.OpdfIntegerWriter

/*
* Copyright (c) 2004-2009, Jean-Marc François. All Rights Reserved.
* Licensed under the New BSD license.  See the LICENSE file.
*/

package be.ac.ulg.montefiore.run.jahmm.io;

import java.io.IOException;
import java.io.Writer;

import be.ac.ulg.montefiore.run.jahmm.ObservationInteger;
import be.ac.ulg.montefiore.run.jahmm.OpdfInteger;

/**
* This class can write a textual description of an {@link OpdfInteger}.
* It is compatible with {@link OpdfIntegerReader}.
*/
public class OpdfIntegerWriter
extends OpdfWriter<OpdfInteger>
{
  public void write(Writer writer, OpdfInteger opdf)
  throws IOException
  {
    String s = "IntegerOPDF [";
   
    for (int i = 0; i < opdf.nbEntries(); i++)
      s += opdf.probability(new ObservationInteger(i)) + " ";
     
    writer.write(s + "]\n");
  }
}
TOP

Related Classes of be.ac.ulg.montefiore.run.jahmm.io.OpdfIntegerWriter

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.