public override object Clone() { PayloadAttribute clone = (PayloadAttribute)base.Clone(); if (payload != null) { clone.payload = (BytesRef)payload.Clone(); } return(clone); }
public override sealed bool IncrementToken() { Token nextToken; // LUCENENET: IDE0059: Remove unnecessary value assignment if (!prefixExhausted) { nextToken = GetNextPrefixInputToken(reusableToken); if (nextToken == null) { prefixExhausted = true; } else { previousPrefixToken.Reinit(nextToken); // Make it a deep copy BytesRef p = previousPrefixToken.Payload; if (p != null) { previousPrefixToken.Payload = (BytesRef)p.Clone(); } SetCurrentToken(nextToken); return(true); } } nextToken = GetNextSuffixInputToken(reusableToken); if (nextToken == null) { return(false); } nextToken = UpdateSuffixToken(nextToken, previousPrefixToken); SetCurrentToken(nextToken); return(true); }
public override sealed bool IncrementToken() { Token nextToken = null; if (!prefixExhausted) { nextToken = GetNextPrefixInputToken(reusableToken); if (nextToken == null) { prefixExhausted = true; } else { previousPrefixToken.Reinit(nextToken); // Make it a deep copy BytesRef p = previousPrefixToken.Payload; if (p != null) { previousPrefixToken.Payload = (BytesRef)p.Clone(); } CurrentToken = nextToken; return(true); } } nextToken = GetNextSuffixInputToken(reusableToken); if (nextToken == null) { return(false); } nextToken = UpdateSuffixToken(nextToken, previousPrefixToken); CurrentToken = nextToken; return(true); }
internal Iterator(int size, PagedGrowableWriter offsets, PagedGrowableWriter lengths, PagedMutable docs, BytesRef values, FixedBitSet docsWithField) { this.Offsets = offsets; this.Size = size; this.Lengths = lengths; this.Docs = docs; this.DocsWithField = docsWithField; Value_Renamed = (BytesRef)values.Clone(); }
internal Iterator(int size, PagedGrowableWriter offsets, PagedGrowableWriter lengths, PagedMutable docs, BytesRef values, FixedBitSet docsWithField) { this.offsets = offsets; this.size = size; this.lengths = lengths; this.docs = docs; this.docsWithField = docsWithField; value = (BytesRef)values.Clone(); }
public virtual void TestPayload() { BytesRef payload = new BytesRef("this is a test!"); Assert.AreEqual(payload.Length, "this is a test!".Length, "Wrong payload length."); BytesRef clone = (BytesRef)payload.Clone(); Assert.AreEqual(payload.Length, clone.Length); for (int i = 0; i < payload.Length; i++) { Assert.AreEqual(payload.Bytes[i + payload.Offset], clone.Bytes[i + clone.Offset]); } }