public class MapList
{
/* (non-Javadoc)
- * @see java.lang.Object#clone()
- */
- protected Object clone() throws CloneNotSupportedException {
- // TODO Auto-generated method stub
- return super.clone();
- }
- /* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(MapList obj) {
this.fromRatio=fromRatio;
this.toRatio=toRatio;
}
+ public MapList(MapList map)
+ {
+ this.fromRange = new int[]
+ { map.fromRange[0], map.fromRange[1] };
+ this.toRange = new int[]
+ { map.toRange[0], map.toRange[1] };
+ this.fromRatio = map.fromRatio;
+ this.toRatio = map.toRatio;
+ if (map.fromShifts != null)
+ {
+ this.fromShifts = new Vector();
+ Enumeration e = map.fromShifts.elements();
+ while (e.hasMoreElements())
+ {
+ int[] el = (int[]) e.nextElement();
+ fromShifts.addElement(new int[]
+ { el[0], el[1] });
+ }
+ }
+ if (map.toShifts != null)
+ {
+ this.toShifts = new Vector();
+ Enumeration e = map.toShifts.elements();
+ while (e.hasMoreElements())
+ {
+ int[] el = (int[]) e.nextElement();
+ toShifts.addElement(new int[]
+ { el[0], el[1] });
+ }
+ }
+ }
/**
* get all mapped positions from 'from' to 'to'
* @return int[][] { int[] { fromStart, fromFinish, toStart, toFinish }, int [fromFinish-fromStart+2] { toStart..toFinish mappings}}