Timetabler
|
Class for segment. More...
#include <segment.h>
Public Member Functions | |
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.
[in] | startSegment | The start segment |
[in] | endSegment | The end segment |
Definition at line 14 of file segment.cpp.
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".
Definition at line 75 of file segment.cpp.
|
virtual |
Gets the type under the FieldType enum.
Implements Field.
Definition at line 66 of file segment.cpp.
|
virtual |
Gets the type name, which is "Segment".
Implements Field.
Definition at line 84 of file segment.cpp.
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.
[in] | other | The Segment object with which the comparison is being made |
Definition at line 52 of file segment.cpp.
int Segment::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.
Definition at line 40 of file segment.cpp.
bool Segment::operator== | ( | const Segment & | other | ) |
Checks if two segment objects are identical, which is if their start and end segments are identical.
[in] | other | The Segment object with which the comparison is being made |
Definition at line 28 of file segment.cpp.