src/main/java/org/thegalactic/lattice/io/ArrowRelationSerializerTeX.java
public void write(final ArrowRelation arrow, final BufferedWriter file) throws IOException {
        final SortedSet<Edge> edges = arrow.getEdges();
        final TreeSet<Node> m = new TreeSet<Node>();
        final TreeSet<Node> j = new TreeSet<Node>();
        for (final Edge edge : edges) {
            m.add(edge.getSource());
            j.add(edge.getTarget());
        }

        file.write("\\begin{tabular}{|c|*{");
        file.write(String.valueOf(j.size()));
        file.write("}{c|}}");
        file.newLine();

        this.writeHline(file);

        for (final Node nj : j) {
            file.write(" & ");
            file.write(nj.getContent().toString());
        }
        this.writeEndOfLine(file);

        this.writeHline(file);

        for (final Node nm : m) {
            file.write(nm.getContent().toString());
            for (final Node nj : j) {
                final Edge edge = arrow.getEdge(nm, nj);
                if (arrow.isUp(edge)) {
                    file.write(" & $\\uparrow$");
                } else if (arrow.isDown(edge)) {
                    file.write(" & $\\downarrow$");
                } else if (arrow.isUpDown(edge)) {
                    file.write(" & $\\updownarrow$");
                } else if (arrow.isCross(edge)) {
                    file.write(" & $\\times$");
                } else {
                    file.write(" & $\\circ$");
                }
            }

            this.writeEndOfLine(file);

            this.writeHline(file);
        }

        file.write("\\end{tabular}");
        file.newLine();
    }
/**
     * Produces the LaTex source code for the array of arrows of this component.
     *
     * The LaTeX source produced isn't autonomous. It must be included in a
     * document.
     *
     * @param arrow an arrow relation to write
     * @param file  a file
     *
     * @throws IOException When an IOException occurs
     */
Produces the LaTex source code for the array of arrows of this component.
The LaTeX source produced isn't autonomous. It must be included in a
document.

@param arrow an arrow relation to write
@param file  a file


Produces the LaTex source code for the array of arrows of this component . The LaTeX source produced isn ' t autonomous . It must be included in a document . @param arrow an arrow relation to write @param file a file
public void write(final ArrowRelation arrow, final BufferedWriter file) throws IOException {
        final SortedSet<Edge> edges = arrow.getEdges();
        final TreeSet<Node> m = new TreeSet<Node>();
        final TreeSet<Node> j = new TreeSet<Node>();
        for (final Edge edge : edges) {
            m.add(edge.getSource());
            j.add(edge.getTarget());
        }
        file.write("\\begin{tabular}{|c|*{");
        file.write(String.valueOf(j.size()));
        file.write("}{c|}}");
        file.newLine();
        this.writeHline(file);
        for (final Node nj : j) {
            file.write(" & ");
            file.write(nj.getContent().toString());
        }
        this.writeEndOfLine(file);
        this.writeHline(file);
        for (final Node nm : m) {
            file.write(nm.getContent().toString());
            for (final Node nj : j) {
                final Edge edge = arrow.getEdge(nm, nj);
                if (arrow.isUp(edge)) {
                    file.write(" & $\\uparrow$");
                } else if (arrow.isDown(edge)) {
                    file.write(" & $\\downarrow$");
                } else if (arrow.isUpDown(edge)) {
                    file.write(" & $\\updownarrow$");
                } else if (arrow.isCross(edge)) {
                    file.write(" & $\\times$");
                } else {
                    file.write(" & $\\circ$");
                }
            }
            this.writeEndOfLine(file);
            this.writeHline(file);
        }
        file.write("\\end{tabular}");
        file.newLine();
    }
public void write ( final ArrowRelation arrow , final BufferedWriter file ) throws IOException { final SortedSet < Edge > edges = arrow . getEdges ( ) ; final TreeSet < Node > m = new TreeSet < Node > ( ) ; final TreeSet < Node > j = new TreeSet < Node > ( ) ; for ( final Edge edge : edges ) { m . add ( edge . getSource ( ) ) ; j . add ( edge . getTarget ( ) ) ; } file . write ( "\\begin{tabular}{|c|*{" ) ; file . write ( String . valueOf ( j . size ( ) ) ) ; file . write ( "}{c|}}" ) ; file . newLine ( ) ; this . writeHline ( file ) ; for ( final Node nj : j ) { file . write ( " & " ) ; file . write ( nj . getContent ( ) . toString ( ) ) ; } this . writeEndOfLine ( file ) ; this . writeHline ( file ) ; for ( final Node nm : m ) { file . write ( nm . getContent ( ) . toString ( ) ) ; for ( final Node nj : j ) { final Edge edge = arrow . getEdge ( nm , nj ) ; if ( arrow . isUp ( edge ) ) { file . write ( " & $\\uparrow$" ) ; } else if ( arrow . isDown ( edge ) ) { file . write ( " & $\\downarrow$" ) ; } else if ( arrow . isUpDown ( edge ) ) { file . write ( " & $\\updownarrow$" ) ; } else if ( arrow . isCross ( edge ) ) { file . write ( " & $\\times$" ) ; } else { file . write ( " & $\\circ$" ) ; } } this . writeEndOfLine ( file ) ; this . writeHline ( file ) ; } file . write ( "\\end{tabular}" ) ; file . newLine ( ) ; }
Produces the LaTex source code for the array of arrows of this component.
Produces the LaTex source code for the array of arrows of this component .