public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (this.GetType() != obj.GetType()) { return(false); } FlushInfo other = (FlushInfo)obj; if (EstimatedSegmentSize != other.EstimatedSegmentSize) { return(false); } if (NumDocs != other.NumDocs) { return(false); } return(true); }
private IOContext(bool readOnce) { this.Context = Context_e.READ; this.MergeInfo = null; this.ReadOnce = readOnce; this.FlushInfo = null; }
/// <summary> /// this constructor is used to initialize a <seealso cref="IOContext"/> instance with a new value for the readOnce variable. </summary> /// <param name="ctxt"> <seealso cref="IOContext"/> object whose information is used to create the new instance except the readOnce variable. </param> /// <param name="readOnce"> The new <seealso cref="IOContext"/> object will use this value for readOnce. </param> public IOContext(IOContext ctxt, bool readOnce) { this.Context = ctxt.Context; this.MergeInfo = ctxt.MergeInfo; this.FlushInfo = ctxt.FlushInfo; this.ReadOnce = readOnce; }
public IOContext(FlushInfo flushInfo) { Debug.Assert(flushInfo != null); this.Context = Context_e.FLUSH; this.MergeInfo = null; this.ReadOnce = false; this.FlushInfo = flushInfo; }
public IOContext(FlushInfo flushInfo) { if (Debugging.AssertsEnabled) Debugging.Assert(flushInfo != null); this.Context = UsageContext.FLUSH; this.MergeInfo = null; this.ReadOnce = false; this.FlushInfo = flushInfo; }
public IOContext(FlushInfo flushInfo) { Debug.Assert(flushInfo != null); this.Context = UsageContext.FLUSH; this.MergeInfo = null; this.ReadOnce = false; this.FlushInfo = flushInfo; }
private IOContext(Context_e context, MergeInfo mergeInfo) { Debug.Assert(context != Context_e.MERGE || mergeInfo != null, "MergeInfo must not be null if context is MERGE"); Debug.Assert(context != Context_e.FLUSH, "Use IOContext(FlushInfo) to create a FLUSH IOContext"); this.Context = context; this.ReadOnce = false; this.MergeInfo = mergeInfo; this.FlushInfo = null; }
public override int GetHashCode() { const int prime = 31; int result = 1; result = prime * result + /*((Context is null) ? 0 :*/ Context.GetHashCode()/*)*/; // LUCENENET NOTE: Enum can never be null in .NET result = prime * result + ((FlushInfo is null) ? 0 : FlushInfo.GetHashCode()); result = prime * result + ((MergeInfo is null) ? 0 : MergeInfo.GetHashCode()); result = prime * result + (ReadOnce ? 1231 : 1237); return result; }
public override bool Equals(object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (this.GetType() != obj.GetType()) { return(false); } IOContext other = (IOContext)obj; if (Context != other.Context) { return(false); } if (FlushInfo == null) { if (other.FlushInfo != null) { return(false); } } else if (!FlushInfo.Equals(other.FlushInfo)) { return(false); } if (MergeInfo == null) { if (other.MergeInfo != null) { return(false); } } else if (!MergeInfo.Equals(other.MergeInfo)) { return(false); } if (ReadOnce != other.ReadOnce) { return(false); } return(true); }
private IOContext(UsageContext? context, MergeInfo mergeInfo) { Debug.Assert(context != UsageContext.MERGE || mergeInfo != null, "MergeInfo must not be null if context is MERGE"); Debug.Assert(context != UsageContext.FLUSH, "Use IOContext(FlushInfo) to create a FLUSH IOContext"); this.Context = context; this.ReadOnce = false; this.MergeInfo = mergeInfo; this.FlushInfo = null; }