Example #1
0
        /// <summary>
        /// Constructs a new <see cref="Bucket" /> with the specified owner and index.
        /// </summary>
        /// <param name="owner">The <see cref="Node" /> who owns the <see cref="Bucket" /></param>
        /// <param name="index"></param>
        public Bucket(INode owner, int index)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            _owner    = owner;
            _index    = index;
            _contacts = new BoundedCollection <IContact>(Constants.K);
        }
 /**
  * Factory method to create an unmodifiable bounded collection.
  *
  * @param coll  the <code>BoundedCollection</code> to decorate, must not be null
  * @return a new unmodifiable bounded collection
  * @throws IllegalArgumentException if bag is null
  */
 public static BoundedCollection decorate(BoundedCollection coll)
 {
     return new UnmodifiableBoundedCollection(coll);
 }
Example #3
0
 /**
  * Factory method to create an unmodifiable bounded collection.
  *
  * @param coll  the <code>BoundedCollection</code> to decorate, must not be null
  * @return a new unmodifiable bounded collection
  * @throws IllegalArgumentException if bag is null
  */
 public static BoundedCollection decorate(BoundedCollection coll)
 {
     return(new UnmodifiableBoundedCollection(coll));
 }
 /**
  * Constructor that wraps (not copies).
  *
  * @param coll  the collection to decorate, must not be null
  * @throws IllegalArgumentException if coll is null
  */
 private UnmodifiableBoundedCollection(BoundedCollection coll)
     : base(coll)
 {
 }
Example #5
0
 /**
  * Constructor that wraps (not copies).
  *
  * @param coll  the collection to decorate, must not be null
  * @throws IllegalArgumentException if coll is null
  */
 private UnmodifiableBoundedCollection(BoundedCollection coll)
     : base(coll)
 {
 }