2009-06-25 07:16:22 -07:00
|
|
|
|
/*
|
|
|
|
|
* BPPair.cs
|
|
|
|
|
* Copyright (c) 2008-2009 kbinani
|
|
|
|
|
*
|
|
|
|
|
* This file is part of Boare.Lib.Vsq.
|
|
|
|
|
*
|
|
|
|
|
* Boare.Lib.Vsq is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the BSD License.
|
|
|
|
|
*
|
|
|
|
|
* Boare.Lib.Vsq is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
*/
|
2009-09-07 03:44:18 -07:00
|
|
|
|
#if JAVA
|
2010-03-16 20:14:08 -07:00
|
|
|
|
package org.kbinani.vsq;
|
|
|
|
|
|
|
|
|
|
import java.io.*;
|
2009-09-07 03:44:18 -07:00
|
|
|
|
#else
|
2009-06-25 07:16:22 -07:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Boare.Lib.Vsq {
|
2009-09-07 03:44:18 -07:00
|
|
|
|
#endif
|
2009-06-25 07:16:22 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Stores the paired value of "Clock" and integer. Mainly used in VsqBPList
|
|
|
|
|
/// </summary>
|
2009-09-07 03:44:18 -07:00
|
|
|
|
#if JAVA
|
2010-03-16 20:14:08 -07:00
|
|
|
|
public class BPPair implements Comparable<BPPair>, Serializable{
|
2009-09-07 03:44:18 -07:00
|
|
|
|
#else
|
2009-06-25 07:16:22 -07:00
|
|
|
|
[Serializable]
|
2010-03-16 20:14:08 -07:00
|
|
|
|
public class BPPair : IComparable<BPPair>{
|
2009-09-07 03:44:18 -07:00
|
|
|
|
#endif
|
2009-06-25 07:16:22 -07:00
|
|
|
|
public int Clock;
|
|
|
|
|
public int Value;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// このインスタンスと、指定したオブジェクトを比較します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item"></param>
|
|
|
|
|
/// <returns></returns>
|
2009-09-07 03:44:18 -07:00
|
|
|
|
public int compareTo( BPPair item ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
if ( Clock > item.Clock ) {
|
|
|
|
|
return 1;
|
|
|
|
|
} else if ( Clock < item.Clock ) {
|
|
|
|
|
return -1;
|
|
|
|
|
} else {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if !JAVA
|
2009-09-07 03:44:18 -07:00
|
|
|
|
public int CompareTo( BPPair item ) {
|
|
|
|
|
return compareTo( item );
|
|
|
|
|
}
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#endif
|
2009-09-07 03:44:18 -07:00
|
|
|
|
|
2009-06-25 07:16:22 -07:00
|
|
|
|
public BPPair( int clock_, int value_ ) {
|
|
|
|
|
Clock = clock_;
|
|
|
|
|
Value = value_;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if !JAVA
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#endif
|