<p>I'm looking to implement something in Java along the lines of:</p>

<pre><code>class Foo{
 private int lorem; //
 private int ipsum;      

 public setAttribute(String attr, int val){
  //sets attribute based on name
 }

 public static void main(String [] args){
  Foo f = new Foo();
  f.setAttribute("lorem",1);
  f.setAttribute("ipsum",2);
 }

 public Foo(){}
}
</code></pre>

<p>...where a variable is set based on the variable name without the variable names hard-coded and without using any other data structures. Is this possible?</p>

In general, you want to use Reflection. Here is a good introduction to the
topic with examples
In particular, the "Changing Values of Fields" section describes how to do what you'd like to do.
I note that the author says, "This feature is extremely powerful and has no equivalent in other conventional languages." Of course, in the last ten years (the article was written in 1998) we have seen great strides made in dynamic languages. The above is fairly easily done in Perl, Python, PHP, Ruby, and so on. I suspect this is the direction you might have come from based on the "eval" tag.