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
Constructor | Description |
---|---|
CharacterRange() | |
CharacterRange(int first, int length) | Initializes a new instance of the CharacterRange struct, specifying a range of character positions within a string. |
Methods
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
first | int | The 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. |
length | int | The 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:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
value | int |
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:
Parameter | Type | Description |
---|---|---|
cr1 | CharacterRange | A CharacterRange to compare for equality. |
cr2 | CharacterRange | A 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:
Parameter | Type | Description |
---|---|---|
cr1 | CharacterRange | A CharacterRange to compare for inequality. |
cr2 | CharacterRange | A 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:
Parameter | Type | Description |
---|---|---|
obj | java.lang.Object | The 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:
Parameter | Type | Description |
---|---|---|
that | CharacterRange |
Clone()
public CharacterRange Clone()
Returns: CharacterRange
clone()
public Object clone()
Returns: java.lang.Object