' Classes/System/Drawing/CharacterRange.ab

#ifndef __SYSTEM_DRAWING_CHARACTERRANGE_AB__
#define __SYSTEM_DRAWING_CHARACTERRANGE_AB__

Class CharacterRange
Public
	Sub CharacterRange(f As Long, l As Long)
		first = f
		length = l
	End Sub

	Sub CharacterRange(ByRef c As CharacterRange)
		first = c.first
		length = c.length
	End Sub

	Sub CharacterRange()
		First = 0
		Length = 0
	End Sub

	Function First() As Long
		Return first
	End Function

	Sub First(f As Long)
		first = f
	End Sub

	Function Length() As Long
		Return l
	End Function

	Sub Length(l As Long)
		length = l
	End Sub

	Sub Operator = (ByRef c As CharacterRange)
		first  = c.first
		length = c.length
	End Sub

	Function Operator ==(c As CharacterRange)
		Return Equals(c)
	End Function

	Function Operator <>(c As CharacterRange)
		Return Not Equals(c)
	End Function

	Function Equals(c As CharacterRange)
		Return first = c.first And length = c.length
	End Function

	Override Function GetHashCode() As Long
		Return first Xor length
	End Function

Private
	first As Long
	length As Long
End Class

#endif '__SYSTEM_DRAWING_CHARACTERRANGE_AB__
