Skip to content

Commit c818441

Browse files
committed
Rename variable
1 parent ee33795 commit c818441

12 files changed

Lines changed: 57 additions & 57 deletions

File tree

chartLib/src/main/kotlin/info/appdev/charting/data/BarDataSet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ open class BarDataSet(yVals: MutableList<BarEntry>, label: String) : BarLineScat
5252

5353
override fun copy(): DataSet<BarEntry>? {
5454
val entries: MutableList<BarEntry> = mutableListOf()
55-
for (i in mEntries.indices) {
56-
entries.add(mEntries[i].copy())
55+
for (i in entriesInternal.indices) {
56+
entries.add(entriesInternal[i].copy())
5757
}
5858
val copied = BarDataSet(entries, label)
5959
copy(copied)

chartLib/src/main/kotlin/info/appdev/charting/data/BaseDataSet.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import info.appdev.charting.utils.Utils
1616
import info.appdev.charting.utils.convertDpToPixel
1717

1818
/**
19-
* This is the base dataset of all DataSets. It's purpose is to implement critical methods
19+
* This is the base dataset of all DataSets. Its purpose is to implement critical methods
2020
* provided by the IDataSet interface.
2121
*/
2222
abstract class BaseDataSet<T : Entry>() : IDataSet<T> {

chartLib/src/main/kotlin/info/appdev/charting/data/BubbleDataSet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ open class BubbleDataSet(yVals: MutableList<BubbleEntry>, label: String) : BarLi
2121

2222
override fun copy(): DataSet<BubbleEntry> {
2323
val entries: MutableList<BubbleEntry> = ArrayList()
24-
for (i in mEntries.indices) {
25-
entries.add(mEntries[i].copy())
24+
for (i in entriesInternal.indices) {
25+
entries.add(entriesInternal[i].copy())
2626
}
2727
val copied = BubbleDataSet(entries, label)
2828
copy(copied)

chartLib/src/main/kotlin/info/appdev/charting/data/CandleDataSet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ open class CandleDataSet(yVals: MutableList<CandleEntry>, label: String = "") :
7171

7272
override fun copy(): DataSet<CandleEntry> {
7373
val entries: MutableList<CandleEntry> = mutableListOf()
74-
for (i in mEntries.indices) {
75-
entries.add(mEntries[i].copy())
74+
for (i in entriesInternal.indices) {
75+
entries.add(entriesInternal[i].copy())
7676
}
7777

7878
val copied = CandleDataSet(entries, label)

chartLib/src/main/kotlin/info/appdev/charting/data/ChartData.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ abstract class ChartData<T : IDataSet<out Entry>> : Serializable {
197197

198198
/**
199199
* Retrieve the index of a DataSet with a specific label from the ChartData.
200-
* Search can be case sensitive or not. IMPORTANT: This method does
200+
* Search can be case-sensitive or not. IMPORTANT: This method does
201201
* calculations at runtime, do not over-use in performance critical
202202
* situations.
203203
*
@@ -252,8 +252,8 @@ abstract class ChartData<T : IDataSet<out Entry>> : Serializable {
252252
}
253253

254254
/**
255-
* Returns the DataSet object with the given label. Search can be case
256-
* sensitive or not. IMPORTANT: This method does calculations at runtime.
255+
* Returns the DataSet object with the given label. Search can be case-sensitive or not.
256+
* IMPORTANT: This method does calculations at runtime.
257257
* Use with care in performance critical situations.
258258
*/
259259
open fun getDataSetByLabel(label: String, ignoreCase: Boolean): T? {

chartLib/src/main/kotlin/info/appdev/charting/data/DataSet.kt

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import kotlin.math.abs
1111
* LineChart, or the values of a specific group of bars in the BarChart).
1212
*/
1313
abstract class DataSet<T : Entry>(
14-
protected var mEntries: MutableList<T>,
14+
protected var entriesInternal: MutableList<T>,
1515
label: String = ""
1616
) : BaseDataSet<T>(label), Serializable {
1717
/**
@@ -53,11 +53,11 @@ abstract class DataSet<T : Entry>(
5353
this.xMax = -Float.MAX_VALUE
5454
this.xMin = Float.MAX_VALUE
5555

56-
if (mEntries.isEmpty()) {
56+
if (entriesInternal.isEmpty()) {
5757
return
5858
}
5959

60-
for (e in mEntries) {
60+
for (e in entriesInternal) {
6161
calcMinMax(e)
6262
}
6363
}
@@ -66,7 +66,7 @@ abstract class DataSet<T : Entry>(
6666
this.yMax = -Float.MAX_VALUE
6767
this.yMin = Float.MAX_VALUE
6868

69-
if (mEntries.isEmpty()) {
69+
if (entriesInternal.isEmpty()) {
7070
return
7171
}
7272

@@ -80,7 +80,7 @@ abstract class DataSet<T : Entry>(
8080
for (i in indexFrom..indexTo) {
8181
// only recalculate y
8282

83-
calcMinMaxY(mEntries[i])
83+
calcMinMaxY(entriesInternal[i])
8484
}
8585
}
8686

@@ -113,15 +113,15 @@ abstract class DataSet<T : Entry>(
113113
}
114114

115115
override val entryCount: Int
116-
get() = mEntries.size
116+
get() = entriesInternal.size
117117

118118
/**
119119
* Returns the array of entries that this DataSet represents.
120120
*/
121121
var entries: MutableList<T>
122-
get() = mEntries
122+
get() = entriesInternal
123123
set(entries) {
124-
mEntries = entries
124+
entriesInternal = entries
125125
notifyDataChanged()
126126
}
127127

@@ -137,30 +137,30 @@ abstract class DataSet<T : Entry>(
137137
override fun toString(): String {
138138
val buffer = StringBuilder()
139139
buffer.append(toSimpleString())
140-
for (i in mEntries.indices) {
141-
buffer.append(mEntries[i].toString()).append(" ")
140+
for (i in entriesInternal.indices) {
141+
buffer.append(entriesInternal[i].toString()).append(" ")
142142
}
143143
return buffer.toString()
144144
}
145145

146146
/**
147147
* Returns a simple string representation of the DataSet with the type and the number of Entries.
148148
*/
149-
fun toSimpleString() = "DataSet, label: $label, entries: ${mEntries.size}"
149+
fun toSimpleString() = "DataSet, label: $label, entries: ${entriesInternal.size}"
150150

151151
override fun addEntryOrdered(entry: T) {
152152
calcMinMax(entry)
153153

154-
if (!mEntries.isEmpty() && mEntries[mEntries.size - 1].x > entry.x) {
154+
if (!entriesInternal.isEmpty() && entriesInternal[entriesInternal.size - 1].x > entry.x) {
155155
val closestIndex = getEntryIndex(entry.x, entry.y, Rounding.UP)
156-
mEntries.add(closestIndex, entry)
156+
entriesInternal.add(closestIndex, entry)
157157
} else {
158-
mEntries.add(entry)
158+
entriesInternal.add(entry)
159159
}
160160
}
161161

162162
override fun clear() {
163-
mEntries.clear()
163+
entriesInternal.clear()
164164
notifyDataChanged()
165165
}
166166

@@ -171,7 +171,7 @@ abstract class DataSet<T : Entry>(
171171
}
172172

173173
override fun removeEntry(entry: T): Boolean {
174-
val removed = mEntries.remove(entry)
174+
val removed = entriesInternal.remove(entry)
175175

176176
if (removed) {
177177
calcMinMax()
@@ -180,14 +180,14 @@ abstract class DataSet<T : Entry>(
180180
}
181181

182182
override fun getEntryIndex(entry: T): Int {
183-
return mEntries.indexOf(entry)
183+
return entriesInternal.indexOf(entry)
184184
}
185185

186186

187187
override fun getEntryForXValue(xValue: Float, closestToY: Float, rounding: Rounding?): T? {
188188
val index = getEntryIndex(xValue, closestToY, rounding)
189189
if (index > -1) {
190-
return mEntries[index]
190+
return entriesInternal[index]
191191
}
192192
return null
193193
}
@@ -200,28 +200,28 @@ abstract class DataSet<T : Entry>(
200200
if (index < 0) {
201201
Timber.e("index $index is < 0 for getEntryForIndex")
202202
return null
203-
} else if (index >= mEntries.size) {
204-
Timber.e("index $index / ${mEntries.size} is out of range for getEntryForIndex")
203+
} else if (index >= entriesInternal.size) {
204+
Timber.e("index $index / ${entriesInternal.size} is out of range for getEntryForIndex")
205205
return null
206206
}
207-
return mEntries[index]
207+
return entriesInternal[index]
208208
}
209209

210210
override fun getEntryIndex(xValue: Float, closestToY: Float, rounding: Rounding?): Int {
211-
if (mEntries.isEmpty()) {
211+
if (entriesInternal.isEmpty()) {
212212
return -1
213213
}
214214

215215
var low = 0
216-
var high = mEntries.size - 1
216+
var high = entriesInternal.size - 1
217217
var closest = high
218218

219219
while (low < high) {
220220
val m = low + (high - low) / 2
221221

222-
val currentEntry: Entry = mEntries[m]
222+
val currentEntry: Entry = entriesInternal[m]
223223

224-
val nextEntry: Entry = mEntries[m + 1]
224+
val nextEntry: Entry = entriesInternal[m + 1]
225225

226226
val d1 = currentEntry.x - xValue
227227
val d2 = nextEntry.x - xValue
@@ -230,7 +230,7 @@ abstract class DataSet<T : Entry>(
230230

231231
if (ad2 < ad1) {
232232
// [m + 1] is closer to xValue
233-
// Search in an higher place
233+
// Search in a higher place
234234
low = m + 1
235235
} else if (ad1 < ad2) {
236236
// [m] is closer to xValue
@@ -243,19 +243,19 @@ abstract class DataSet<T : Entry>(
243243
// Search in a lower place
244244
high = m
245245
} else if (d1 < 0.0) {
246-
// Search in an higher place
246+
// Search in a higher place
247247
low = m + 1
248248
}
249249
}
250250

251251
closest = high
252252
}
253253

254-
val closestEntry: Entry = mEntries[closest]
254+
val closestEntry: Entry = entriesInternal[closest]
255255
val closestXValue = closestEntry.x
256256
if (rounding == Rounding.UP) {
257257
// If rounding up, and found x-value is lower than specified x, and we can go upper...
258-
if (closestXValue < xValue && closest < mEntries.size - 1) {
258+
if (closestXValue < xValue && closest < entriesInternal.size - 1) {
259259
++closest
260260
}
261261
} else if (rounding == Rounding.DOWN) {
@@ -267,7 +267,7 @@ abstract class DataSet<T : Entry>(
267267

268268
// Search by closest to y-value
269269
if (!closestToY.isNaN()) {
270-
while (closest > 0 && mEntries[closest - 1].x == closestXValue) {
270+
while (closest > 0 && entriesInternal[closest - 1].x == closestXValue) {
271271
closest -= 1
272272
}
273273

@@ -276,11 +276,11 @@ abstract class DataSet<T : Entry>(
276276

277277
while (true) {
278278
closest += 1
279-
if (closest >= mEntries.size) {
279+
if (closest >= entriesInternal.size) {
280280
break
281281
}
282282

283-
val value: T = mEntries[closest]
283+
val value: T = entriesInternal[closest]
284284

285285
if (value.x != closestXValue) {
286286
break
@@ -301,23 +301,23 @@ abstract class DataSet<T : Entry>(
301301
val entries: MutableList<T> = mutableListOf()
302302

303303
var low = 0
304-
var high = mEntries.size - 1
304+
var high = entriesInternal.size - 1
305305

306306
while (low <= high) {
307307
var m = (high + low) / 2
308-
var entry = mEntries[m]
308+
var entry = entriesInternal[m]
309309

310310
// if we have a match
311311
if (xValue == entry.x) {
312-
while (m > 0 && mEntries[m - 1].x == xValue) {
312+
while (m > 0 && entriesInternal[m - 1].x == xValue) {
313313
m--
314314
}
315315

316-
high = mEntries.size
316+
high = entriesInternal.size
317317

318318
// loop over all "equal" entries
319319
while (m < high) {
320-
entry = mEntries[m]
320+
entry = entriesInternal[m]
321321
if (entry.x == xValue) {
322322
entries.add(entry)
323323
} else {

chartLib/src/main/kotlin/info/appdev/charting/data/LineDataSet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ open class LineDataSet(yVals: MutableList<Entry> = mutableListOf(), label: Strin
7575

7676
override fun copy(): DataSet<Entry> {
7777
val entries: MutableList<Entry> = mutableListOf()
78-
for (i in mEntries.indices) {
79-
entries.add(mEntries[i].copy())
78+
for (i in entriesInternal.indices) {
79+
entries.add(entriesInternal[i].copy())
8080
}
8181
val copied = LineDataSet(entries, label)
8282
copy(copied)

chartLib/src/main/kotlin/info/appdev/charting/data/PieDataSet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ open class PieDataSet(yVals: MutableList<PieEntry>, label: String) : DataSet<Pie
3131

3232
override fun copy(): DataSet<PieEntry> {
3333
val entries: MutableList<PieEntry> = mutableListOf()
34-
for (i in mEntries.indices) {
35-
entries.add(mEntries[i].copy())
34+
for (i in entriesInternal.indices) {
35+
entries.add(entriesInternal[i].copy())
3636
}
3737
val copied = PieDataSet(entries, label)
3838
return copied

chartLib/src/main/kotlin/info/appdev/charting/data/RadarDataSet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ open class RadarDataSet(yVals: MutableList<RadarEntry>, label: String = "") : Li
6060

6161
override fun copy(): DataSet<RadarEntry> {
6262
val entries: MutableList<RadarEntry> = mutableListOf()
63-
for (i in mEntries.indices) {
64-
entries.add(mEntries[i].copy())
63+
for (i in entriesInternal.indices) {
64+
entries.add(entriesInternal[i].copy())
6565
}
6666
val copied = RadarDataSet(entries, label)
6767
copy(copied)

chartLib/src/main/kotlin/info/appdev/charting/data/ScatterDataSet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ open class ScatterDataSet(yVals: MutableList<Entry>, label: String = "") : LineS
4040

4141
override fun copy(): DataSet<Entry> {
4242
val entries: MutableList<Entry> = mutableListOf()
43-
for (i in mEntries.indices) {
44-
entries.add(mEntries[i].copy())
43+
for (i in entriesInternal.indices) {
44+
entries.add(entriesInternal[i].copy())
4545
}
4646
val copied = ScatterDataSet(entries, label)
4747
copy(copied)

0 commit comments

Comments
 (0)