【Java开源代码栏目提醒】:网学会员在Java开源代码频道为大家收集整理了Voting.java提供大家参考,希望对大家有所帮助!
/**
*
*/
package com.mwq.info;
import java.io.UnsupportedEncodingException;
/**
* @author mwq
*
*/
public class Voting {
private String work;
private String art;
private String level;
private String[] borrow;
private String[] want;
private String[] needs;
private String[] scarcity;
private String[] buy;
/**
* @return art
*/
public String getArt() {
return art;
}
/**
* @param art
* 要设置的 art
*/
public void setArt(String art) {
this.art = art;
}
/**
* @return borrow
*/
public String[] getBorrow() {
return borrow;
}
/**
* @param borrow
* 要设置的 borrow
*/
public void setBorrow(String[] borrow) {
this.borrow = borrow;
for (int i = 0; i < borrow.length; i++) {
this.borrow[i] = this.toChinese(borrow[i]);
}
}
/**
* @return buy
*/
public String[] getBuy() {
return buy;
}
/**
* @param buy
* 要设置的 buy
*/
public void setBuy(String[] buy) {
this.buy = buy;
for (int i = 0; i < buy.length; i++) {
this.buy[i] = this.toChinese(buy[i]);
}
}
/**
* @return level
*/
public String getLevel() {
return level;
}
/**
* @param level
* 要设置的 level
*/
public void setLevel(String level) {
this.level = this.toChinese(level);
}
/**
* @return needs
*/
public String[] getNeeds() {
return needs;
}
/**
* @param needs
* 要设置的 needs
*/
public void setNeeds(String[] needs) {
this.needs = needs;
for (int i = 0; i < needs.length; i++) {
this.needs[i] = this.toChinese(needs[i]);
}
}
/**
* @return scarcity
*/
public String[] getScarcity() {
return scarcity;
}
/**
* @param scarcity
* 要设置的 scarcity
*/
public void setScarcity(String[] scarcity) {
this.scarcity = scarcity;
for (int i = 0; i < scarcity.length; i++) {
this.scarcity[i] = this.toChinese(scarcity[i]);
}
}
/**
* @return want
*/
public String[] getWant() {
return want;
}
/**
* @param want
* 要设置的 want
*/
public void setWant(String[] want) {
this.want = want;
for (int i = 0; i < want.length; i++) {
this.want[i] = this.toChinese(want[i]);
}
}
/**
* @return work
*/
public String getWork() {
return work;
}
/**
* @param work
* 要设置的 work
*/
public void setWork(String work) {
this.work = this.toChinese(work);
}
public String toChinese(String str) {
String chinese = null;
try {
chinese = new String(str.trim().getBytes("ISO8859-1"), "GB2312");
} catch (UnsupportedEncodingException e) {
System.out.println("在进行字符转码时抛出异常,内容如下:");
e.printStackTrace();
}
return chinese;
}
}
上一篇:
VoteUpdateAction.java
下一篇:
关于大学英语教学