Looks up what interactable component is as a particular location in the map
@param position Position to look up
@return The {@code Interactable} component at the specified location or {@code null} if there's nothing there
516263
public synchronized Interactable getInteractableAt(TerminalPosition position) {
        if (position.getRow() < 0 || position.getColumn() < 0) {
            return null;
        }
        if(position.getRow() >= lookupMap.length) {
            return null;
        }
        else if(position.getColumn() >= lookupMap[0].length) {
            return null;
        }
        else if(lookupMap[position.getRow()][position.getColumn()] == -1) {
            return null;
        }
        return interactables.get(lookupMap[position.getRow()][position.getColumn()]);
    }
976630
private CompletableFuture<IteratorBatch<T>> fetch(int position) {
    return openFuture.thenCompose(initialBatch -> {
      if (!initialBatch.complete()) {
        return client.applyOn(partitionId, service -> nextFunction.next(service, initialBatch.id(), position))
            .thenCompose(nextBatch -> {
              if (nextBatch == null) {
                return close().thenApply(v -> null);
              }
              return CompletableFuture.completedFuture(nextBatch);
            });
      }
      return CompletableFuture.completedFuture(null);
    });
  }
20114
public ScreenLocation getNextLocation(short position, short setNewAnchor)
    {
        if (position == ScreenConstants.FIRST_LOCATION)
            position = ScreenConstants.FIRST_FRAME_LOCATION;
        if (position == ScreenConstants.NEXT_LOGICAL)
            position = ScreenConstants.BELOW_LAST_CONTROL;      // Stack all screens (should only be applet)
        if (position == ScreenConstants.ADD_SCREEN_VIEW_BUFFER)
            position = ScreenConstants.ADD_VIEW_BUFFER;     // No buffer around frame!
        return super.getNextLocation(position, setNewAnchor);
    }
973199
@SuppressWarnings("ConstantConditions")
    public synchronized void add(Interactable interactable) {
        TerminalPosition topLeft = interactable.toBasePane(TerminalPosition.TOP_LEFT_CORNER);
        TerminalSize size = interactable.getSize();
        interactables.add(interactable);
        int index = interactables.size() - 1;
        for(int y = topLeft.getRow(); y < topLeft.getRow() + size.getRows(); y++) {
            for(int x = topLeft.getColumn(); x < topLeft.getColumn() + size.getColumns(); x++) {
                //Make sure it's not outside the map
                if(y >= 0 && y < lookupMap.length &&
                        x >= 0 && x < lookupMap[y].length) {
                    lookupMap[y][x] = index;
                }
            }
        }
    }
632384
@Override
    public SourcePosition position() {
        if (tsym.sourcefile == null) return null;
        return SourcePositionImpl.make(tsym.sourcefile,
                                       (tree==null) ? Position.NOPOS : tree.pos,
                                       lineMap);
    }
996507
public CmsPositionBean getAreaPosition(boolean relative) {

        // returning the relative position
        if (relative) {
            return new CmsPositionBean(m_currentSelection);
        }

        // returning the absolute position
        CmsPositionBean abs = new CmsPositionBean(m_currentSelection);
        abs.setTop(m_currentSelection.getTop() + getElement().getAbsoluteTop());
        abs.setLeft(m_currentSelection.getLeft() + getElement().getAbsoluteLeft());
        return abs;
    }
224758
public PositionOptions getPosition()
	{
		IComplexOption position = options.getComplexOption("position");
		
		if (position instanceof PositionOptions)
		{
			return (PositionOptions) position;
		}
		
		return new PositionOptions()
				.setMy(new PositionAlignmentOptions(PositionRelation.CENTER))
				.setAt(new PositionAlignmentOptions(PositionRelation.CENTER))
				.setOf("window");
	}
59068
private Interactable findNextUpOrDown(Interactable interactable, boolean isDown) {
        int directionTerm = isDown ? 1 : -1;
        TerminalPosition startPosition = interactable.getCursorLocation();
        if (startPosition == null) {
            // If the currently active interactable component is not showing the cursor, use the top-left position
            // instead if we're going up, or the bottom-left position if we're going down
            if(isDown) {
                startPosition = new TerminalPosition(0, interactable.getSize().getRows() - 1);
            }
            else {
                startPosition = TerminalPosition.TOP_LEFT_CORNER;
            }
        }
        else {
            //Adjust position so that it's at the bottom of the component if we're going down or at the top of the
            //component if we're going right. Otherwise the lookup might product odd results in certain cases.
            if(isDown) {
                startPosition = startPosition.withRow(interactable.getSize().getRows() - 1);
            }
            else {
                startPosition = startPosition.withRow(0);
            }
        }
        startPosition = interactable.toBasePane(startPosition);
        if(startPosition == null) {
            // The structure has changed, our interactable is no longer inside the base pane!
            return null;
        }
        Set<Interactable> disqualified = getDisqualifiedInteractables(startPosition, true);
        TerminalSize size = getSize();
        int maxShiftLeft = interactable.toBasePane(TerminalPosition.TOP_LEFT_CORNER).getColumn();
        maxShiftLeft = Math.max(maxShiftLeft, 0);
        int maxShiftRight = interactable.toBasePane(new TerminalPosition(interactable.getSize().getColumns() - 1, 0)).getColumn();
        maxShiftRight = Math.min(maxShiftRight, size.getColumns() - 1);
        int maxShift = Math.max(startPosition.getColumn() - maxShiftLeft, maxShiftRight - startPosition.getRow());
        for (int searchRow = startPosition.getRow() + directionTerm;
             searchRow >= 0 && searchRow < size.getRows();
             searchRow += directionTerm) {

            for (int xShift = 0; xShift <= maxShift; xShift++) {
                for (int modifier : new int[]{1, -1}) {
                    if (xShift == 0 && modifier == -1) {
                        break;
                    }
                    int searchColumn = startPosition.getColumn() + (xShift * modifier);
                    if (searchColumn < maxShiftLeft || searchColumn > maxShiftRight) {
                        continue;
                    }

                    int index = lookupMap[searchRow][searchColumn];
                    if (index != -1 && !disqualified.contains(interactables.get(index))) {
                        return interactables.get(index);
                    }
                }
            }
        }
        return null;
    }
792503
private void setPosition(CmsPositionBean position) {

        m_currentPosition = position;
        setSelectPosition(position.getLeft(), position.getTop(), position.getHeight(), position.getWidth());
    }
125654
public E lookahead(int position) {
        int idx = offset + position - 1;
        if (idx < elements.length) {
            return elements[idx];
        }
        return null;
    }
615013
@Override
    public void removeComponent(int position) {
        if (mData != null && position >= 0 && position < mData.size()) {
            removeComponent(mData.get(position));
        }
    }
81613
public int getChildPosition(View child) {
        final ViewHolder holder = getChildViewHolderInt(child);
        return holder != null ? holder.getPosition() : NO_POSITION;
    }
180288
public ScreenLocation getNextLocation(short position, short setNewAnchor)
    {
        if (position == ScreenConstants.NEXT_LOGICAL)
            position = ScreenConstants.RIGHT_OF_LAST;
        if (position == ScreenConstants.FIRST_LOCATION)
            position = ScreenConstants.FIRST_DISPLAY_LOCATION;
        if (position == ScreenConstants.ADD_SCREEN_VIEW_BUFFER)
            position = ScreenConstants.ADD_GRID_SCREEN_BUFFER;      // No buffer around frame!
        return super.getNextLocation(position, setNewAnchor);
    }
1030953
public View getHeaderAt(int position) {
        if (position == MATCHED_STICKIED_HEADER) {
            return mStickiedHeader;
        }

        try {
            return (View)getChildAt(position).getTag();
        } catch (Exception e) {
        }
        return null;
    }
420042
public void setPosition(GeoLocationPoint position) {
		if ((this.position == null && position != null)
			|| (this.position != null && !this.position.equals(position))) {
			this.position = position;
			fireShapeChanged();
			checkPrimitiveValidity();
		}
	}
26976
private void searchAtLocation(Coordinate location, boolean isShift) {
		Geometry point = new Geometry(Geometry.POINT, 0, -1);
		point.setCoordinates(new Coordinate[] { location });

		GeomajasServerExtension
				.getInstance()
				.getServerFeatureService()
				.search(mapPresenter, point, pixelsToUnits(pixelTolerance), QueryType.INTERSECTS, searchLayerType, -1,
						new SelectionCallback(isShift, false));
	}
920294
public  MaterialAccount getAccountAtCurrentPosition(int position) {

        if (position < 0 || position >= accountManager.size())
            throw  new RuntimeException("Account Index Overflow");

        return findAccountNumber(position);
    }