Android Open Source - simple-matrix Matrix Rational






From Project

Back to project page simple-matrix.

License

The source code is released under:

MIT License

If you think the Android project simple-matrix 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

/*
 * The MatrixRational Parcelable class uitlizes String arrays rather
 * than Rational arrays in order to serialize the data.
 *//*w  w  w  .j  a v a 2s.c  om*/

package com.alexkang.x3matrixcalculator;

import android.os.Parcel;
import android.os.Parcelable;

public class MatrixRational implements Parcelable {
  String[][] matrix;
  
  public MatrixRational(String[][] matrix) {
    this.matrix = matrix;
  }
  
  public MatrixRational(Parcel in) {
    matrix = (String[][]) in.readSerializable();
  }
  
  public String[][] getMatrix() {
    return matrix;
  }
  
  public void setMatrix(String[][] newMatrix) {
    this.matrix = newMatrix;
  }
  
  @Override
  public int describeContents() {
    // TODO Auto-generated method stub
    return 0;
  }

  @Override
  public void writeToParcel(Parcel out, int flags) {
    // TODO Auto-generated method stub
    out.writeSerializable(matrix);
  }

  public static final Parcelable.Creator<MatrixRational> CREATOR =
      new Parcelable.Creator<MatrixRational>() {
    
    @Override
    public MatrixRational createFromParcel(Parcel in) {
      return new MatrixRational(in);
    }
    
    @Override
    public MatrixRational[] newArray(int size) {
      return new MatrixRational[size];
    }
  };
}




Java Source Code List

com.alexkang.x3matrixcalculator.DisplayResultActivity.java
com.alexkang.x3matrixcalculator.MainActivity.java
com.alexkang.x3matrixcalculator.MatrixRational.java
com.alexkang.x3matrixcalculator.Matrix.java
com.alexkang.x3matrixcalculator.SettingsActivity.java
com.alexkang.x3matrixcalculator.calculations.Advanced.java
com.alexkang.x3matrixcalculator.calculations.Basic.java
com.alexkang.x3matrixcalculator.calculations.RationalAdvanced.java
com.alexkang.x3matrixcalculator.calculations.RationalBasic.java
com.alexkang.x3matrixcalculator.calculations.RationalCalc.java
com.alexkang.x3matrixcalculator.calculations.Rational.java