scheduler
Class TravelPartsList

java.lang.Object
  extended byscheduler.TravelPartsList
All Implemented Interfaces:
java.lang.Cloneable

public final class TravelPartsList
extends java.lang.Object
implements java.lang.Cloneable

A list of parts of a single travel.

Author:
Piotrek

Field Summary
private  int changesCount
          The changes count implied by the travel parts on the list.
 boolean fContainsFeedback
          Indicates whether this travel parts list contains expert knowledge feedback.
private  java.util.ArrayList parts
          A list of parts of the travel.
 
Constructor Summary
TravelPartsList()
          Constructor.
 
Method Summary
 void AddTravelPart(TravelPart travelPart)
          Adds a new travel part to the list.
 void AddTravelParts(TravelPartsList travelPartsList)
          Adds a new travel part to the list.
protected  java.lang.Object clone()
          Creates a shallow copy of the list.
 boolean equals(java.lang.Object other)
           
 int GetChangesCount()
          Gets the changes count in the current list.
 TravelPart GetFirstTravelPart()
          Gets the first travel part from the list.
 TravelPart GetLastTravelPart()
          Gets the last travel part from the list.
 double GetLength()
          Gets the total length of travel parts.
 TravelPartsList GetRevertedList()
          Gets the reverted list.
 java.util.Iterator GetTravelParts()
          Gets the iterator to the parts of the travel.
 int GetTravelPartsCount()
          Gets the number of the travel parts on the list.
 boolean IsEqual(TravelPartsList other)
          Gets a boolean value indicating whether this and the given one lists are equal.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parts

private java.util.ArrayList parts
A list of parts of the travel.


changesCount

private int changesCount
The changes count implied by the travel parts on the list.


fContainsFeedback

public boolean fContainsFeedback
Indicates whether this travel parts list contains expert knowledge feedback. It is not set by this class, except for the cloning and adding of other travel parts list.

Constructor Detail

TravelPartsList

public TravelPartsList()
Constructor.

Method Detail

AddTravelPart

public void AddTravelPart(TravelPart travelPart)
Adds a new travel part to the list. The new part must start where the old one has ended.

Parameters:
travelPart - A travel part to be added.

GetTravelParts

public java.util.Iterator GetTravelParts()
Gets the iterator to the parts of the travel.

Returns:
An iterator to the list of travel parts.

clone

protected java.lang.Object clone()
Creates a shallow copy of the list.

See Also:
Object.clone()

AddTravelParts

public void AddTravelParts(TravelPartsList travelPartsList)
Adds a new travel part to the list. The new part must start where the old one has ended.

Parameters:
travelPartsList - A list of travel parts to be added.

GetFirstTravelPart

public TravelPart GetFirstTravelPart()
Gets the first travel part from the list.

Returns:
The first travel part from the list or null if the list is empty.

GetLastTravelPart

public TravelPart GetLastTravelPart()
Gets the last travel part from the list.

Returns:
The last travel part from the list or null if the list is empty.

GetTravelPartsCount

public int GetTravelPartsCount()
Gets the number of the travel parts on the list.

Returns:
A number of the travel parts on the list.

GetLength

public double GetLength()
Gets the total length of travel parts.

Returns:
A total length of travel parts.

IsEqual

public boolean IsEqual(TravelPartsList other)
Gets a boolean value indicating whether this and the given one lists are equal.

Parameters:
other -
Returns:
A boolean value indicating whether this and the given one lists are equal.

equals

public boolean equals(java.lang.Object other)
See Also:
Object.equals(java.lang.Object)

GetChangesCount

public int GetChangesCount()
Gets the changes count in the current list.

Returns:
The changes count.

GetRevertedList

public TravelPartsList GetRevertedList()
Gets the reverted list.

Returns:
The reverted list.