Package net.sourceforge.jiu.color.quantization

# Class ContouringColorPair

java.lang.Object
net.sourceforge.jiu.color.quantization.ContouringColorPair

All Implemented Interfaces:
  `ComparatorInterface`

class ContouringColorPair extends Object implements ComparatorInterface
A data structure for storing the index values of a pair of contouring colors plus their respective self co-occurrence frequency values.

Author:
  Marco Schmidt
See Also:
  - `MedianCutContourRemoval`

## Field Summary

Fields
Modifier and Type
Field
Description
`private int`
`index1`
`private int`
`index2`
`private double`
`scof1`
`private double`
`scof2`

## Constructor Summary

Constructors
Constructor
Description
`ContouringColorPair()`
Creates a new object of this class.
`ContouringColorPair(int i1, int i2, double sf1, double sf2)`
Creates a new object of this class.

## Method Summary

Modifier and Type
Method
Description
`int`
`compare(Object o1, Object o2)`
Compares the two argument objects and returns their relation.
`int`
`getColorIndex(boolean smaller)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### index1

private int index1

### index2

private int index2

### scof1

private double scof1

### scof2

private double scof2

## Constructor Details

### ContouringColorPair

public ContouringColorPair()
Creates a new object of this class.

### ContouringColorPair

public ContouringColorPair(int i1, int i2, double sf1, double sf2)
Creates a new object of this class.

Parameters:
  `i1` - palette index of first color
  `i2` - palette index of second color
  `sf1` - self co-occurrence frequency value of first color
  `sf2` - self co-occurrence frequency value of second color

## Method Details

### compare

public int compare(Object o1, Object o2)
Description copied from interface: `ComparatorInterface`
Compares the two argument objects and returns their relation. Returns

- a value < 0 if `o1` is smaller than `o2`,
- 0 if `o1` is equal to `o2` and
- a value > 0 if `o1` is greater than `o2`.

Specified by:
  `compare` in interface `ComparatorInterface`

### getColorIndex

public int getColorIndex(boolean smaller)