Exemple #1
0
        public RefinedPetroleum(JToken token)
        {
            // Console.WriteLine($"{token.ToString(Newtonsoft.Json.Formatting.Indented)}");

            if (token == null)
            {
                Production  = ValueDate.Empty;
                Exports     = ValueDate.Empty;
                Imports     = ValueDate.Empty;
                Consumption = ValueDate.Empty;

                return;
            }

            Production  = new ValueDate(token["production"], "bbl_per_day");
            Consumption = new ValueDate(token["consumption"], "bbl_per_day"); // Trap null exception
            Imports     = new ValueDate(token["imports"], "bbl_per_day");
            Exports     = new ValueDate(token["exports"], "bbl_per_day");
        }
Exemple #2
0
        public CrudeOil(JToken token)
        {
            if (token == null)
            {
                Production     = ValueDate.Empty;
                Exports        = ValueDate.Empty;
                Imports        = ValueDate.Empty;
                ProvedReserves = ValueDate.Empty;

                return;
            }

            Production     = new ValueDate(token["production"], "bbl_per_day");
            Exports        = new ValueDate(token["exports"], "bbl_per_day");
            Imports        = new ValueDate(token["imports"], "bbl_per_day");
            ProvedReserves = new ValueDate(token["proved_reserves"], "bbl");

            //System.Console.WriteLine($"{token.ToString(Newtonsoft.Json.Formatting.Indented)}");
        }
Exemple #3
0
        public NaturalGas(JToken token)
        {
            // Console.WriteLine($"{token.ToString(Newtonsoft.Json.Formatting.Indented)}");

            if (token == null)
            {
                Production     = ValueDate.Empty;
                Consumption    = ValueDate.Empty;
                Imports        = ValueDate.Empty;
                Exports        = ValueDate.Empty;
                ProvedReserves = ValueDate.Empty;
                return;
            }

            Production     = new ValueDate(token["production"], "cubic_metres");
            Consumption    = new ValueDate(token["consumption"], "cubic_metres");
            Imports        = new ValueDate(token["imports"], "cubic_metres");
            Exports        = new ValueDate(token["exports"], "cubic_metres");
            ProvedReserves = new ValueDate(token["proved_reserves"], "cubic_metres");
        }