Code example for AtomicReference

Methods: get

0
        detail = (TextView) v.findViewById(commit_subject);
    } 
 
    public void updateViewFor(FilePath filePath) {
        CharSequence fileName = filePath.getPath();
        FilePathMatcher currentFPM = filePathMatcher.get();
        if (currentFPM != null) {
            fileName = highlightFilePath(filePath, currentFPM);
        } 
        detail.setText(fileName);
    } 
 
    private CharSequence highlightFilePath(FilePath filePath, FilePathMatcher currentFPM) {
        Spannable highlightedFilePath = new SpannableStringBuilder(filePath.getPath());
        for (int index : currentFPM.match(filePath.getPath())) {
            highlightedFilePath.setSpan(wrap(highlightStyle), index, index + 1, SPAN_INCLUSIVE_INCLUSIVE);
        } 
        return highlightedFilePath;
    } 
}