org.ow2.weblab.core.extended.comparator
Class SegmentComparator
java.lang.Object
org.ow2.weblab.core.extended.comparator.SegmentComparator
- All Implemented Interfaces:
- java.io.Serializable, java.util.Comparator<org.ow2.weblab.core.model.Segment>
public class SegmentComparator
- extends java.lang.Object
- implements java.io.Serializable, java.util.Comparator<org.ow2.weblab.core.model.Segment>
A Comparator for Segments.
First of all Segment are ordered using their type: LinearSegment,
TemporalSegment, SpatialSegment an then any other Segment.
Then Segments of same types are compare together.
For LinearSegment and TemporalSegment: The smaller is the one that starts first. If equals,
the smaller is the first that stops too. If equals, they are equals (in comparison terms, non consistent with
equals of Resource).
For SpatialSegment: The smaller is the one with the less Coordinates. If equals, we process
all the coordinates to find the first difference between Xs and then Ys (Coordinate by
Coordinate). The smaller is the smaller using this first difference. If all number (x and y) in
Coordinates are equals, then Segments are equals (in comparison terms, non consistent with
equals of Resource).
- Author:
- Cassidian WebLab Team
- See Also:
- Serialized Form
- WARNING:
- Comparison is inconsistent with
equals() since no equals() was generated by JAX-WS
and it will use the default one from Object.
- Date:
- 2008-01-03
|
Method Summary |
int |
compare(org.ow2.weblab.core.model.Segment seg1,
org.ow2.weblab.core.model.Segment seg2)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
equals |
SegmentComparator
public SegmentComparator()
compare
public int compare(org.ow2.weblab.core.model.Segment seg1,
org.ow2.weblab.core.model.Segment seg2)
- Specified by:
compare in interface java.util.Comparator<org.ow2.weblab.core.model.Segment>
Copyright © 2004-2011. All Rights Reserved.