If you think the Android project SensorDataCollector 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
/*
* Copyright (c) 2014, the SenSee authors. Please see the AUTHORS file
* for details. //www.java2s.com
*
* Licensed under the GNU Public License, Version 3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.gnu.org/copyleft/gpl.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/package sysnetlab.android.sdc.datacollector;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
publicclass Tag implements Parcelable {
privateint mId;
private String mName;
private String mShortDescription;
private String mLongDescription;
public Tag(String name, int tagId) {
this(name, "", "", tagId);
}
public Tag(String name, String shortDesc, int tagId) {
this(name, shortDesc, "", tagId);
}
public Tag(String name, String shortDesc, String longDesc, int tagId) {
mName = name;
mShortDescription = shortDesc;
mLongDescription = longDesc;
this.mId = tagId;
}
publicint getTagId() {
return mId;
}
publicvoid setTagId(int tagId) {
this.mId = tagId;
}
public String getName() {
return mName;
}
publicvoid setName(String mName) {
this.mName = mName;
}
public String getShortDescription() {
return mShortDescription;
}
publicvoid setShortDescription(String mShortDescription) {
this.mShortDescription = mShortDescription;
}
public String getLongDescription() {
return mLongDescription;
}
public String toString() {
return mName;
}
publicvoid setLongDescription(String mLongDescription) {
this.mLongDescription = mLongDescription;
}
@Override
publicboolean equals(Object rhs) {
if (rhs == this) {
return true;
}
if (!(rhs instanceof Tag)) {
return false;
}
Tag tag = (Tag) rhs;
if (mId != tag.mId) {
return false;
}
if (!TextUtils.equals(mName, tag.mName)) {
return false;
}
if (!TextUtils.equals(mShortDescription, tag.mShortDescription)) {
return false;
}
if (!TextUtils.equals(mLongDescription, tag.mLongDescription)) {
return false;
}
return true;
}
publicstaticfinal Parcelable.Creator<Tag> CREATOR = new Parcelable.Creator<Tag>() {
@Override
public Tag createFromParcel(Parcel inParcel) {
returnnew Tag(inParcel);
}
@Override
public Tag[] newArray(int size) {
returnnew Tag[size];
}
};
public Tag(Parcel inParcel) {
mId = inParcel.readInt();
mName = inParcel.readString();
mShortDescription = inParcel.readString();
mLongDescription = inParcel.readString();
}
@Override
publicint describeContents() {
return 0;
}
@Override
publicvoid writeToParcel(Parcel outParcel, int flags) {
outParcel.writeInt(mId);
outParcel.writeString(mName);
outParcel.writeString(mShortDescription);
outParcel.writeString(mLongDescription);
}
public Parcelable.Creator<Tag> getCreator() {
return CREATOR;
}
}