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); } }
/** * 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; }
/// <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; }