/// <summary>
        /// Fills all congeneric chains of this chain.
        /// All congeneric sequences stored in <see cref="congenericChains"/> field.
        /// </summary>
        private void FillCongenericChains()
        {
            var occurrences = new List<int>[alphabet.Cardinality - 1];

            for (int i = 0; i < alphabet.Cardinality - 1; i++)
            {
                occurrences[i] = new List<int>();
            }

            for (int j = 0; j < building.Length; j++)
            {
                if (building[j] != 0)
                {
                    occurrences[building[j] - 1].Add(j);
                }
            }

            congenericChains = new CongenericChain[alphabet.Cardinality - 1];
            for (int k = 0; k < alphabet.Cardinality - 1; k++)
            {
                congenericChains[k] = new CongenericChain(occurrences[k], alphabet[k + 1], building.Length);
            }
        }
        /// <summary>
        /// Sets item in provided position.
        /// </summary>
        /// <param name="item">
        /// The item.
        /// </param>
        /// <param name="index">
        /// The index.
        /// </param>
        public override void Set(IBaseObject item, int index)
        {
            base.Set(item, index);

            congenericChains = null;
        }
        /// <summary>
        /// Removes element from given position.
        /// </summary>
        /// <param name="index">
        /// Index of deleted position.
        /// </param>
        public override void DeleteAt(int index)
        {
            base.DeleteAt(index);

            congenericChains = null;
        }
        /// <summary>
        /// The remove at.
        /// </summary>
        /// <param name="index">
        /// Index of deleted element.
        /// </param>
        public override void RemoveAt(int index)
        {
            base.RemoveAt(index);

            congenericChains = null;
        }
 /// <summary>
 /// Deletes chain (building and alphabet) and creates new empty chain with given length.
 /// </summary>
 /// <param name="length">
 /// New chain length.
 /// </param>
 public override void ClearAndSetNewLength(int length)
 {
     base.ClearAndSetNewLength(length);
     congenericChains = null;
     relationIntervalsManagers = null;
 }