Skip to content

Commit 8df7268

Browse files
committed
Code cosmetic
1 parent 8f0e0da commit 8df7268

File tree

6 files changed

+22
-47
lines changed

6 files changed

+22
-47
lines changed

MPChartLib/src/main/java/com/github/mikephil/charting/data/DataSet.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ protected void copy(DataSet dataSet) {
191191
super.copy(dataSet);
192192
}
193193

194+
@NonNull
194195
@Override
195196
public String toString() {
196197
StringBuilder buffer = new StringBuilder();
@@ -207,9 +208,11 @@ public String toString() {
207208
*/
208209

209210
public String toSimpleString() {
210-
return"DataSet, label: " + (getLabel() == null ? "" : getLabel()) + ", entries: " + mEntries.size() +
211+
return "DataSet, label: " +
212+
(getLabel() == null ? "" : getLabel()) +
213+
", entries: " +
214+
mEntries.size() +
211215
"\n";
212-
213216
}
214217

215218
@Override
@@ -233,9 +236,9 @@ public float getXMax() {
233236
}
234237

235238
@Override
236-
public void addEntryOrdered(T entry) {
239+
public void addEntryOrdered(@NonNull T entry) {
237240

238-
if (mEntries == null) {
241+
if (mEntries == null) {
239242
mEntries = new ArrayList<>();
240243
}
241244

@@ -269,9 +272,9 @@ public boolean addEntry(@NonNull T entry) {
269272
}
270273

271274
@Override
272-
public boolean removeEntry(T entry) {
275+
public boolean removeEntry(@NonNull T entry) {
273276

274-
if (mEntries == null)
277+
if (mEntries == null)
275278
return false;
276279

277280
// remove the entry
@@ -285,7 +288,7 @@ public boolean removeEntry(T entry) {
285288
}
286289

287290
@Override
288-
public int getEntryIndex(Entry entry) {
291+
public int getEntryIndex(@NonNull Entry entry) {
289292
return mEntries.indexOf(entry);
290293
}
291294

MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/IDataSet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface IDataSet<T : Entry> {
3232

3333
/**
3434
* Returns the number of y-values this DataSet represents -> the size of the y-values array
35-
* -> yvals.size()
35+
* -> yVals.size()
3636
*/
3737
val entryCount: Int
3838

@@ -107,7 +107,7 @@ interface IDataSet<T : Entry> {
107107
* Returns the position of the provided entry in the DataSets Entry array.
108108
* Returns -1 if doesn't exist.
109109
*/
110-
fun getEntryIndex(entry: T): Int
110+
fun getEntryIndex(e: T): Int
111111

112112
/**
113113
* This method returns the actual

MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/ILineDataSet.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@ public interface ILineDataSet extends ILineRadarDataSet<Entry> {
1313

1414
/**
1515
* Returns the drawing mode for this line dataset
16-
*
17-
* @return
1816
*/
1917
LineDataSet.Mode getMode();
2018

2119
/**
2220
* Returns the intensity of the cubic lines (the effect intensity).
2321
* Max = 1f = very cubic, Min = 0.05f = low cubic effect, Default: 0.2f
24-
*
25-
* @return
2622
*/
2723
float getCubicIntensity();
2824

@@ -45,59 +41,42 @@ public interface ILineDataSet extends ILineRadarDataSet<Entry> {
4541
/**
4642
* Returns the color at the given index of the DataSet's circle-color array.
4743
* Performs a IndexOutOfBounds check by modulus.
48-
*
49-
* @param index
50-
* @return
5144
*/
5245
int getCircleColor(int index);
5346

5447
/**
5548
* Returns the number of colors in this DataSet's circle-color array.
56-
*
57-
* @return
5849
*/
5950
int getCircleColorCount();
6051

6152
/**
6253
* Returns true if drawing circles for this DataSet is enabled, false if not
63-
*
64-
* @return
6554
*/
6655
boolean isDrawCirclesEnabled();
6756

6857
/**
6958
* Returns the color of the inner circle (the circle-hole).
70-
*
71-
* @return
7259
*/
7360
int getCircleHoleColor();
7461

7562
/**
7663
* Returns true if drawing the circle-holes is enabled, false if not.
77-
*
78-
* @return
7964
*/
8065
boolean isDrawCircleHoleEnabled();
8166

8267
/**
8368
* Returns the DashPathEffect that is used for drawing the lines.
84-
*
85-
* @return
8669
*/
8770
DashPathEffect getDashPathEffect();
8871

8972
/**
9073
* Returns true if the dashed-line effect is enabled, false if not.
9174
* If the DashPathEffect object is null, also return false here.
92-
*
93-
* @return
9475
*/
9576
boolean isDashedLineEnabled();
9677

9778
/**
9879
* Returns the IFillFormatter that is set for this DataSet.
99-
*
100-
* @return
10180
*/
10281
IFillFormatter getFillFormatter();
10382
}

MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/ILineRadarDataSet.java renamed to MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/ILineRadarDataSet.kt

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
1-
package com.github.mikephil.charting.interfaces.datasets;
1+
package com.github.mikephil.charting.interfaces.datasets
22

3-
import android.graphics.drawable.Drawable;
4-
5-
import com.github.mikephil.charting.data.Entry;
3+
import com.github.mikephil.charting.data.Entry
64

75
/**
86
* Created by Philipp Jahoda on 21/10/15.
97
*/
10-
public interface ILineRadarDataSet<T extends Entry> extends ILineScatterCandleRadarDataSet<T> {
11-
8+
interface ILineRadarDataSet<T : Entry?> : ILineScatterCandleRadarDataSet<T?> {
129
/**
1310
* Returns the color that is used for filling the line surface area.
1411
*/
15-
int getFillColor();
12+
val fillColor: Int
1613

1714
/**
1815
* Returns the drawable used for filling the area below the line.
1916
*/
20-
Drawable getFillDrawable();
17+
val fillDrawable: Drawable?
2118

2219
/**
2320
* Returns the alpha value that is used for filling the line surface,
2421
* default: 85
2522
*/
26-
int getFillAlpha();
23+
val fillAlpha: Int
2724

2825
/**
2926
* Returns the stroke-width of the drawn line
3027
*/
31-
float getLineWidth();
28+
val lineWidth: Float
3229

3330
/**
3431
* Returns true if filled drawing is enabled, false if not
3532
*/
36-
boolean isDrawFilledEnabled();
33+
val isDrawFilledEnabled: Boolean
3734

3835
/**
3936
* Set to true if the DataSet should be drawn filled (surface), and not just
@@ -42,5 +39,5 @@ public interface ILineRadarDataSet<T extends Entry> extends ILineScatterCandleRa
4239
* For devices with API level < 18 (Android 4.3), hardware acceleration of the chart should
4340
* be turned off. Default: false
4441
*/
45-
void setDrawFilled(boolean enabled);
42+
fun setDrawFilled(enabled: Boolean)
4643
}

MPChartLib/src/main/java/com/github/mikephil/charting/interfaces/datasets/ILineScatterCandleRadarDataSet.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,21 @@ import com.github.mikephil.charting.data.Entry
66
interface ILineScatterCandleRadarDataSet<T : Entry> : IBarLineScatterCandleBubbleDataSet<T> {
77
/**
88
* Returns true if vertical highlight indicator lines are enabled (drawn)
9-
* @return
109
*/
1110
val isVerticalHighlightIndicatorEnabled: Boolean
1211

1312
/**
1413
* Returns true if vertical highlight indicator lines are enabled (drawn)
15-
* @return
1614
*/
1715
val isHorizontalHighlightIndicatorEnabled: Boolean
1816

1917
/**
2018
* Returns the line-width in which highlight lines are to be drawn.
21-
* @return
2219
*/
2320
val highlightLineWidth: Float
2421

2522
/**
2623
* Returns the DashPathEffect that is used for highlighting.
27-
* @return
2824
*/
2925
val dashPathEffectHighlight: DashPathEffect?
3026
}

MPChartLib/src/main/java/com/github/mikephil/charting/renderer/LineChartRenderer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import java.lang.ref.WeakReference
2222
import kotlin.math.max
2323
import kotlin.math.min
2424

25-
class LineChartRenderer(
25+
open class LineChartRenderer(
2626
@JvmField var chart: LineDataProvider, animator: ChartAnimator?,
2727
viewPortHandler: ViewPortHandler?
2828
) : LineRadarRenderer(animator, viewPortHandler) {

0 commit comments

Comments
 (0)