de.lmu.ifi.dbs.elki.datasource.parser
Class SimplePolygonParser

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser
      extended by de.lmu.ifi.dbs.elki.datasource.parser.SimplePolygonParser
All Implemented Interfaces:
Parser, InspectionUtilFrequentlyScanned, Parameterizable

public class SimplePolygonParser
extends AbstractParser
implements Parser

Parser to load polygon data (2D and 3D only) from a simple format. One record per line, points separated by whitespace, numbers separated by colons. Multiple polygons components can be separated using POLYGON_SEPARATOR. Unparseable parts will be treated as labels.


Nested Class Summary
static class SimplePolygonParser.Parameterizer
          Parameterization class.
 
Field Summary
static Pattern COORD
          Pattern to catch coordinates
private static Logging logger
          Class logger
static String POLYGON_SEPARATOR
          Polygon separator
 
Fields inherited from class de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser
ATTRIBUTE_CONCATENATION, COLUMN_SEPARATOR_ID, COMMENT, NUMBER_PATTERN, QUOTE_CHAR, QUOTE_ID, quoteChar, WHITESPACE_PATTERN
 
Constructor Summary
SimplePolygonParser(Pattern colSep, char quoteChar)
          Constructor.
 
Method Summary
protected  Logging getLogger()
          Get the logger for this class.
 MultipleObjectsBundle parse(InputStream in)
          Returns a list of the objects parsed from the specified input stream.
private  Object[] parseLine(String line)
          Parse a single line.
 
Methods inherited from class de.lmu.ifi.dbs.elki.datasource.parser.AbstractParser
tokenize, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

private static final Logging logger
Class logger


COORD

public static final Pattern COORD
Pattern to catch coordinates


POLYGON_SEPARATOR

public static final String POLYGON_SEPARATOR
Polygon separator

See Also:
Constant Field Values
Constructor Detail

SimplePolygonParser

public SimplePolygonParser(Pattern colSep,
                           char quoteChar)
Constructor.

Parameters:
colSep -
quoteChar -
Method Detail

parse

public MultipleObjectsBundle parse(InputStream in)
Description copied from interface: Parser
Returns a list of the objects parsed from the specified input stream.

Specified by:
parse in interface Parser
Parameters:
in - the stream to parse objects from
Returns:
a list containing those objects parsed from the input stream

parseLine

private Object[] parseLine(String line)
Parse a single line.

Parameters:
line - Line to parse
Returns:
Parsed polygon

getLogger

protected Logging getLogger()
Description copied from class: AbstractParser
Get the logger for this class.

Specified by:
getLogger in class AbstractParser
Returns:
Logger.

Release 0.4.0 (2011-09-20_1324)