Creative Commons Legal Code
Attribution-NonCommercial 3.0 Unported
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT C...
If you think the Android project AudioBook 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
/**
* This work is licensed under the Creative Commons Attribution-NonCommercial-
* NoDerivs 3.0 Unported License. To view a copy of this license, visit
* http://creativecommons.org/licenses/by-nc-nd/3.0/ or send a letter to
* Creative Commons, 444 Castro Street, Suite 900, Mountain View, California,
* 94041, USA.//fromwww.java2s.com
*
* Use of this work is permitted only in accordance with license rights granted.
* Materials provided "AS IS"; no representations or warranties provided.
*
* Copyright ? 2012 Marcus Parkkinen, Aki K?kel?, Fredrik ?hs.
**/package edu.chalmers.dat255.audiobookplayer.model;
import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
/**
* A time stamp to be put in a track. Used to keep track of certain times.
* <p>
* The time is immutable, so the object must be destroyed and recreated to
* "move" a tag.
*
* @author Aki K?kel?
* @version 0.6
*
*/publicclass Tag implements Serializable {
privatestaticfinallong serialVersionUID = 4L;
privateint time;
/**
* Creates a tag which contains a track index and a time in milliseconds.
*
* @param time
* @param trackIndex
*/public Tag(int time) {
this.time = time;
}
/**
* @return Time in milliseconds.
*/publicint getTime() {
return time;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
publicint hashCode() {
returnnew HashCodeBuilder().append(time).toHashCode();
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
publicboolean equals(final Object obj) {
if (obj instanceof Tag) {
final Tag other = (Tag) obj;
returnnew EqualsBuilder().append(time, other.time).isEquals();
} else {
return false;
}
}
}