PPL Configured Java Language Interface  1.2
Variable.java
Go to the documentation of this file.
1 /* Variable Java class declaration and implementation.
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 package parma_polyhedra_library;
25 
26 import javax.management.RuntimeErrorException;
27 
29 
38 public class Variable implements Comparable<Variable> {
40  private long varid;
41 
43 
47  public Variable(long i) {
48  if (i < 0)
49  throw new
50  RuntimeErrorException(new Error("parma_polyhedra_library.Variable::"
51  + "Variable:"
52  + " an index variable"
53  + " cannot be negative."));
54  varid = i;
55  }
56 
58  public long id() {
59  return varid;
60  }
61 
67  public int compareTo(Variable v) {
68  if (varid < v.varid)
69  return -1;
70  else if (varid == v.varid)
71  return 0;
72  else
73  return 1;
74  }
75 
78 
87  public static native void setStringifier(Variable_Stringifier vs);
88 
89  public native String toString();
90 
91  private static native void initIDs();
92  static {
93  initIDs();
94  }
95 }
int compareTo(Variable v)
Returns a negative number if this is smaller than v, a zero if this equals v, a positive number if v ...
Definition: Variable.java:67
An interface for objects converting a Variable id to a string.
static native void initIDs()
Variable(long i)
Builds the variable corresponding to the Cartesian axis of index i.
Definition: Variable.java:47
static native void setStringifier(Variable_Stringifier vs)
Sets the variable stringifier object.
long id()
Returns the index of the Cartesian axis associated to this.
Definition: Variable.java:58
long varid
The index of the Cartesian axis.
Definition: Variable.java:40
A dimension of the vector space.
Definition: Variable.java:38
static Variable_Stringifier stringifier
Optional customization provider for toString.
Definition: Variable.java:77