Пример #1
0
        //-------------------------------------------------------------------------
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ImmutableValidator private void validate()
        private void validate()
        {
            IborIndex shortIndex = shortObservation.Index;
            IborIndex longIndex  = longObservation.Index;

            if (!shortIndex.Currency.Equals(longIndex.Currency))
            {
                throw new System.ArgumentException("Interpolation requires two indices in the same currency");
            }
            if (shortIndex.Equals(longIndex))
            {
                throw new System.ArgumentException("Interpolation requires two different indices");
            }
            if (!shortObservation.FixingDate.Equals(longObservation.FixingDate))
            {
                throw new System.ArgumentException("Interpolation requires observations with same fixing date");
            }
            if (!indicesInOrder(shortIndex, longIndex, shortObservation.FixingDate))
            {
                throw new System.ArgumentException(Messages.format("Interpolation indices passed in wrong order: {} {}", shortIndex, longIndex));
            }
        }