Skip to content
Snippets Groups Projects
Unverified Commit c9e036b3 authored by Philipp Hanslovsky's avatar Philipp Hanslovsky
Browse files

Add `next()` method to Interpolation enum

Toggling interpolation now simply becomes `interpolation.next()` instead of `NLINEAR.equals(interpolation) ? NEARESTNEIGHBOR : NLINEAR`.
parent 2fcad967
No related branches found
No related tags found
No related merge requests found
......@@ -37,8 +37,15 @@ public enum Interpolation
NEARESTNEIGHBOR( "nearest-neighbor interpolation" ),
NLINEAR( "tri-linear interpolation" );
static {
NEARESTNEIGHBOR.next = NLINEAR;
NLINEAR.next = NEARESTNEIGHBOR;
}
private final String name;
private Interpolation next = null;
private Interpolation( final String name )
{
this.name = name;
......@@ -48,4 +55,8 @@ public enum Interpolation
{
return name;
}
public Interpolation next() {
return next;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment