games.strategy.util
Class PointFileReaderWriter

java.lang.Object
  extended by games.strategy.util.PointFileReaderWriter

public class PointFileReaderWriter
extends java.lang.Object

Utiltity to read and write files in the form of String -> a list of points, or string-> list of polygons

Author:
Sean Bridges

Constructor Summary
PointFileReaderWriter()
          Creates a new instance of PointFileReader
 
Method Summary
static java.util.Map<java.lang.String,java.util.List<java.awt.Point>> readOneToMany(java.io.InputStream stream)
          Returns a map of the form String -> Collection of points.
static java.util.Map<java.lang.String,java.util.List<java.awt.Polygon>> readOneToManyPolygons(java.io.InputStream stream)
          Returns a map of the form String -> Collection of points.
static java.util.Map<java.lang.String,java.awt.Point> readOneToOne(java.io.InputStream stream)
          Returns a map of the form String -> Point.
static java.util.Map<java.lang.String,java.awt.Point> readOneToOneCenters(java.io.InputStream stream)
          Returns a map of the form String -> Point.
static void writeOneToMany(java.io.OutputStream sink, java.util.Map mapping)
           
static void writeOneToManyPolygons(java.io.OutputStream sink, java.util.Map<java.lang.String,java.util.List<java.awt.Polygon>> mapping)
           
static void writeOneToOne(java.io.OutputStream sink, java.util.Map<java.lang.String,java.awt.Point> mapping)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PointFileReaderWriter

public PointFileReaderWriter()
Creates a new instance of PointFileReader

Method Detail

readOneToOne

public static java.util.Map<java.lang.String,java.awt.Point> readOneToOne(java.io.InputStream stream)
                                                                   throws java.io.IOException
Returns a map of the form String -> Point.

Throws:
java.io.IOException

readOneToOneCenters

public static java.util.Map<java.lang.String,java.awt.Point> readOneToOneCenters(java.io.InputStream stream)
                                                                          throws java.io.IOException
Returns a map of the form String -> Point.

Throws:
java.io.IOException

writeOneToOne

public static void writeOneToOne(java.io.OutputStream sink,
                                 java.util.Map<java.lang.String,java.awt.Point> mapping)
                          throws java.lang.Exception
Throws:
java.lang.Exception

writeOneToManyPolygons

public static void writeOneToManyPolygons(java.io.OutputStream sink,
                                          java.util.Map<java.lang.String,java.util.List<java.awt.Polygon>> mapping)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

writeOneToMany

public static void writeOneToMany(java.io.OutputStream sink,
                                  java.util.Map mapping)
                           throws java.lang.Exception
Throws:
java.lang.Exception

readOneToMany

public static java.util.Map<java.lang.String,java.util.List<java.awt.Point>> readOneToMany(java.io.InputStream stream)
                                                                                    throws java.io.IOException
Returns a map of the form String -> Collection of points.

Throws:
java.io.IOException

readOneToManyPolygons

public static java.util.Map<java.lang.String,java.util.List<java.awt.Polygon>> readOneToManyPolygons(java.io.InputStream stream)
                                                                                              throws java.io.IOException
Returns a map of the form String -> Collection of points.

Throws:
java.io.IOException