Exemplo n.º 1
0
 /// <summary>
 /// Copy contructor for doing deep copy of the <b>Partition</b> objects.
 /// </summary>
 /// <param name="old">The <b>Partition</b> to copy from.</param>
 public Partition(Partition old)
     : base(old)
 {
     CopyMembers(old);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Generates the partitions for a slice. Partition names and limits should be supplied.
        /// </summary>
        /// <param name="partitionNames">Array containing the names of the partitions.</param>
        /// <param name="partitionLimits">Two dimensional array containing the limits
        /// of the partitions.</param>
        /// <returns>A list of newly generated partition entities.</returns>
        /// <remarks>
        /// The length of the <paramref name="partitionNames"/> and the length of the first dimension
        /// of the <paramref name="partitionLimits"/> parameter must be the same. The <paramref name="partitionLimits"/>
        /// array must have the second dimension of the size of 2.
        /// </remarks>
        public List<Partition> GeneratePartitions(string[] partitionNames, long[][] partitionLimits)
        {
            List<Partition> partitions = new List<Partition>();

            for (int pi = 0; pi < partitionNames.Length; pi++)
            {
                Partition np = new Partition(this);

                np.Name = partitionNames[pi];
                np.From = partitionLimits[pi][0];
                np.To = partitionLimits[pi][1];
                np.Save();

                partitions.Add(np);
            }

            return partitions;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a deep copy of the passed object.
 /// </summary>
 /// <param name="old">A <b>Partition</b> object to create the deep copy from.</param>
 private void CopyMembers(Partition old)
 {
     this.from = old.from;
     this.to = old.to;
 }