2017-08-19 1 views
-1

サーバ接続にはsetTimeoutを使用します。接続するときはベクターリストを逆にしたいと思います。どのように私のベクトルリストを反転させる?AS3ベクターリストを逆にする方法

マイベクトル変数クラス

public class UriIterator 
{ 
    private var _availableAddresses: Vector.<SocketConnection> = new Vector.<SocketConnection>(); 
    private var currentIndex:int = 0; 

    public function UriIterator(){ 

    } 


    public function withAddress(host: String, port: int): UriIterator { 
     const a: SocketConnection = new SocketConnection(host, port); 
     _availableAddresses.push(a); 
     return this; 
    } 


    public function get next():SocketConnection { 
     var address = _availableAddresses[currentIndex]; 
     currentIndex++; 
     if (currentIndex > _availableAddresses.length - 1) 
      currentIndex = 0; 
     return address; 
    } 




} 

とその

public static const urisToTry: UriIterator = new UriIterator() 

urisToTry.withAddress("https:// 123", 1234); 
urisToTry.withAddress("https:// 123", 1234); 
urisToTry.withAddress("https:// 123", 1234); 
urisToTry.withAddress("https:// 123", 1234); 

答えて

関連する問題