JML

net.sf.jqql.obsolete
Class SlideWindow

java.lang.Object
  extended by net.sf.jqql.obsolete.SlideWindow

public class SlideWindow
extends Object

 SlideWidow
 QQ everytime only send a fragment, originally doesn't need to use SlideWindow.
 but consider for posterior  expansibility, define a SlideWindow, its biggest size is 32
 滑窗
 QQ每次只发送一个分片,本来是无需使用滑窗的。但是为了以后的扩展性考虑,还是
 定义一个滑窗,滑窗最大尺寸是32
 

Author:
luma

Constructor Summary
SlideWindow(int size, int m)
          constructed function, set some initial value 构造函数,设置一些初始值
SlideWindow(int size, int l, int m)
          constructed function, set some initial value 构造函数,初始化一些值
 
Method Summary
 int getHigh()
           
 int getIncrement()
           
 int getLow()
           
 int getMask()
           
 int getMaxPassed()
           
 int getWindowSize()
           
 boolean isFinished()
           
 boolean put(int window)
           fill a window, if appointed window is out of indeed window area, then fail, or if this window has been filled, also fail, or else success if filled window is low position, increase low 填充一个窗口,如果指定的窗口在当然窗口范围之外,则失败,或者如果这个窗口 之前填充过,也失败,否则成功 如果填充的窗口是下限位置,则提升下限
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlideWindow

public SlideWindow(int size,
                   int m)
constructed function, set some initial value 构造函数,设置一些初始值

Parameters:
size - 滑窗大小 // SlideWindow size
m - 最大窗口值 // window value max

SlideWindow

public SlideWindow(int size,
                   int l,
                   int m)
constructed function, set some initial value 构造函数,初始化一些值

Parameters:
size - 滑窗大小 // SlideWindow size
l - 初始下限值 // initial low value
m - 最大窗口值 // window value max
Method Detail

put

public boolean put(int window)
 fill a window, if appointed window is out of indeed window area, then fail, 
 or if this window has been filled, also fail, or else success
 if filled window is low position, increase low
 填充一个窗口,如果指定的窗口在当然窗口范围之外,则失败,或者如果这个窗口
 之前填充过,也失败,否则成功
 如果填充的窗口是下限位置,则提升下限
 

Parameters:
window - 窗口索引
Returns:
成功返回true,失败返回false

getMaxPassed

public int getMaxPassed()
Returns:
已经收到或者发送成功的最大窗口值 // max window value which is received or sent

isFinished

public boolean isFinished()
Returns:
true表示所有期望收到的都已经收到 // means all indeed receiving is received

getLow

public int getLow()
Returns:
Returns the low.

getHigh

public int getHigh()
Returns:
Returns the high.

getMask

public int getMask()
Returns:
Returns the mask.

getWindowSize

public int getWindowSize()
Returns:
Returns the windowSize.

getIncrement

public int getIncrement()
Returns:
Returns the increment.

JML