Get the new position
@since 19.06.2006
@param p
@param keyOff
@return
162391
public int updatePosition(int p, boolean keyOff)
	{
		p++;
		if (loop && p>=position[loopEndPoint]) p=position[loopStartPoint];
		if (sustain && p>=position[sustainEndPoint] && !keyOff) p=position[sustainStartPoint];
		return p;
	}
1072560
public void position(long p) throws IOException {
        long blockStart = (input.position() - maxOffset) 
         / buffer.length * buffer.length;
        long blockEnd = blockStart + maxOffset;
        if ((p >= blockStart) && (p < blockEnd)) {
            // Desired position is somewhere inside current buffer
            long adj = p - blockStart;
            offset = (int)adj;
            return;
        }
        positionDirect(p);
    }
1037332
public V get(final K key) {
		if (map.containsKey(key)) {
			// remove from queue and add it again in FIFO queue
			queue.remove(key);
			queue.add(key);
		}
		return map.get(key);
	}
44766
public ScreenLocation getNextLocation(short position, short setNewAnchor)
    {
        if (position == ScreenConstants.FIRST_LOCATION)
            position = ScreenConstants.FIRST_FIELD_BUTTON_LOCATION;
        if (position == ScreenConstants.NEXT_LOGICAL)
            position = ScreenConstants.RIGHT_OF_LAST_BUTTON;
        return super.getNextLocation(position, setNewAnchor);
    }
968720
@Override
	@Pure
	public final P getNearest(Point2D<?, ?> position) {
		final Pair<P, Double> data = getNearestData(position.getX(), position.getY());
		if (data != null) {
			return data.getKey();
		}
		return null;
	}
868712
public long pushPosition(final long iPosition) throws IOException {
    final int position = getHoles() * RECORD_SIZE;
    file.allocateSpace(RECORD_SIZE);

    file.writeLong(position, iPosition);

    if (OLogManager.instance().isDebugEnabled())
      OLogManager.instance().debug(this, "Pushed new hole %s/#%d -> #%d:%d", owner.getName(), position / RECORD_SIZE,
          owner.getId(), iPosition);

    return position;
  }
41835
public boolean moveTo(final long pKey) {
        try {
            if (pKey < 0 || mRTX.moveTo(pKey)) {
                lastPointer.put(mRTX, pKey);
                return true;
            } else {
                return false;
            }
        } catch (TTIOException exc) {
            throw new RuntimeException(exc);
        }
    }
1195887
public long getBackpointer(long newKeyNum) {
    int index = Arrays.binarySearch(newKeyNums, newKeyNum);
    if (index >= 0) {
      return oldKeyNums[index];
    }
    return -1;
  }
308238
public static <K, V, P> V getIfAbsentWith(
            Map<K, V> map,
            K key,
            Function<? super P, ? extends V> function,
            P parameter)
    {
        if (map instanceof UnsortedMapIterable)
        {
            return ((MapIterable<K, V>) map).getIfAbsentWith(key, function, parameter);
        }
        V result = map.get(key);
        if (MapIterate.isAbsent(result, map, key))
        {
            result = function.valueOf(parameter);
        }
        return result;
    }
882168
@Override
    public C setLocation(final Point2D p)
    {
        setX(p.getX());

        setY(p.getY());

        return cast();
    }
1161851
@Override
  public Object get(final ByteBuffer buf, final int position)
  {
    final Lock lock = stripedLock.getAt(lockIndex(position)).readLock();
    lock.lock();
    try {
      return sketchCache.get(buf).get(position).copy();
    }
    finally {
      lock.unlock();
    }
  }
1222507
protected final int shiftKeys(int pos) {
		// Shift entries with the same hash.
		int last, slot;
		for (;;) {
			pos = ((last = pos) + 1) & mask;
			while (workbenchEntry[pos] != null) {
				slot = hashCode(workbenchEntry[pos].ipAddress) & mask;
				if (last <= pos ? last >= slot || slot > pos : last >= slot && slot > pos) break;
				pos = (pos + 1) & mask;
			}
			if (workbenchEntry[pos] == null) break;
			workbenchEntry[last] = workbenchEntry[pos];
		}
		workbenchEntry[last] = null;
		return last;
	}
987435
function _getNewOffset(pos, zeroPos, maxOffset) {
        var offset = pos - zeroPos;
        offset = Math.min(maxOffset, Math.max(0, offset));
        return offset;
    }
1067146
private Parameter getParameterByOrdinal(Integer position)
    {
        for (Parameter p : parameters)
        {
            if (position.equals(p.getPosition()))
            {
                return p;
            }
        }

        return null;
    }
629094
private PGPSecretKey getSecretKey(InputStream input, String keyId) throws IOException, PGPException {
        PGPSecretKeyRingCollection keyrings = new PGPSecretKeyRingCollection(PGPUtil.getDecoderStream(input), new JcaKeyFingerprintCalculator());

        Iterator rIt = keyrings.getKeyRings();

        while (rIt.hasNext()) {
            PGPSecretKeyRing kRing = (PGPSecretKeyRing) rIt.next();
            Iterator kIt = kRing.getSecretKeys();

            while (kIt.hasNext()) {
                PGPSecretKey key = (PGPSecretKey) kIt.next();

                if (key.isSigningKey() && String.format("%08x", key.getKeyID() & 0xFFFFFFFFL).equals(keyId.toLowerCase())) {
                    return key;
                }
            }
        }

        return null;
    }
519541
public long getPosition() {
		try {
			return reader.getFilePointer();
		} catch (IOException ex) {
			logger.logp(Level.SEVERE, className, "getPosition", "HPEL_ErrorReadingFileOffset", new Object[]{file, ex.getMessage()});
		}
		return -1L;
	}
687938
public final TextBuilder p(float f) {
        if (null != __buffer) __append(f);
        else __caller.p(f);
        return this;
    }