Android Open Source - MathApp Util






From Project

Back to project page MathApp.

License

The source code is released under:

MIT License

If you think the Android project MathApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package ie.lc.mathApp;
/* w w w .ja  v a  2  s. co m*/




/**
 * Provides generic utility methods.
 */
public class Util
{
  /**
   * Sleep the calling thread.
   * @param millis Time to sleep in milliseconds.
   */
  public static void sleep( long millis ) {
    try {
      Thread.sleep( millis );
    }
    catch (InterruptedException ex) {
      Thread.interrupted();
    }
  }
  
  
  
  
  
  /**
   * Get a random integer in the given half-open range.
   * @param low
   * @param high
   * @return int
   */
  public static int randomIntRange( int low, int high ) {
    return low + ((int) Math.floor(Math.random() * (high-low)));
  }
  
  
  
  
  
  /**
   * Capitalise a word.
   */
  public static String capitalise( String word ) {
    return word.substring( 0, 1 ).toUpperCase() + word.substring( 1 );
  }
}




Java Source Code List

ie.lc.mathApp.ActivityArithmetic.java
ie.lc.mathApp.ActivityCommonMenu.java
ie.lc.mathApp.ActivityGameBase.java
ie.lc.mathApp.ActivityScore.java
ie.lc.mathApp.ActivitySqrt.java
ie.lc.mathApp.ActivityWave.java
ie.lc.mathApp.CallbackThread.java
ie.lc.mathApp.Callback.java
ie.lc.mathApp.Geo.java
ie.lc.mathApp.Operator.java
ie.lc.mathApp.ScoreData.java
ie.lc.mathApp.Score.java
ie.lc.mathApp.SeekBarAdapter.java
ie.lc.mathApp.Storage.java
ie.lc.mathApp.TextWatcherAdapter.java
ie.lc.mathApp.Util.java
ie.lc.mathApp.Wave.java