Android Open Source - DisposableIncome-OldJava Cash






From Project

Back to project page DisposableIncome-OldJava.

License

The source code is released under:

MIT License

If you think the Android project DisposableIncome-OldJava 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 uk.co.wilka.disposableincome;
/*from  w  ww.ja v a  2s .c o m*/
import java.net.CacheRequest;

public class Cash {

    private int pence;

    public static Cash fromPounds(int pounds) {
        return new Cash(pounds * 100);
    }

    public static Cash fromPence(int pence) {
        return new Cash(pence);
    }

    private Cash(int pence) {
        this.pence = pence;
    }

    public int getPounds() {
        return pence / 100;
    }

    public int getPence() {
        return pence;
    }

    // TODO: Unit test this
    public Cash plus(Cash other) {
        return new Cash(pence + other.pence);
    }

    // TODO: Unit test this
    public Cash minus(Cash other) {
        return new Cash(pence - other.pence);
    }
}




Java Source Code List

uk.co.wilka.disposableincome.CalendarAccess.java
uk.co.wilka.disposableincome.CalendarProvider.java
uk.co.wilka.disposableincome.CashWithdraw.java
uk.co.wilka.disposableincome.CashWithdrawalDetailsActivity.java
uk.co.wilka.disposableincome.Cash.java
uk.co.wilka.disposableincome.DatabaseHelper.java
uk.co.wilka.disposableincome.IAccessData.java
uk.co.wilka.disposableincome.IProvideCalendar.java
uk.co.wilka.disposableincome.MainActivity.java
uk.co.wilka.disposableincome.PlusOneMonthCalendarProvider.java
uk.co.wilka.disposableincome.WithdrawDateComparer.java
uk.co.wilka.disposableincome.WithdrawType.java
uk.co.wilka.disposableincome.WithdrawalForMonthCalculator.java
uk.co.wilka.disposableincome.test.CashTest.java
uk.co.wilka.disposableincome.test.CashWithdrawTest.java
uk.co.wilka.disposableincome.test.FakeCalendarProvider.java
uk.co.wilka.disposableincome.test.PlusOneMonthCalendarProviderTests.java
uk.co.wilka.disposableincome.test.WithdrawDateComparerTests.java
uk.co.wilka.disposableincome.test.WithdrawalForMonthCalculatorTests.java