swOffsets = new int[offsets.length+1]; System.arraycopy( offsets, 0, swOffsets, 0, offsets.length ); swOffsets[offsets.length] = defOffset; Arrays.sort(swOffsets);
int uniqueOffsets = 0; int lastValue = -1; for (int i = 0; i < offsets.length; i++) { if (offsets[i] != lastValue) { uniqueOffsets++; lastValue = offsets[i]; } }  swOffsets = new int[uniqueOffsets]; int insertPos = 0; lastValue = -1; for (int i = 0; i < offsets.length; i++) { if (offsets[i] != lastValue) { swOffsets[insertPos++] = offsets[i]; lastValue = offsets[i]; } }
		public SwitchDetails(int pc, int[] offsets, int defOffset) {			switchPC = pc;			swOffsets = new int[offsets.length+1];			System.arraycopy( offsets, 0, swOffsets, 0, offsets.length );			swOffsets[offsets.length] = defOffset;			Arrays.sort(swOffsets);			defaultOffset = defOffset;			nextOffset = 0;		}	