|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsbrt.shell.text.AbstractLinkedHashSetFormat<E>
E
- the type of element.public abstract class AbstractLinkedHashSetFormat<E>
This abstract class is a skeleton implementation of LinkedHashSetFormat. A concrete class with a defined format can be created by simply overriding the constructor of this class.
Constructor Summary | |
---|---|
AbstractLinkedHashSetFormat(java.lang.String delimiter,
java.util.regex.Pattern regex,
Formatter<E> elementFormatter,
Parser<E> elementParser)
Constructs a new LinkedHashSet format from
the provided arguments. |
|
AbstractLinkedHashSetFormat(java.lang.String delimiter,
java.util.regex.Pattern regex,
SimpleFormat<E> elementFormat)
Constructs a new LinkedHashSet format from
the provided arguments. |
Method Summary | |
---|---|
java.lang.String |
format(java.util.Set<? extends E> c)
Returns a formatted string representation of the provided collection. |
java.lang.String |
getDelimiter()
Returns the delimiter used to separate elements when producing a formatted string. |
Formatter<E> |
getElementFormatter()
Returns the formatter for the elements of this LinkedHashSet format. |
Parser<E> |
getElementParser()
Returns the parser for the elements of this set format. |
java.util.regex.Pattern |
getRegex()
Returns the regular expression used to separate elements when parsing a formatted string. |
java.util.LinkedHashSet<E> |
parse(java.lang.String set)
Parses the provided string and returns its corresponding collection of elements as a LinkedHashSet . |
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 |
---|
public AbstractLinkedHashSetFormat(java.lang.String delimiter, java.util.regex.Pattern regex, SimpleFormat<E> elementFormat)
LinkedHashSet
format from
the provided arguments.
delimiter
- the delimiter used to separate elements
of sets when producing a formatted string
representation.regex
- the regular expression pattern used to
parse a string representation of a set with this format.
The method call regex.split(String)
should return
an array containing the string representation of the elements
of the provided set string.elementFormat
- the format used for elements the
of sets with this format.
java.lang.NullPointerException
- if any provided argument
is null
.public AbstractLinkedHashSetFormat(java.lang.String delimiter, java.util.regex.Pattern regex, Formatter<E> elementFormatter, Parser<E> elementParser)
LinkedHashSet
format from
the provided arguments.
delimiter
- the delimiter used to separate elements
of sets when producing a formatted string
representation.regex
- the regular expression pattern used to
parse a string representation of a set with this format.
The method call regex.split(String)
should return
an array containing the string representation of the elements
of the provided set string.elementFormatter
- the formatter used for elements the
of sets with this format.elementParser
- the parser used for elements the
of sets with this format.
java.lang.NullPointerException
- if any provided argument
is null
.Method Detail |
---|
public java.lang.String getDelimiter()
public java.util.regex.Pattern getRegex()
public Formatter<E> getElementFormatter()
LinkedHashSet
format.
getElementFormatter
in interface LinkedHashSetFormat<E>
LinkedHashSet
format.public Parser<E> getElementParser()
getElementParser
in interface LinkedHashSetFormat<E>
public java.lang.String format(java.util.Set<? extends E> c)
format
in interface LinkedHashSetFormat<E>
c
- the collection to be formatted.
public java.util.LinkedHashSet<E> parse(java.lang.String set)
LinkedHashSet
.
parse
in interface LinkedHashSetFormat<E>
parse
in interface Parser<java.util.LinkedHashSet<E>>
set
- the string to be parsed.
LinkedHashSet
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |