Back to project page mobile-android.
The source code is released under:
MIT License
If you think the Android project mobile-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.manyconf.conference; /*from ww w.ja v a2 s .c o m*/ import android.os.Parcel; import android.os.Parcelable; /** * Model of a speaker, filled by the ConferenceBuilder class */ public class SpeakerModel implements Comparable<SpeakerModel>, Parcelable { public int speakerID; public String firstName; public String lastName; public String biography; public String email; public String company; public String toString() { return firstName + " " + lastName; } public SpeakerModel() { } @Override public int compareTo(SpeakerModel other) { int last = this.lastName.compareTo(other.lastName); int first = this.firstName.compareTo(other.firstName); if(last != 0) { return last; } else { return first; } } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SpeakerModel that = (SpeakerModel) o; if (company != null ? !company.equals(that.company) : that.company != null) return false; if (email != null ? !email.equals(that.email) : that.email != null) return false; if (!firstName.equals(that.firstName)) return false; if (!lastName.equals(that.lastName)) return false; return true; } @Override public int hashCode() { int result = firstName.hashCode(); result = 31 * result + lastName.hashCode(); result = 31 * result + (email != null ? email.hashCode() : 0); result = 31 * result + (company != null ? company.hashCode() : 0); return result; } // Constructor that accepts a parcel public SpeakerModel(Parcel in) { String[] data = new String[5]; in.readStringArray(data); this.firstName = data[0]; this.lastName = data[1]; this.biography = data[2]; this.email = data[3]; this.company = data[4]; } @Override public int describeContents(){ return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeStringArray(new String[] { this.firstName, this.lastName, this.biography, this.email, this.company}); } public static final Parcelable.Creator<SpeakerModel> CREATOR = new Parcelable.Creator<SpeakerModel>() { public SpeakerModel createFromParcel(Parcel in) { return new SpeakerModel(in); } public SpeakerModel[] newArray(int size) { return new SpeakerModel[size]; } }; }