OffsetView.java
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 package org.gecode;
00025
00037 public class OffsetView<IV extends IntView> implements IntView {
00038 private IV v;
00039 private int c;
00040
00043 public OffsetView() {}
00046 public OffsetView(JavaSpace s, int c0, IV x) {
00047 v = x;
00048 c = c0;
00049 }
00050
00051 @SuppressWarnings("unchecked")
00052 public OffsetView<IV> copy(JavaSpace newHome, boolean share) {
00053 OffsetView<IV> nv = new OffsetView<IV>();
00054 nv.v = (IV)v.copy(newHome, share);
00055 nv.c = c;
00056 return nv;
00057 }
00058 public void subscribe(JavaSpace s, JavaPropagator p, PropCond pc) {
00059 v.subscribe(s, p, pc);
00060 }
00061 public void cancel(JavaSpace s, JavaPropagator p, PropCond pc) {
00062 v.cancel(s, p, pc);
00063 }
00064
00065 public boolean assigned() { return v.assigned(); }
00066 public int val() { return v.val()+c; }
00067 public int min() { return v.min()+c; }
00068 public int max() { return v.max()+c; }
00069 public boolean in(int val) { return v.in(val-c); }
00070
00071 public IntModEvent lq(JavaSpace s, int i) {
00072 return v.lq(s, i-c);
00073 }
00074 public IntModEvent eq(JavaSpace s, int i) {
00075 return v.eq(s, i-c);
00076 }
00077 public IntModEvent gq(JavaSpace s, int i) {
00078 return v.gq(s, i-c);
00079 }
00080 public IntModEvent nq(JavaSpace s, int i) {
00081 return v.nq(s, i-c);
00082 }
00083
00084 public IntModEvent inter(JavaSpace s, RangeIterator iter) {
00085 throw (new UnsupportedOperationException("Not implemented"));
00086 }
00087 }