how to find a set of any start location to between any last required location using lambdas
I am not familiar of this new java feature of lambda, I have an arraylist
in generic class Location and I want to get a set of objects from a starting location (Object.element
) to a specific location
void find(){
int Sindex;
int Eindex;
String stationName=(String) to.getSelectedItem();// combo box
String stationNameEnd=(String) from.getSelectedItem();// get from combo box
Controller manager=new Controller();
manager.station.stream().forEach((entrySet) -> {
if (entrySet.getStopName().equals(stationName)) {
Sindex= manager.station.indexOf(entrySet);
if(!entrySet.getStopName().equalsIgnoreCase(stationNameEnd)){
dist=dist + entrySet.getDistanceforlaststation();
TolalPrice=TolalPrice+ entrySet.getPrice();
Name=stationName;
Name+=", "+ entrySet.getStopName();
time= time+entrySet.getTime();
point=point+entrySet.getPoints();
}
}
});
Problem: I am not familiar of this new java feature of lambda
Case 1.1: I have an arraylist
in generic class Location
Case 1.2: and I want to get a set of object
case 2: from find starting Object.element
and
case 2.1: also stop to at specific location
What I have to do through lambda