forked from PhilJay/MPAndroidChart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChartData.java
More file actions
969 lines (784 loc) · 23.9 KB
/
ChartData.java
File metadata and controls
969 lines (784 loc) · 23.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
package com.github.mikephil.charting.data;
import android.graphics.Typeface;
import android.util.Log;
import com.github.mikephil.charting.components.YAxis.AxisDependency;
import com.github.mikephil.charting.utils.Highlight;
import com.github.mikephil.charting.utils.ValueFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Class that holds all relevant data that represents the chart. That involves
* at least one (or more) DataSets, and an array of x-values.
*
* @author Philipp Jahoda
*/
public abstract class ChartData<T extends DataSet<? extends Entry>> {
/** maximum y-value in the y-value array across all axes */
protected float mYMax = 0.0f;
/** the minimum y-value in the y-value array across all axes */
protected float mYMin = 0.0f;
protected float mLeftAxisMax = 0.0f;
protected float mLeftAxisMin = 0.0f;
protected float mRightAxisMax = 0.0f;
protected float mRightAxisMin = 0.0f;
/** the total sum of all y-values */
private float mYValueSum = 0f;
/** total number of y-values across all DataSet objects */
private int mYValCount = 0;
/** the last start value used for calcMinMax */
protected int mLastStart = 0;
/** the last end value used for calcMinMax */
protected int mLastEnd = 0;
/**
* contains the average length (in characters) an entry in the x-vals array
* has
*/
private float mXValAverageLength = 0;
/** holds all x-values the chart represents */
protected List<String> mXVals;
/** array that holds all DataSets the ChartData object represents */
protected List<T> mDataSets;
public ChartData() {
mXVals = new ArrayList<String>();
mDataSets = new ArrayList<T>();
}
/**
* Constructor for only x-values. This constructor can be used for setting
* up an empty chart without data.
*
* @param xVals
*/
public ChartData(List<String> xVals) {
this.mXVals = xVals;
this.mDataSets = new ArrayList<T>();
init();
}
/**
* Constructor for only x-values. This constructor can be used for setting
* up an empty chart without data.
*
* @param xVals
*/
public ChartData(String[] xVals) {
this.mXVals = arrayToList(xVals);
this.mDataSets = new ArrayList<T>();
init();
}
/**
* constructor for chart data
*
* @param xVals The values describing the x-axis. Must be at least as long
* as the highest xIndex in the Entry objects across all
* DataSets.
* @param sets the dataset array
*/
public ChartData(List<String> xVals, List<T> sets) {
this.mXVals = xVals;
this.mDataSets = sets;
init();
}
/**
* constructor that takes string array instead of List string
*
* @param xVals The values describing the x-axis. Must be at least as long
* as the highest xIndex in the Entry objects across all
* DataSets.
* @param sets the dataset array
*/
public ChartData(String[] xVals, List<T> sets) {
this.mXVals = arrayToList(xVals);
this.mDataSets = sets;
init();
}
/**
* Turns an array of strings into an List of strings.
*
* @param array
* @return
*/
private List<String> arrayToList(String[] array) {
return Arrays.asList(array);
}
/**
* performs all kinds of initialization calculations, such as min-max and
* value count and sum
*/
protected void init() {
isLegal();
calcMinMax(mLastStart, mLastEnd);
calcYValueSum();
calcYValueCount();
calcXValAverageLength();
}
/**
* calculates the average length (in characters) across all x-value strings
*/
private void calcXValAverageLength() {
if (mXVals.size() <= 0) {
mXValAverageLength = 1;
return;
}
float sum = 1f;
for (int i = 0; i < mXVals.size(); i++) {
sum += mXVals.get(i).length();
}
mXValAverageLength = sum / (float) mXVals.size();
}
/**
* Checks if the combination of x-values array and DataSet array is legal or
* not.
*/
private void isLegal() {
if (mDataSets == null)
return;
for (int i = 0; i < mDataSets.size(); i++) {
if (mDataSets.get(i)
.getYVals()
.size() > mXVals.size()) {
throw new IllegalArgumentException(
"One or more of the DataSet Entry arrays are longer than the x-values array of this ChartData object.");
}
}
}
/**
* Call this method to let the CartData know that the underlying data has
* changed.
*/
public void notifyDataChanged() {
init();
}
/**
* calc minimum and maximum y value over all datasets
*/
public void calcMinMax(int start, int end) {
if (mDataSets == null || mDataSets.size() < 1) {
mYMax = 0f;
mYMin = 0f;
} else {
mLastStart = start;
mLastEnd = end;
mYMin = Float.MAX_VALUE;
mYMax = Float.MIN_VALUE;
for (int i = 0; i < mDataSets.size(); i++) {
mDataSets.get(i).calcMinMax(start, end);
if (mDataSets.get(i).getYMin() < mYMin)
mYMin = mDataSets.get(i).getYMin();
if (mDataSets.get(i).getYMax() > mYMax)
mYMax = mDataSets.get(i).getYMax();
}
// left axis
T firstLeft = getFirstLeft();
if (firstLeft != null) {
mLeftAxisMax = firstLeft.getYMax();
mLeftAxisMin = firstLeft.getYMin();
for (DataSet<?> dataSet : mDataSets) {
if (dataSet.getAxisDependency() == AxisDependency.LEFT) {
if (dataSet.getYMin() < mLeftAxisMin)
mLeftAxisMin = dataSet.getYMin();
if (dataSet.getYMax() > mLeftAxisMax)
mLeftAxisMax = dataSet.getYMax();
}
}
}
// right axis
T firstRight = getFirstRight();
if (firstRight != null) {
mRightAxisMax = firstRight.getYMax();
mRightAxisMin = firstRight.getYMin();
for (DataSet<?> dataSet : mDataSets) {
if (dataSet.getAxisDependency() == AxisDependency.RIGHT) {
if (dataSet.getYMin() < mRightAxisMin)
mRightAxisMin = dataSet.getYMin();
if (dataSet.getYMax() > mRightAxisMax)
mRightAxisMax = dataSet.getYMax();
}
}
}
// in case there is only one axis, adjust the second axis
handleEmptyAxis(firstLeft, firstRight);
}
}
/**
* calculates the sum of all y-values in all datasets
*/
protected void calcYValueSum() {
mYValueSum = 0;
if (mDataSets == null)
return;
for (int i = 0; i < mDataSets.size(); i++) {
mYValueSum += Math.abs(mDataSets.get(i).getYValueSum());
}
}
/**
* Calculates the total number of y-values across all DataSets the ChartData
* represents.
*
* @return
*/
protected void calcYValueCount() {
mYValCount = 0;
if (mDataSets == null)
return;
int count = 0;
for (int i = 0; i < mDataSets.size(); i++) {
count += mDataSets.get(i).getEntryCount();
}
mYValCount = count;
}
/** ONLY GETTERS AND SETTERS BELOW THIS */
/**
* returns the number of LineDataSets this object contains
*
* @return
*/
public int getDataSetCount() {
if (mDataSets == null)
return 0;
return mDataSets.size();
}
/**
* Returns the smallest y-value the data object contains.
*
* @return
*/
public float getYMin() {
return mYMin;
}
/**
* Returns the minimum y-value for the specified axis.
*
* @param axis
* @return
*/
public float getYMin(AxisDependency axis) {
if (axis == AxisDependency.LEFT)
return mLeftAxisMin;
else
return mRightAxisMin;
}
/**
* Returns the greatest y-value the data object contains.
*
* @return
*/
public float getYMax() {
return mYMax;
}
/**
* Returns the maximum y-value for the specified axis.
*
* @param axis
* @return
*/
public float getYMax(AxisDependency axis) {
if (axis == AxisDependency.LEFT)
return mLeftAxisMax;
else
return mRightAxisMax;
}
/**
* returns the average length (in characters) across all values in the
* x-vals array
*
* @return
*/
public float getXValAverageLength() {
return mXValAverageLength;
}
/**
* Returns the total y-value sum across all DataSet objects the this object
* represents.
*
* @return
*/
public float getYValueSum() {
return mYValueSum;
}
/**
* Returns the total number of y-values across all DataSet objects the this
* object represents.
*
* @return
*/
public int getYValCount() {
return mYValCount;
}
/**
* returns the x-values the chart represents
*
* @return
*/
public List<String> getXVals() {
return mXVals;
}
/**
* Adds a new x-value to the chart data.
*
* @param xVal
*/
public void addXValue(String xVal) {
mXValAverageLength = (mXValAverageLength + xVal.length()) / 2f;
mXVals.add(xVal);
}
/**
* Removes the x-value at the specified index.
*
* @param index
*/
public void removeXValue(int index) {
mXVals.remove(index);
}
/**
* Returns an the array of DataSets this object holds.
*
* @return
*/
public List<T> getDataSets() {
return mDataSets;
}
/**
* Retrieve the index of a DataSet with a specific label from the ChartData.
* Search can be case sensitive or not. IMPORTANT: This method does
* calculations at runtime, do not over-use in performance critical
* situations.
*
* @param dataSets the DataSet array to search
* @param type
* @param ignorecase if true, the search is not case-sensitive
* @return
*/
protected int getDataSetIndexByLabel(List<T> dataSets, String label,
boolean ignorecase) {
if (ignorecase) {
for (int i = 0; i < dataSets.size(); i++)
if (label.equalsIgnoreCase(dataSets.get(i).getLabel()))
return i;
} else {
for (int i = 0; i < dataSets.size(); i++)
if (label.equals(dataSets.get(i).getLabel()))
return i;
}
return -1;
}
/**
* returns the total number of x-values this ChartData object represents
* (the size of the x-values array)
*
* @return
*/
public int getXValCount() {
return mXVals.size();
}
/**
* Returns the labels of all DataSets as a string array.
*
* @return
*/
protected String[] getDataSetLabels() {
String[] types = new String[mDataSets.size()];
for (int i = 0; i < mDataSets.size(); i++) {
types[i] = mDataSets.get(i).getLabel();
}
return types;
}
/**
* Get the Entry for a corresponding highlight object
*
* @param highlight
* @return the entry that is highlighted
*/
public Entry getEntryForHighlight(Highlight highlight) {
return mDataSets.get(highlight.getDataSetIndex()).getEntryForXIndex(
highlight.getXIndex());
}
/**
* Returns the DataSet object with the given label. Search can be case
* sensitive or not. IMPORTANT: This method does calculations at runtime.
* Use with care in performance critical situations.
*
* @param label
* @param ignorecase
* @return
*/
public T getDataSetByLabel(String label, boolean ignorecase) {
int index = getDataSetIndexByLabel(mDataSets, label, ignorecase);
if (index < 0 || index >= mDataSets.size())
return null;
else
return mDataSets.get(index);
}
/**
* Returns the DataSet object at the given index.
*
* @param index
* @return
*/
public T getDataSetByIndex(int index) {
if (mDataSets == null || index < 0 || index >= mDataSets.size())
return null;
return mDataSets.get(index);
}
/**
* Adds a DataSet dynamically.
*
* @param d
*/
public void addDataSet(T d) {
if (d == null)
return;
mYValCount += d.getEntryCount();
mYValueSum += d.getYValueSum();
if (mDataSets.size() <= 0) {
mYMax = d.getYMax();
mYMin = d.getYMin();
if (d.getAxisDependency() == AxisDependency.LEFT) {
mLeftAxisMax = d.getYMax();
mLeftAxisMin = d.getYMin();
} else {
mRightAxisMax = d.getYMax();
mRightAxisMin = d.getYMin();
}
} else {
if (mYMax < d.getYMax())
mYMax = d.getYMax();
if (mYMin > d.getYMin())
mYMin = d.getYMin();
if (d.getAxisDependency() == AxisDependency.LEFT) {
if (mLeftAxisMax < d.getYMax())
mLeftAxisMax = d.getYMax();
if (mLeftAxisMin > d.getYMin())
mLeftAxisMin = d.getYMin();
} else {
if (mRightAxisMax < d.getYMax())
mRightAxisMax = d.getYMax();
if (mRightAxisMin > d.getYMin())
mRightAxisMin = d.getYMin();
}
}
mDataSets.add(d);
handleEmptyAxis(getFirstLeft(), getFirstRight());
}
/**
* This adjusts the other axis if one axis is empty and the other is not.
*
* @param firstLeft
* @param firstRight
*/
private void handleEmptyAxis(T firstLeft, T firstRight) {
// in case there is only one axis, adjust the second axis
if (firstLeft == null) {
mLeftAxisMax = mRightAxisMax;
mLeftAxisMin = mRightAxisMin;
} else if (firstRight == null) {
mRightAxisMax = mLeftAxisMax;
mRightAxisMin = mLeftAxisMin;
}
}
/**
* Removes the given DataSet from this data object. Also recalculates all
* minimum and maximum values. Returns true if a DataSet was removed, false
* if no DataSet could be removed.
*
* @param d
*/
public boolean removeDataSet(T d) {
if (d == null)
return false;
boolean removed = mDataSets.remove(d);
// if a DataSet was removed
if (removed) {
mYValCount -= d.getEntryCount();
mYValueSum -= d.getYValueSum();
calcMinMax(mLastStart, mLastEnd);
}
return removed;
}
/**
* Removes the DataSet at the given index in the DataSet array from the data
* object. Also recalculates all minimum and maximum values. Returns true if
* a DataSet was removed, false if no DataSet could be removed.
*
* @param index
*/
public boolean removeDataSet(int index) {
if (index >= mDataSets.size() || index < 0)
return false;
T set = mDataSets.get(index);
return removeDataSet(set);
}
/**
* Adds an Entry to the DataSet at the specified index. Entries are added to
* the end of the list.
*
* @param entry
* @param dataSetIndex
*/
public void addEntry(Entry e, int dataSetIndex) {
if (mDataSets.size() > dataSetIndex && dataSetIndex >= 0) {
float val = e.getVal();
mYValCount += 1;
mYValueSum += val;
if (mYMax < val)
mYMax = val;
if (mYMin > val)
mYMin = val;
T set = mDataSets.get(dataSetIndex);
if (set != null) {
if (set.getAxisDependency() == AxisDependency.LEFT) {
if (mLeftAxisMax < e.getVal())
mLeftAxisMax = e.getVal();
if (mLeftAxisMin > e.getVal())
mLeftAxisMin = e.getVal();
} else {
if (mRightAxisMax < e.getVal())
mRightAxisMax = e.getVal();
if (mRightAxisMin > e.getVal())
mRightAxisMin = e.getVal();
}
handleEmptyAxis(getFirstLeft(), getFirstRight());
// add the entry to the dataset
set.addEntry(e);
}
} else {
Log.e("addEntry", "Cannot add Entry because dataSetIndex too high or too low.");
}
}
/**
* Removes the given Entry object from the DataSet at the specified index.
*
* @param e
* @param dataSetIndex
*/
public boolean removeEntry(Entry e, int dataSetIndex) {
// entry null, outofbounds
if (e == null || dataSetIndex >= mDataSets.size())
return false;
// remove the entry from the dataset
boolean removed = mDataSets.get(dataSetIndex).removeEntry(e.getXIndex());
if (removed) {
float val = e.getVal();
mYValCount -= 1;
mYValueSum -= val;
calcMinMax(mLastStart, mLastEnd);
}
return removed;
}
/**
* Removes the Entry object at the given xIndex from the DataSet at the
* specified index. Returns true if an Entry was removed, false if no Entry
* was found that meets the specified requirements.
*
* @param xIndex
* @param dataSetIndex
* @return
*/
public boolean removeEntry(int xIndex, int dataSetIndex) {
if (dataSetIndex >= mDataSets.size())
return false;
T dataSet = mDataSets.get(dataSetIndex);
Entry e = dataSet.getEntryForXIndex(xIndex);
return removeEntry(e, dataSetIndex);
}
/**
* Returns the DataSet that contains the provided Entry, or null, if no
* DataSet contains this Entry.
*
* @param e
* @return
*/
public T getDataSetForEntry(Entry e) {
if (e == null)
return null;
for (int i = 0; i < mDataSets.size(); i++) {
T set = mDataSets.get(i);
for (int j = 0; j < set.getEntryCount(); j++) {
if (e.equalTo(set.getEntryForXIndex(e.getXIndex())))
return set;
}
}
return null;
}
/**
* Returns all colors used across all DataSet objects this object
* represents.
*
* @return
*/
public int[] getColors() {
if (mDataSets == null)
return null;
int clrcnt = 0;
for (int i = 0; i < mDataSets.size(); i++) {
clrcnt += mDataSets.get(i).getColors().size();
}
int[] colors = new int[clrcnt];
int cnt = 0;
for (int i = 0; i < mDataSets.size(); i++) {
List<Integer> clrs = mDataSets.get(i).getColors();
for (Integer clr : clrs) {
colors[cnt] = clr;
cnt++;
}
}
return colors;
}
/**
* Returns the index of the provided DataSet inside the DataSets array of
* this data object. Returns -1 if the DataSet was not found.
*
* @param dataSet
* @return
*/
public int getIndexOfDataSet(T dataSet) {
for (int i = 0; i < mDataSets.size(); i++) {
if (mDataSets.get(i) == dataSet)
return i;
}
return -1;
}
public T getFirstLeft() {
for (T dataSet : mDataSets) {
if (dataSet.getAxisDependency() == AxisDependency.LEFT)
return dataSet;
}
return null;
}
public T getFirstRight() {
for (T dataSet : mDataSets) {
if (dataSet.getAxisDependency() == AxisDependency.RIGHT)
return dataSet;
}
return null;
}
/**
* Generates an x-values array filled with numbers in range specified by the
* parameters. Can be used for convenience.
*
* @return
*/
public static List<String> generateXVals(int from, int to) {
List<String> xvals = new ArrayList<String>();
for (int i = from; i < to; i++) {
xvals.add("" + i);
}
return xvals;
}
/**
* Sets a custom ValueFormatter for all DataSets this data object contains.
*
* @param f
*/
public void setValueFormatter(ValueFormatter f) {
if (f == null)
return;
else {
for (DataSet<?> set : mDataSets) {
set.setValueFormatter(f);
}
}
}
/**
* Sets the color of the value-text (color in which the value-labels are
* drawn) for all DataSets this data object contains.
*
* @param color
*/
public void setValueTextColor(int color) {
for (DataSet<?> set : mDataSets) {
set.setValueTextColor(color);
}
}
/**
* Sets the Typeface for all value-labels for all DataSets this data object
* contains.
*
* @param color
*/
public void setValueTypeface(Typeface tf) {
for (DataSet<?> set : mDataSets) {
set.setValueTypeface(tf);
}
}
/**
* Sets the size (in dp) of the value-text for all DataSets this data object
* contains.
*
* @param color
*/
public void setValueTextSize(float size) {
for (DataSet<?> set : mDataSets) {
set.setValueTextSize(size);
}
}
/**
* Enables / disables drawing values (value-text) for all DataSets this data
* object contains.
*
* @param enabled
*/
public void setDrawValues(boolean enabled) {
for (DataSet<?> set : mDataSets) {
set.setDrawValues(enabled);
}
}
/**
* Enables / disables highlighting values for all DataSets this data object
* contains.
*/
public void setHighlightEnabled(boolean enabled) {
for (DataSet<?> set : mDataSets) {
set.setHighlightEnabled(enabled);
}
}
/**
* Returns true if highlighting of all underlying values is enabled, false
* if not.
*
* @return
*/
public boolean isHighlightEnabled() {
for (DataSet<?> set : mDataSets) {
if (!set.isHighlightEnabled())
return false;
}
return true;
}
/**
* Clears this data object from all DataSets and removes all Entries. Don't
* forget to invalidate the chart after this.
*/
public void clearValues() {
mDataSets.clear();
notifyDataChanged();
}
/**
* Checks if this data object contains the specified Entry. Returns true if
* so, false if not. NOTE: Performance is pretty bad on this one, do not
* over-use in performance critical situations.
*
* @param e
* @return
*/
public boolean contains(Entry e) {
for (T set : mDataSets) {
if (set.contains(e))
return true;
}
return false;
}
/**
* Checks if this data object contains the specified DataSet. Returns true
* if so, false if not.
*
* @param dataSet
* @return
*/
public boolean contains(T dataSet) {
for (T set : mDataSets) {
if (set.equals(dataSet))
return true;
}
return false;
}
}