Class for segment.
More...
#include <segment.h>
|
| Segment (int, int) |
| Constructs the Segment object. More...
|
|
bool | operator== (const Segment &other) |
| Checks if two segment objects are identical, which is if their start and end segments are identical. More...
|
|
int | length () |
| Gets the length of the Segment, which is the number of segment units it represents. For example, the length of the Segment 16 is 6. More...
|
|
bool | isIntersecting (const Segment &other) |
| Determines if two Segments are intersecting. Two segments are said to be intersecting if they contain a common segment unit. For example, 14 and 36 are intersecting, while 12 and 36 are not. More...
|
|
FieldType | getType () |
| Gets the type under the FieldType enum. More...
|
|
std::string | getName () |
| Gets the name of the Segment. The name is a string that concatenates the start and end segment values. For example, the name of 16 is "16". More...
|
|
std::string | getTypeName () |
| Gets the type name, which is "Segment". More...
|
|
Segment::Segment |
( |
int |
startSegment, |
|
|
int |
endSegment |
|
) |
| |
Constructs the Segment object.
- Parameters
-
[in] | startSegment | The start segment |
[in] | endSegment | The end segment |
std::string Segment::getName |
( |
| ) |
|
Gets the name of the Segment. The name is a string that concatenates the start and end segment values. For example, the name of 16 is "16".
- Returns
- The name
Gets the type under the FieldType enum.
- Returns
- A member of the FieldType enum, which is FieldType::segment
Implements Field.
std::string Segment::getTypeName |
( |
| ) |
|
|
virtual |
Gets the type name, which is "Segment".
- Returns
- The string "Segment"
Implements Field.
bool Segment::isIntersecting |
( |
const Segment & |
other | ) |
|
Determines if two Segments are intersecting. Two segments are said to be intersecting if they contain a common segment unit. For example, 14 and 36 are intersecting, while 12 and 36 are not.
- Parameters
-
[in] | other | The Segment object with which the comparison is being made |
- Returns
- True if intersecting, False otherwise.
Gets the length of the Segment, which is the number of segment units it represents. For example, the length of the Segment 16 is 6.
- Returns
- The length
bool Segment::operator== |
( |
const Segment & |
other | ) |
|
Checks if two segment objects are identical, which is if their start and end segments are identical.
- Parameters
-
[in] | other | The Segment object with which the comparison is being made |
- Returns
- True if identical, False otherwise
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/timetabler/checkouts/v0.3.0/include/fields/segment.h
- /home/docs/checkouts/readthedocs.org/user_builds/timetabler/checkouts/v0.3.0/src/fields/segment.cpp