コード例 #1
0
        public override object Clone()
        {
            PayloadAttribute clone = (PayloadAttribute)base.Clone();

            if (payload != null)
            {
                clone.payload = (BytesRef)payload.Clone();
            }
            return(clone);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 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();
 }
コード例 #5
0
 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();
 }
コード例 #6
0
 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();
 }
コード例 #7
0
ファイル: TestPayloads.cs プロジェクト: joyanta/lucene.net
        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]);
            }
        }
コード例 #8
0
        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]);
            }
        }