Last active
August 29, 2015 14:17
-
-
Save juliensimon/cf4cdb1a4c1a1dee5b6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LinearSearchModeFactory<T> { | |
public static final int modeMoveFirst = 1; | |
public static final int modeMoveLast = 2; | |
public static final int modeMoveUp = 3; | |
public static <T> LinearSearchMode<T> build(int mode) { | |
switch (mode) { | |
case modeMoveFirst: | |
return new LinearSearchModeMoveFirst<T>(); | |
case modeMoveLast: | |
return new LinearSearchModeMoveLast<T>(); | |
case modeMoveUp: | |
return new LinearSearchModeMoveUp<T>(); | |
default: | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment