public override System.Object Clone()
 {
     OffsetAttributeImpl impl = new OffsetAttributeImpl();
     impl.endOffset = endOffset;
     impl.startOffset = startOffset;
     return impl;
 }
Example #2
0
        override public System.Object Clone()
        {
            OffsetAttributeImpl impl = new OffsetAttributeImpl();

            impl.endOffset   = endOffset;
            impl.startOffset = startOffset;
            return(impl);
        }
Example #3
0
        public override bool Equals(System.Object other)
        {
            if (other == this)
            {
                return(true);
            }

            if (other is OffsetAttributeImpl)
            {
                OffsetAttributeImpl o = (OffsetAttributeImpl)other;
                return(o.startOffset == startOffset && o.endOffset == endOffset);
            }

            return(false);
        }
		public virtual void  TestOffsetAttribute()
		{
			OffsetAttributeImpl att = new OffsetAttributeImpl();
			Assert.AreEqual(0, att.StartOffset());
			Assert.AreEqual(0, att.EndOffset());
			
			att.SetOffset(12, 34);
			// no string test here, because order unknown
			
			OffsetAttributeImpl att2 = (OffsetAttributeImpl) AssertCloneIsEqual(att);
			Assert.AreEqual(12, att2.StartOffset());
			Assert.AreEqual(34, att2.EndOffset());
			
			att2 = (OffsetAttributeImpl) AssertCopyIsEqual(att);
			Assert.AreEqual(12, att2.StartOffset());
			Assert.AreEqual(34, att2.EndOffset());
			
			att.Clear();
			Assert.AreEqual(0, att.StartOffset());
			Assert.AreEqual(0, att.EndOffset());
		}
		public virtual void  TestOffsetAttribute()
		{
			OffsetAttributeImpl att = new OffsetAttributeImpl();
			Assert.AreEqual(0, att.StartOffset());
			Assert.AreEqual(0, att.EndOffset());
			
			att.SetOffset(12, 34);
			// no string test here, because order unknown
			
			OffsetAttributeImpl att2 = (OffsetAttributeImpl) AssertCloneIsEqual(att);
			Assert.AreEqual(12, att2.StartOffset());
			Assert.AreEqual(34, att2.EndOffset());
			
			att2 = (OffsetAttributeImpl) AssertCopyIsEqual(att);
			Assert.AreEqual(12, att2.StartOffset());
			Assert.AreEqual(34, att2.EndOffset());
			
			att.Clear();
			Assert.AreEqual(0, att.StartOffset());
			Assert.AreEqual(0, att.EndOffset());
		}