首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

flex中的创办StringBuffer

2012-10-31 
flex中的创建StringBufferimport mx.collections.ArrayCollection??public class StringBuffer?{???publi

flex中的创建StringBuffer

import mx.collections.ArrayCollection;
?
?public class StringBuffer
?{
?
??public function StringBuffer()
??{
??}?????
???? /**
???? * @private
???? * */
???? private var source:ArrayCollection=new ArrayCollection();
????
??public function get data():ArrayCollection
??{
???return source;
??}
??
??/**
???? * @private
???? * */
??public function set data(value:ArrayCollection):void
??{
???source.removeAll();
???source=value;
??}
??????/**
???? * @private
???? * */
??public function append(s:String):StringBuffer
??{
???source.addItem(s);
???return this;
??}
??
??/**
???? * @private
???? * */
??public function insert(i:int,s:String):StringBuffer
??{
???source.addItemAt(s,i);
???return this;
??}
??
??/**
???? * @private
???? * */
??public function remove(i:int):StringBuffer
??{
???source.removeItemAt(i);
???return this;
??}
??
??/**
???? * @private
???? * */
??public function clear():void
??{
???source.removeAll();
??}
??
??/**
???? * @private
???? * */
??public function toString():String
??{
???var result:String="";
???for each(var s:String in source)
????result+=s+"\n";
???return result;
??}
??
?}

热点排行