org.jaitools.imageutils
Class FloodFiller.ScanSegment

java.lang.Object
  extended by org.jaitools.imageutils.FloodFiller.ScanSegment
All Implemented Interfaces:
Comparable<FloodFiller.ScanSegment>
Enclosing class:
FloodFiller

public static class FloodFiller.ScanSegment
extends Object
implements Comparable<FloodFiller.ScanSegment>

Records a segment of contiguous pixels in a single row that will become part of a filled region.


Constructor Summary
FloodFiller.ScanSegment(int startX, int endX, int y)
          Creates a new segment.
 
Method Summary
 int compareTo(FloodFiller.ScanSegment other)
          Compares this segment to another.
 boolean contains(int x, int y)
          Checks if the given location lies within this segment.
 boolean equals(Object obj)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloodFiller.ScanSegment

public FloodFiller.ScanSegment(int startX,
                               int endX,
                               int y)
Creates a new segment.

Parameters:
startX - start X ordinate
endX - end X ordinate
y - Y ordinate
Method Detail

contains

public boolean contains(int x,
                        int y)
Checks if the given location lies within this segment.

Parameters:
x - location X ordinate
y - location Y ordinate
Returns:
the result as boolean

compareTo

public int compareTo(FloodFiller.ScanSegment other)
Compares this segment to another. The comparison is first by Y ordinate, then by left and right X ordinates.

Specified by:
compareTo in interface Comparable<FloodFiller.ScanSegment>
Parameters:
other - the other segment

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009-2013. All Rights Reserved.