You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
1.9 KiB
105 lines
1.9 KiB
package org.leolo.rail.report; |
|
|
|
import java.util.HashSet; |
|
|
|
import org.leolo.rail.model.ScheduleType; |
|
|
|
public class TrainScheduleEntry { |
|
|
|
private HashSet<BasicTrainScheduleEntry> subEntry = new HashSet<>(); |
|
private BasicTrainScheduleEntry mainEntry = null; |
|
private String note = ""; |
|
|
|
public void addEntry(BasicTrainScheduleEntry entry) { |
|
subEntry.add(entry); |
|
if(mainEntry==null) { |
|
mainEntry = entry; |
|
}else if(entry.getScheduleType() == ScheduleType.OVL) { |
|
mainEntry = entry; |
|
} |
|
} |
|
|
|
public int getSubentryCount() { |
|
return subEntry.size(); |
|
} |
|
|
|
public BasicTrainScheduleEntry getAssocEntry() { |
|
for(BasicTrainScheduleEntry btse:subEntry) { |
|
if(btse!=mainEntry) { |
|
return btse; |
|
} |
|
} |
|
return null; |
|
} |
|
|
|
public String getMainSUID() { |
|
return mainEntry.getSuid(); |
|
} |
|
|
|
public ScheduleType getScheduleType() { |
|
return mainEntry.getScheduleType(); |
|
} |
|
|
|
public String getSignalId() { |
|
return mainEntry.getSignalId(); |
|
} |
|
|
|
public String getToc() { |
|
return mainEntry.getToc(); |
|
} |
|
|
|
public String getTrainClass() { |
|
return mainEntry.getTrainClass(); |
|
} |
|
|
|
public String getOrigin() { |
|
return mainEntry.getOrigin(); |
|
} |
|
|
|
public long getOriginTime() { |
|
return mainEntry.getOriginTime(); |
|
} |
|
|
|
public String getDestination() { |
|
return mainEntry.getDestination(); |
|
} |
|
|
|
public long getDestinationTime() { |
|
return mainEntry.getDestinationTime(); |
|
} |
|
|
|
public HashSet<BasicTrainScheduleEntry> getAssoicatedEntry() { |
|
return mainEntry.getAssoicatedEntry(); |
|
} |
|
|
|
|
|
public String getTrainUid() { |
|
return mainEntry.getTrainUid(); |
|
} |
|
|
|
|
|
public long getDepartTime() { |
|
return mainEntry.getDepartTime(); |
|
} |
|
|
|
public String getDepartPlatform() { |
|
return mainEntry.getDepartPlatform(); |
|
} |
|
|
|
public long getArriveTime() { |
|
return mainEntry.getArriveTime(); |
|
} |
|
|
|
public String getArrivePlatform() { |
|
return mainEntry.getArrivePlatform(); |
|
} |
|
|
|
public String getNote() { |
|
return note; |
|
} |
|
|
|
public void setNote(String note) { |
|
this.note = note; |
|
} |
|
|
|
}
|
|
|