Android Open Source - EulerSolutions Problem Calculator






From Project

Back to project page EulerSolutions.

License

The source code is released under:

MIT License

If you think the Android project EulerSolutions 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 com.eulersolutions.model;
//from ww w .  j a  va2  s  . c  om
import java.util.List;

import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;

@SuppressLint("ParcelCreator")
public abstract class ProblemCalculator implements Parcelable{
  
  private static final String TAG = "EulerSolutions-ProblemCalculator";
  
  protected abstract boolean validInput(List<Number> values);
  protected abstract List<Number> parseInput(List<String> values);
  protected abstract Number calculate(List<Number> values);
  
  public ProblemCalculator()
  {
  }
  
  public ProblemCalculator(Parcel source)
  {
  }
  
  public Number findAnswer(List<String> inputValues){
    
    Log.i(TAG, "entering Find Answer");
    List<Number> values = parseInput(inputValues);
    
    if(!validInput(values))
    {
      return null;
    }
    
    return calculate(values);
  }
  
  @Override
  public int describeContents() {
    return this.hashCode();
  }
  
  @Override
  public void writeToParcel(Parcel destination, int flags) {
    
  }
}




Java Source Code List

com.eulersolutions.controllers.MainActivity.java
com.eulersolutions.controllers.ProblemPresentationActivity.java
com.eulersolutions.controllers.ProblemSelectArrayAdapter.java
com.eulersolutions.controllers.ProblemSolutionActivity.java
com.eulersolutions.controllers.SolutionDisplayFragment.java
com.eulersolutions.controllers.SolutionSelectFragment.java
com.eulersolutions.interfaces.ISelectionListener.java
com.eulersolutions.interfaces.ISolutionDisplay.java
com.eulersolutions.interfaces.ISolutionHandler.java
com.eulersolutions.model.CompletedProblems.java
com.eulersolutions.model.EvenFibonacciNmCalculator.java
com.eulersolutions.model.LargestPrimeFactorCalculator.java
com.eulersolutions.model.MultiplesABCalculator.java
com.eulersolutions.model.ProblemCalculator.java
com.eulersolutions.model.ProblemSummary.java