NanoXLSX.Core 3.0.0-rc.3
Loading...
Searching...
No Matches
NanoXLSX.Range Struct Reference

Struct representing a cell range with a start and end address. More...

Public Member Functions

 Range (Address start, Address end)
 Constructor with addresses as arguments. The addresses are automatically swapped if the start address is greater than the end address. Referencing modifiers ($) for rows and columns can be passed through the address type of the address objects.
 Range (int startColumn, int startRow, int endColumn, int endRow)
 Constructor with start and end rows and columns as arguments. The addresses are automatically swapped if the start address is greater than the end address. Referencing modifiers ($) for rows and columns are not considered.
 Range (string range)
 Constructor with a range string as argument. The addresses are automatically swapped if the start address is greater than the end address. Referencing modifiers ($) for rows and columns can be defined in the passed string.
bool Contains (Range other)
 Gets whether another range is completely enclosed by this range.
bool Contains (Address address)
 Determines whether an address is within this range.
bool Overlaps (Range other)
 Determines whether the passed range overlaps with this range.
IReadOnlyList< AddressResolveEnclosedAddresses ()
 Gets a list of all addresses between the start and end address.
override string ToString ()
 Overwritten ToString method.
override bool Equals (object obj)
 Compares two objects whether they are ranges and equal. The cell types (possible $ prefix) are considered.
override int GetHashCode ()
 Gets the hash code of the range object according to its string representation.

Static Public Member Functions

static bool operator== (Range range1, Range range2)
 Compares two objects whether they are ranges and equal. The cell types (possible $ prefix) are considered. This method reflects Equals(object).
static bool operator!= (Range range1, Range range2)
 Compares two objects whether they not equal. This method reflects the inverted method of Equals(object).

Properties

Address EndAddress [get]
 End address of the range.
Address StartAddress [get]
 Start address of the range.

Detailed Description

Struct representing a cell range with a start and end address.

Definition at line 15 of file Range.cs.

Constructor & Destructor Documentation

◆ Range() [1/3]

NanoXLSX.Range.Range ( Address start,
Address end )

Constructor with addresses as arguments. The addresses are automatically swapped if the start address is greater than the end address. Referencing modifiers ($) for rows and columns can be passed through the address type of the address objects.

Parameters
startStart address of the range
endEnd address of the range

Definition at line 35 of file Range.cs.

◆ Range() [2/3]

NanoXLSX.Range.Range ( int startColumn,
int startRow,
int endColumn,
int endRow )

Constructor with start and end rows and columns as arguments. The addresses are automatically swapped if the start address is greater than the end address. Referencing modifiers ($) for rows and columns are not considered.

Parameters
startColumnStart column number (zero based) of the range
startRowStart row number (zero based) of the range
endColumnEnd column number (zero based) of the range
endRowEnd row number (zero based) of the range

Definition at line 57 of file Range.cs.

◆ Range() [3/3]

NanoXLSX.Range.Range ( string range)

Constructor with a range string as argument. The addresses are automatically swapped if the start address is greater than the end address. Referencing modifiers ($) for rows and columns can be defined in the passed string.

Parameters
rangeAddress range (e.g. 'A1:B12')

Definition at line 67 of file Range.cs.

Member Function Documentation

◆ Contains() [1/2]

bool NanoXLSX.Range.Contains ( Address address)

Determines whether an address is within this range.

Parameters
addressAddress to check
Returns
True if the address is part of this range, otherwise false

Definition at line 100 of file Range.cs.

◆ Contains() [2/2]

bool NanoXLSX.Range.Contains ( Range other)

Gets whether another range is completely enclosed by this range.

Parameters
otherOther range to check
Returns
True if the other range is completely enclosed. False if only partial overlapping or not intersecting

Definition at line 87 of file Range.cs.

◆ Equals()

override bool NanoXLSX.Range.Equals ( object obj)

Compares two objects whether they are ranges and equal. The cell types (possible $ prefix) are considered.

Parameters
objOther object to compare
Returns
True if the two objects are the same range

Definition at line 146 of file Range.cs.

◆ GetHashCode()

override int NanoXLSX.Range.GetHashCode ( )

Gets the hash code of the range object according to its string representation.

Returns
Hash code of the range

Definition at line 160 of file Range.cs.

◆ operator!=()

bool NanoXLSX.Range.operator!= ( Range range1,
Range range2 )
static

Compares two objects whether they not equal. This method reflects the inverted method of Equals(object).

Parameters
range1First range object
range2Second range object
Returns
False, if both objects are equal, otherwise true

Definition at line 185 of file Range.cs.

◆ operator==()

bool NanoXLSX.Range.operator== ( Range range1,
Range range2 )
static

Compares two objects whether they are ranges and equal. The cell types (possible $ prefix) are considered. This method reflects Equals(object).

Parameters
range1First range object
range2Second range object
Returns
True, if both objects are equal, otherwise false

Definition at line 174 of file Range.cs.

◆ Overlaps()

bool NanoXLSX.Range.Overlaps ( Range other)

Determines whether the passed range overlaps with this range.

Parameters
otherRange to check for overlapping
Returns
True if overlapping, otherwise false

Definition at line 113 of file Range.cs.

◆ ResolveEnclosedAddresses()

IReadOnlyList< Address > NanoXLSX.Range.ResolveEnclosedAddresses ( )

Gets a list of all addresses between the start and end address.

Returns
List of Addresses
Remarks
Use this function with caution. Very big ranges may result to hundred of Millions or even Billions of cells. This may lead to an extremely high memory consumptions or even a crash of the application

Definition at line 125 of file Range.cs.

◆ ToString()

override string NanoXLSX.Range.ToString ( )

Overwritten ToString method.

Returns
Returns the range (e.g. 'A1:B12')

Definition at line 136 of file Range.cs.

Property Documentation

◆ EndAddress

Address NanoXLSX.Range.EndAddress
get

End address of the range.

Definition at line 23 of file Range.cs.

◆ StartAddress

Address NanoXLSX.Range.StartAddress
get

Start address of the range.

Definition at line 27 of file Range.cs.


The documentation for this struct was generated from the following file: