PPL Configured Java Language Interface  0.12.1
Variable.java
Go to the documentation of this file.
00001 /* Variable Java class declaration and implementation.
00002    Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
00003    Copyright (C) 2010-2012 BUGSENG srl (http://bugseng.com)
00004 
00005 This file is part of the Parma Polyhedra Library (PPL).
00006 
00007 The PPL is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 The PPL is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with this program; if not, write to the Free Software Foundation,
00019 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
00020 
00021 For the most up-to-date information see the Parma Polyhedra Library
00022 site: http://bugseng.com/products/ppl/ . */
00023 
00024 package parma_polyhedra_library;
00025 
00026 import javax.management.RuntimeErrorException;
00027 
00029 
00038 public class Variable implements Comparable<Variable> {
00040     private int varid;
00041 
00043 
00047     public Variable(int i) {
00048         if (i < 0)
00049             throw new
00050                 RuntimeErrorException(new Error("parma_polyhedra_library.Variable::"
00051                                                 + "Variable:"
00052                                                 + " an index variable"
00053                                                 + " cannot be negative."));
00054         varid = i;
00055     }
00056 
00058     public int id() {
00059         return varid;
00060     }
00061 
00067     public int compareTo(Variable v) {
00068         return varid - v.varid;
00069     }
00070 
00071     private static native void initIDs();
00072     static {
00073         initIDs();
00074     }
00075 }