/**
* lowest and highest value in the to Map
*/
- int[] toRange=null;
+ int[] toRange=null;
public int getFromRatio()
{
return fromRatio;
fromShifts = new Vector();
for (int i=0;i<from.length; i+=2)
- {
+ {
ensureRange(fromRange, from[i]);
ensureRange(fromRange, from[i+1]);
- fromShifts.add(new int[]
+ fromShifts.addElement(new int[]
{from[i], from[i + 1]});
}
toShifts = new Vector();
{
ensureRange(toRange, to[i]);
ensureRange(toRange, to[i+1]);
- toShifts.add(new int[]
+ toShifts.addElement(new int[]
{to[i], to[i + 1]});
}
this.fromRatio=fromRatio;
return shift(pos, toShifts, toRatio, fromShifts, fromRatio);
}
/**
- *
+ *
* @param fromShifts
* @param fromRatio
* @param toShifts
iv = (int[]) fromShifts2.elementAt(intv++);
if (iv[0]<=iv[1]) {
if (fs==-1 && startpos>=iv[0] && startpos<=iv[1]) {
- fs = i;
+ fs = i;
}
if (fe==-1 && endpos>=iv[0] && endpos<=iv[1]) {
- fe = i;
+ fe = i;
}
} else {
if (fs==-1 && startpos<=iv[0] && startpos>=iv[1]) {
- fs = i;
+ fs = i;
}
if (fe==-1 && endpos<=iv[0] && endpos>=iv[1]) {
- fe = i;
+ fe = i;
}
}
i++;
iv = (int[]) fromShifts2.elementAt(i);
iv = new int[] { iv[1], iv[0]};// reverse and clone
// truncate initial interval
- if (i==fs)
+ if (i==fs)
{
iv[0] = startpos;
}
}
// create array of start end intervals.
int[] range = null;
- if (ranges!=null && ranges.size()>0)
+ if (ranges!=null && ranges.size()>0)
{
range = new int[ranges.size()*2];
intv = 0;
intvSize=ranges.size();
- i=0;
- while (intv<intvSize)
+ i=0;
+ while (intv<intvSize)
{
iv = (int[]) ranges.elementAt(intv);
range[i++] = iv[0];
System.out.print("\n");
f++;t--;
}
- }
+ }
System.out.print("\n");
mmap = ml.makeToMap();
System.out.println("ToMap : (" + mmap[0][0] + " " + mmap[0][1] + " " +
f++; t--;
System.out.print("\n");
}
- }
+ }
}