Searches for the given item and calculates its global position

@param identifier the identifier of an item which is searched for
@return the global position, or -1 if not found
342940
public int getPosition(long identifier) {
        int position = 0;
        for (IAdapter<Item> adapter : mAdapters) {
            if (adapter.getOrder() < 0) {
                continue;
            }

            int relativePosition = adapter.getAdapterPosition(identifier);
            if (relativePosition != -1) {
                return position + relativePosition;
            }
            position = adapter.getAdapterItemCount();
        }

        return -1;
    }
762383
public void updateItem(long identifier) {
        if (mDrawer != null && mAdapter != null && mItemAdapter.getAdapterItems() != null && identifier != -1) {
            IDrawerItem drawerItem = DrawerUtils.getDrawerItem(getDrawerItems(), identifier);
            for (int i = 0; i < mItemAdapter.getAdapterItems().size(); i++) {
                if (mItemAdapter.getAdapterItems().get(i).getIdentifier() == drawerItem.getIdentifier()) {
                    IDrawerItem miniDrawerItem = generateMiniDrawerItem(drawerItem);
                    if (miniDrawerItem != null) {
                        mItemAdapter.set(i, miniDrawerItem);
                    }
                }
            }
        }
    }
719615
@SuppressWarnings("unchecked")
    public Declaration getDeclaration(final String identifier) {
        if ( this.dirty || (this.declarations == null) ) {
            this.declarations = this.getExtendedLhs( this, null ).getOuterDeclarations();
            this.dirty = false;
        }
        return this.declarations.get( identifier );
    }
1129688
public ModelAdapter<Model, Item> removeByIdentifier(final long identifier) {
        recursive(new AdapterPredicate<Item>() {
            @Override
            public boolean apply(@NonNull IAdapter<Item> lastParentAdapter, int lastParentPosition, Item item, int position) {
                if (identifier == item.getIdentifier()) {
                    //if it's a subitem remove it from the parent
                    if (item instanceof ISubItem) {
                        //a sub item which is not in the list can be instantly deleted
                        IExpandable parent = (IExpandable) ((ISubItem) item).getParent();
                        //parent should not be null, but check in any case..
                        if (parent != null) {
                            parent.getSubItems().remove(item);
                        }
                    }
                    if (position != -1) {
                        //a normal displayed item can only be deleted afterwards
                        remove(position);
                    }
                }
                return false;
            }
        }, false);

        return this;
    }
914928
def _onGlobal(self, name, line, pos, absPosition, level):
        """"""
        # level is ignored
        for item in self.globals:
            if item.name == name:
                return
        self.globals.append(Global(name, line, pos, absPosition))
504825
public Endpoint getEndpoint(ModuleIdentifier identifier) {
		for (Endpoint endpoint : getEndpoints()) {
			if (endpoint.getIdentifier().equals(identifier)) {
				return endpoint;
			}
		}
		return null;
	}
697847
public final UserManagedCacheBuilder<K, V, T> identifier(String identifier) {
    UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
    otherBuilder.id = identifier;
    return otherBuilder;
  }
76291
public int locateIndex(int index) {

        int min = 0;
        int max = this.indexValues.length - 1;

        if (max == -1) {
            return -1;
        }

        // Binary search
        while ((this.indexValues[min] <= index) && (this.indexValues[max] >= index)) {
            int current = (max + min) / 2;
            if (this.indexValues[current] > index) {
                max = current - 1;
            } else if (this.indexValues[current] < index) {
                min = current + 1;
            } else {
                return current;
            }
        }
        if (this.indexValues[max] < index) {
            return max;
        } else {
            return min - 1;
        }
    }
1180061
public IDrawerItem getDrawerItem(long identifier) {
        Pair<IDrawerItem, Integer> res = getAdapter().getItemById(identifier);
        if (res != null) {
            return res.first;
        } else {
            return null;
        }
    }
687573
boolean scanSpecialIdentifier(String identifier) {

        int length = identifier.length();

        if (limit - currentPosition < length) {
            return false;
        }

        for (int i = 0; i < length; i++) {
            int character = identifier.charAt(i);

            if (character == sqlString.charAt(currentPosition + i)) {
                continue;
            }

            if (character
                    == Character.toUpperCase(sqlString.charAt(currentPosition
                        + i))) {
                continue;
            }

            return false;
        }

        currentPosition += length;

        return true;
    }
758676
public static Tag getTag(int identifier) {
    Tag t = null;
    try {
      if (instance == null)
        getTiffTags();
    } catch (ReadTagsIOException e) {
      /*Nothing to be shown*/
    }
    if (tagMap.containsKey(identifier))
      t = tagMap.get(identifier);
    return t;
  }
16594
public int indexOf(IESigType eSigType, String id) {
        return items.indexOf(new ESigItem(eSigType, id));
    }
8785
private String getUrl(final IRI identifier) {
        return getServices().getResourceService().toExternal(identifier, getBaseUrl()).getIRIString();
    }
368725
public void detachIdentifier(String identifier) {
		if (!StringUtils.equals(identifier, getIdentifier())) {
			Sysprop s = CoreUtils.getInstance().getDao().read(getAppid(), identifier);
			if (s != null && StringUtils.equals(getId(), s.getCreatorid())) {
				deleteIdentifier(identifier);
			}
		}
	}
522388
public int findItemOnlyIdx(JQMListItem item) {
        if (item == null) return -1;
        List<JQMListItem> items = getItems();
        if (items == null) return -1;
        int i = items.indexOf(item);
        if (i == -1) return -1;
        int j = 0;
        for (JQMListItem k : items) {
            if (k == null) continue;
            if (k == item) return j;
            j++;
        }
        return -1;
    }
1100544
@Override
    public Object get(final String identifier) {
        Declaration decl = getDeclarations().get( identifier );
        if ( decl == null ) {
            throw new IllegalArgumentException( "identifier '" + identifier + "' cannot be found" );
        }
        return get( decl );
    }
107966
public ESigItem get(IESigType eSigType, String id) {
        int i = indexOf(eSigType, id);
        return i == -1 ? null : items.get(i);
    }