cz.cuni.jagrlib
Class RankHistogram

java.lang.Object
  extended by cz.cuni.jagrlib.RankHistogram
All Implemented Interfaces:
Rank

public class RankHistogram
extends java.lang.Object
implements Rank

Simple rank implementation using histogram array.

Since:
0.25
See Also:
RankHistogram.java

Field Summary
protected  int card
          Histogram cardinality.
protected  int[] h
          Actual histogram.
protected  int hMax
          Actual index of maximum value.
protected  int hMin
          Actual index of minimum value.
protected  int maxV
          Actual maximal value.
 
Constructor Summary
RankHistogram()
           
 
Method Summary
 void add(int value)
          Adds new pixel value.
 void init(int maxValue)
          Initializes the rank.
 int result(RankType type)
          Computes the given rank-value (min, median, max, ..).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxV

protected int maxV
Actual maximal value.


h

protected int[] h
Actual histogram.


hMin

protected int hMin
Actual index of minimum value.


hMax

protected int hMax
Actual index of maximum value.


card

protected int card
Histogram cardinality.

Constructor Detail

RankHistogram

public RankHistogram()
Method Detail

init

public void init(int maxValue)
Initializes the rank.

Specified by:
init in interface Rank

add

public void add(int value)
Adds new pixel value.

Specified by:
add in interface Rank

result

public int result(RankType type)
Computes the given rank-value (min, median, max, ..). Can be destructive - should be called once after each init(int) call.

Specified by:
result in interface Rank