Maps the supplied ID to a Pairtree path.

@param aID An ID to map to a Pairtree path
@return The Pairtree path for the supplied ID
169580
public static String mapToPtPath(final String aID) {
        Objects.requireNonNull(aID);

        final String encodedID = encodeID(aID);
        final List<String> shorties = new ArrayList<>();

        int start = 0;

        while (start < encodedID.length()) {
            int end = start + myShortyLength;

            if (end > encodedID.length()) {
                end = encodedID.length();
            }

            shorties.add(encodedID.substring(start, end));
            start = end;
        }

        return concat(shorties.toArray(new String[0]));
    }
489993
@SuppressWarnings("unchecked")
    public <T extends XPathBuilder> T setId(final String id) {
        this.id = id;
        return (T) this;
    }
412301
private void assignObjectId(int dtx, int dty)
    {
        final int tw = transformable.getWidth() / map.getTileWidth();
        final int th = transformable.getHeight() / map.getTileHeight();

        for (int tx = dtx; tx < dtx + tw; tx++)
        {
            for (int ty = dty; ty < dty + th; ty++)
            {
                mapPath.addObjectId(tx, ty, id);
            }
        }
    }
134623
public MemberConfig setId(String id) {
    return setId(id != null ? MemberId.from(id) : null);
  }
344641
@SuppressWarnings("unchecked")
    public <T extends WebLocatorAbstractBuilder> T setId(final String id) {
        pathBuilder.setId(id);
        return (T) this;
    }
427654
public VarSetBuilder varSetAtPath( String[] path)
    {
    VarSet varSet = null;
    if( path != null && path.length > 0)
      {
      varSet = new VarSet( path[0]);
      varSet_.addMember( varSet);

      for( int i = 1; i < path.length; i++)
        {
        VarSet child = new VarSet( path[i]);
        varSet.addMember( child);
        varSet = child;
        }
      }

    return
      varSet == null
      ? null
      : new VarSetBuilder( varSet);
    }
387840
private Node findNode(String id) {
        Node result = doFindNode(id);
        if (result != null) {
            return result;
        }
        throw new IllegalArgumentException("Couldn't find node " + id);
    }
407824
public List<String> getDependencyPath(int nodeIndex, int rootIndex) {
    TreeGraphNode node = getNodeByIndex(nodeIndex);
    TreeGraphNode rootTree = getNodeByIndex(rootIndex);
    return getDependencyPath(node, rootTree);
  }
709755
public static String mapToID(final String aPtPath) throws InvalidPathException {
        final String encapsulatingDir = getEncapsulatingDir(aPtPath);

        String id = aPtPath;

        if (id.endsWith(Character.toString(mySeparator))) {
            id = id.substring(0, id.length() - 1);
        }

        if (encapsulatingDir != null) {
            id = id.substring(0, id.length() - encapsulatingDir.length());
        }

        id = id.replace(Character.toString(mySeparator), "");
        id = decodeID(id);

        return id;
    }
754767
def tree_path(treemap, tree)
      if (ptree = treemap[tree])
        tree_path(treemap, ptree) + '/' + tree.name
      else
        ''
      end
    end
136414
public Map<String, TreeItemIdNode> getCustomIdNodeMap() {
		// No user context present
		if (getScratchMap() == null) {
			return createCustomIdNodeMapping();
		}
		Map<String, TreeItemIdNode> map = (Map<String, TreeItemIdNode>) getScratchMap().get(CUSTOM_IDS_TO_NODE_SCRATCH_MAP_KEY);
		if (map == null) {
			map = createCustomIdNodeMapping();
			getScratchMap().put(CUSTOM_IDS_TO_NODE_SCRATCH_MAP_KEY, map);
		}
		return map;
	}
910955
@SuppressWarnings("checkstyle:BooleanExpressionComplexity")
    public static String encodeID(final String aID) {
        Objects.requireNonNull(aID, LOGGER.getMessage(MessageCodes.PT_004));

        final byte[] bytes;

        try {
            bytes = aID.getBytes("utf-8");
        } catch (final UnsupportedEncodingException details) {
            throw new PairtreeRuntimeException(MessageCodes.PT_008, details);
        }

        final StringBuffer idBuffer = new StringBuffer();

        for (final byte b : bytes) {
            final int i = b & 0xff;

            if (i < 0x21 || i > 0x7e || i == 0x22 || i == 0x2a || i == 0x2b || i == 0x2c || i == 0x3c ||
                    i == 0x3d || i == 0x3e || i == 0x3f || i == 0x5c || i == 0x5e || i == 0x7c) {
                // Encode
                idBuffer.append(HEX_INDICATOR);
                idBuffer.append(Integer.toHexString(i));
            } else {
                // Don't encode
                final char[] chars = Character.toChars(i);

                assert chars.length == 1;
                idBuffer.append(chars[0]);
            }
        }

        for (int index = 0; index < idBuffer.length(); index++) {
            final char character = idBuffer.charAt(index);

            // Encode characters that need to be encoded according to Pairtree specification
            if (character == PATH_SEP) {
                idBuffer.setCharAt(index, EQUALS_SIGN);
            } else if (character == COLON) {
                idBuffer.setCharAt(index, PLUS_SIGN);
            } else if (character == PERIOD) {
                idBuffer.setCharAt(index, COMMA);
            }
        }

        return idBuffer.toString();
    }
901677
public String addId(final URI id) {
        if (id == null) {
            return null;
        }
        final URI localId = id.normalize();
        index ++;
        final String newId = PREFIX + Integer.toString(index);
        idMap.put(localId, newId);
        return newId;
    }
518061
public PathImpl get(String scheme)
  {
    ConcurrentHashMap<String,SchemeRoot> map = getMap();
    
    SchemeRoot root = map.get(scheme);

    if (root == null) {
      PathImpl rootPath = createLazyScheme(scheme);
      
      if (rootPath != null) {
        map.putIfAbsent(scheme, new SchemeRoot(rootPath));
        root = map.get(scheme);
      }
    }
    
    PathImpl path = null;
    
    if (root != null) {
      path = root.getRoot();
    }
    
    if (path != null) {
      return path;
    }
    else {
      return new NotFoundPath(this, scheme + ":");
    }
  }
1265419
protected String getObjectPath(String id, String name) {
        // The format of the object id is <type>/<path>/<objectName>
        id = id.substring(id.indexOf('/') + 1);
        if (id.charAt(0) == '/') {
            id = id.substring(1);
        }
        if (id.lastIndexOf(name) <= 0) {
            return id;
        }
        return id.substring(0, id.lastIndexOf(name) - 1);
    }
781955
public int strId2IdxAdd(Map fmap) {
	strId2Idx(fmap);
	
	if (idx < 0) {
	    idx = fmap.size();
	    fmap.put(strId, new Integer(idx));
	}
	
	return idx;
    }
480438
public String getRelativePath() {
        final StringBuilder builder = new StringBuilder();
        for(final String p : path) {
            builder.append(p).append("/");
        }
        builder.append(getName());
        return builder.toString();
    }