Code example for SparseArray

Methods: append

0
     */ 
    private Transformer<T> transformer = null;
 
    public void map(Uri uri, T url) {
        matcher.addURI(uri.getAuthority(), sanifyPath(uri), code);
        uriToUrl.append(code, url);
        code += 1;
    } 
 
    /* 
     * Get rid of the last '/' if any 
     */ 
    private String sanifyPath(Uri uri) {
        String path = uri.toString().substring(uri.getAuthority().length() + CONTENT_LENGHT);
        // removing trailing / 
        if (path.charAt(0) == '/') {
            path = path.substring(1);
        } 
        return path;
    }