Android Open Source - AstroPhysCalc Calc Page






From Project

Back to project page AstroPhysCalc.

License

The source code is released under:

Apache License

If you think the Android project AstroPhysCalc 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 org.astrophyscalc;
/*from  w w w  .  j  ava  2  s  . c  o m*/
import java.util.ArrayList;
import java.util.List;

public class CalcPage {

  public static final CalcRow[] ORBIT_MASS = {CalcRow.ORBIT_MASS, CalcRow.ORBIT_RADIUS, CalcRow.ORBIT_PERIOD};
  public static final CalcRow[] ORBIT_RADIUS = {CalcRow.ORBIT_RADIUS, CalcRow.ORBIT_PERIOD, CalcRow.ORBIT_MASS};
  public static final CalcRow[] ORBIT_PERIOD = {CalcRow.ORBIT_PERIOD, CalcRow.ORBIT_RADIUS, CalcRow.ORBIT_MASS};
  public static final CalcPage ORBITS = CalcPage.create(R.string.orbitPageTitle, ORBIT_MASS, ORBIT_RADIUS, ORBIT_PERIOD);

  public static final CalcRow[] KE_MASS = {CalcRow.KE_MASS, CalcRow.KE_ENERGY, CalcRow.KE_VELOCITY};
  public static final CalcRow[] KE_ENERGY = {CalcRow.KE_ENERGY, CalcRow.KE_MASS, CalcRow.KE_VELOCITY};
  public static final CalcRow[] KE_VELOCITY = {CalcRow.KE_VELOCITY, CalcRow.KE_MASS, CalcRow.KE_ENERGY};
  public static final CalcPage KE = CalcPage.create(R.string.kineticPageTitle, KE_MASS, KE_ENERGY, KE_VELOCITY);

  public static final CalcRow[] FLUX_POWER = {CalcRow.FLUX_POWER, CalcRow.FLUX_DISTANCE, CalcRow.FLUX};
  public static final CalcRow[] FLUX_DISTANCE = {CalcRow.FLUX_DISTANCE, CalcRow.FLUX_POWER, CalcRow.FLUX};
  public static final CalcRow[] FLUX = {CalcRow.FLUX, CalcRow.FLUX_POWER, CalcRow.FLUX_DISTANCE};
  public static final CalcPage FLUX_PAGE = CalcPage.create(R.string.fluxPageTitle, FLUX_POWER, FLUX_DISTANCE, FLUX);

  private final int titleStringId;
  private final List<List<CalcRow>> listOfLists;

  public static CalcPage create(final int titleStringId, final CalcRow[] ... calcRowArray) {
    final List<List<CalcRow>> listOfLists = new ArrayList<List<CalcRow>>();
    for (CalcRow[] rowArray: calcRowArray) {
      final List<CalcRow> rowList = new ArrayList<CalcRow>();
      for (CalcRow row: rowArray) {
        rowList.add(row);
      }
      listOfLists.add(rowList);
    }
    return new CalcPage(titleStringId, listOfLists);
  }

  private CalcPage(final int titleStringId, final List<List<CalcRow>> listOfLists) {
    this.titleStringId = titleStringId;
    this.listOfLists = listOfLists;
  }

  public List<List<CalcRow>> getListOfLists() {
    return listOfLists;
  }

  public int getTitleStringId() {
    return titleStringId;
  }

}




Java Source Code List

org.astrophyscalc.AstroPhysCalcActivity.java
org.astrophyscalc.CalcPage.java
org.astrophyscalc.CalcRow.java
org.astrophyscalc.Calculator.java
org.astrophyscalc.Constants.java
org.astrophyscalc.DimensionTest.java
org.astrophyscalc.Dimension.java
org.astrophyscalc.FractionTest.java
org.astrophyscalc.Fraction.java
org.astrophyscalc.LengthUnit.java
org.astrophyscalc.MassUnit.java
org.astrophyscalc.TimeUnitTest.java
org.astrophyscalc.TimeUnit.java
org.astrophyscalc.UnitAndDimTest.java
org.astrophyscalc.UnitAndDim.java
org.astrophyscalc.UnitExpressionTest.java
org.astrophyscalc.UnitExpression.java
org.astrophyscalc.UnitSelectionRule.java
org.astrophyscalc.UnitSelector.java
org.astrophyscalc.UnitSpinnerItem.java
org.astrophyscalc.UnitUtilTest.java
org.astrophyscalc.UnitUtil.java
org.astrophyscalc.Unit.java
org.astrophyscalc.ValueAndUnitsTest.java
org.astrophyscalc.ValueAndUnits.java