示例#1
0
        public override bool Equals(Object obj)
        {
            if (this == obj)
            {
                return(true);
            }

            if (obj is ChannelId)
            {
                ChannelId id = (ChannelId)obj;
                if (id.depth() == depth())
                {
                    for (int i = id.depth(); i-- > 0;)
                    {
                        if (!id.getSegment(i).Equals(getSegment(i)))
                        {
                            return(false);
                        }
                    }
                    return(true);
                }
            }

            return(false);
        }
示例#2
0
        /* ------------------------------------------------------------ */
        public bool isParentOf(ChannelId id)
        {
            if (Wild || depth() != id.depth() - 1)
            {
                return(false);
            }

            for (int i = _segments.Length; i-- > 0;)
            {
                if (!_segments[i].Equals(id._segments[i]))
                {
                    return(false);
                }
            }
            return(true);
        }
示例#3
0
		/* ------------------------------------------------------------ */
		public bool isParentOf(ChannelId id)
		{
			if (Wild || depth() != id.depth() - 1)
				return false;

			for (int i = _segments.Length; i-- > 0; )
			{
				if (!_segments[i].Equals(id._segments[i]))
					return false;
			}
			return true;
		}