예제 #1
0
        public override bool Equals(System.Object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            if (obj is Token)
            {
                Token other = (Token)obj;

                InitTermBuffer();
                other.InitTermBuffer();

                if (termLength == other.termLength && startOffset == other.startOffset && endOffset == other.endOffset && flags == other.flags && positionIncrement == other.positionIncrement && SubEqual(type, other.type) && SubEqual(payload, other.payload))
                {
                    for (int i = 0; i < termLength; i++)
                    {
                        if (termBuffer[i] != other.termBuffer[i])
                        {
                            return(false);
                        }
                    }
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
예제 #2
0
 /**
  * Copy the prototype token's fields into this one. Note: Payloads are shared.
  * @param prototype
  */
 public void Reinit(Token prototype)
 {
     prototype.InitTermBuffer();
     SetTermBuffer(prototype.termBuffer, 0, prototype.termLength);
     positionIncrement = prototype.positionIncrement;
     flags             = prototype.flags;
     startOffset       = prototype.startOffset;
     endOffset         = prototype.endOffset;
     type    = prototype.type;
     payload = prototype.payload;
 }
예제 #3
0
파일: Token.cs 프로젝트: jhuntsman/FlexNet
		/// <summary> Copy the prototype token's fields into this one. Note: Payloads are shared.</summary>
		/// <param name="prototype">
		/// </param>
		public virtual void  Reinit(Token prototype)
		{
			prototype.InitTermBuffer();
			SetTermBuffer(prototype.termBuffer, 0, prototype.termLength);
			positionIncrement = prototype.positionIncrement;
			flags = prototype.flags;
			startOffset = prototype.startOffset;
			endOffset = prototype.endOffset;
			type = prototype.type;
			payload = prototype.payload;
		}