<commit_before>package org.osmdroid.views.overlay;

import android.graphics.Paint;

import org.osmdroid.views.overlay.advancedpolyline.PolylineStyle;

/**
 * Class UniquePaintList
 * @author <NAME>
 */
public class UniquePaintList implements PaintList {

    private Paint mPaint;
    private boolean mMonochromatic;
    private PolylineStyle mStyle;
    private int[] mColorIndexes;
    private float[] mLines;

    public UniquePaintList(Paint pPaint, boolean monochromatic, final PolylineStyle pStyle) {
        mPaint = pPaint;
        mMonochromatic = monochromatic;
        mStyle = pStyle;
    }

    @Override
    public void setReferencesForAdvancedStyling(final int[] pColorIndexes, final float[] pLines) {
        mColorIndexes = pColorIndexes;
        mLines = pLines;
    }

    @Override
    public Paint getPaint(int pIndex) {
        if(mStyle != null) {
            if(mMonochromatic) {
                return mPaint;
            } else {
                return mStyle.getPaintForLine(pIndex, mColorIndexes, mLines, mPaint);
            }
        } else {
            // index has no effect, just return the stored paint
            // paint object will not be modified (rounded joints ...)
            return mPaint;
        }
    }

    @Override
    public boolean isMonochromatic() {
        return mMonochromatic;
    }
}<commit_msg>Added Javadoc in UniquePaintList class.<commit_after>package org.osmdroid.views.overlay;

import android.graphics.Paint;

import org.osmdroid.views.overlay.advancedpolyline.PolylineStyle;

/**
 * Class UniquePaintList holding the Paint and style information.
 * Used in LineDrawer class to get right Paint object.
 * @author <NAME>
 */
public class UniquePaintList implements PaintList {

    private Paint mPaint;
    private boolean mMonochromatic;
    private PolylineStyle mStyle;
    private int[] mColorIndexes;
    private float[] mLines;

    /**
     * Constructor
     * @param pPaint provide a paint object
     * @param monochromatic flag if line can be drawn at once
     * @param pStyle provide a style (optional)
     */
    public UniquePaintList(final Paint pPaint, final boolean monochromatic, final PolylineStyle pStyle) {
        mPaint = pPaint;
        mMonochromatic = monochromatic;
        mStyle = pStyle;
    }

    /**
     * Setup references for arrays.
     * This call is mandatory for non monochromatic lines with set style.
     * @param pColorIndexes reference to color index array
     * @param pLines reference to lines array
     */
    @Override
    public void setReferencesForAdvancedStyling(final int[] pColorIndexes, final float[] pLines) {
        mColorIndexes = pColorIndexes;
        mLines = pLines;
    }

    /**
     * Returns Paint for current index.
     * Please note: For monochromatic lines index as no effect. Pass zero.
     * Parameter index is only used for non monochromatic lines.
     * @param pIndex paint object
     * @return
     */
    @Override
    public Paint getPaint(final int pIndex) {
        if(mStyle != null) {
            // a style is set
            if(mMonochromatic) {
                return mPaint;
            } else {
                return mStyle.getPaintForLine(pIndex, mColorIndexes, mLines, mPaint);
            }
        } else {
            // index has no effect, just return the stored paint
            // paint object will not be modified (rounded joints ...)
            return mPaint;
        }
    }

    /**
     * Getter
     * @return monochromatic flag
     */
    @Override
    public boolean isMonochromatic() {
        return mMonochromatic;
    }
}
{'fraction_non_alphanumeric': 0.07536713771127736, 'fraction_numerical': 0.0, 'mean_word_length': 2.3425925925925926, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6963890', 'n_tokens_mistral': 1039, 'n_tokens_neox': 972, 'n_words': 309}