Package ptolemy.domains.metroII.kernel
Class MappingConstraintReaderWriter
- java.lang.Object
-
- ptolemy.domains.metroII.kernel.MappingConstraintReaderWriter
-
public class MappingConstraintReaderWriter extends java.lang.Object
MappingConstraintReaderWriter provides methods to read or write mapping constraints from or to a csv file.- Since:
- Ptolemy II 11.0
- Version:
- $Id: MappingConstraintReaderWriter.java 68172 2014-01-22 02:03:40Z glp $
- Author:
- Liangpeng Guo
- Pt.AcceptedRating:
- Red (glp)
- Pt.ProposedRating:
- Red (glp)
-
-
Constructor Summary
Constructors Constructor Description MappingConstraintReaderWriter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.LinkedList<Pair<java.lang.String,java.lang.String>>
readConstraints(java.lang.String buffer)
Returns a list of mapping constraints.static java.lang.String
readMappingFile(java.lang.String filename)
Reads mapping constraints from a file.static void
writeMappingFile(java.io.File file, java.lang.String content)
Writes content to mapping file.
-
-
-
Method Detail
-
readMappingFile
public static java.lang.String readMappingFile(java.lang.String filename) throws java.io.IOException
Reads mapping constraints from a file. MappingConstraintSolver- Parameters:
filename
- Filename of the mapping constraint file.- Returns:
- the constraint file in a string.
- Throws:
java.io.IOException
- a failed or interrupted I/O operations has occurred.
-
readConstraints
public static java.util.LinkedList<Pair<java.lang.String,java.lang.String>> readConstraints(java.lang.String buffer)
Returns a list of mapping constraints.- Parameters:
buffer
- constraints in a string.- Returns:
- a list of mapping constraints.
-
writeMappingFile
public static void writeMappingFile(java.io.File file, java.lang.String content) throws java.io.IOException
Writes content to mapping file.- Parameters:
file
- The mapping file to be written.content
- the content to save to the mapping file.- Throws:
java.io.IOException
- If a failed or interrupted I/O operations has occurred.
-
-