Пример #1
0
        public override void CopyTo(IAttribute target)
        {
            var to = target as Token;

            if (to != null)
            {
                to.Reinit(this);
                // reinit shares the payload, so clone it:
                if (payload != null)
                {
                    to.payload = (BytesRef)payload.Clone();
                }
            }
            else
            {
                base.CopyTo(target);
                ((IOffsetAttribute)target).SetOffset(startOffset, endOffset);
                ((IPositionIncrementAttribute)target).PositionIncrement = positionIncrement;
                ((IPayloadAttribute)target).Payload = (payload == null) ? null : (BytesRef)payload.Clone();
                ((IFlagsAttribute)target).Flags     = flags;
                ((ITypeAttribute)target).Type       = type;
            }
        }
Пример #2
0
        public override void CopyTo(IAttribute target)
        {
            KeywordAttribute attr = (KeywordAttribute)target;

            attr.IsKeyword = keyword;
        }
Пример #3
0
 public override void CopyTo(IAttribute target)
 {
     ((BoostAttribute)target).Boost = boost;
 }
Пример #4
0
        public override void CopyTo(IAttribute target)
        {
            PayloadAttribute t = (PayloadAttribute)target;

            t.Payload = (payload == null) ? null : (BytesRef)payload.Clone();
        }
Пример #5
0
        public override void CopyTo(IAttribute target)
        {
            OffsetAttribute t = (OffsetAttribute)target;

            t.SetOffset(startOffset, endOffset);
        }