Package net.sf.eBusx.geo
Class LineString.Builder
- java.lang.Object
-
- net.sf.eBus.messages.EMessageObject.Builder<M>
-
- net.sf.eBus.messages.EField.Builder<LineString>
-
- net.sf.eBusx.geo.LineString.Builder
-
- Enclosing class:
- LineString
public static final class LineString.Builder extends EField.Builder<LineString>
Builder class used to createLineString
instances. ABuilder
instance is obtained by callingLineString.builder()
method.
-
-
Field Summary
-
Fields inherited from class net.sf.eBus.messages.EMessageObject.Builder
mTargetClass
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LineString.Builder
add(Position pos)
Appends position to positions list.LineString.Builder
addAll(java.util.Collection<Position> positions)
Appends position collection to positions list.LineString.Builder
addAll(Position[] positions)
Appends position array to positions list.LineString
buildImpl()
Returns a newLineString
instance created from this builder's validated settings.LineString.Builder
positions(Position[] positions)
Sets positions list to the given position values.protected Validator
validate(Validator problems)
Verifies that this line string has at least two positions.-
Methods inherited from class net.sf.eBus.messages.EMessageObject.Builder
build
-
-
-
-
Method Detail
-
validate
protected Validator validate(Validator problems)
Verifies that this line string has at least two positions.- Overrides:
validate
in classEField.Builder<LineString>
- Parameters:
problems
- append detected problems to this list.- Returns:
problems
to allow for method chaining.- See Also:
Validator
-
buildImpl
public LineString buildImpl()
Returns a newLineString
instance created from this builder's validated settings.- Specified by:
buildImpl
in classEMessageObject.Builder<LineString>
- Returns:
- new line string instance.
-
add
public LineString.Builder add(Position pos)
Appends position to positions list.- Parameters:
pos
- append this position.- Returns:
this Builder
instance.- Throws:
java.lang.NullPointerException
- ifpos
isnull
.- See Also:
addAll(Position[])
,addAll(Collection)
,positions(Position[])
-
addAll
public LineString.Builder addAll(Position[] positions)
Appends position array to positions list.- Parameters:
positions
- append all positions to list.- Returns:
this Builder
instance.- Throws:
java.lang.NullPointerException
- ifpositions
isnull
.- See Also:
add(Position)
,addAll(Collection)
,positions(Position[])
-
addAll
public LineString.Builder addAll(java.util.Collection<Position> positions)
Appends position collection to positions list.- Parameters:
positions
- append all positions to list.- Returns:
this Builder
instance.- Throws:
java.lang.NullPointerException
- ifpositions
isnull
.- See Also:
add(Position)
,addAll(Position[])
,positions(Position[])
-
positions
public LineString.Builder positions(Position[] positions)
Sets positions list to the given position values. Note that all previously added positions are removed from the list prior to adding these positions but after verifying that positions array is notnull
.- Parameters:
positions
- set position list to this array.- Returns:
this Builder
instance.- Throws:
java.lang.NullPointerException
- ifpositions
isnull
. If this exception is thrown then positions list is unchanged.- See Also:
add(Position)
,addAll(Position[])
,addAll(Collection)
-
-