title: Method with more than 50 input variables?
body: <p>I'm working on an application and have a little problem right now. Let me explain what is the purpose of this application:<br>
  - there is a main menu with different buttons (let's say 16 buttons). 
  - each time the user clicks on a button, it sends a request to a database and display a listview of results with different results depending on the button you clicked.<br>
  - in the database, there is a column with a "category number". (actually there are 3 columns with CatNumbers but let's keep it simple).<br>
  - the request asks to display all the elements where this category number equals some values (these are the inputs of my method, called "myVariableN" sent from the MainActivity to the ListView activity via putExtra/getExtra).  In my ListViewActivity which displays the results:  </p>
  
  <pre><code>private void displayListView() {
      Bundle bundle = getIntent().getExtras();
      String title = bundle.getString("title", "Choose here :");
      int myVariable1 = bundle.getInt("myVariable1", 500);
      int myVariable2 = bundle.getInt("myVariable2", 500);
      int myVariable3 = bundle.getInt("myVariable3", 500);
      int myVariable4 = bundle.getInt("myVariable4", 500);
      int myVariable5 = bundle.getInt("myVariable5", 500);
      int myVariable6 = bundle.getInt("myVariable6", 500);
  </code></pre>
  
  <p>So what I have so far is this : if you click on button 1 for example, it sends 6 variables (myVariable1, 2, 3 ... 6) and ask to display all elements "WHERE CatNumber IN (myVariable1, myVariable2, ... myVariable6).    </p>
  
  <pre><code>public Cursor findPoiInTable(int myVariable1, int myVariable2,
          int myVariable3, int myVariable4, int myVariable5, int myVariable6) 
  {
      String inInterval = "(?,?,?,?,?,?)";
      String where = COL_CAT1 + " IN " + inInterval + " OR " + COL_CAT2
              + " IN " + inInterval + " OR " + COL_CAT3 + " IN " + inInterval;
      String[] whereArgs = new String[3 * 6];
  
      for (int i = 0; i &lt; 3; i++) 
      {
          whereArgs[6 * i] = Integer.toString(myVariable1);
          whereArgs[6 * i + 1] = Integer.toString(myVariable2);
          whereArgs[6 * i + 2] = Integer.toString(myVariable3);
          whereArgs[6 * i + 3] = Integer.toString(myVariable4);
          whereArgs[6 * i + 4] = Integer.toString(myVariable5);
          whereArgs[6 * i + 5] = Integer.toString(myVariable6);
      }
      Cursor c = myDatabase.query(DATABASE_TABLE, new String[] { KEY_ROWID,
              COL_NAME, COL_STREET}, where, whereArgs, null, null, null);
     return c; 
  } 
  </code></pre>
  
  <p>Problem is, out of these 16 buttons from the main menu, there are a few buttons which would require to get data from the database with a much bigger range of category numbers. For example, something like "SELECT .... FROM.... WHERE CatNumber IN (myVariable1, myVariable2, ..... myVariable*<em>50</em>*).<br>
  And unfortunately, the method must be the same for every button, no matter if there are 2 or 50 input variables.    </p>
  
  <p>I feel like if I do this, my method is gonna be too heavy and will slow down my whole application, because in most of the cases, even when the request will be supposed to find 2 or 3 CatNumbers, the method will be defined for 50 inputs or more so it will have to make the whole calculation every time.     </p>
  
  <p>What I was thinking about was:<br>
  <strong>a/</strong> Modifying my method with a IF statement, so for example, IF there are less than... let's say 6 variables sent, it will make the light method with only 6 myVariable input, ELSE, it's gonna run the heavy method with 50 inputs. So the heavy method will be used only in a few cases, the wrong thing is that even if there are only 7 inputs, it will run the heavy method. Or in the same kind of idea, I could send a boolean sent via putExtra and set to TRUE (for using the light method) and FALSE (and then it would use the heavy method).<br>
  <strong>b/</strong> Set the value by default to 500 (as done in my code), so only the specific myVariables have a value different than 500. And then my question is: <strong>is it possible to define a method with 50 inputs and to make it only use the input whose value is different from a certain number, so the method isn't always too heavy to run?</strong>  For example in the code above with the method, would it be possible to say to only look for two variables if the four other are equal to 500 (myVariable1 and myVariable2 instead of all the variables even if the whole method is defined for the rest?).<br>
  Thanks in advance !</p>