Android Open Source - MyLibReminder Loan

From Project

Back to project page MyLibReminder.


The source code is released under:

Apache License

If you think the Android project MyLibReminder 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.geonnave.mylibreminder;
//from   w  w w.j  a  va2  s .c  om
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Loan {
  private int id;
  private String book, library;
  private Calendar date;
  public Loan() {
    // TODO Auto-generated constructor stub
  public Loan(int id, String book, String library, Calendar date ){ = id; = book;
    this.library = library; = date;
  public String getBook() {
    return book;

  public void setBook(String book) { = book;

  public String getLibrary() {
    return library;

  public void setLibrary(String library) {
    this.library = library;

  public Calendar getDate() {
    return date;
  public String getFormatedDate() {
    return new SimpleDateFormat("yyyy-MM-dd").format(date.getTime());

  public void setDate(Calendar date) { = date;
  public void setDate(int year, int month, int day) {
    date.set(year, month, day);
  public int getId() {
    return id;
  public void setId(int id) { = id;
  public String toString(){
    return "Restore book "+book + " at "+date.getTime()+" to library "+library;

//  public static void Main(String[] args) {
//    Calendar c1 = new GregorianCalendar(); 
//    Loan l1 = new Loan("Book1", "Lirary1", c1);
//    System.out.println(l1);
//  }

Java Source Code List