00001 //tabstop=4 00002 //*****************************************************************************/ 00003 // Project: jpl 00004 // 00005 // File: $Id$ 00006 // Date: $Date$ 00007 // Author: Fred Dushin <fadushin@syr.edu> 00008 // 00009 // 00010 // Description: 00011 // 00012 // 00013 // ------------------------------------------------------------------------- 00014 // Copyright (c) 1998 Fred Dushin 00015 // All rights reserved. 00016 // 00017 // This library is free software; you can redistribute it and/or 00018 // modify it under the terms of the GNU Library Public License 00019 // as published by the Free Software Foundation; either version 2 00020 // of the License, or (at your option) any later version. 00021 // 00022 // This library is distributed in the hope that it will be useful, 00023 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00024 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00025 // GNU Library Public License for more details. 00026 //*****************************************************************************/ 00027 package jpl.fli; 00028 00029 00030 00031 //----------------------------------------------------------------------/ 00032 // term_t 00055 // Implementation notes: 00056 // 00057 //----------------------------------------------------------------------/ 00058 public class term_t 00059 extends LongHolder 00060 { 00061 public static final long UNASSIGNED = -1L; 00062 00063 public 00064 term_t() 00065 { 00066 value = UNASSIGNED; 00067 } 00068 00069 //------------------------------------------------------------------/ 00070 // toString 00080 // Implementation notes: 00081 // 00082 //------------------------------------------------------------------/ 00083 public static String 00084 toString( int n, term_t term0 ) 00085 { 00086 String s = ""; 00087 int i; 00088 long ith_term_t; 00089 00090 for ( i = 0, ith_term_t = term0.value; i < n; ++i, ++ith_term_t ){ 00091 term_t term = new term_t(); 00092 term.value = ith_term_t; 00093 s += term.toString(); 00094 00095 if ( i != n - 1 ){ 00096 s += ", "; 00097 } 00098 } 00099 00100 return s; 00101 } 00102 00103 00104 //------------------------------------------------------------------/ 00105 // equals 00120 // Implementation notes: 00121 // 00122 //------------------------------------------------------------------/ 00123 public boolean 00124 equals( Object obj ) 00125 { 00126 return 00127 (obj instanceof term_t) && 00128 this.value == ((term_t)obj).value && 00129 this.value != UNASSIGNED; 00130 } 00131 } 00132 00133 //345678901234567890123456789012346578901234567890123456789012345678901234567890