TrainVagas  0.1
domain.Route Class Reference

Public Member Functions

 Route ()
 
 Route (String id, double total_distance)
 
 Route (String route)
 
String getStartingTown ()
 
double getDistance ()
 
int getNumberOfNodes ()
 
int getNumberOfStops ()
 
String getKeyOfStop (int n_stop)
 
void setRoute (String route)
 
void setKey (String r)
 
void setTotalDistance (String val)
 
void setTotalDistance (double val)
 
String getKey ()
 
String getEndingTown ()
 
boolean isAvailable ()
 
void setAvailable (boolean exist)
 
boolean testCondition (String condition, String operand, double valor2)
 

Static Public Member Functions

static String formatKey (String key_route)
 

Private Attributes

String key
 
double totalDistance
 
boolean available
 

Static Private Attributes

static final int MINIMAL_SIZE_OF_ID = 2
 
static final String PATTERN_ID ="[^a-zA-Z]"
 
static final String PATTERN_DOUBLE ="[^0-9.,]"
 
static final String PATTERN_NO_DUPLICATE ="(\\D)\\1{1}"
 

Constructor & Destructor Documentation

◆ Route() [1/3]

domain.Route.Route ( )

Construtor

Here is the call graph for this function:

◆ Route() [2/3]

domain.Route.Route ( String  id,
double  total_distance 
)

Construtor

Parameters
idkey da rota
total_distancedistancia da rota
Here is the call graph for this function:

◆ Route() [3/3]

domain.Route.Route ( String  route)

Construtor

Parameters
routeKey+distancia em formato de string Ex: AB50
Here is the call graph for this function:

Member Function Documentation

◆ formatKey()

static String domain.Route.formatKey ( String  key_route)
static

Formata uma string para o padrao do key de rota

Parameters
key_routekey a ser formatado
Returns
string formatada
Here is the caller graph for this function:

◆ getDistance()

double domain.Route.getDistance ( )

Retorna a distancia total de uma rota(viagem)

Returns
Retorna a distancia total de uma rota(viagem)
Here is the caller graph for this function:

◆ getEndingTown()

String domain.Route.getEndingTown ( )

Retona a cidade de destino de uma rota

Returns
Cidade de destino
Here is the caller graph for this function:

◆ getKey()

String domain.Route.getKey ( )

Retorna a key da rota

Returns
O key da rota
Here is the caller graph for this function:

◆ getKeyOfStop()

String domain.Route.getKeyOfStop ( int  n_stop)

Retorna o key do trecho entre uma parada ate a proxima estacao

Parameters
n_stopnumero da parada que se deseja o retorno do trecho
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getNumberOfNodes()

int domain.Route.getNumberOfNodes ( )

Retorna o numero de node des uma rota(viagem)

Returns
Numero de nodes
Here is the caller graph for this function:

◆ getNumberOfStops()

int domain.Route.getNumberOfStops ( )

Retorna o numero de paradas que serao feitas em uma rota(viagem) a partida nao e considerada como uma parada

Returns
Numero de paradas
Here is the caller graph for this function:

◆ getStartingTown()

String domain.Route.getStartingTown ( )

Retona cidade de origem de uma rota(viagem)

Returns
Retorna a cidade de origem de uma rota(viagen)
Here is the caller graph for this function:

◆ isAvailable()

boolean domain.Route.isAvailable ( )

Retorna a disponibilidade de uma rota

Returns
Retorna se a rota e valida/disponivel
Here is the caller graph for this function:

◆ setAvailable()

void domain.Route.setAvailable ( boolean  exist)

Set a disponibilidade da rota

Parameters
exist
Here is the caller graph for this function:

◆ setKey()

void domain.Route.setKey ( String  r)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRoute()

void domain.Route.setRoute ( String  route)

Configura o key e a distancia da rota atraves de uma string

Parameters
routeKey+distancia em formato de string Ex: AB50
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTotalDistance() [1/2]

void domain.Route.setTotalDistance ( String  val)

Set a distancia de uma rota(viagem)

Parameters
valvalor da distancia(no formato de texto) que sera usado para definir a distancia total da rota.
Here is the caller graph for this function:

◆ setTotalDistance() [2/2]

void domain.Route.setTotalDistance ( double  val)

Set a distancia de uma rota(viagem)

Parameters
valvalor da distancia que sera usado para definir a distancia total da rota

◆ testCondition()

boolean domain.Route.testCondition ( String  condition,
String  operand,
double  valor2 
)

Executa o teste da condicao

Parameters
conditionCondicao literal(texto) a ser considerada
operando operando literal (texto) que se deseja verificar
valor2valor usado como referencia na verificacao
Returns
Retorna o resultado do teste
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ available

boolean domain.Route.available
private

Indica se a rota existe

◆ key

String domain.Route.key
private

Identificador usado nos maps

◆ MINIMAL_SIZE_OF_ID

final int domain.Route.MINIMAL_SIZE_OF_ID = 2
staticprivate

◆ PATTERN_DOUBLE

final String domain.Route.PATTERN_DOUBLE ="[^0-9.,]"
staticprivate

◆ PATTERN_ID

final String domain.Route.PATTERN_ID ="[^a-zA-Z]"
staticprivate

◆ PATTERN_NO_DUPLICATE

final String domain.Route.PATTERN_NO_DUPLICATE ="(\\D)\\1{1}"
staticprivate

◆ totalDistance

double domain.Route.totalDistance
private

Distancia total da rota ou viagem


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