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 createLineStringinstances. ABuilderinstance 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.Builderadd(Position pos)Appends position to positions list.LineString.BuilderaddAll(java.util.Collection<Position> positions)Appends position collection to positions list.LineString.BuilderaddAll(Position[] positions)Appends position array to positions list.LineStringbuildImpl()Returns a newLineStringinstance created from this builder's validated settings.LineString.Builderpositions(Position[] positions)Sets positions list to the given position values.protected Validatorvalidate(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:
 validatein classEField.Builder<LineString>- Parameters:
 problems- append detected problems to this list.- Returns:
 problemsto allow for method chaining.- See Also:
 Validator
 
- 
buildImpl
public LineString buildImpl()
Returns a newLineStringinstance created from this builder's validated settings.- Specified by:
 buildImplin 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 Builderinstance.- Throws:
 java.lang.NullPointerException- ifposisnull.- 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 Builderinstance.- Throws:
 java.lang.NullPointerException- ifpositionsisnull.- 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 Builderinstance.- Throws:
 java.lang.NullPointerException- ifpositionsisnull.- 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 Builderinstance.- Throws:
 java.lang.NullPointerException- ifpositionsisnull. If this exception is thrown then positions list is unchanged.- See Also:
 add(Position),addAll(Position[]),addAll(Collection)
 
 - 
 
 -