How do I reduce my code using a function when using a lot of references like PIXELS_PER_INCH = 72?
<p>I have some code that needs reducing and it was recommended to me on Reddit.com that I use functions to do it. But the problem is the code is mostly a collection of <code>public static final</code> "references" such as <code>PIXELS_PER_INCH = 72</code>.</p>

<p>I open sourced my <a href="https://github.com/jacksmartie/PhotoMem" rel="nofollow">app</a> on GitHub, if anyone wants to look at it that way.</p>

<p>Here's an example of where I assign values to my constants:</p>

<pre><code>public static final int PICTURES_4 = 0;
public static final int PICTURES_6 = 1;
public static final int PICTURES_8 = 2;
public static final int PICTURES_10 = 3;
public static final int PICTURES_12 = 4;

public static final int PICTURES_OPTION_0 = 4;
public static final int PICTURES_OPTION_1 = 6;
public static final int PICTURES_OPTION_2 = 8;
public static final int PICTURES_OPTION_3 = 10;
</code></pre>

<p>And here's an example of where I use those constant references:</p>

<pre><code>switch (settings.getInt(SettingsActivity.PICTURES_OPTION, SettingsActivity.DEFAULT_PICTURES_OPTION)) {
        case SettingsActivity.PICTURES_4:
            totalImages = SettingsActivity.PICTURES_OPTION_0;
            break;
        case SettingsActivity.PICTURES_6:
            totalImages = SettingsActivity.PICTURES_OPTION_1;
            break;
        case SettingsActivity.PICTURES_8:
            totalImages = SettingsActivity.PICTURES_OPTION_2;
            break;
</code></pre>

<p>Essentially, I would like to know how to use a function to reduce the code but still keep the ability to use readable references. Or is my idea of using a readable reference wrong? I learned in an online programming class about using constants as readable references (such as PIXELS_PER_INCH = 72) instead of using absolute values.</p>

<p>Thank you for your time.</p>

<p>Update:
I ended up using aioobe and Lloyd Ozymandias Force's suggestions. I used <code>EnumMap</code> in a for loop. Within the for loop, though, I couldn't use <code>myEnumMap.values()</code> for some reason. I Googled it and found a different way to do it using <code>myEnumMap.class.getEnumConstants()</code>, instead.</p>
