com.azalient.api.b.network
Interface IService

All Superinterfaces:
IActionable, IAssociate, IClippable, IDeletable, IDescribed, IDraggable, IPastable, IRecord, ISequence, ITripSource, IUserData, RecordR, RecordRW, RecordW, SortableData, StoreRecordRW

public interface IService
extends IClippable, IPastable, IAssociate, IDescribed, ISequence, StoreRecordRW, IUserData, ITripSource

A service defines the route and the stops that are made by a public transport vehicle. A service is a sequence of links and a set of stands which are on those links


Field Summary
static Speed DEFAULT_SPEED
          The default speed used to calculate timetables, if no other speed is set
static IService[] ZERO
          A static zero-length array, created for convenience, and to save memory
 
Fields inherited from interface com.azalient.api.ui.clipboard.IClippable
scratch
 
Fields inherited from interface com.azalient.api.a.tables.IRecord
DELETED, KEY_SEP, KEY_SEP_CHAR
 
Method Summary
 void add(IStand stand)
          add a stand at the end of the sequence
 void add(ITrail trail)
          Add trail at end of service
 void addAtStart(ITrail trail)
          Add trail at beginning of service
 NamedColour colour()
          Returns the colour associated with this service.
 void colour(NamedColour colour)
          Sets the colour associated with this service.
 boolean contains(ITrail trail)
           
 IService copy()
          Create and return a copy of this Service
 IDwell dwell(IStand stand)
          Get the dwell object corresponding to the given stand
 IDwell[] dwells()
          The sequence of dwells for each transport on this service, in order.
 int indexOf(IStand stand)
          The 0..N-1 index of this stand in the service, or -1, if the service does not stop at this stand
 void insert(int index, IStand stand)
          add a stand at at the given index in the sequence
 boolean isLift()
          Returns true if this is a lift service
 IService join(String name, IService that)
          Create a new Service, of the given name, joining this to that
 boolean liftDown()
          Returns true if this is a downward lift service
 boolean liftUp()
          Returns true if this is an upward lift service
 Price priceBase()
          The base price for boarding this service.
 void priceBase(Price p)
          Set the base price for boarding this service.
 Price pricePerDistanceLongUnit()
          The price per long distance unit (km, mile) for this service.
 void pricePerDistanceLongUnit(Price p)
          Set the price per long distance unit (km, mile) for this service.
 void prune1()
          Remove first trail from service
 void pruneN()
          Remove last trail from service
 void rebuild()
          Rebuild the array of links, perhaps after a trail has been modified
 void remove(IStand stand)
          remove a stand from this service
 Speed speed()
          The speed used to calculate a timetable
 IStand[] stands()
          The sequence of stands which each transport on this service will visit, in order.
 ITrail[] trails()
          The sequence of trails that make up the service route
 ILink[] twigs()
          A convenience method to return all the links in all the trails that make up the route
 UTime variability()
          Returns the variability of the departure time for this service.
 
Methods inherited from interface com.azalient.api.ui.clipboard.IClippable
children, getAlt, references, tableName
 
Methods inherited from interface com.azalient.api.ui.clipboard.IDeletable
delete, deleted, name
 
Methods inherited from interface com.azalient.api.ui.clipboard.IPastable
finish, pickables
 
Methods inherited from interface com.azalient.api.ui.clipboard.IAssociate
clip, name, proxy, selected
 
Methods inherited from interface com.azalient.api.ui.clipboard.IDraggable
selected, selectedForDraggingDraw
 
Methods inherited from interface com.azalient.api.ui.clipboard.IActionable
action
 
Methods inherited from interface com.azalient.api.file.StoreRecordRW
canRename, rename, store
 
Methods inherited from interface com.azalient.api.file.RecordR
extraSet, finished, isApplicable, isEditable, set
 
Methods inherited from interface com.azalient.api.a.tables.IRecord
name
 
Methods inherited from interface com.azalient.api.file.RecordW
extraCols, extraGet, extraGetB, extraGetD, extraGetI, extraGetS, extraGetT, isVolatile
 
Methods inherited from interface com.azalient.api.a.tables.IDescribed
description
 
Methods inherited from interface com.azalient.api.b.network.ISequence
canJoinTo, components, endLocation, extend, extendBack, extensionBackSequence, extensionBackSequenceName, extensionBackSequences, extensionSequence, extensionSequenceName, extensionSequences, info, join, rename, startLocation
 
Methods inherited from interface com.azalient.api.a.IUserData
userData, userData, userDataHashCode
 
Methods inherited from interface com.azalient.api.b.demand.ITripSource
generateTrips, generateTrips
 

Field Detail

ZERO

static final IService[] ZERO
A static zero-length array, created for convenience, and to save memory


DEFAULT_SPEED

static final Speed DEFAULT_SPEED
The default speed used to calculate timetables, if no other speed is set

Method Detail

trails

ITrail[] trails()
The sequence of trails that make up the service route


stands

IStand[] stands()
The sequence of stands which each transport on this service will visit, in order.


indexOf

int indexOf(IStand stand)
The 0..N-1 index of this stand in the service, or -1, if the service does not stop at this stand


dwells

IDwell[] dwells()
The sequence of dwells for each transport on this service, in order.


dwell

IDwell dwell(IStand stand)
Get the dwell object corresponding to the given stand


twigs

ILink[] twigs()
A convenience method to return all the links in all the trails that make up the route

Specified by:
twigs in interface ISequence

addAtStart

void addAtStart(ITrail trail)
Add trail at beginning of service


add

void add(ITrail trail)
Add trail at end of service


contains

boolean contains(ITrail trail)

prune1

void prune1()
Remove first trail from service

Specified by:
prune1 in interface ISequence

pruneN

void pruneN()
Remove last trail from service

Specified by:
pruneN in interface ISequence

add

void add(IStand stand)
add a stand at the end of the sequence


insert

void insert(int index,
            IStand stand)
add a stand at at the given index in the sequence


remove

void remove(IStand stand)
remove a stand from this service


rebuild

void rebuild()
Rebuild the array of links, perhaps after a trail has been modified


copy

IService copy()
Create and return a copy of this Service

Specified by:
copy in interface ISequence

join

IService join(String name,
              IService that)
Create a new Service, of the given name, joining this to that


colour

NamedColour colour()
Returns the colour associated with this service.


colour

void colour(NamedColour colour)
Sets the colour associated with this service.


priceBase

Price priceBase()
The base price for boarding this service. Total price = base price + (distance x price per distance unit)


priceBase

void priceBase(Price p)
Set the base price for boarding this service. Total price = base price + (distance x price per distance unit)


pricePerDistanceLongUnit

Price pricePerDistanceLongUnit()
The price per long distance unit (km, mile) for this service. Total price = base price + (distance x price per distance unit)


pricePerDistanceLongUnit

void pricePerDistanceLongUnit(Price p)
Set the price per long distance unit (km, mile) for this service. Total price = base price + (distance x price per distance unit)


speed

Speed speed()
The speed used to calculate a timetable


variability

UTime variability()
Returns the variability of the departure time for this service. If variability is X seconds, then 95% of services will depart within +/- X seconds of the stated departure time. (This uses a Gaussian bell-curve distribution, with a standard distribution of half this variability value)


liftDown

boolean liftDown()
Returns true if this is a downward lift service


liftUp

boolean liftUp()
Returns true if this is an upward lift service


isLift

boolean isLift()
Returns true if this is a lift service