public Tag getTagAt(final int pos, final boolean serverTagOnly) { return source.useAllTypesCache ? allTagTypesSubCache.getTagAt(pos,serverTagOnly) : Tag.getTagAtUncached(source,pos,serverTagOnly); }
static final Tag getTagAt(final Source source, final int pos, final boolean serverTagOnly) { // returns null if pos is out of range. return source.useAllTypesCache ? source.cache.getTagAt(pos,serverTagOnly) : getTagAtUncached(source,pos,serverTagOnly); }
public Tag addTagAt(final int pos, final boolean serverTagOnly) { final Tag tag=Tag.getTagAtUncached(source,pos,serverTagOnly); if (serverTagOnly && tag==null) return null; // don't add null to cache if we were only looking for server tags allTagTypesSubCache.addTagAt(pos,tag); if (tag==null) return null; final TagType tagType=tag.getTagType(); for (int i=1; i<subCaches.length; i++) { if (tagType==subCaches[i].tagType) { subCaches[i].addTagAt(pos,tag); return tag; } } return tag; }