Extent.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
00025 package org.gecode.gist;
00026
00027 public class Extent {
00028
00029 public int extentL;
00030 public int extentR;
00031
00032 public Extent(int pExtentL, int pExtentR) {
00033 extentL = pExtentL;
00034 extentR = pExtentR;
00035 }
00036
00037 public Extent(int width) {
00038 int halfWidth = width / 2;
00039 extentL = 0 - halfWidth;
00040 extentR = 0 + halfWidth;
00041 }
00042
00043 public void extend(int deltaL, int deltaR) {
00044 extentL += deltaL;
00045 extentR += deltaR;
00046 }
00047
00048 public void move(int delta) {
00049 extentL += delta;
00050 extentR += delta;
00051 }
00052
00053 public String toString() {
00054 return "(" + extentL + "," + extentR + ")";
00055 }
00056
00057 }