FileDocCategorySizeDatePackage
RTP.javaAPI DocFobs4JMF API 0.4.11624Wed Dec 28 15:56:58 GMT 2005com.neon.util

RTP

public class RTP extends Object
Neon Standard Utilities RTP Utilities
author
Scott Hays
created
2005/08/26 Copyright (c) 2005 Neon Advanced Technologies Co., Ltd. All rights reserved. The Neon RTP Utility is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The Neon RTP Utility is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

Fields Summary
private static int
MAX_SEQ_NUM
Constructors Summary
Methods Summary
public static booleanareConsecutiveSequenceNumbers(long numOne, long numTwo)

	
	       
		if (numOne == MAX_SEQ_NUM && numTwo == 0) return true;
		if (numOne+1 == numTwo) return true;
		
		return false;
	
public static intcompareSequenceNumbers(long p, long c)

		// Allow for the case where sequence number has wrapped.
		if (p > MAX_SEQ_NUM - 100 && c < 100) return 1;
		if (c > MAX_SEQ_NUM - 100 && p < 100) return -1;
		
		if (p < c) return -1;
		if (p == c) return 0;
		
		return 1;
	
public static longnextSequenceNumber(long seq)

		if (seq == MAX_SEQ_NUM) return 0;
		return seq+1;
	
public static longpreviousSequenceNumber(long seq)

		if (seq == 0) return MAX_SEQ_NUM;
		return seq-1;