22 lines
452 B
Java
22 lines
452 B
Java
package com.inmind.map01;
|
|
|
|
public class Poker implements Comparable<Poker>{
|
|
String pokerName;//牌面
|
|
int index;//牌的索引,用来排序
|
|
|
|
public Poker(String pokerName, int index) {
|
|
this.pokerName = pokerName;
|
|
this.index = index;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return this.pokerName+" ";
|
|
}
|
|
|
|
@Override
|
|
public int compareTo(Poker o) {
|
|
return this.index - o.index;
|
|
}
|
|
}
|