Gini class final
A class that represents a Gini coefficient.
The Gini
class is a simple value object that represents a Gini
coefficient. It consists of an int
value that represents the year of the
Gini coefficient, and a double
value that represents the value of the Gini
coefficient. The year
field must be greater than 1990, and the
coefficient
field must be between 0.0 and 100.0 (inclusive).
Reference - https://wikipedia.org/wiki/Gini_coefficient.
Example usage:
final gini = Gini(year: 2020, coefficient: 32.0);
print(gini.year); // Prints: 2020
print(gini.coefficient); // Prints: 32.0
- Implemented types
- Available Extensions
Constructors
Properties
- coefficient → double
-
The value of this Gini coefficient.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- year → int
-
The year of this Gini coefficient.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
{JsonCodec codec = const JsonCodec()}) → String -
Returns a JSON-encoded string representation of the object.
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
covariant Gini other) → bool -
The equality operator.
override
Constants
- maxCoefficient → const double
-
The maximum value that can be used as the
coefficient
parameter when creating aGini
object. - minCoefficient → const double
-
The minimum value that can be used as the
coefficient
parameter when creating aGini
object. - minYear → const int
-
The minimum year that can be used as the
year
parameter when creating aGini
object.