コード例 #1
0
            //        {
            //            // set up matching values at initialization
            //            @delegate = incrementor;
            //            base.setMaximalCount(@delegate.getMaximalCount());
            //            base.incrementCount(@delegate.getCount());
            //        }

            /// <summary>
            /// {@inheritDoc} </summary>
            public override void SetMaximalCount(int max)
            {
                base.setMaximalCount(max);
                @delegate = @delegate.withMaximalCount(max);
            }
コード例 #2
0
 /// <summary>
 /// {@inheritDoc} </summary>
 public override void ResetCount()
 {
     base.resetCount();
     @delegate = @delegate.withStart(0);
 }
コード例 #3
0
        /// <summary>
        /// Create an instance that delegates everything to a <seealso cref="IntegerSequence.Incrementor"/>.
        /// <para>
        /// This factory method is intended only as a temporary hack for internal use in
        /// Apache Commons Math 3.X series, when {@code Incrementor} is required in
        /// interface (as a return value or in protected fields). It should <em>not</em>
        /// be used in other cases. The <seealso cref="IntegerSequence.Incrementor"/> class should
        /// be used instead of {@code Incrementor}.
        /// </para>
        /// <para>
        /// All methods are mirrored to the underlying <seealso cref="IntegerSequence.Incrementor"/>,
        /// as long as neither <seealso cref="#setMaximalCount(int)"/> nor <seealso cref="#resetCount()"/> are called.
        /// If one of these two methods is called, the created instance becomes independent
        /// of the <seealso cref="IntegerSequence.Incrementor"/> used at creation. The rationale is that
        /// <seealso cref="IntegerSequence.Incrementor"/> cannot change their maximal count and cannot be reset.
        /// </para> </summary>
        /// <param name="incrementor"> wrapped <seealso cref="IntegerSequence.Incrementor"/> </param>
        /// <returns> an incrementor wrapping an <seealso cref="IntegerSequence.Incrementor"/>
        /// @since 3.6 </returns>
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: public static Incrementor wrap(final IntegerSequence.Incrementor incrementor)
        public static Incrementor Wrap(IntegerSequence.Incrementor incrementor)
        {
            return(new IncrementorAnonymousInnerClass(incrementor));
        }