Last active
September 24, 2018 05:16
-
-
Save albow-net/d2b845dbcfac61a76b4f8f16716de10d to your computer and use it in GitHub Desktop.
jgrapht/Line.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Line { | |
private final String name; | |
private final int time; | |
Line( String name,int time ) { | |
this.name = name; | |
this.time = time; | |
} | |
public String getName() { | |
return this.name; | |
} | |
public int getTime() { | |
return this.time; | |
} | |
@Override | |
public String toString() { | |
return "Line [name=" + name + ", time=" + time + "]"; | |
} | |
@Override | |
public int hashCode() { | |
final int prime = 31; | |
int result = 1; | |
result = prime * result + ((name == null) ? 0 : name.hashCode()); | |
result = prime * result + time; | |
return result; | |
} | |
@Override | |
public boolean equals( Object obj ) { | |
if ( this == obj ) return true; | |
if ( obj == null ) return false; | |
if ( getClass() != obj.getClass() ) return false; | |
Line other = (Line)obj; | |
if ( name == null ) { | |
if ( other.name != null ) return false; | |
} else if ( ! name.equals( other.name ) ) { | |
return false; | |
} | |
if ( time != other.time ) { | |
return false; | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment