/// <summary> /// Determines whether this index is part of acces path of the other index. /// </summary> /// <param name="otherIndex">Index of the other.</param> /// <returns> /// True whether this index is prefix of the given one. /// </returns> internal override bool IsPrefixOf(MemoryIndex otherIndex) { NamedIndex namedIndex = otherIndex as NamedIndex; if (namedIndex != null) { return(MemoryRoot.Equals(namedIndex.MemoryRoot) && base.IsPrefixOf(otherIndex)); } else { return(false); } }
/// <summary> /// Determines whether the specified <see cref="System.Object" />, is equal to this instance. /// </summary> /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param> /// <returns> /// <c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>. /// </returns> public override bool Equals(object obj) { NamedIndex otherIndex = obj as NamedIndex; if (otherIndex != null) { return(MemoryRoot.Equals(otherIndex.MemoryRoot) && base.Equals(obj)); } else { return(false); } }
/// <summary> /// Initializes a new instance of the <see cref="NamedIndex"/> class. /// </summary> /// <param name="parentIndex">Index of the parent.</param> /// <param name="path">The path.</param> protected NamedIndex(NamedIndex parentIndex, List <IndexSegment> path) : base(path, parentIndex.CallLevel) { MemoryRoot = parentIndex.MemoryRoot; }
/// <summary> /// Initializes a new instance of the <see cref="NamedIndex"/> class. /// </summary> /// <param name="parentIndex">Index of the parent.</param> /// <param name="callLevel">The call level.</param> protected NamedIndex(NamedIndex parentIndex, int callLevel) : base(parentIndex.MemoryPath, callLevel) { MemoryRoot = parentIndex.MemoryRoot; }
/// <summary> /// Initializes a new instance of the <see cref="NamedIndex"/> class. /// </summary> /// <param name="parentIndex">Index of the parent.</param> /// <param name="pathName">Name of the path.</param> protected NamedIndex(NamedIndex parentIndex, IndexSegment pathName) : base(parentIndex, pathName) { MemoryRoot = parentIndex.MemoryRoot; }