📄 citymap.java
字号:
public class CityMap
{
String city;
double xpos;
double ypos;
public CityMap(String s_city)
{
String _city[]=new String[3];
_city=get_info(s_city,(int)'\t');
city=_city[0];
Double doubl;
doubl=Double.valueOf(_city[1]);
xpos=doubl.doubleValue();
doubl=Double.valueOf(_city[2]);
ypos=doubl.doubleValue();
}
public CityMap()
{
city="";
xpos=0.0;
ypos=0.0;
}
/**
*method: splitString
*param: args the string to split
*param: c the char you want to match
*return: a array
*/
public static String[] get_info(String arg,int c)
{
String[] _array=new String[6];
int cc=0;
//System.out.println(arg.indexOf(c));
while(arg.indexOf(c)!=-1)
{
_array[cc]=arg.substring(0,arg.indexOf(c));
arg=arg.substring(arg.indexOf(c)+1,arg.length());
cc++;
}
_array[cc]=arg;
return _array;
}
/**
*method:getcity()
*/
public String getcity()
{
return city;
}
/**
*method:
*/
public double getxpos()
{
return xpos;
}/**
*method:
*/
public double getypos()
{
return ypos;
}
/**
*method:
*/
public void setcity(String c)
{
city=c;
}
/**
*method:
*/
public void setxpos(double c)
{
xpos=c;
}
/**
*method:
*/
public void setypos(double c)
{
ypos=c;
}
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -