中国开发网: 论坛: Java/J2ME: 贴子 724109
Apache:to mhappy
flex

package
{
import flash.utils.IDataInput;
import flash.utils.IDataOutput;
import flash.utils.IExternalizable;

import mx.collections.ArrayCollection;
[Binable]
[Remoteclass (alias="Zeta.bussinesss.xxx.xxx.Quest_collect")]
public class Quest_CollectBase implements IExternalizable
{
private var _commitcount:int;
private var _quest_id:String;
private var _sectionscollects:ArrayCollection;
private var _showcount:int;

public function Quest_Collect()
{
}
public function set commitcount(value:int):void
{
_commitcount=value;
}
public function get commitcount():int
{
return _commitcount;
}
//其他几个属性省略
public function readExternal(input:IDataInput):void
{
_quest_id=input.readObject() as String;
_showcount=input.readInt();
_commitcount=input.readInt();
_sectionscollects=input.readObject() as ArrayCollection;
}

public function writeExternal (output:IDataOutput):void
{

output.writeObject(_quest_id);
output.writeInt(_showcount);
output.writeInt(_commitcount);
output.writeObject(_sectionscollects);
}

}
}



JAVA



package Zeta.Bussiness.Collect;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serializable;
import java.util.ArrayList;

import flex.messaging.io.ArrayCollection;

public class Quest_Collect implements Serializable,Externalizable {


private String quest_id;
private int showcount=0;
private int commitcount=0;

private ArrayCollection sectioncollects;

public Quest_Collect()
{

this.sectioncollects= new ArrayCollection();
}
@Override
public void readExternal(ObjectInput input) throws IOException,
ClassNotFoundException {
// TODO Auto-generated method stub


this.quest_id=(String) input.readObject();
this.showcount=input.readInt();
this.commitcount=input.readInt();
this.sectioncollects=(ArrayCollection) input.readObject();

}

@Override
public void writeExternal(ObjectOutput output) throws IOException {
// TODO Auto-generated method stub
output.writeObject(quest_id);
output.writeInt(showcount);
output.writeInt(commitcount);
output.writeObject(sectioncollects);

}

public synchronized String getQuest_id() {
return quest_id;
}

public synchronized void setQuest_id(String quest_id) {
this.quest_id = quest_id;
}

public synchronized int getShowcount() {
return showcount;
}

public synchronized void setShowcount(int showcount) {
this.showcount = showcount;
}
public synchronized void addShowcount()
{
this.showcount++;
}
public synchronized int getCommitcount() {
return commitcount;
}

public synchronized void setCommitcount(int commitcount) {
this.commitcount = commitcount;
}
public synchronized void addCommitcount()
{
this.commitcount++;
}
public ArrayCollection getSectioncollects() {
return sectioncollects;
}
public void setSectioncollects(ArrayCollection value) {
this.sectioncollects = value;
}


}











相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录