org.uacalc.io
Class AlgebraIO

java.lang.Object
  extended by org.uacalc.io.AlgebraIO

public final class AlgebraIO
extends java.lang.Object

Reader and writers.

Version:
$Id: AlgebraIO.java,v 1.8 2011/04/04 05:41:53 ralphfreese Exp $
Author:
Ralph Freese

Method Summary
static void convertToXML(java.io.File f)
          Read in a file like foo.alg file and output foo.xml.
static void convertToXML(java.lang.String f)
          Read in a file like foo.alg file and output foo.xml.
static void main(java.lang.String[] args)
           
static int parseLine(java.lang.String line)
          Parses the line as a single int but if it starts with "%" it returns -1 so we can have comments.
static SmallAlgebra readAlgebraFile(java.io.File f)
           
static SmallAlgebra readAlgebraFile(java.lang.String f)
           
static SmallAlgebra readAlgebraFromStream(java.io.InputStream is)
           
static java.util.List<SmallAlgebra> readAlgebraListFile(java.io.File f)
           
static java.util.List<SmallAlgebra> readAlgebraListFile(java.lang.String f)
           
static SmallAlgebra readAlgebraListFromStream(java.io.InputStream is)
           
static java.util.List<java.util.List<java.lang.Integer>> readDepth2List(java.io.BufferedReader in, java.lang.String start, java.lang.String end)
           
static Operation readOp(int arity, int size, java.io.BufferedReader in)
           
static SmallAlgebra readProjectivePlane(java.io.BufferedReader in)
          Define a ternary ring from a plane as given at http://math.uwyo.edu/~moorhous/pub/planes/.
static SmallAlgebra readProjectivePlane(java.io.File f)
           
static SmallAlgebra readProjectivePlane(java.io.InputStream f)
           
static SmallAlgebra readProjectivePlane(java.lang.String f)
           
static void writeAlgebraFile(SmallAlgebra alg, java.io.File f)
           
static void writeAlgebraFile(SmallAlgebra alg, java.io.File f, boolean oldStyle)
           
static void writeAlgebraFile(SmallAlgebra alg, java.lang.String f)
           
static void writeAlgebraFile(SmallAlgebra alg, java.lang.String f, boolean oldStyle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseLine

public static int parseLine(java.lang.String line)
Parses the line as a single int but if it starts with "%" it returns -1 so we can have comments.


readAlgebraFile

public static SmallAlgebra readAlgebraFile(java.lang.String f)
                                    throws java.io.IOException,
                                           BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException

readAlgebraFile

public static SmallAlgebra readAlgebraFile(java.io.File f)
                                    throws java.io.IOException,
                                           BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException

readAlgebraFromStream

public static SmallAlgebra readAlgebraFromStream(java.io.InputStream is)
                                          throws java.io.IOException,
                                                 BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException

readAlgebraListFile

public static java.util.List<SmallAlgebra> readAlgebraListFile(java.lang.String f)
                                                        throws java.io.IOException,
                                                               BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException

readAlgebraListFile

public static java.util.List<SmallAlgebra> readAlgebraListFile(java.io.File f)
                                                        throws java.io.IOException,
                                                               BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException

readAlgebraListFromStream

public static SmallAlgebra readAlgebraListFromStream(java.io.InputStream is)
                                              throws java.io.IOException,
                                                     BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException

readOp

public static Operation readOp(int arity,
                               int size,
                               java.io.BufferedReader in)
                        throws java.io.IOException,
                               BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException

readDepth2List

public static java.util.List<java.util.List<java.lang.Integer>> readDepth2List(java.io.BufferedReader in,
                                                                               java.lang.String start,
                                                                               java.lang.String end)

convertToXML

public static void convertToXML(java.lang.String f)
                         throws java.io.IOException,
                                BadAlgebraFileException
Read in a file like foo.alg file and output foo.xml.

Throws:
java.io.IOException
BadAlgebraFileException

convertToXML

public static void convertToXML(java.io.File f)
                         throws java.io.IOException,
                                BadAlgebraFileException
Read in a file like foo.alg file and output foo.xml.

Throws:
java.io.IOException
BadAlgebraFileException

writeAlgebraFile

public static void writeAlgebraFile(SmallAlgebra alg,
                                    java.lang.String f)
                             throws java.io.IOException
Throws:
java.io.IOException

writeAlgebraFile

public static void writeAlgebraFile(SmallAlgebra alg,
                                    java.io.File f)
                             throws java.io.IOException
Throws:
java.io.IOException

writeAlgebraFile

public static void writeAlgebraFile(SmallAlgebra alg,
                                    java.lang.String f,
                                    boolean oldStyle)
                             throws java.io.IOException
Throws:
java.io.IOException

writeAlgebraFile

public static void writeAlgebraFile(SmallAlgebra alg,
                                    java.io.File f,
                                    boolean oldStyle)
                             throws java.io.IOException
Throws:
java.io.IOException

readProjectivePlane

public static SmallAlgebra readProjectivePlane(java.io.InputStream f)
                                        throws java.io.IOException,
                                               BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException

readProjectivePlane

public static SmallAlgebra readProjectivePlane(java.lang.String f)
                                        throws java.io.IOException,
                                               BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException

readProjectivePlane

public static SmallAlgebra readProjectivePlane(java.io.File f)
                                        throws java.io.IOException,
                                               BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException

readProjectivePlane

public static SmallAlgebra readProjectivePlane(java.io.BufferedReader in)
                                        throws java.io.IOException,
                                               BadAlgebraFileException
Define a ternary ring from a plane as given at http://math.uwyo.edu/~moorhous/pub/planes/. The file format is line for each line of the plane (how appropriate) with the points it contains which are the integers 0 to N - 1. We assume the first line is 0, 1, to n. For nondesargian planes it is likely to be the unusual ternary ring, for example it won't be the Hall quasifield in the Hall plane.

Throws:
java.io.IOException
BadAlgebraFileException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        BadAlgebraFileException
Throws:
java.io.IOException
BadAlgebraFileException


Copyright 2003 Ralph Freese. All Rights Reserved.