zoukankan      html  css  js  c++  java
  • 第二阶段冲刺(九)

    今日任务:

    • 通过昨天反应出来的问题,开会进行讨论,制定任务卡。
    • 继续观察网友提出的问题,有利于后期的维护。

    增加删除代码:

    package com.yuukidach.ucount;

    import android.content.res.Resources;

    import org.litepal.crud.DataSupport;

    public class IOItem extends DataSupport {
    public final int TYPE_COST = -1;
    public final int TYPE_EARN = 1;

    private int id;
    private int type; // 收入还会支出
    private int mId;
    private double money;
    private String name;
    private String description;
    private String timeStamp;
    private String srcName; // 项目资源名称

    public IOItem () {}

    public IOItem(String srcName, String name) {
    this.srcName = srcName;
    this.name = name;
    }

    // 构造函数(无具体描述)
    public IOItem(String srcName, int type, double money, String name) {
    this.srcName = srcName;
    this.money = money;
    this.type = type;
    this.name = name;
    }

    // 构造函数(有具体描述)
    public IOItem(String srcName, int type, double money, String name, String description) {
    this.money = money;
    this.type = type;
    this.srcName = srcName;
    this.name = name;
    this.description = description;
    }

    public double getMoney() { return money; }
    public int getType() { return type; }
    public String getName() { return name; }
    public String getDescription() { return description; }
    public String getTimeStamp() { return timeStamp; }
    public int getmId() { return mId; }
    public String getSrcName() { return srcName; }
    public int getId() { return id; }

    // 设定属性
    public void setMoney(double money) { this.money = money; }
    public void setType(int type) { this.type = type; }
    public void setName(String name) { this.name = name; }
    public void setDescription(String description) { this.description = description; }
    public void setTimeStamp(String timeStamp) { this.timeStamp = timeStamp; }
    public void setmId(int mId) { this.mId = mId; }
    public void setSrcName(String srcName) { this.srcName = srcName; }

    // 返回图片资源的id
    public int getSrcId() {
    Resources resources = MainActivity.resources;
    return resources.getIdentifier(srcName, "drawable", MainActivity.PACKAGE_NAME);
    }
    }

  • 相关阅读:
    C++11 指针成员与拷贝构造(浅拷贝与深拷贝)
    C++11 委派构造函数
    C++11 继承构造函数
    C++11 局部和匿名类型作模板实参
    C++11 外部模板
    C++11 函数模板的默认模板参数
    2D游戏新手引导点光源和类迷雾实现
    UVA 12293
    【算法】8 图文搭配诠释三种链表及其哨兵
    小米面试
  • 原文地址:https://www.cnblogs.com/mac-13/p/13084230.html
Copyright © 2011-2022 走看看