Skip to content

Commit 2262826

Browse files
committed
Store volume units
1 parent 2b3ed55 commit 2262826

File tree

1 file changed

+38
-27
lines changed

1 file changed

+38
-27
lines changed

Diff for: Foundation/Unit.swift

+38-27
Original file line numberDiff line numberDiff line change
@@ -321,33 +321,40 @@ open class Unit : NSObject, NSCopying, NSSecureCoding {
321321
case knot
322322
case meterPerSecond
323323
case milePerHour
324+
324325
case celsius
325326
case fahrenheit
326327
case generic
327328
case kelvin
329+
328330
case acreFoot
329331
case bushel
330332
case centiliter
331333
case cubicCentimeter
332334
case cubicFoot
333335
case cubicInch
334336
case cubicKilometer
337+
case cubicDecimeter
335338
case cubicMeter
336339
case cubicMile
337340
case cubicYard
338341
case cup
339342
case cupMetric
340343
case deciliter
341344
case fluidOunce
345+
case fluidOunceImperial
342346
case gallon
343347
case gallonImperial
344348
case hectoliter
345349
case liter
346350
case megaliter
351+
case kiloliter
347352
case milliliter
348353
case pint
354+
case pintImperial
349355
case pintMetric
350356
case quart
357+
case quartImperial
351358
case tablespoon
352359
case teaspoon
353360

@@ -2223,187 +2230,191 @@ public final class UnitVolume : Dimension {
22232230

22242231
public class var megaliters: UnitVolume {
22252232
get {
2226-
return UnitVolume(symbol: Symbol.megaliters, coefficient: Coefficient.megaliters)
2233+
return Unit.stored(at: .megaliter, newUnit: UnitVolume(symbol: Symbol.megaliters, coefficient: Coefficient.megaliters, storeIndex: .megaliter))
22272234
}
22282235
}
22292236

22302237
public class var kiloliters: UnitVolume {
22312238
get {
2232-
return UnitVolume(symbol: Symbol.kiloliters, coefficient: Coefficient.kiloliters)
2239+
return Unit.stored(at: .kiloliter, newUnit: UnitVolume(symbol: Symbol.megaliters, coefficient: Coefficient.kiloliters, storeIndex: .kiloliter))
22332240
}
22342241
}
22352242

22362243
public class var liters: UnitVolume {
22372244
get {
2238-
return UnitVolume(symbol: Symbol.liters, coefficient: Coefficient.liters)
2245+
return Unit.stored(at: .liter, newUnit: UnitVolume(symbol: Symbol.liters, coefficient: Coefficient.liters, storeIndex: .liter))
22392246
}
22402247
}
22412248

22422249
public class var deciliters: UnitVolume {
22432250
get {
2244-
return UnitVolume(symbol: Symbol.deciliters, coefficient: Coefficient.deciliters)
2251+
return Unit.stored(at: .deciliter, newUnit: UnitVolume(symbol: Symbol.deciliters, coefficient: Coefficient.deciliters, storeIndex: .deciliter))
22452252
}
22462253
}
22472254

22482255
public class var centiliters: UnitVolume {
22492256
get {
2250-
return UnitVolume(symbol: Symbol.centiliters, coefficient: Coefficient.centiliters)
2257+
return Unit.stored(at: .centiliter, newUnit: UnitVolume(symbol: Symbol.centiliters, coefficient: Coefficient.centiliters, storeIndex: .centiliter))
22512258
}
22522259
}
22532260

22542261
public class var milliliters: UnitVolume {
22552262
get {
2256-
return UnitVolume(symbol: Symbol.milliliters, coefficient: Coefficient.milliliters)
2263+
return Unit.stored(at: .milliliter, newUnit: UnitVolume(symbol: Symbol.milliliters, coefficient: Coefficient.milliliters, storeIndex: .milliliter))
22572264
}
22582265
}
22592266

22602267
public class var cubicKilometers: UnitVolume {
22612268
get {
2262-
return UnitVolume(symbol: Symbol.cubicKilometers, coefficient: Coefficient.cubicKilometers)
2269+
return Unit.stored(at: .cubicKilometer, newUnit: UnitVolume(symbol: Symbol.cubicKilometers, coefficient: Coefficient.cubicKilometers, storeIndex: .cubicKilometer))
22632270
}
22642271
}
22652272

22662273
public class var cubicMeters: UnitVolume {
22672274
get {
2268-
return UnitVolume(symbol: Symbol.cubicMeters, coefficient: Coefficient.cubicMeters)
2275+
return Unit.stored(at: .cubicMeter, newUnit: UnitVolume(symbol: Symbol.cubicMeters, coefficient: Coefficient.cubicMeters, storeIndex: .cubicMeter))
22692276
}
22702277
}
22712278

22722279
public class var cubicDecimeters: UnitVolume {
22732280
get {
2274-
return UnitVolume(symbol: Symbol.cubicDecimeters, coefficient: Coefficient.cubicDecimeters)
2281+
return Unit.stored(at: .cubicDecimeter, newUnit: UnitVolume(symbol: Symbol.cubicDecimeters, coefficient: Coefficient.cubicDecimeters, storeIndex: .cubicDecimeter))
22752282
}
22762283
}
22772284

22782285
public class var cubicCentimeters: UnitVolume {
22792286
get {
2280-
return UnitVolume(symbol: Symbol.cubicCentimeters, coefficient: Coefficient.cubicCentimeters)
2287+
return Unit.stored(at: .cubicCentimeter, newUnit: UnitVolume(symbol: Symbol.cubicCentimeters, coefficient: Coefficient.cubicCentimeters, storeIndex: .cubicCentimeter))
22812288
}
22822289
}
22832290

22842291
public class var cubicMillimeters: UnitVolume {
22852292
get {
2293+
return Unit.stored(at: .cubicMeter, newUnit: UnitVolume(symbol: Symbol.cubicMeters, coefficient: Coefficient.cubicMeters, storeIndex: .cubicMeter))
22862294
return UnitVolume(symbol: Symbol.cubicMillimeters, coefficient: Coefficient.cubicMillimeters)
22872295
}
22882296
}
22892297

22902298
public class var cubicInches: UnitVolume {
22912299
get {
2300+
return Unit.stored(at: .cubicMeter, newUnit: UnitVolume(symbol: Symbol.cubicMeters, coefficient: Coefficient.cubicMeters, storeIndex: .cubicMeter))
22922301
return UnitVolume(symbol: Symbol.cubicInches, coefficient: Coefficient.cubicInches)
22932302
}
22942303
}
22952304

22962305
public class var cubicFeet: UnitVolume {
22972306
get {
2298-
return UnitVolume(symbol: Symbol.cubicFeet, coefficient: Coefficient.cubicFeet)
2307+
return Unit.stored(at: .cubicFoot, newUnit: UnitVolume(symbol: Symbol.cubicFeet, coefficient: Coefficient.cubicFeet, storeIndex: .cubicFoot))
22992308
}
23002309
}
23012310

23022311
public class var cubicYards: UnitVolume {
23032312
get {
2304-
return UnitVolume(symbol: Symbol.cubicYards, coefficient: Coefficient.cubicYards)
2313+
return Unit.stored(at: .cubicYard, newUnit: UnitVolume(symbol: Symbol.cubicYards, coefficient: Coefficient.cubicYards, storeIndex: .cubicYard))
23052314
}
23062315
}
23072316

23082317
public class var cubicMiles: UnitVolume {
23092318
get {
2310-
return UnitVolume(symbol: Symbol.cubicMiles, coefficient: Coefficient.cubicMiles)
2319+
return Unit.stored(at: .cubicMile, newUnit: UnitVolume(symbol: Symbol.cubicMiles, coefficient: Coefficient.cubicMiles, storeIndex: .cubicMile))
23112320
}
23122321
}
23132322

23142323
public class var acreFeet: UnitVolume {
23152324
get {
2316-
return UnitVolume(symbol: Symbol.acreFeet, coefficient: Coefficient.acreFeet)
2325+
return Unit.stored(at: .acreFoot, newUnit: UnitVolume(symbol: Symbol.acreFeet, coefficient: Coefficient.acreFeet, storeIndex: .acreFoot))
23172326
}
23182327
}
23192328

23202329
public class var bushels: UnitVolume {
23212330
get {
2322-
return UnitVolume(symbol: Symbol.bushels, coefficient: Coefficient.bushels)
2331+
return Unit.stored(at: .bushel, newUnit: UnitVolume(symbol: Symbol.bushels, coefficient: Coefficient.bushels, storeIndex: .bushel))
23232332
}
23242333
}
23252334

23262335
public class var teaspoons: UnitVolume {
23272336
get {
2328-
return UnitVolume(symbol: Symbol.teaspoons, coefficient: Coefficient.teaspoons)
2337+
return Unit.stored(at: .teaspoon, newUnit: UnitVolume(symbol: Symbol.teaspoons, coefficient: Coefficient.teaspoons, storeIndex: .teaspoon))
23292338
}
23302339
}
23312340

23322341
public class var tablespoons: UnitVolume {
23332342
get {
2334-
return UnitVolume(symbol: Symbol.tablespoons, coefficient: Coefficient.tablespoons)
2343+
return Unit.stored(at: .tablespoon, newUnit: UnitVolume(symbol: Symbol.tablespoons, coefficient: Coefficient.tablespoons, storeIndex: .tablespoon))
23352344
}
23362345
}
23372346

23382347
public class var fluidOunces: UnitVolume {
23392348
get {
2340-
return UnitVolume(symbol: Symbol.fluidOunces, coefficient: Coefficient.fluidOunces)
2349+
return Unit.stored(at: .fluidOunce, newUnit: UnitVolume(symbol: Symbol.fluidOunces, coefficient: Coefficient.fluidOunces, storeIndex: .fluidOunce))
23412350
}
23422351
}
23432352

23442353
public class var cups: UnitVolume {
23452354
get {
2346-
return UnitVolume(symbol: Symbol.cups, coefficient: Coefficient.cups)
2355+
return Unit.stored(at: .cup, newUnit: UnitVolume(symbol: Symbol.cups, coefficient: Coefficient.cups, storeIndex: .cup))
23472356
}
23482357
}
23492358

23502359
public class var pints: UnitVolume {
23512360
get {
2352-
return UnitVolume(symbol: Symbol.pints, coefficient: Coefficient.pints)
2361+
return Unit.stored(at: .pint, newUnit: UnitVolume(symbol: Symbol.pints, coefficient: Coefficient.pints, storeIndex: .pint))
23532362
}
23542363
}
23552364

23562365
public class var quarts: UnitVolume {
23572366
get {
2358-
return UnitVolume(symbol: Symbol.quarts, coefficient: Coefficient.quarts)
2367+
return Unit.stored(at: .quart, newUnit: UnitVolume(symbol: Symbol.quarts, coefficient: Coefficient.quarts, storeIndex: .quart))
23592368
}
23602369
}
23612370

23622371
public class var gallons: UnitVolume {
23632372
get {
2364-
return UnitVolume(symbol: Symbol.gallons, coefficient: Coefficient.gallons)
2373+
return Unit.stored(at: .gallon, newUnit: UnitVolume(symbol: Symbol.gallons, coefficient: Coefficient.gallons, storeIndex: .gallon))
23652374
}
23662375
}
23672376

23682377
public class var imperialTeaspoons: UnitVolume {
23692378
get {
2379+
return Unit.stored(at: .gallonImperial, newUnit: UnitVolume(symbol: Symbol.cubicMeters, coefficient: Coefficient.cubicMeters, storeIndex: .cubicMeter))
23702380
return UnitVolume(symbol: Symbol.imperialTeaspoons, coefficient: Coefficient.imperialTeaspoons)
23712381
}
23722382
}
23732383

23742384
public class var imperialTablespoons: UnitVolume {
23752385
get {
2386+
return Unit.stored(at: .cubicMeter, newUnit: UnitVolume(symbol: Symbol.cubicMeters, coefficient: Coefficient.cubicMeters, storeIndex: .cubicMeter))
23762387
return UnitVolume(symbol: Symbol.imperialTablespoons, coefficient: Coefficient.imperialTablespoons)
23772388
}
23782389
}
23792390

23802391
public class var imperialFluidOunces: UnitVolume {
23812392
get {
2382-
return UnitVolume(symbol: Symbol.imperialFluidOunces, coefficient: Coefficient.imperialFluidOunces)
2393+
return Unit.stored(at: .fluidOunceImperial, newUnit: UnitVolume(symbol: Symbol.imperialFluidOunces, coefficient: Coefficient.imperialFluidOunces, storeIndex: .fluidOunceImperial))
23832394
}
23842395
}
23852396

23862397
public class var imperialPints: UnitVolume {
23872398
get {
2388-
return UnitVolume(symbol: Symbol.imperialPints, coefficient: Coefficient.imperialPints)
2399+
return Unit.stored(at: .pintImperial, newUnit: UnitVolume(symbol: Symbol.imperialPints, coefficient: Coefficient.imperialPints, storeIndex: .pintImperial))
23892400
}
23902401
}
23912402

23922403
public class var imperialQuarts: UnitVolume {
23932404
get {
2394-
return UnitVolume(symbol: Symbol.imperialQuarts, coefficient: Coefficient.imperialQuarts)
2405+
return Unit.stored(at: .quartImperial, newUnit: UnitVolume(symbol: Symbol.imperialQuarts, coefficient: Coefficient.imperialQuarts, storeIndex: .quartImperial))
23952406
}
23962407
}
23972408

23982409
public class var imperialGallons: UnitVolume {
23992410
get {
2400-
return UnitVolume(symbol: Symbol.imperialGallons, coefficient: Coefficient.imperialGallons)
2411+
return Unit.stored(at: .gallonImperial, newUnit: UnitVolume(symbol: Symbol.imperialGallons, coefficient: Coefficient.imperialGallons, storeIndex: .gallonImperial))
24012412
}
24022413
}
24032414

24042415
public class var metricCups: UnitVolume {
24052416
get {
2406-
return UnitVolume(symbol: Symbol.metricCups, coefficient: Coefficient.metricCups)
2417+
return Unit.stored(at: .cupMetric, newUnit: UnitVolume(symbol: Symbol.metricCups, coefficient: Coefficient.metricCups, storeIndex: .cupMetric))
24072418
}
24082419
}
24092420

0 commit comments

Comments
 (0)