package com.fxy.bean;

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

/**
 * 重量对象
 *
 * @author qin.guilin
 *
 */
public class WeightBean implements Parcelable {


    public String weight="";

    //连续次数
    public Integer continuous = 0 ;

    @Override
    public String toString() {
        return "WeightBean{" +
                "weight=" + weight +
                ", continuous=" + continuous +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.weight);
        dest.writeInt(this.continuous);
    }

    public WeightBean() {
    }

    protected WeightBean(Parcel in) {
        this.weight     = in.readString();
        this.continuous = in.readInt();
    }

    public static final Creator<WeightBean> CREATOR = new Creator<WeightBean>() {
        @Override
        public WeightBean createFromParcel(Parcel source) {
            return new WeightBean(source);
        }

        @Override
        public WeightBean[] newArray(int size) {
            return new WeightBean[size];
        }
    };



    public String getWeight() {
        return weight;
    }

    public int getContinuous() {
        return continuous;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }
    public void setWeightContinuous(String weight,int num) {
        if (this.weight.equals(weight.trim())){
            this.continuous = this.continuous+num;
        }else{
            this.weight = weight;
            this.continuous = 1;
        }

    }

    public void incContinuous(int num ) {
        this.continuous = this.continuous+num;
    }
}
