text:
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using TTC2017.SmartGrids.CIM.IEC61968.AssetModels;
using TTC2017.SmartGrids.CIM.IEC61968.Assets;
using TTC2017.SmartGrids.CIM.IEC61968.Common;
using TTC2017.SmartGrids.CIM.IEC61968.Metering;
using TTC2017.SmartGrids.CIM.IEC61968.WiresExt;
using TTC2017.SmartGrids.CIM.IEC61970.Core;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfAssetModels;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfCommon;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfERPSupport;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfOperations;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfTypeAsset;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfWork;
using TTC2017.SmartGrids.CIM.IEC61970.Meas;
using TTC2017.SmartGrids.CIM.IEC61970.Wires;

namespace TTC2017.SmartGrids.CIM.IEC61970.Informative.InfAssets
{

    /// <summary>
    /// The default implementation of the CurrentTransformerInfo class
    /// </summary>
    [XmlNamespaceAttribute("http://iec.ch/TC57/2009/CIM-schema-cim14#InfAssets")]
    [XmlNamespacePrefixAttribute("cimInfAssets")]
    [ModelRepresentationClassAttribute("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/InfAssets/Current" +
        "TransformerInfo")]
    [DebuggerDisplayAttribute("CurrentTransformerInfo {UUID}")]
    public partial class CurrentTransformerInfo : ElectricalInfo, ICurrentTransformerInfo, IModelElement
    {

        /// <summary>
        /// The backing field for the AccuracyClass property
        /// </summary>
        private string _accuracyClass;

        private static Lazy<ITypedElement> _accuracyClassAttribute = new Lazy<ITypedElement>(RetrieveAccuracyClassAttribute);

        /// <summary>
        /// The backing field for the CtClass property
        /// </summary>
        private string _ctClass;

        private static Lazy<ITypedElement> _ctClassAttribute = new Lazy<ITypedElement>(RetrieveCtClassAttribute);

        /// <summary>
        /// The backing field for the CoreBurden property
        /// </summary>
        private float _coreBurden;

        private static Lazy<ITypedElement> _coreBurdenAttribute = new Lazy<ITypedElement>(RetrieveCoreBurdenAttribute);

        /// <summary>
        /// The backing field for the PrimaryFlsRating property
        /// </summary>
        private float _primaryFlsRating;

        private static Lazy<ITypedElement> _primaryFlsRatingAttribute = new Lazy<ITypedElement>(RetrievePrimaryFlsRatingAttribute);

        /// <summary>
        /// The backing field for the AccuracyLimit property
        /// </summary>
        private float _accuracyLimit;

        private static Lazy<ITypedElement> _accuracyLimitAttribute = new Lazy<ITypedElement>(RetrieveAccuracyLimitAttribute);

        /// <summary>
        /// The backing field for the KneePointCurrent property
        /// </summary>
        private float _kneePointCurrent;

        private static Lazy<ITypedElement> _kneePointCurrentAttribute = new Lazy<ITypedElement>(RetrieveKneePointCurrentAttribute);

        /// <summary>
        /// The backing field for the Usage property
        /// </summary>
        private string _usage;

        private static Lazy<ITypedElement> _usageAttribute = new Lazy<ITypedElement>(RetrieveUsageAttribute);

        /// <summary>
        /// The backing field for the SecondaryFlsRating property
        /// </summary>
        private float _secondaryFlsRating;

        private static Lazy<ITypedElement> _secondaryFlsRatingAttribute = new Lazy<ITypedElement>(RetrieveSecondaryFlsRatingAttribute);

        /// <summary>
        /// The backing field for the TertiaryFlsRating property
        /// </summary>
        private float _tertiaryFlsRating;

        private static Lazy<ITypedElement> _tertiaryFlsRatingAttribute = new Lazy<ITypedElement>(RetrieveTertiaryFlsRatingAttribute);

        /// <summary>
        /// The backing field for the CoreCount property
        /// </summary>
        private int _coreCount;

        private static Lazy<ITypedElement> _coreCountAttribute = new Lazy<ITypedElement>(RetrieveCoreCountAttribute);

        /// <summary>
        /// The backing field for the KneePointVoltage property
        /// </summary>
        private float _kneePointVoltage;

        private static Lazy<ITypedElement> _kneePointVoltageAttribute = new Lazy<ITypedElement>(RetrieveKneePointVoltageAttribute);

        private static Lazy<ITypedElement> _maxRatioReference = new Lazy<ITypedElement>(RetrieveMaxRatioReference);

        /// <summary>
        /// The backing field for the MaxRatio property
        /// </summary>
        private IRatio _maxRatio;

        private static Lazy<ITypedElement> _primaryRatioReference = new Lazy<ITypedElement>(RetrievePrimaryRatioReference);

        /// <summary>
        /// The backing field for the PrimaryRatio property
        /// </summary>
        private IRatio _primaryRatio;

        private static Lazy<ITypedElement> _tertiaryRatioReference = new Lazy<ITypedElement>(RetrieveTertiaryRatioReference);

        /// <summary>
        /// The backing field for the TertiaryRatio property
        /// </summary>
        private IRatio _tertiaryRatio;

        private static Lazy<ITypedElement> _nominalRatioReference = new Lazy<ITypedElement>(RetrieveNominalRatioReference);

        /// <summary>
        /// The backing field for the NominalRatio property
        /// </summary>
        private IRatio _nominalRatio;

        private static Lazy<ITypedElement> _secondaryRatioReference = new Lazy<ITypedElement>(RetrieveSecondaryRatioReference);

        /// <summary>
        /// The backing field for the SecondaryRatio property
        /// </summary>
        private IRatio _secondaryRatio;

        private static IClass _classInstance;

        /// <summary>
        /// The accuracyClass property
        /// </summary>
        [XmlElementNameAttribute("accuracyClass")]
        [XmlAttributeAttribute(true)]
        public virtual string AccuracyClass
        {
            get
            {
                return this._accuracyClass;
            }
            set
            {
                if ((this._accuracyClass != value))
                {
                    string old = this._accuracyClass;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnAccuracyClassChanging(e);
                    this.OnPropertyChanging("AccuracyClass", e, _accuracyClassAttribute);
                    this._accuracyClass = value;
                    this.OnAccuracyClassChanged(e);
                    this.OnPropertyChanged("AccuracyClass", e, _accuracyClassAttribute);
                }
            }
        }

        /// <summary>
        /// The ctClass property
        /// </summary>
        [XmlElementNameAttribute("ctClass")]
        [XmlAttributeAttribute(true)]
        public virtual string CtClass
        {
            get
            {
                return this._ctClass;
            }
            set
            {
                if ((this._ctClass != value))
                {
                    string old = this._ctClass;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnCtClassChanging(e);
                    this.OnPropertyChanging("CtClass", e, _ctClassAttribute);
                    this._ctClass = value;
                    this.OnCtClassChanged(e);
                    this.OnPropertyChanged("CtClass", e, _ctClassAttribute);
                }
            }
        }

        /// <summary>
        /// The coreBurden property
        /// </summary>
        [XmlElementNameAttribute("coreBurden")]
        [XmlAttributeAttribute(true)]
        public virtual float CoreBurden
        {
            get
            {
                return this._coreBurden;
            }
            set
            {
                if ((this._coreBurden != value))
                {
                    float old = this._coreBurden;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnCoreBurdenChanging(e);
                    this.OnPropertyChanging("CoreBurden", e, _coreBurdenAttribute);
                    this._coreBurden = value;
                    this.OnCoreBurdenChanged(e);
                    this.OnPropertyChanged("CoreBurden", e, _coreBurdenAttribute);
                }
            }
        }

        /// <summary>
        /// The primaryFlsRating property
        /// </summary>
        [XmlElementNameAttribute("primaryFlsRating")]
        [XmlAttributeAttribute(true)]
        public virtual float PrimaryFlsRating
        {
            get
            {
                return this._primaryFlsRating;
            }
            set
            {
                if ((this._primaryFlsRating != value))
                {
                    float old = this._primaryFlsRating;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnPrimaryFlsRatingChanging(e);
                    this.OnPropertyChanging("PrimaryFlsRating", e, _primaryFlsRatingAttribute);
                    this._primaryFlsRating = value;
                    this.OnPrimaryFlsRatingChanged(e);
                    this.OnPropertyChanged("PrimaryFlsRating", e, _primaryFlsRatingAttribute);
                }
            }
        }

        /// <summary>
        /// The accuracyLimit property
        /// </summary>
        [XmlElementNameAttribute("accuracyLimit")]
        [XmlAttributeAttribute(true)]
        public virtual float AccuracyLimit
        {
            get
            {
                return this._accuracyLimit;
            }
            set
            {
                if ((this._accuracyLimit != value))
                {
                    float old = this._accuracyLimit;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnAccuracyLimitChanging(e);
                    this.OnPropertyChanging("AccuracyLimit", e, _accuracyLimitAttribute);
                    this._accuracyLimit = value;
                    this.OnAccuracyLimitChanged(e);
                    this.OnPropertyChanged("AccuracyLimit", e, _accuracyLimitAttribute);
                }
            }
        }

        /// <summary>
        /// The kneePointCurrent property
        /// </summary>
        [XmlElementNameAttribute("kneePointCurrent")]
        [XmlAttributeAttribute(true)]
        public virtual float KneePointCurrent
        {
            get
            {
                return this._kneePointCurrent;
            }
            set
            {
                if ((this._kneePointCurrent != value))
                {
                    float old = this._kneePointCurrent;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnKneePointCurrentChanging(e);
                    this.OnPropertyChanging("KneePointCurrent", e, _kneePointCurrentAttribute);
                    this._kneePointCurrent = value;
                    this.OnKneePointCurrentChanged(e);
                    this.OnPropertyChanged("KneePointCurrent", e, _kneePointCurrentAttribute);
                }
            }
        }

        /// <summary>
        /// The usage property
        /// </summary>
        [XmlElementNameAttribute("usage")]
        [XmlAttributeAttribute(true)]
        public virtual string Usage
        {
            get
            {
                return this._usage;
            }
            set
            {
                if ((this._usage != value))
                {
                    string old = this._usage;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnUsageChanging(e);
                    this.OnPropertyChanging("Usage", e, _usageAttribute);
                    this._usage = value;
                    this.OnUsageChanged(e);
                    this.OnPropertyChanged("Usage", e, _usageAttribute);
                }
            }
        }

        /// <summary>
        /// The secondaryFlsRating property
        /// </summary>
        [XmlElementNameAttribute("secondaryFlsRating")]
        [XmlAttributeAttribute(true)]
        public virtual float SecondaryFlsRating
        {
            get
            {
                return this._secondaryFlsRating;
            }
            set
            {
                if ((this._secondaryFlsRating != value))
                {
                    float old = this._secondaryFlsRating;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnSecondaryFlsRatingChanging(e);
                    this.OnPropertyChanging("SecondaryFlsRating", e, _secondaryFlsRatingAttribute);
                    this._secondaryFlsRating = value;
                    this.OnSecondaryFlsRatingChanged(e);
                    this.OnPropertyChanged("SecondaryFlsRating", e, _secondaryFlsRatingAttribute);
                }
            }
        }

        /// <summary>
        /// The tertiaryFlsRating property
        /// </summary>
        [XmlElementNameAttribute("tertiaryFlsRating")]
        [XmlAttributeAttribute(true)]
        public virtual float TertiaryFlsRating
        {
            get
            {
                return this._tertiaryFlsRating;
            }
            set
            {
                if ((this._tertiaryFlsRating != value))
                {
                    float old = this._tertiaryFlsRating;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnTertiaryFlsRatingChanging(e);
                    this.OnPropertyChanging("TertiaryFlsRating", e, _tertiaryFlsRatingAttribute);
                    this._tertiaryFlsRating = value;
                    this.OnTertiaryFlsRatingChanged(e);
                    this.OnPropertyChanged("TertiaryFlsRating", e, _tertiaryFlsRatingAttribute);
                }
            }
        }

        /// <summary>
        /// The coreCount property
        /// </summary>
        [XmlElementNameAttribute("coreCount")]
        [XmlAttributeAttribute(true)]
        public virtual int CoreCount
        {
            get
            {
                return this._coreCount;
            }
            set
            {
                if ((this._coreCount != value))
                {
                    int old = this._coreCount;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnCoreCountChanging(e);
                    this.OnPropertyChanging("CoreCount", e, _coreCountAttribute);
                    this._coreCount = value;
                    this.OnCoreCountChanged(e);
                    this.OnPropertyChanged("CoreCount", e, _coreCountAttribute);
                }
            }
        }

        /// <summary>
        /// The kneePointVoltage property
        /// </summary>
        [XmlElementNameAttribute("kneePointVoltage")]
        [XmlAttributeAttribute(true)]
        public virtual float KneePointVoltage
        {
            get
            {
                return this._kneePointVoltage;
            }
            set
            {
                if ((this._kneePointVoltage != value))
                {
                    float old = this._kneePointVoltage;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnKneePointVoltageChanging(e);
                    this.OnPropertyChanging("KneePointVoltage", e, _kneePointVoltageAttribute);
                    this._kneePointVoltage = value;
                    this.OnKneePointVoltageChanged(e);
                    this.OnPropertyChanged("KneePointVoltage", e, _kneePointVoltageAttribute);
                }
            }
        }

        /// <summary>
        /// The maxRatio property
        /// </summary>
        [XmlElementNameAttribute("maxRatio")]
        [XmlAttributeAttribute(true)]
        public virtual IRatio MaxRatio
        {
            get
            {
                return this._maxRatio;
            }
            set
            {
                if ((this._maxRatio != value))
                {
                    IRatio old = this._maxRatio;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnMaxRatioChanging(e);
                    this.OnPropertyChanging("MaxRatio", e, _maxRatioReference);
                    this._maxRatio = value;
                    if ((old != null))
                    {
                        old.Deleted -= this.OnResetMaxRatio;
                    }
                    if ((value != null))
                    {
                        value.Deleted += this.OnResetMaxRatio;
                    }
                    this.OnMaxRatioChanged(e);
                    this.OnPropertyChanged("MaxRatio", e, _maxRatioReference);
                }
            }
        }

        /// <summary>
        /// The primaryRatio property
        /// </summary>
        [XmlElementNameAttribute("primaryRatio")]
        [XmlAttributeAttribute(true)]
        public virtual IRatio PrimaryRatio
        {
            get
            {
                return this._primaryRatio;
            }
            set
            {
                if ((this._primaryRatio != value))
                {
                    IRatio old = this._primaryRatio;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnPrimaryRatioChanging(e);
                    this.OnPropertyChanging("PrimaryRatio", e, _primaryRatioReference);
                    this._primaryRatio = value;
                    if ((old != null))
                    {
                        old.Deleted -= this.OnResetPrimaryRatio;
                    }
                    if ((value != null))
                    {
                        value.Deleted += this.OnResetPrimaryRatio;
                    }
                    this.OnPrimaryRatioChanged(e);
                    this.OnPropertyChanged("PrimaryRatio", e, _primaryRatioReference);
                }
            }
        }

        /// <summary>
        /// The tertiaryRatio property
        /// </summary>
        [XmlElementNameAttribute("tertiaryRatio")]
        [XmlAttributeAttribute(true)]
        public virtual IRatio TertiaryRatio
        {
            get
            {
                return this._tertiaryRatio;
            }
            set
            {
                if ((this._tertiaryRatio != value))
                {
                    IRatio old = this._tertiaryRatio;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnTertiaryRatioChanging(e);
                    this.OnPropertyChanging("TertiaryRatio", e, _tertiaryRatioReference);
                    this._tertiaryRatio = value;
                    if ((old != null))
                    {
                        old.Deleted -= this.OnResetTertiaryRatio;
                    }
                    if ((value != null))
                    {
                        value.Deleted += this.OnResetTertiaryRatio;
                    }
                    this.OnTertiaryRatioChanged(e);
                    this.OnPropertyChanged("TertiaryRatio", e, _tertiaryRatioReference);
                }
            }
        }

        /// <summary>
        /// The nominalRatio property
        /// </summary>
        [XmlElementNameAttribute("nominalRatio")]
        [XmlAttributeAttribute(true)]
        public virtual IRatio NominalRatio
        {
            get
            {
                return this._nominalRatio;
            }
            set
            {
                if ((this._nominalRatio != value))
                {
                    IRatio old = this._nominalRatio;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnNominalRatioChanging(e);
                    this.OnPropertyChanging("NominalRatio", e, _nominalRatioReference);
                    this._nominalRatio = value;
                    if ((old != null))
                    {
                        old.Deleted -= this.OnResetNominalRatio;
                    }
                    if ((value != null))
                    {
                        value.Deleted += this.OnResetNominalRatio;
                    }
                    this.OnNominalRatioChanged(e);
                    this.OnPropertyChanged("NominalRatio", e, _nominalRatioReference);
                }
            }
        }

        /// <summary>
        /// The secondaryRatio property
        /// </summary>
        [XmlElementNameAttribute("secondaryRatio")]
        [XmlAttributeAttribute(true)]
        public virtual IRatio SecondaryRatio
        {
            get
            {
                return this._secondaryRatio;
            }
            set
            {
                if ((this._secondaryRatio != value))
                {
                    IRatio old = this._secondaryRatio;
                    ValueChangedEventArgs e = new ValueChangedEventArgs(old, value);
                    this.OnSecondaryRatioChanging(e);
                    this.OnPropertyChanging("SecondaryRatio", e, _secondaryRatioReference);
                    this._secondaryRatio = value;
                    if ((old != null))
                    {
                        old.Deleted -= this.OnResetSecondaryRatio;
                    }
                    if ((value != null))
                    {
                        value.Deleted += this.OnResetSecondaryRatio;
                    }
                    this.OnSecondaryRatioChanged(e);
                    this.OnPropertyChanged("SecondaryRatio", e, _secondaryRatioReference);
                }
            }
        }

        /// <summary>
        /// Gets the referenced model elements of this model element
        /// </summary>
        public override IEnumerableExpression<IModelElement> ReferencedElements
        {
            get
            {
                return base.ReferencedElements.Concat(new CurrentTransformerInfoReferencedElementsCollection(this));
            }
        }

        /// <summary>
        /// Gets the Class model for this type
        /// </summary>
        public new static IClass ClassInstance
        {
            get
            {
                if ((_classInstance == null))
                {
                    _classInstance = ((IClass)(MetaRepository.Instance.Resolve("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/InfAssets/Current" +
                            "TransformerInfo")));
                }
                return _classInstance;
            }
        }

        /// <summary>
        /// Gets fired before the AccuracyClass property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> AccuracyClassChanging;

        /// <summary>
        /// Gets fired when the AccuracyClass property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> AccuracyClassChanged;

        /// <summary>
        /// Gets fired before the CtClass property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> CtClassChanging;

        /// <summary>
        /// Gets fired when the CtClass property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> CtClassChanged;

        /// <summary>
        /// Gets fired before the CoreBurden property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> CoreBurdenChanging;

        /// <summary>
        /// Gets fired when the CoreBurden property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> CoreBurdenChanged;

        /// <summary>
        /// Gets fired before the PrimaryFlsRating property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> PrimaryFlsRatingChanging;

        /// <summary>
        /// Gets fired when the PrimaryFlsRating property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> PrimaryFlsRatingChanged;

        /// <summary>
        /// Gets fired before the AccuracyLimit property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> AccuracyLimitChanging;

        /// <summary>
        /// Gets fired when the AccuracyLimit property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> AccuracyLimitChanged;

        /// <summary>
        /// Gets fired before the KneePointCurrent property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> KneePointCurrentChanging;

        /// <summary>
        /// Gets fired when the KneePointCurrent property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> KneePointCurrentChanged;

        /// <summary>
        /// Gets fired before the Usage property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> UsageChanging;

        /// <summary>
        /// Gets fired when the Usage property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> UsageChanged;

        /// <summary>
        /// Gets fired before the SecondaryFlsRating property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> SecondaryFlsRatingChanging;

        /// <summary>
        /// Gets fired when the SecondaryFlsRating property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> SecondaryFlsRatingChanged;

        /// <summary>
        /// Gets fired before the TertiaryFlsRating property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> TertiaryFlsRatingChanging;

        /// <summary>
        /// Gets fired when the TertiaryFlsRating property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> TertiaryFlsRatingChanged;

        /// <summary>
        /// Gets fired before the CoreCount property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> CoreCountChanging;

        /// <summary>
        /// Gets fired when the CoreCount property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> CoreCountChanged;

        /// <summary>
        /// Gets fired before the KneePointVoltage property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> KneePointVoltageChanging;

        /// <summary>
        /// Gets fired when the KneePointVoltage property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> KneePointVoltageChanged;

        /// <summary>
        /// Gets fired before the MaxRatio property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> MaxRatioChanging;

        /// <summary>
        /// Gets fired when the MaxRatio property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> MaxRatioChanged;

        /// <summary>
        /// Gets fired before the PrimaryRatio property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> PrimaryRatioChanging;

        /// <summary>
        /// Gets fired when the PrimaryRatio property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> PrimaryRatioChanged;

        /// <summary>
        /// Gets fired before the TertiaryRatio property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> TertiaryRatioChanging;

        /// <summary>
        /// Gets fired when the TertiaryRatio property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> TertiaryRatioChanged;

        /// <summary>
        /// Gets fired before the NominalRatio property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> NominalRatioChanging;

        /// <summary>
        /// Gets fired when the NominalRatio property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> NominalRatioChanged;

        /// <summary>
        /// Gets fired before the SecondaryRatio property changes its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> SecondaryRatioChanging;

        /// <summary>
        /// Gets fired when the SecondaryRatio property changed its value
        /// </summary>
        public event System.EventHandler<ValueChangedEventArgs> SecondaryRatioChanged;

        private static ITypedElement RetrieveAccuracyClassAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("accuracyClass")));
        }

        /// <summary>
        /// Raises the AccuracyClassChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnAccuracyClassChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.AccuracyClassChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the AccuracyClassChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnAccuracyClassChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.AccuracyClassChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrieveCtClassAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("ctClass")));
        }

        /// <summary>
        /// Raises the CtClassChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnCtClassChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.CtClassChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the CtClassChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnCtClassChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.CtClassChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrieveCoreBurdenAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("coreBurden")));
        }

        /// <summary>
        /// Raises the CoreBurdenChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnCoreBurdenChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.CoreBurdenChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the CoreBurdenChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnCoreBurdenChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.CoreBurdenChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrievePrimaryFlsRatingAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("primaryFlsRating")));
        }

        /// <summary>
        /// Raises the PrimaryFlsRatingChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnPrimaryFlsRatingChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.PrimaryFlsRatingChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the PrimaryFlsRatingChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnPrimaryFlsRatingChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.PrimaryFlsRatingChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrieveAccuracyLimitAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("accuracyLimit")));
        }

        /// <summary>
        /// Raises the AccuracyLimitChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnAccuracyLimitChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.AccuracyLimitChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the AccuracyLimitChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnAccuracyLimitChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.AccuracyLimitChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrieveKneePointCurrentAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("kneePointCurrent")));
        }

        /// <summary>
        /// Raises the KneePointCurrentChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnKneePointCurrentChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.KneePointCurrentChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the KneePointCurrentChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnKneePointCurrentChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.KneePointCurrentChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrieveUsageAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("usage")));
        }

        /// <summary>
        /// Raises the UsageChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnUsageChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.UsageChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the UsageChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnUsageChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.UsageChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrieveSecondaryFlsRatingAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("secondaryFlsRating")));
        }

        /// <summary>
        /// Raises the SecondaryFlsRatingChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnSecondaryFlsRatingChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.SecondaryFlsRatingChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the SecondaryFlsRatingChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnSecondaryFlsRatingChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.SecondaryFlsRatingChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrieveTertiaryFlsRatingAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("tertiaryFlsRating")));
        }

        /// <summary>
        /// Raises the TertiaryFlsRatingChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnTertiaryFlsRatingChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.TertiaryFlsRatingChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the TertiaryFlsRatingChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnTertiaryFlsRatingChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.TertiaryFlsRatingChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrieveCoreCountAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("coreCount")));
        }

        /// <summary>
        /// Raises the CoreCountChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnCoreCountChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.CoreCountChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the CoreCountChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnCoreCountChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.CoreCountChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrieveKneePointVoltageAttribute()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("kneePointVoltage")));
        }

        /// <summary>
        /// Raises the KneePointVoltageChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnKneePointVoltageChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.KneePointVoltageChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the KneePointVoltageChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnKneePointVoltageChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.KneePointVoltageChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        private static ITypedElement RetrieveMaxRatioReference()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("maxRatio")));
        }

        /// <summary>
        /// Raises the MaxRatioChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnMaxRatioChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.MaxRatioChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the MaxRatioChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnMaxRatioChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.MaxRatioChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Handles the event that the MaxRatio property must reset
        /// </summary>
        /// <param name="sender">The object that sent this reset request</param>
        /// <param name="eventArgs">The event data for the reset event</param>
        private void OnResetMaxRatio(object sender, System.EventArgs eventArgs)
        {
            this.MaxRatio = null;
        }

        private static ITypedElement RetrievePrimaryRatioReference()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("primaryRatio")));
        }

        /// <summary>
        /// Raises the PrimaryRatioChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnPrimaryRatioChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.PrimaryRatioChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the PrimaryRatioChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnPrimaryRatioChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.PrimaryRatioChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Handles the event that the PrimaryRatio property must reset
        /// </summary>
        /// <param name="sender">The object that sent this reset request</param>
        /// <param name="eventArgs">The event data for the reset event</param>
        private void OnResetPrimaryRatio(object sender, System.EventArgs eventArgs)
        {
            this.PrimaryRatio = null;
        }

        private static ITypedElement RetrieveTertiaryRatioReference()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("tertiaryRatio")));
        }

        /// <summary>
        /// Raises the TertiaryRatioChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnTertiaryRatioChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.TertiaryRatioChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the TertiaryRatioChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnTertiaryRatioChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.TertiaryRatioChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Handles the event that the TertiaryRatio property must reset
        /// </summary>
        /// <param name="sender">The object that sent this reset request</param>
        /// <param name="eventArgs">The event data for the reset event</param>
        private void OnResetTertiaryRatio(object sender, System.EventArgs eventArgs)
        {
            this.TertiaryRatio = null;
        }

        private static ITypedElement RetrieveNominalRatioReference()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("nominalRatio")));
        }

        /// <summary>
        /// Raises the NominalRatioChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnNominalRatioChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.NominalRatioChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the NominalRatioChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnNominalRatioChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.NominalRatioChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Handles the event that the NominalRatio property must reset
        /// </summary>
        /// <param name="sender">The object that sent this reset request</param>
        /// <param name="eventArgs">The event data for the reset event</param>
        private void OnResetNominalRatio(object sender, System.EventArgs eventArgs)
        {
            this.NominalRatio = null;
        }

        private static ITypedElement RetrieveSecondaryRatioReference()
        {
            return ((ITypedElement)(((ModelElement)(CurrentTransformerInfo.ClassInstance)).Resolve("secondaryRatio")));
        }

        /// <summary>
        /// Raises the SecondaryRatioChanging event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnSecondaryRatioChanging(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.SecondaryRatioChanging;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Raises the SecondaryRatioChanged event
        /// </summary>
        /// <param name="eventArgs">The event data</param>
        protected virtual void OnSecondaryRatioChanged(ValueChangedEventArgs eventArgs)
        {
            System.EventHandler<ValueChangedEventArgs> handler = this.SecondaryRatioChanged;
            if ((handler != null))
            {
                handler.Invoke(this, eventArgs);
            }
        }

        /// <summary>
        /// Handles the event that the SecondaryRatio property must reset
        /// </summary>
        /// <param name="sender">The object that sent this reset request</param>
        /// <param name="eventArgs">The event data for the reset event</param>
        private void OnResetSecondaryRatio(object sender, System.EventArgs eventArgs)
        {
            this.SecondaryRatio = null;
        }

        /// <summary>
        /// Resolves the given attribute name
        /// </summary>
        /// <returns>The attribute value or null if it could not be found</returns>
        /// <param name="attribute">The requested attribute name</param>
        /// <param name="index">The index of this attribute</param>
        protected override object GetAttributeValue(string attribute, int index)
        {
            if ((attribute == "ACCURACYCLASS"))
            {
                return this.AccuracyClass;
            }
            if ((attribute == "CTCLASS"))
            {
                return this.CtClass;
            }
            if ((attribute == "COREBURDEN"))
            {
                return this.CoreBurden;
            }
            if ((attribute == "PRIMARYFLSRATING"))
            {
                return this.PrimaryFlsRating;
            }
            if ((attribute == "ACCURACYLIMIT"))
            {
                return this.AccuracyLimit;
            }
            if ((attribute == "KNEEPOINTCURRENT"))
            {
                return this.KneePointCurrent;
            }
            if ((attribute == "USAGE"))
            {
                return this.Usage;
            }
            if ((attribute == "SECONDARYFLSRATING"))
            {
                return this.SecondaryFlsRating;
            }
            if ((attribute == "TERTIARYFLSRATING"))
            {
                return this.TertiaryFlsRating;
            }
            if ((attribute == "CORECOUNT"))
            {
                return this.CoreCount;
            }
            if ((attribute == "KNEEPOINTVOLTAGE"))
            {
                return this.KneePointVoltage;
            }
            return base.GetAttributeValue(attribute, index);
        }

        /// <summary>
        /// Sets a value to the given feature
        /// </summary>
        /// <param name="feature">The requested feature</param>
        /// <param name="value">The value that should be set to that feature</param>
        protected override void SetFeature(string feature, object value)
        {
            if ((feature == "MAXRATIO"))
            {
                this.MaxRatio = ((IRatio)(value));
                return;
            }
            if ((feature == "PRIMARYRATIO"))
            {
                this.PrimaryRatio = ((IRatio)(value));
                return;
            }
            if ((feature == "TERTIARYRATIO"))
            {
                this.TertiaryRatio = ((IRatio)(value));
                return;
            }
            if ((feature == "NOMINALRATIO"))
            {
                this.NominalRatio = ((IRatio)(value));
                return;
            }
            if ((feature == "SECONDARYRATIO"))
            {
                this.SecondaryRatio = ((IRatio)(value));
                return;
            }
            if ((feature == "ACCURACYCLASS"))
            {
                this.AccuracyClass = ((string)(value));
                return;
            }
            if ((feature == "CTCLASS"))
            {
                this.CtClass = ((string)(value));
                return;
            }
            if ((feature == "COREBURDEN"))
            {
                this.CoreBurden = ((float)(value));
                return;
            }
            if ((feature == "PRIMARYFLSRATING"))
            {
                this.PrimaryFlsRating = ((float)(value));
                return;
            }
            if ((feature == "ACCURACYLIMIT"))
            {
                this.AccuracyLimit = ((float)(value));
                return;
            }
            if ((feature == "KNEEPOINTCURRENT"))
            {
                this.KneePointCurrent = ((float)(value));
                return;
            }
            if ((feature == "USAGE"))
            {
                this.Usage = ((string)(value));
                return;
            }
            if ((feature == "SECONDARYFLSRATING"))
            {
                this.SecondaryFlsRating = ((float)(value));
                return;
            }
            if ((feature == "TERTIARYFLSRATING"))
            {
                this.TertiaryFlsRating = ((float)(value));
                return;
            }
            if ((feature == "CORECOUNT"))
            {
                this.CoreCount = ((int)(value));
                return;
            }
            if ((feature == "KNEEPOINTVOLTAGE"))
            {
                this.KneePointVoltage = ((float)(value));
                return;
            }
            base.SetFeature(feature, value);
        }

        /// <summary>
        /// Gets the property expression for the given attribute
        /// </summary>
        /// <returns>An incremental property expression</returns>
        /// <param name="attribute">The requested attribute in upper case</param>
        protected override NMF.Expressions.INotifyExpression<object> GetExpressionForAttribute(string attribute)
        {
            if ((attribute == "MaxRatio"))
            {
                return new MaxRatioProxy(this);
            }
            if ((attribute == "PrimaryRatio"))
            {
                return new PrimaryRatioProxy(this);
            }
            if ((attribute == "TertiaryRatio"))
            {
                return new TertiaryRatioProxy(this);
            }
            if ((attribute == "NominalRatio"))
            {
                return new NominalRatioProxy(this);
            }
            if ((attribute == "SecondaryRatio"))
            {
                return new SecondaryRatioProxy(this);
            }
            return base.GetExpressionForAttribute(attribute);
        }

        /// <summary>
        /// Gets the property expression for the given reference
        /// </summary>
        /// <returns>An incremental property expression</returns>
        /// <param name="reference">The requested reference in upper case</param>
        protected override NMF.Expressions.INotifyExpression<NMF.Models.IModelElement> GetExpressionForReference(string reference)
        {
            if ((reference == "MaxRatio"))
            {
                return new MaxRatioProxy(this);
            }
            if ((reference == "PrimaryRatio"))
            {
                return new PrimaryRatioProxy(this);
            }
            if ((reference == "TertiaryRatio"))
            {
                return new TertiaryRatioProxy(this);
            }
            if ((reference == "NominalRatio"))
            {
                return new NominalRatioProxy(this);
            }
            if ((reference == "SecondaryRatio"))
            {
                return new SecondaryRatioProxy(this);
            }
            return base.GetExpressionForReference(reference);
        }

        /// <summary>
        /// Gets the Class for this model element
        /// </summary>
        public override IClass GetClass()
        {
            if ((_classInstance == null))
            {
                _classInstance = ((IClass)(MetaRepository.Instance.Resolve("http://iec.ch/TC57/2009/CIM-schema-cim14#//IEC61970/Informative/InfAssets/Current" +
                        "TransformerInfo")));
            }
            return _classInstance;
        }

        /// <summary>
        /// The collection class to to represent the children of the CurrentTransformerInfo class
        /// </summary>
        public class CurrentTransformerInfoReferencedElementsCollection : ReferenceCollection, ICollectionExpression<IModelElement>, ICollection<IModelElement>
        {

            private CurrentTransformerInfo _parent;

            /// <summary>
            /// Creates a new instance
            /// </summary>
            public CurrentTransformerInfoReferencedElementsCollection(CurrentTransformerInfo parent)
            {
                this._parent = parent;
            }

            /// <summary>
            /// Gets the amount of elements contained in this collection
            /// </summary>
            public override int Count
            {
                get
                {
                    int count = 0;
                    if ((this._parent.MaxRatio != null))
                    {
                        count = (count + 1);
                    }
                    if ((this._parent.PrimaryRatio != null))
                    {
                        count = (count + 1);
                    }
                    if ((this._parent.TertiaryRatio != null))
                    {
                        count = (count + 1);
                    }
                    if ((this._parent.NominalRatio != null))
                    {
                        count = (count + 1);
                    }
                    if ((this._parent.SecondaryRatio != null))
                    {
                        count = (count + 1);
                    }
                    return count;
                }
            }

            protected override void AttachCore()
            {
                this._parent.MaxRatioChanged += this.PropagateValueChanges;
                this._parent.PrimaryRatioChanged += this.PropagateValueChanges;
                this._parent.TertiaryRatioChanged += this.PropagateValueChanges;
                this._parent.NominalRatioChanged += this.PropagateValueChanges;
                this._parent.SecondaryRatioChanged += this.PropagateValueChanges;
            }

            protected override void DetachCore()
            {
                this._parent.MaxRatioChanged -= this.PropagateValueChanges;
                this._parent.PrimaryRatioChanged -= this.PropagateValueChanges;
                this._parent.TertiaryRatioChanged -= this.PropagateValueChanges;
                this._parent.NominalRatioChanged -= this.PropagateValueChanges;
                this._parent.SecondaryRatioChanged -= this.PropagateValueChanges;
            }

            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                if ((this._parent.MaxRatio == null))
                {
                    IRatio maxRatioCasted = item.As<IRatio>();
                    if ((maxRatioCasted != null))
                    {
                        this._parent.MaxRatio = maxRatioCasted;
                        return;
                    }
                }
                if ((this._parent.PrimaryRatio == null))
                {
                    IRatio primaryRatioCasted = item.As<IRatio>();
                    if ((primaryRatioCasted != null))
                    {
                        this._parent.PrimaryRatio = primaryRatioCasted;
                        return;
                    }
                }
                if ((this._parent.TertiaryRatio == null))
                {
                    IRatio tertiaryRatioCasted = item.As<IRatio>();
                    if ((tertiaryRatioCasted != null))
                    {
                        this._parent.TertiaryRatio = tertiaryRatioCasted;
                        return;
                    }
                }
                if ((this._parent.NominalRatio == null))
                {
                    IRatio nominalRatioCasted = item.As<IRatio>();
                    if ((nominalRatioCasted != null))
                    {
                        this._parent.NominalRatio = nominalRatioCasted;
                        return;
                    }
                }
                if ((this._parent.SecondaryRatio == null))
                {
                    IRatio secondaryRatioCasted = item.As<IRatio>();
                    if ((secondaryRatioCasted != null))
                    {
                        this._parent.SecondaryRatio = secondaryRatioCasted;
                        return;
                    }
                }
            }

            /// <summary>
            /// Clears the collection and resets all references that implement it.
            /// </summary>
            public override void Clear()
            {
                this._parent.MaxRatio = null;
                this._parent.PrimaryRatio = null;
                this._parent.TertiaryRatio = null;
                this._parent.NominalRatio = null;
                this._parent.SecondaryRatio = null;
            }

            /// <summary>
            /// Gets a value indicating whether the given element is contained in the collection
            /// </summary>
            /// <returns>True, if it is contained, otherwise False</returns>
            /// <param name="item">The item that should be looked out for</param>
            public override bool Contains(IModelElement item)
            {
                if ((item == this._parent.MaxRatio))
                {
                    return true;
                }
                if ((item == this._parent.PrimaryRatio))
                {
                    return true;
                }
                if ((item == this._parent.TertiaryRatio))
                {
                    return true;
                }
                if ((item == this._parent.NominalRatio))
                {
                    return true;
                }
                if ((item == this._parent.SecondaryRatio))
                {
                    return true;
                }
                return false;
            }

            /// <summary>
            /// Copies the contents of the collection to the given array starting from the given array index
            /// </summary>
            /// <param name="array">The array in which the elements should be copied</param>
            /// <param name="arrayIndex">The starting index</param>
            public override void CopyTo(IModelElement[] array, int arrayIndex)
            {
                if ((this._parent.MaxRatio != null))
                {
                    array[arrayIndex] = this._parent.MaxRatio;
                    arrayIndex = (arrayIndex + 1);
                }
                if ((this._parent.PrimaryRatio != null))
                {
                    array[arrayIndex] = this._parent.PrimaryRatio;
                    arrayIndex = (arrayIndex + 1);
                }
                if ((this._parent.TertiaryRatio != null))
                {
                    array[arrayIndex] = this._parent.TertiaryRatio;
                    arrayIndex = (arrayIndex + 1);
                }
                if ((this._parent.NominalRatio != null))
                {
                    array[arrayIndex] = this._parent.NominalRatio;
                    arrayIndex = (arrayIndex + 1);
                }
                if ((this._parent.SecondaryRatio != null))
                {
                    array[arrayIndex] = this._parent.SecondaryRatio;
                    arrayIndex = (arrayIndex + 1);
                }
            }

            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                if ((this._parent.MaxRatio == item))
                {
                    this._parent.MaxRatio = null;
                    return true;
                }
                if ((this._parent.PrimaryRatio == item))
                {
                    this._parent.PrimaryRatio = null;
                    return true;
                }
                if ((this._parent.TertiaryRatio == item))
                {
                    this._parent.TertiaryRatio = null;
                    return true;
                }
                if ((this._parent.NominalRatio == item))
                {
                    this._parent.NominalRatio = null;
                    return true;
                }
                if ((this._parent.SecondaryRatio == item))
                {
                    this._parent.SecondaryRatio = null;
                    return true;
                }
                return false;
            }

            /// <summary>
            /// Gets an enumerator that enumerates the collection
            /// </summary>
            /// <returns>A generic enumerator</returns>
            public override IEnumerator<IModelElement> GetEnumerator()
            {
                return Enumerable.Empty<IModelElement>().Concat(this._parent.MaxRatio).Concat(this._parent.PrimaryRatio).Concat(this._parent.TertiaryRatio).Concat(this._parent.NominalRatio).Concat(this._parent.SecondaryRatio).GetEnumerator();
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the accuracyClass property
        /// </summary>
        private sealed class AccuracyClassProxy : ModelPropertyChange<ICurrentTransformerInfo, string>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public AccuracyClassProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "accuracyClass")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override string Value
            {
                get
                {
                    return this.ModelElement.AccuracyClass;
                }
                set
                {
                    this.ModelElement.AccuracyClass = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the ctClass property
        /// </summary>
        private sealed class CtClassProxy : ModelPropertyChange<ICurrentTransformerInfo, string>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public CtClassProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "ctClass")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override string Value
            {
                get
                {
                    return this.ModelElement.CtClass;
                }
                set
                {
                    this.ModelElement.CtClass = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the coreBurden property
        /// </summary>
        private sealed class CoreBurdenProxy : ModelPropertyChange<ICurrentTransformerInfo, float>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public CoreBurdenProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "coreBurden")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override float Value
            {
                get
                {
                    return this.ModelElement.CoreBurden;
                }
                set
                {
                    this.ModelElement.CoreBurden = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the primaryFlsRating property
        /// </summary>
        private sealed class PrimaryFlsRatingProxy : ModelPropertyChange<ICurrentTransformerInfo, float>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public PrimaryFlsRatingProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "primaryFlsRating")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override float Value
            {
                get
                {
                    return this.ModelElement.PrimaryFlsRating;
                }
                set
                {
                    this.ModelElement.PrimaryFlsRating = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the accuracyLimit property
        /// </summary>
        private sealed class AccuracyLimitProxy : ModelPropertyChange<ICurrentTransformerInfo, float>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public AccuracyLimitProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "accuracyLimit")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override float Value
            {
                get
                {
                    return this.ModelElement.AccuracyLimit;
                }
                set
                {
                    this.ModelElement.AccuracyLimit = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the kneePointCurrent property
        /// </summary>
        private sealed class KneePointCurrentProxy : ModelPropertyChange<ICurrentTransformerInfo, float>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public KneePointCurrentProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "kneePointCurrent")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override float Value
            {
                get
                {
                    return this.ModelElement.KneePointCurrent;
                }
                set
                {
                    this.ModelElement.KneePointCurrent = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the usage property
        /// </summary>
        private sealed class UsageProxy : ModelPropertyChange<ICurrentTransformerInfo, string>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public UsageProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "usage")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override string Value
            {
                get
                {
                    return this.ModelElement.Usage;
                }
                set
                {
                    this.ModelElement.Usage = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the secondaryFlsRating property
        /// </summary>
        private sealed class SecondaryFlsRatingProxy : ModelPropertyChange<ICurrentTransformerInfo, float>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public SecondaryFlsRatingProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "secondaryFlsRating")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override float Value
            {
                get
                {
                    return this.ModelElement.SecondaryFlsRating;
                }
                set
                {
                    this.ModelElement.SecondaryFlsRating = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the tertiaryFlsRating property
        /// </summary>
        private sealed class TertiaryFlsRatingProxy : ModelPropertyChange<ICurrentTransformerInfo, float>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public TertiaryFlsRatingProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "tertiaryFlsRating")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override float Value
            {
                get
                {
                    return this.ModelElement.TertiaryFlsRating;
                }
                set
                {
                    this.ModelElement.TertiaryFlsRating = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the coreCount property
        /// </summary>
        private sealed class CoreCountProxy : ModelPropertyChange<ICurrentTransformerInfo, int>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public CoreCountProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "coreCount")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override int Value
            {
                get
                {
                    return this.ModelElement.CoreCount;
                }
                set
                {
                    this.ModelElement.CoreCount = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the kneePointVoltage property
        /// </summary>
        private sealed class KneePointVoltageProxy : ModelPropertyChange<ICurrentTransformerInfo, float>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public KneePointVoltageProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "kneePointVoltage")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override float Value
            {
                get
                {
                    return this.ModelElement.KneePointVoltage;
                }
                set
                {
                    this.ModelElement.KneePointVoltage = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the maxRatio property
        /// </summary>
        private sealed class MaxRatioProxy : ModelPropertyChange<ICurrentTransformerInfo, IRatio>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public MaxRatioProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "maxRatio")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override IRatio Value
            {
                get
                {
                    return this.ModelElement.MaxRatio;
                }
                set
                {
                    this.ModelElement.MaxRatio = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the primaryRatio property
        /// </summary>
        private sealed class PrimaryRatioProxy : ModelPropertyChange<ICurrentTransformerInfo, IRatio>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public PrimaryRatioProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "primaryRatio")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override IRatio Value
            {
                get
                {
                    return this.ModelElement.PrimaryRatio;
                }
                set
                {
                    this.ModelElement.PrimaryRatio = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the tertiaryRatio property
        /// </summary>
        private sealed class TertiaryRatioProxy : ModelPropertyChange<ICurrentTransformerInfo, IRatio>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public TertiaryRatioProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "tertiaryRatio")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override IRatio Value
            {
                get
                {
                    return this.ModelElement.TertiaryRatio;
                }
                set
                {
                    this.ModelElement.TertiaryRatio = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the nominalRatio property
        /// </summary>
        private sealed class NominalRatioProxy : ModelPropertyChange<ICurrentTransformerInfo, IRatio>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public NominalRatioProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "nominalRatio")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override IRatio Value
            {
                get
                {
                    return this.ModelElement.NominalRatio;
                }
                set
                {
                    this.ModelElement.NominalRatio = value;
                }
            }
        }

        /// <summary>
        /// Represents a proxy to represent an incremental access to the secondaryRatio property
        /// </summary>
        private sealed class SecondaryRatioProxy : ModelPropertyChange<ICurrentTransformerInfo, IRatio>
        {

            /// <summary>
            /// Creates a new observable property access proxy
            /// </summary>
            /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
            public SecondaryRatioProxy(ICurrentTransformerInfo modelElement) :
                    base(modelElement, "secondaryRatio")
            {
            }

            /// <summary>
            /// Gets or sets the value of this expression
            /// </summary>
            public override IRatio Value
            {
                get
                {
                    return this.ModelElement.SecondaryRatio;
                }
                set
                {
                    this.ModelElement.SecondaryRatio = value;
                }
            }
        }
    }
}


text:
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.command.undo;

import com.intellij.openapi.editor.Document;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.Nullable;

/**
 * Do not implement this directly. Use DocumentReferenceManager instead.
 */
public interface DocumentReference {
  DocumentReference[] EMPTY_ARRAY = new DocumentReference[0];

  @Nullable
  Document getDocument();

  @Nullable
  VirtualFile getFile();
}

redpajama_set_name: RedPajamaGithub


text:
package org.glob3.mobile.generated;
//
//  FlatPlanet.cpp
//  G3MiOSSDK
//
//  Created by Agustín Trujillo on 10/07/13.
//
//

//
//  FlatPlanet.hpp
//  G3MiOSSDK
//
//  Created by Agustín Trujillo on 10/07/13.
//
//

public class FlatPlanet extends Planet
{
  private final Vector2D _size ;
  private final Vector3D _radii ;

  private MutableVector3D _origin = new MutableVector3D();
  private MutableVector3D _initialPoint = new MutableVector3D();
  private MutableVector3D _lastFinalPoint = new MutableVector3D();
  private boolean _validSingleDrag;
  private MutableVector3D _lastDirection = new MutableVector3D();

  private MutableVector3D _centerRay = new MutableVector3D();
  private MutableVector3D _initialPoint0 = new MutableVector3D();
  private MutableVector3D _initialPoint1 = new MutableVector3D();
  private double _distanceBetweenInitialPoints;
  private MutableVector3D _centerPoint = new MutableVector3D();
  //  mutable double          _angleBetweenInitialRays;

  public FlatPlanet(Vector2D size)
  {
     _size = new Vector2D(size);
     _radii = new Vector3D(size._x, size._y, 0);
  }

  public void dispose()
  {

  }

  public final Vector3D getRadii()
  {
    return _radii;
  }

  public final Vector3D centricSurfaceNormal(Vector3D position)
  {
    return new Vector3D(0, 0, 1);
  }

  public final Vector3D geodeticSurfaceNormal(Vector3D position)
  {
    return new Vector3D(0, 0, 1);
  }

  public final Vector3D geodeticSurfaceNormal(MutableVector3D position)
  {
    return new Vector3D(0, 0, 1);
  }

  public final void geodeticSurfaceNormal(Angle latitude, Angle longitude, MutableVector3D result)
  {
    result.set(0, 0, 1);
  }

  public final Vector3D geodeticSurfaceNormal(Angle latitude, Angle longitude)
  {
    return new Vector3D(0, 0, 1);
  }

  public final Vector3D geodeticSurfaceNormal(Geodetic3D geodetic)
  {
    return new Vector3D(0, 0, 1);
  }

  public final Vector3D geodeticSurfaceNormal(Geodetic2D geodetic)
  {
    return new Vector3D(0, 0, 1);
  }

  public final java.util.ArrayList<Double> intersectionsDistances(double originX, double originY, double originZ, double directionX, double directionY, double directionZ)
  {
    java.util.ArrayList<Double> intersections = new java.util.ArrayList<Double>();

    // compute intersection with plane
    if (directionZ == 0)
       return intersections;
    final double t = -originZ / directionZ;
    final double x = originX + t * directionX;
    final double halfWidth = 0.5 * _size._x;
    if (x < -halfWidth || x > halfWidth)
       return intersections;
    final double y = originY + t * directionY;
    final double halfHeight = 0.5 * _size._y;
    if (y < -halfHeight || y > halfHeight)
       return intersections;
    intersections.add(t);
    return intersections;
  }

  public final Vector3D toCartesian(Angle latitude, Angle longitude, double height)
  {
    final double x = longitude._degrees * _size._x / 360.0;
    final double y = latitude._degrees * _size._y / 180.0;
    return new Vector3D(x, y, height);
  }

  public final Vector3D toCartesian(Geodetic3D geodetic)
  {
    return toCartesian(geodetic._latitude, geodetic._longitude, geodetic._height);
  }

  public final Vector3D toCartesian(Geodetic2D geodetic)
  {
    return toCartesian(geodetic._latitude, geodetic._longitude, 0.0);
  }

  public final Vector3D toCartesian(Geodetic2D geodetic, double height)
  {
    return toCartesian(geodetic._latitude, geodetic._longitude, height);
  }

  public final void toCartesian(Angle latitude, Angle longitude, double height, MutableVector3D result)
  {
    final double x = longitude._degrees * _size._x / 360.0;
    final double y = latitude._degrees * _size._y / 180.0;
    result.set(x, y, height);
  }

  public final void toCartesian(Geodetic3D geodetic, MutableVector3D result)
  {
    toCartesian(geodetic._latitude, geodetic._longitude, geodetic._height, result);
  }
  public final void toCartesian(Geodetic2D geodetic, MutableVector3D result)
  {
    toCartesian(geodetic._latitude, geodetic._longitude, 0.0, result);
  }

  public final void toCartesian(Geodetic2D geodetic, double height, MutableVector3D result)
  {
    toCartesian(geodetic._latitude, geodetic._longitude, height, result);
  }

  //Vector3D FlatPlanet::toCartesian(const Angle& latitude,
  //                                 const Angle& longitude,
  //                                 const double height) const {
  //  return toCartesian(Geodetic3D(latitude, longitude, height));
  //}

  public final Geodetic2D toGeodetic2D(Vector3D position)
  {
    final double longitude = position._x * 360.0 / _size._x;
    final double latitude = position._y * 180.0 / _size._y;
    return (new Geodetic2D(Angle.fromDegrees(latitude), Angle.fromDegrees(longitude)));
  }

  public final Geodetic3D toGeodetic3D(Vector3D position)
  {
    return new Geodetic3D(toGeodetic2D(position), position._z);
  }

  public final Vector3D scaleToGeodeticSurface(Vector3D position)
  {
    return new Vector3D(position._x, position._y, 0);
  }

  public final Vector3D scaleToGeocentricSurface(Vector3D position)
  {
    return scaleToGeodeticSurface(position);
  }

  public final Geodetic2D getMidPoint (Geodetic2D P0, Geodetic2D P1)
  {
    return new Geodetic2D(P0._latitude.add(P1._latitude).times(0.5), P0._longitude.add(P1._longitude).times(0.5));
  }

  // compute distance from two points
  public final double computePreciseLatLonDistance(Geodetic2D g1, Geodetic2D g2)
  {
    return toCartesian(g1).sub(toCartesian(g2)).length();
  }

  // compute distance from two points
  public final double computeFastLatLonDistance(Geodetic2D g1, Geodetic2D g2)
  {
    return computePreciseLatLonDistance(g1, g2);
  }

  public final MutableMatrix44D createGeodeticTransformMatrix(Geodetic3D position)
  {
    return MutableMatrix44D.createTranslationMatrix(toCartesian(position));
  }

  public final boolean isFlat()
  {
     return true;
  }

  public final void beginSingleDrag(Vector3D origin, Vector3D initialRay)
  {
    _origin = origin.asMutableVector3D();
    _initialPoint = Plane.intersectionXYPlaneWithRay(origin, initialRay).asMutableVector3D();
    _lastFinalPoint = _initialPoint;
    _validSingleDrag = false;
  }

  public final MutableMatrix44D singleDrag(Vector3D finalRay)
  {
    // test if initialPoint is valid
    if (_initialPoint.isNan())
       return MutableMatrix44D.invalid();

    // compute final point
    final Vector3D origin = _origin.asVector3D();
    MutableVector3D finalPoint = Plane.intersectionXYPlaneWithRay(origin, finalRay).asMutableVector3D();
    if (finalPoint.isNan())
       return MutableMatrix44D.invalid();

    // save params for possible inertial animations
    _validSingleDrag = true;
    _lastDirection = _lastFinalPoint.sub(finalPoint);
    _lastFinalPoint = finalPoint;

    // return rotation matrix
    return MutableMatrix44D.createTranslationMatrix(_initialPoint.sub(finalPoint).asVector3D());
  }

  public final Effect createEffectFromLastSingleDrag()
  {
    if (!_validSingleDrag)
       return null;
    return new SingleTranslationEffect(_lastDirection.asVector3D());
  }

  public final void beginDoubleDrag(Vector3D origin, Vector3D centerRay, Vector3D initialRay0, Vector3D initialRay1)
  {
    _origin = origin.asMutableVector3D();
    _centerRay = centerRay.asMutableVector3D();
    _initialPoint0 = Plane.intersectionXYPlaneWithRay(origin, initialRay0).asMutableVector3D();
    _initialPoint1 = Plane.intersectionXYPlaneWithRay(origin, initialRay1).asMutableVector3D();
    _distanceBetweenInitialPoints = _initialPoint0.sub(_initialPoint1).length();
    _centerPoint = Plane.intersectionXYPlaneWithRay(origin, centerRay).asMutableVector3D();
    //  _angleBetweenInitialRays = initialRay0.angleBetween(initialRay1).degrees();

    // middle point in 3D
    _initialPoint = _initialPoint0.add(_initialPoint1).times(0.5);
  }

  public final MutableMatrix44D doubleDrag(Vector3D finalRay0, Vector3D finalRay1)
  {
    // test if initialPoints are valid
    if (_initialPoint0.isNan() || _initialPoint1.isNan())
      return MutableMatrix44D.invalid();

    // init params
    final IMathUtils mu = IMathUtils.instance();
    MutableVector3D positionCamera = _origin;

    // compute distance to translate camera
    double d0 = _distanceBetweenInitialPoints;
    final Vector3D r1 = finalRay0;
    final Vector3D r2 = finalRay1;
    double k = ((r1._x/r1._z - r2._x/r2._z) * (r1._x/r1._z - r2._x/r2._z) + (r1._y/r1._z - r2._y/r2._z) * (r1._y/r1._z - r2._y/r2._z));
    double zc = _origin.z();
    double uz = _centerRay.z();
    double t2 = (d0 / mu.sqrt(k) - zc) / uz;

    // start to compound matrix
    MutableMatrix44D matrix = MutableMatrix44D.identity();
    positionCamera = _origin;
    MutableVector3D viewDirection = _centerRay;
    MutableVector3D ray0 = finalRay0.asMutableVector3D();
    MutableVector3D ray1 = finalRay1.asMutableVector3D();

    // drag from initialPoint to centerPoint and move the camera forward
    {
      MutableVector3D delta = _initialPoint.sub((_centerPoint));
      delta = delta.add(viewDirection.times(t2));
      MutableMatrix44D translation = MutableMatrix44D.createTranslationMatrix(delta.asVector3D());
      positionCamera = positionCamera.transformedBy(translation, 1.0);
  //    matrix.copyValue(translation.multiply(matrix));
      matrix.copyValueOfMultiplication(translation, matrix);
    }

    // compute 3D point of view center
    Vector3D centerPoint2 = Plane.intersectionXYPlaneWithRay(positionCamera.asVector3D(), viewDirection.asVector3D());

    // compute middle point in 3D
    Vector3D P0 = Plane.intersectionXYPlaneWithRay(positionCamera.asVector3D(), ray0.asVector3D());
    Vector3D P1 = Plane.intersectionXYPlaneWithRay(positionCamera.asVector3D(), ray1.asVector3D());
    Vector3D finalPoint = P0.add(P1).times(0.5);

    // drag globe from centerPoint to finalPoint
    {
      MutableMatrix44D translation = MutableMatrix44D.createTranslationMatrix(centerPoint2.sub(finalPoint));
      positionCamera = positionCamera.transformedBy(translation, 1.0);
  //    matrix.copyValue(translation.multiply(matrix));
      matrix.copyValueOfMultiplication(translation, matrix);
    }

    // camera rotation
    {
      Vector3D normal = geodeticSurfaceNormal(centerPoint2);
      Vector3D v0 = _initialPoint0.asVector3D().sub(centerPoint2).projectionInPlane(normal);
      Vector3D p0 = Plane.intersectionXYPlaneWithRay(positionCamera.asVector3D(), ray0.asVector3D());
      Vector3D v1 = p0.sub(centerPoint2).projectionInPlane(normal);
      double angle = v0.angleBetween(v1)._degrees;
      double sign = v1.cross(v0).dot(normal);
      if (sign<0)
         angle = -angle;
      MutableMatrix44D rotation = MutableMatrix44D.createGeneralRotationMatrix(Angle.fromDegrees(angle), normal, centerPoint2);
  //    matrix.copyValue(rotation.multiply(matrix));
      matrix.copyValueOfMultiplication(rotation, matrix);
    }

    return matrix;
  }

  public final Effect createDoubleTapEffect(Vector3D origin, Vector3D centerRay, Vector3D tapRay)
  {
    final Vector3D initialPoint = Plane.intersectionXYPlaneWithRay(origin, tapRay);
    if (initialPoint.isNan())
       return null;
    final Vector3D centerPoint = Plane.intersectionXYPlaneWithRay(origin, centerRay);

    // create effect
    return new DoubleTapTranslationEffect(TimeInterval.fromSeconds(0.75), initialPoint.sub(centerPoint), toGeodetic3D(origin)._height *0.6);
  }

  public final double distanceToHorizon(Vector3D position)
  {
    double xCorner = 0.5 * _size._x;
    if (position._x > 0)
       xCorner *= -1;
    double yCorner = 0.5 * _size._y;
    if (position._y > 0)
       yCorner *= -1;
    final Vector3D fartherCorner = new Vector3D(xCorner, yCorner, 0.0);
    return position.sub(fartherCorner).length();
  }

  public final MutableMatrix44D drag(Geodetic3D origin, Geodetic3D destination)
  {
    final Vector3D P0 = toCartesian(origin);
    final Vector3D P1 = toCartesian(destination);
    return MutableMatrix44D.createTranslationMatrix(P1.sub(P0));
  }

  public final Vector3D getNorth()
  {
    return Vector3D.upY();
  }

  public final void applyCameraConstrainers(Camera previousCamera, Camera nextCamera)
  {
  //  Vector3D pos = nextCamera->getCartesianPosition();
  //  Vector3D origin = _origin.asVector3D();
  //  double maxDist = _size.length() * 1.5;
  //
  //  if (pos.distanceTo(origin) > maxDist) {
  //    //    printf("TOO FAR %f\n", pos.distanceTo(origin) / maxDist);
  //    nextCamera->copyFrom(*previousCamera);
  //  }
  }

  public final Geodetic3D getDefaultCameraPosition(Sector rendereSector)
  {
    final Vector3D asw = toCartesian(rendereSector.getSW());
    final Vector3D ane = toCartesian(rendereSector.getNE());
    final double height = asw.sub(ane).length() * 1.9;

    return new Geodetic3D(rendereSector._center, height);
  }

  public final String getType()
  {
    return "Flat";
  }

}


text:
package com.tle.beans.entity;

import com.tle.beans.Institution;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.AccessType;
import org.hibernate.annotations.Index;

/** @author Nicholas Read */
@Entity
@AccessType("field")
@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"entity_id"})})
public class EntityLock {
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private long id;

  @OneToOne(fetch = FetchType.LAZY)
  private BaseEntity entity;

  @Column(length = 40)
  private String userSession;

  private String userID;

  @ManyToOne(fetch = FetchType.LAZY)
  @Index(name = "entityLockInstIndex")
  private Institution institution;

  public EntityLock() {
    super();
  }

  public String getUserSession() {
    return userSession;
  }

  public String getUserID() {
    return userID;
  }

  public void setUserID(String userID) {
    this.userID = userID;
  }

  public void setUserSession(String userSession) {
    this.userSession = userSession;
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public BaseEntity getEntity() {
    return entity;
  }

  public void setEntity(BaseEntity entity) {
    this.entity = entity;
  }

  public Institution getInstitution() {
    return institution;
  }

  public void setInstitution(Institution institution) {
    this.institution = institution;
  }
}