CharacterRange

Inheritance: java.lang.Object, com.aspose.ms.System.ValueType, com.aspose.ms.lang.Struct

All Implemented Interfaces: java.lang.Cloneable

public class CharacterRange extends Struct<CharacterRange> implements Cloneable

Specifies a range of character positions within a string.

Constructors

ConstructorDescription
CharacterRange()
CharacterRange(int first, int length)Initializes a new instance of the CharacterRange struct, specifying a range of character positions within a string.

Methods

MethodDescription
getFirst()Gets or sets the position in the string of the first character of this CharacterRange.
setFirst(int value)Gets or sets the position in the string of the first character of this CharacterRange.
getLength()Gets or sets the number of positions in this CharacterRange.
setLength(int value)Gets or sets the number of positions in this CharacterRange.
op_Equality(CharacterRange cr1, CharacterRange cr2)Compares two CharacterRange objects.
op_Inequality(CharacterRange cr1, CharacterRange cr2)Compares two CharacterRange objects.
equals(Object obj)Gets a value indicating whether this object is equivalent to the specified object.
hashCode()Returns the hash code for this instance.
CloneTo(CharacterRange that)
Clone()
clone()

CharacterRange()

public CharacterRange()

CharacterRange(int first, int length)

public CharacterRange(int first, int length)

Initializes a new instance of the CharacterRange struct, specifying a range of character positions within a string.

Parameters:

ParameterTypeDescription
firstintThe position of the first character in the range. For example, if First is set to 0, the first position of the range is position 0 in the string.
lengthintThe number of positions in the range.

getFirst()

public final int getFirst()

Gets or sets the position in the string of the first character of this CharacterRange.

Value: The first position of this CharacterRange.

Returns: int

setFirst(int value)

public final void setFirst(int value)

Gets or sets the position in the string of the first character of this CharacterRange.

Value: The first position of this CharacterRange.

Parameters:

ParameterTypeDescription
valueint

getLength()

public final int getLength()

Gets or sets the number of positions in this CharacterRange.

Value: The number of positions in this CharacterRange.

Returns: int

setLength(int value)

public final void setLength(int value)

Gets or sets the number of positions in this CharacterRange.

Value: The number of positions in this CharacterRange.

Parameters:

ParameterTypeDescription
valueint

op_Equality(CharacterRange cr1, CharacterRange cr2)

public static boolean op_Equality(CharacterRange cr1, CharacterRange cr2)

Compares two CharacterRange objects. Gets a value indicating whether the First and Length values of the two CharacterRange objects are equal.

Parameters:

ParameterTypeDescription
cr1CharacterRangeA CharacterRange to compare for equality.
cr2CharacterRangeA CharacterRange to compare for equality.

Returns: boolean - true to indicate the two CharacterRange objects have the same First and Length values; otherwise, false.

op_Inequality(CharacterRange cr1, CharacterRange cr2)

public static boolean op_Inequality(CharacterRange cr1, CharacterRange cr2)

Compares two CharacterRange objects. Gets a value indicating whether the First or Length values of the two CharacterRange objects are not equal.

Parameters:

ParameterTypeDescription
cr1CharacterRangeA CharacterRange to compare for inequality.
cr2CharacterRangeA CharacterRange to compare for inequality.

Returns: boolean - true to indicate the either the First or Length values of the two CharacterRange objects differ; otherwise, false.

equals(Object obj)

public boolean equals(Object obj)

Gets a value indicating whether this object is equivalent to the specified object.

Parameters:

ParameterTypeDescription
objjava.lang.ObjectThe object to compare to for equality..

Returns: boolean - true to indicate the specified object is an instance with the same First and Length value as this instance; otherwise, false.

hashCode()

public int hashCode()

Returns the hash code for this instance.

Returns: int - A 32-bit signed integer that is the hash code for this instance.

CloneTo(CharacterRange that)

public void CloneTo(CharacterRange that)

Parameters:

ParameterTypeDescription
thatCharacterRange

Clone()

public CharacterRange Clone()

Returns: CharacterRange

clone()

public Object clone()

Returns: java.lang.Object