sbrt.shell.text
Class PipeSetFormat<E>

java.lang.Object
  extended by sbrt.shell.text.AbstractLinkedHashSetFormat<E>
      extended by sbrt.shell.text.PipeSetFormat<E>
Type Parameters:
E - the element type.
All Implemented Interfaces:
Formatter<java.util.Set<? extends E>>, LinkedHashSetFormat<E>, Parser<java.util.LinkedHashSet<E>>

public final class PipeSetFormat<E>
extends AbstractLinkedHashSetFormat<E>

This class is used to define a format for pipe-delimited sets. If a set is composed of elements a, b, c, its string representation would be "a | b | c".

Author:
This class was written and documented by Jeremiah Wright while in the Wagner lab.

Constructor Summary
PipeSetFormat(Formatter<E> elementFormatter, Parser<E> elementParser)
          Constructs a new pipe-delimited set format with the provided element format.
PipeSetFormat(SimpleFormat<E> elementFormat)
          Constructs a new pipe-delimited set format with the provided element format.
 
Method Summary
static PipeSetFormat<java.lang.String> getBasic()
          Returns a PipeSetFormat that does not format or parse the elements supplied to it.
 
Methods inherited from class sbrt.shell.text.AbstractLinkedHashSetFormat
format, getDelimiter, getElementFormatter, getElementParser, getRegex, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface sbrt.shell.text.Formatter
format
 

Constructor Detail

PipeSetFormat

public PipeSetFormat(SimpleFormat<E> elementFormat)
Constructs a new pipe-delimited set format with the provided element format.

Parameters:
elementFormat - the format of the set-elements.

PipeSetFormat

public PipeSetFormat(Formatter<E> elementFormatter,
                     Parser<E> elementParser)
Constructs a new pipe-delimited set format with the provided element format.

Parameters:
elementFormatter - the formatter for the set-elements.
elementParser - the parser for the set-elements.
Method Detail

getBasic

public static final PipeSetFormat<java.lang.String> getBasic()
Returns a PipeSetFormat that does not format or parse the elements supplied to it. In other words, it returns a PipeSetFormat with the most basic possible functionality. Empty strings are not allowed however.

Returns:
an PipeSetFormat that does not format or parse the elements supplied to it.