How to assign values to an array? - java

Ok, I'm trying to create a hamburger object, it has to have an array of toppings and other things. I keep getting a compilation error every time I try to assign values to the array for each object. Here's the class
/*
This Hamburger class is to define how to make a Hamburger sandwich
Then this class will be used to create a Hamburger object in the tester class
Fields & their purpose
4. toppings – an array of Strings storing the toppings on the burger.
*/
public class Hamburger {
//declear private fields
private int weight;
private String doneness;
private boolean cheese;
private String[] toppings;
//creat arrays for each object, then use it in each specific object
//String[] hamburgerToppings = {"l", "m"};
//String[] cheseburgerToppings = {"l", "m"};
//String[] anotherCheseburgerToppings = {"l", "m"};
//create printable array of toppings
//full constructor
public Hamburger(int weightOZ, String done,
boolean WantCheese, String[] topps) {
weight = weightOZ;
doneness = done;
cheese = WantCheese;
toppings = topps;
}
//overloaded no-arg constructor
public Hamburger(){
}
//copy constructor
public Hamburger(Hamburger burger){
weight = burger.weight;
doneness = burger.doneness;
cheese = burger.cheese;
toppings = burger.toppings;
}
//declear getter methods
public int getWeight() {
return weight;
}
public String getDoneness() {
return doneness;
}
and here's the tester class
//This class will test & run the Hamburger class
//It has the main method to run the other methods in the Hamburger class
public class HamburgerTester {
public static void main(String[] args) {
//Creating Hamburger objects
Hamburger hamburger = new Hamburger();
Hamburger cheseburger = new Hamburger();
Hamburger anotherCheseburger = new Hamburger(cheseburger);
//Setting Values for hamburger object
hamburger.setWeight(7);
hamburger.setDoneness("Mediuem Rare");
hamburger.setCheese(false);
hamburger.setToppings();
//Setting Values for cheseburger object
cheseburger.setWeight(10);
cheseburger.setDoneness("Well Done");
cheseburger.setCheese(true);
//cheseburger.setToppings();
//anotherCheseburger object is a copy of cheseburger
//there's no need to set special values for it
//Printing Results
System.out.println("Hamburger weight is: " + hamburger.getWeight() +
" doneness: " + hamburger.getDoneness() +
" with/without cheese: " + hamburger.getCheese() +
" Toppings: " + hamburger.getToppings());
System.out.println("cheseburger: " + cheseburger.toString());
System.out.println("cheseburger copy: " + anotherCheseburger.toString());
System.out.println("cheseburger wieght after a bite: " + cheseburger.bite());
System.out.println("cheseburger wieght after a 2 bites: " + cheseburger.bite());
}
}
public boolean getCheese() {
return cheese;
}
public String[] getToppings() {
return toppings;
}
//declear setter methods
public void setWeight(int weightOZ) {
this.weight = weightOZ;
}
public void setDoneness(String done) {
this.doneness = done;
}
public void setCheese(boolean WantCheese) {
this.cheese = WantCheese;
}
public void setToppings(String[] topps) {
this.toppings = topps;
for(int i =0; i < toppings.length; i++) {
if (i > 0)
System.out.print(", ");
System.out.print(toppings[i]);
}
}
//copy method
public Hamburger copy(){
Hamburger burger = new Hamburger(weight, doneness, cheese, toppings);
return burger;
}
//bite methode
public int bite(){
if (weight > 0)
weight--;
return weight;
}
//toString method to print what each Hamburger contains
public String toString(){
String str = "Weight is: " + weight +
"\nDoneness is: " + doneness +
"\nCheese is: " + cheese +
"\nToppings are: " + toppings;
return str;
}
}
any help is appreciated, thanks!

Ill try to help, What Are you trying to do? Your getter and setter methods for the object Hamburger appear to be in the class Hamburgertester.

Related

How can I call upon a parameter of a super class while in a sub class so that I can do more calculations with a variable?

THis is the code, just for you to reference when you're curious about what I'm trying to accomplish:
import java.util.EmptyStackException;
public class TicketMain {
public static void main(String[] args) {
// Create a Student Ticket
StudentTicket t1 = new StudentTicket(100,true);
t1.setPromotionCode("KEXP call-in winner");
System.out.println(t1);
// Generate a general ticket
Ticket t2 = new Ticket(55, 40);
System.out.println(t2);
// Generate a student ticket
StudentTicket t3 = new StudentTicket(90,false);
t3.setPromotionCode("KEXP call-in winner");
System.out.println(t3);
// Check for equality
System.out.println("Ticket t1 and Ticket t2 are equal: " + t1.equals(t2)); // Should return false
System.out.println("Ticket t1 and Ticket t3 are equal: " + t1.equals(t3)); // Should return true
// Total tickets generated
System.out.println("Total Tickets generated so far: " + Ticket.getTicketCount());
}
}
class Ticket {
private double price;
private int daysEarly;
private String promotionCode;
private static final String emptyString = "";
private static int ticketID; // Generates ticket number
public Ticket (double price, int daysEarly) { // Constructs ticket with given price, # of days early, no promo, assigns ticket #
this.price = price;
this.daysEarly = daysEarly;
ticketID += 1;
if (ticketID < 0) {
throw new EmptyStackException();
}
}
public int getDaysEarly(){
return daysEarly;
}
public double getPrice() {
return price;
}
public String getPromotionCode(){
if (promotionCode == null) return emptyString;
if (promotionCode.equals("KEXP call-in winner")) promotionCode = ("KEXP call in winner (student)");
return promotionCode;
}
public String setPromotionCode(String code){
if (code == null) throw new Error();
this.promotionCode = code;
return promotionCode;
}
public String toString(){
return "Ticket ID: " + ticketID + ", Price: $" + getPrice() + ", Days Early: " + getDaysEarly() + ", Promotion Code: " + getPromotionCode() + ".";
}
public static int getTicketCount(){
return ticketID;
}
public boolean equals(Ticket one) {
if (price == one.price && promotionCode.equals(one.promotionCode)) return true;
else return false;
}
}
As follows is the area where I'm trying to do math on super parameters...
I put "price/2" within param of sub to take care of math but I still need another "if statement" metaphorically
class StudentTicket extends Ticket {
private static final int daysEarly = 14;
public StudentTicket(double price, boolean honors) {
/*
Student tickets are always bought by campus ticket sales agency, two weeks in advance.
Students always get 50% off initial price.
Honor students get an addition $5 off after the 50%, down to a minimum of $0.
Student tickets have special promo codes.
*/
super(price/2, daysEarly);
// HOW DO I CALL UPON SUPER AFTER ALREADY HAVING DONE SO ???
// I STILL NEED TO SUBTRACT 5 BASED ON HONORS BOOLEAN OF SUBCLASS
// HOW DO I ADD AN IF STATEMENT INTO PARAM OF SUPER ???
// All you will do is make a call to super constructor and pass appropriate parameters
// So the idea is when I create a instance of StudentTicket and return price it should return me a discounted.
// That means you need to override the getPrice() method in superclass to update the ticket price
}
}
I was told to override the getPrice method but I don't know of any way to access the sub parameters
You could create a setPrice() method in the ticket class:
...
public int getDaysEarly(){
return daysEarly;
}
public void setPrice(double newPrice){
price = newPrice;
}
public double getPrice() {
return price;
}
...
Then do this in the StudentTicket constructor:
public StudentTicket(double price, int daysEarly, boolean honors) {
super(price/2, daysEarly);
if(honors == true)
setPrice(getPrice() - 5);
}
Because your methods are type: public and StudentTicket is a child of Ticket class, it should be able to access and utilize any public or protected methods from its parent.
Or you could do as haoyu wang mentioned, and declare price as protected.

How can I show all objects on java

Item.java
I have an item with variables name and weight
package com.company;
public class Item {
String name;
Double weight;
}
Bag.java
the bag can receive up to 20 kg items.
package com.company;
public class Bag {
Item [] myBags;
int itemCount;
Double currentWeight;
Bag(){
itemCount = 0;
currentWeight = 0.0;
myBags = new Item[50];
}
boolean canAddItem(Item item) {
if (currentWeight + item.weight > 20) {
return false;
} else {
return true;
}
}
void AddItem(Item item){
myBags[itemCount] = item;
currentWeight = currentWeight + myBags[itemCount].weight;
itemCount++;
}
}
Main.java
package com.company;
public class Main {
public static void main(String[] args) {
// write your code here
Bag myBag = new Bag();
/*item 1*/
Item fishing_rod = new Item();
fishing_rod.name = "rod1";
fishing_rod.weight = 10.4;
if(myBag.canAddItem(fishing_rod)){
myBag.AddItem(fishing_rod);}
/*item 2*/
Item axe = new Item();
axe.name = "axe1";
axe.weight = 2.2;
if(myBag.canAddItem(axe)){
myBag.AddItem(axe);}
System.out.println(myBag.currentWeight);
//System.out.println(myBag.myBags); i want to show that's here
}
}
I added two objects to the bag . I want to show all the objects I have added in the bag.
How can I show ? How can I show this in java ?
Thanks for your help
You have to override the toString() method in your class:
For Item class first:
#Override
public String toString() {
return "Name: "+ name + ": weight "+ weight +"Kg";
}
then for Bag class
#Override
public String toString() {
return Arrays.toString(myBags);
}
In this way every time you print your bag you will get the content of it.
In Bag class:
public void printBag() {
for(int i =0; i< itemCount; i++) {
System.out.println("Name: " + myBags[i].name);
System.out.println("Weight: " + myBags[i].weight);
}
}
In main method:
myBag.printBag();
Define a function inside your Bag class:
public void printBag() {
for(Item element : myBags) {
System.out.println('Name: ' + element.name);
System.out.println('Weight: ' + element.weight);
}
}
And call it from the main:
myBag.printBag();

Need help finding the error

I have the following code which contains a run-time error. The code was meant to print out:
Vehicle mode:flight Fuel:propane Max Altitude:10000
Vehicle mode:traversal Fuel:coal Horsepower:5000
I could not find it myself (as I am fairly new to coding) and would like some help if possible.
Thanks.
class Main {
public static void main(String[] args) {
HotAirBalloon airbag = new HotAirBalloon(10000);
Locomotive loco = new Locomotive(5000);
System.out.println(airbag.toString());
System.out.println(loco.toString());
}
}
class Vehicle {
String mode, fuel;
public String toString() {
return "Vehicle Mode:" + mode + " Fuel:" + fuel;
}
}
class HotAirBalloon extends Vehicle {
int maxAltitude;
HotAirBalloon(int _alt) {
mode = "flight";
fuel = "propane";
maxAltitude = _alt;
}
public String toString() {
return toString() + " Max Altitude:" + maxAltitude;
}
}
class Locomotive extends Vehicle {
int horsePower;
Locomotive(int _hp) {
mode = "traversal";
fuel = "coal";
horsePower = _hp;
}
public String toString() {
return toString() + " Horsepower:" + horsePower;
}
}
Because you are trying to call the super classes version of the current method you need to add super.toString()
//old
return toString() + " Horsepower:" + horsePower;
//new
return super.toString() + " Horsepower:" + horsePower;
You also need to do this with your other subclass
When you a method calls itself its called recursion, where a method keeps calling itself until a certain condition.
This code will do fine. the problem was that you were calling toString() multiple times which was causing a Stack overflow. plus you have to declare a String in parent class vehicle and update it in the child classes with flight mode etc..run the code below:
class Main {
public static void main(String[] args) {
HotAirBalloon airbag = new HotAirBalloon(10000);
Locomotive loco = new Locomotive(5000);
System.out.println(airbag.toString());
System.out.println(loco.toString());
}
}
class Vehicle {
String mode, fuel;
String s;
}
class HotAirBalloon extends Vehicle {
int maxAltitude;
HotAirBalloon(int _alt) {
mode = "flight";
fuel = "propane";
maxAltitude = _alt;
s= "Vehicle Mode:" + mode + " Fuel:" + fuel;
}
public String toString() {
return s + " Max Altitude:" + maxAltitude;
}}
class Locomotive extends Vehicle {
int horsePower;
Locomotive(int _hp) {
mode = "traversal";
fuel = "coal";
horsePower = _hp;
s= "Vehicle Mode:" + mode + " Fuel:" + fuel;
}
public String toString() {
return s+ " Horsepower:" + horsePower;
}
}

Error; cannot find symbol; Symbol: variable super

I am working on 3 programs that contain the classes CarRental.java, LuxuryCarRental.java, and UseCarRental.java, On my LuxuryCarRental.java, I keep getting the error, Error; cannot find symbol; Symbol: variable super for the class, here is my program, I'm relatively new to Java, so please be detailed! Thanks in advance!
import java.text.DecimalFormat;
public class LuxuryCarRental extends CarRental{
private boolean chauffeur;
private double dailyChauffeurFee;
public LuxuryCarRental(String renterName, int renterZip, String sizeOfCar,int rentalDays, boolean chauffeur) {
super(renterName, renterZip, sizeOfCar, rentalDays);
this.chauffeur = chauffeur;
}
public void display(){
super.dailyRentalFee = 79.99;
this.dailyChauffeurFee = 0;
if(chauffeur){
this.dailyChauffeurFee = 200;
}
super.totalRentalFee = super.dailyRentalFee * super.getRentalDays() + this.dailyChauffeurFee * super.getRentalDays();
DecimalFormat df = new DecimalFormat("0.00");
System.out.println("Car Rental - Renter Name : " + super.getRenterName() + ", Renter Zip: " + super.getRenterZip() +
", Rental Days : " + super.getRentalDays() +
", Daily Rental Fee: " + dailyRentalFee + ", Daily Chauffer Fee: " + dailyChauffeurFee +
", Total Rental Fee: " + df.format(totalRentalFee));
}
}
And here are all the classes from all three of my programs that correspond to each other.
public class CarRental {
private String renterName;
private int renterZip;
private String sizeOfCar;
private int rentalDays;
protected double dailyRentalFee;
protected double totalRentalFee;
public class UseCarRental
public class LuxuryCarRental extends CarRental {
private boolean chauffeur;
private double dailyChauffeurFee;
public CarRental(String renterName, int renterZip, String sizeOfCar, int rentalDays)
{
renterName = renterName;
renterZip = renterZip;
sizeOfCar = sizeOfCar;
rentalDays = rentalDays;
And my altered code:
public class CarRental
{
public static void main(String[] args)
{
private String renterName;
private int renterZip;
private String sizeOfCar;
private int rentalDays;
protected double dailyRentalFee;
protected double totalRentalFee;
}
public CarRental(String renterName, int renterZip, String sizeOfCar, int rentalDays)
{
renterName = renterName;
renterZip = renterZip;
sizeOfCar = sizeOfCar;
rentalDays = rentalDays;
}
public void setDailyRentalFee(double dailyRentalFee)
{
this.dailyRentalFee = dailyRentalFee;
}
public double getDailyRentalFee()
{
return dailyRentalFee;
}
public void display(){
if(sizeOfCar.equalsIgnoreCase("economy"))
{
dailyRentalFee = 29.99;
}
else if(sizeOfCar.equalsIgnoreCase("midsize"))
{
dailyRentalFee = 38.99;
} else {
dailyRentalFee = 43.50;
}
//calculates total rental fee
this.totalRentalFee = this.dailyRentalFee * rentalDays;
DecimalFormat df = new DecimalFormat("0.00");
//displays output
System.out.println("Car Rental - Renter Name : " + renterName + ", Renter Zip: " + renterZip +
", Size of car: " + sizeOfCar + ", Rental Days : " + rentalDays +
", Daily Rental Fee: " + dailyRentalFee + ", Total Rental Fee: " + df.format(totalRentalFee));
}
public String getRenterName()
{
return renterName;
}
public int getRenterZip()
{
return renterZip;
}
public int getRentalDays()
{
return rentalDays;
}
}
super.dailyRentalFee = 79.99;
This doesn't work. The same goes for every other place you've used it.
I assume your class has a private field dailyRentalFee?
Make it protected instead. Or use public/protected getters and setters.
You're in a subclass which you should really view as an extension of the superclass. Everything that is available in the superclass is available in the subclass, provided you don't use private access but rather protected (available in current class and subclass) or public (available everywhere that has access to the current class).
Example:
class SuperClass {
protected int someValue = 5;
private int anotherValue = 10;
}
class SubClass extends SuperClass {
public void doSomething() {
someValue = 6; // I can access it because it's protected instead of private
anotherValue = 1; // I can't access it because it's private and only accessible in the SuperClass
}
}
To summarize:
Drop the super.X, super() is used to call the constructor of the superclass
Use protected or public access identifiers instead of private
First thing, super doesn't work the way you have used it.
when you extend a class, CarRental in your case, you inherite all public and protected members of that class. so to use a variable of your super class, you dont have to prefix super, you can just use the variable as if the child class holds it. so instead of
super.dailyRentalFee = 79.99;
use
dailyRentalFee = 79.99; // since dailyRentalFee is protected in class CarRental
// this will work
similarly,
super.totalRentalFee = super.dailyRentalFee * super.getRentalDays() + this.dailyChauffeurFee * super.getRentalDays();
should be written as
totalRentalFee = dailyRentalFee * getRentalDays() + this.dailyChauffeurFee * getRentalDays();
provided, the method getRentalDays is public in the CarRental class.
and about the error you mentioned in #Jeroen's answers' comments,
make sure LuxuryCarRental and CarRental are in the same package. To be simple,
make sure both files are in the same folder.
EDIT:
Your code doesn't contain a main method, that is why that error is produced. You should have a main method in your program for it to execute. That is the starting point of all java applications. so define a class with a main method inside and then create a LuxuryCarRental object and perform your computations there. for example,
class Sample {
public static void main(String[] args) { //this is how all main methods would look
LuxuryCarRental luxuryCar = new LuxuryCarRental("A",62020,"SUV",10,true);
//call the LuxuryCarRental methods as per your coding requirements
}
}
see, its simpe,
class CarRental {
//CarRental code
}
class LuxuryCarRental {
//LuxuryCarRental code
}
class Test {
public static void main(String[] args) {
LuxuryCarRental luxuryCar = new LuxuryCarRental("A",62020,"SUV",10,true);
luxuryCar.display();
}
}

How to use CompareTo to sort the PlaneMap by Ascending and Descending order

Im trying to sort my planes by Ascending and Descending order. I have a hashmap of planes and i want to compare them so that i can get the next plane due and last plane due by sorting the map by timeLimitBeforeLand. I wrote a compareTo method which looks like :
//---------------------------------------------------------------------------------------
// CompareTo() used with the Comparable implementation.
//---------------------------------------------------------------------------------------
public int compareTo(Object arg0)
{
if((arg0 != null) && (arg0 instanceof Plane))
{
Plane p = (Plane) arg0;
return (int)Math.ceil(this.timeLimitBeforeLand - p.getLimitBeforeLand());
}
return 0;
}
CompareTo takes timeLimitBeforeLand:
// ---------------------------------------------------------------------------------------
// Name: getTimeLimitBeforeLand.
// Description: Get the time before every plane is going to land.
//---------------------------------------------------------------------------------------
public double getTimeLimitBeforeLand()
{
double fuelConsumption;
double timeLimitBeforeLand = 0;
for (TreeMap<String, Plane> theEntry : airlineMap.values()) {
for (Plane aPlane : theEntry.values()) {
if (aPlane.getPlaneType() == aPlane.getPlaneType().AIRBUS) {
System.out.println(" ");
System.out.println(aPlane);
fuelConsumption = 2;
timeLimitBeforeLand = (double) (aPlane.getFuelRemaining() / fuelConsumption);
System.out.println(timeLimitBeforeLand + " minutes to land.");
System.out.println(" ");
} else if (aPlane.getPlaneType() == aPlane.getPlaneType().CORPORATE) {
System.out.println(" ");
System.out.println(aPlane);
fuelConsumption = 3;
timeLimitBeforeLand = (aPlane.getFuelRemaining() / fuelConsumption);
System.out.println(timeLimitBeforeLand + " minutes to land.");
System.out.println(" ");
} else if (aPlane.getPlaneType() == aPlane.getPlaneType().PRIVATE) {
System.out.println(" ");
System.out.println(aPlane);
fuelConsumption = 4;
timeLimitBeforeLand = (double) (aPlane.getFuelRemaining() / fuelConsumption);
System.out.println(timeLimitBeforeLand + " minutes to land.");
System.out.println(" ");
}
}
}
return timeLimitBeforeLand;
}
My attempt so far in the mainApp:
TreeMap<String, PlaneStore> map = new TreeMap<String, PlaneStore>();
ArrayList<Plane> copyList = new ArrayList<Plane>(map.);
Plane comp = new Plane();
Collections.sort(copyList, plane);
Plane Class:
//---------------------------------------------------------------------------------------
// Name: Imports.
// Description: To allow the use of different Java classes.
//---------------------------------------------------------------------------------------
import java.io.Serializable;
//---------------------------------------------------------------------------------------
//Name: Class declaration.
//---------------------------------------------------------------------------------------
public class Plane implements Comparable, Serializable
{
//---------------------------------------------------------------------------------------
// Variable declarations.
//---------------------------------------------------------------------------------------
private String flightNumber;
public String airlineName;
private double fuelRemaining;
private int overdue;
private int passengerNumber;
//---------------------------------------------------------------------------------------
// Enum declaration.
//---------------------------------------------------------------------------------------
private AIRPLANETYPE planeType;
private boolean isLanded = false;
public double timeLimitBeforeLand;
//---------------------------------------------------------------------------------------
// Enum Constuctor.
//---------------------------------------------------------------------------------------
public enum AIRPLANETYPE
{
AIRBUS("1"), CORPORATE("2"), PRIVATE("3");
private String planeName;
private AIRPLANETYPE(String planeName)
{
this.planeName = planeName;
}
public String getPlaneName()
{
return this.planeName;
}
}
//---------------------------------------------------------------------------------------
// Constructor.
//---------------------------------------------------------------------------------------
public Plane(String flightNumber, String airlineName,
double fuelRemaining, int overdue, int passengerNumber,
AIRPLANETYPE planeType, boolean isLanded)
{
this.flightNumber = flightNumber;
this.airlineName = airlineName;
this.fuelRemaining = fuelRemaining;
this.passengerNumber = passengerNumber;
this.overdue = overdue;
this.planeType = planeType;
this.isLanded = isLanded;
}
//---------------------------------------------------------------------------------------
// Getters and Setters.
//---------------------------------------------------------------------------------------
public String getAirlineName()
{
return airlineName;
}
public void setAirlineName(String airlineName)
{
this.airlineName = airlineName;
}
public void setOverdue(int overdue)
{
this.overdue = overdue;
}
public int getOverdue()
{
return overdue;
}
public String getFlightNumber()
{
return flightNumber;
}
public void setFlightNumber(String flightNumber)
{
this.flightNumber = flightNumber;
}
public double getFuelRemaining()
{
return fuelRemaining;
}
public void setFuelRemaining(double fuelRemaining)
{
this.fuelRemaining = fuelRemaining;
}
public int getPassengerNumber()
{
return passengerNumber;
}
public void setPassengerNumber(int passengerNumber)
{
this.passengerNumber = passengerNumber;
}
public AIRPLANETYPE getPlaneType()
{
return planeType;
}
public void setPlaneType(AIRPLANETYPE planeType)
{
this.planeType = planeType;
}
public boolean isLanded()
{
return isLanded;
}
public void setLanded(boolean isLanded)
{
this.isLanded = isLanded;
}
public double getLimitBeforeLand()
{
return timeLimitBeforeLand;
}
public void setTimeLimitBeforeLand(double timeLimitBeforeLand)
{
this.timeLimitBeforeLand = timeLimitBeforeLand;
}
//---------------------------------------------------------------------------------------
// CompareTo() used with the Comparable implementation.
//---------------------------------------------------------------------------------------
public int compareTo(Object arg0)
{
if((arg0 != null) && (arg0 instanceof Plane))
{
Plane p = (Plane) arg0;
return (int)Math.ceil(this.timeLimitBeforeLand - p.getLimitBeforeLand());
}
return 0;
}
//---------------------------------------------------------------------------------------
// toString().
//---------------------------------------------------------------------------------------
public String toString()
{
return "Plane: flightNumber=" + flightNumber + "."
+ " airlineName=" + airlineName + "."
+ " fuelRemaining=" + fuelRemaining + " litres."
+ " overdue=" + overdue + " minutes."
+ " passengerNumber="+ passengerNumber + "."
+ " airplaneType=" + planeType +
"hasLanded=" + isLanded+ ".\n";
}
}
The second argument in Collections.sort is for a Comparator not a Plane. Since I saw no mention of a Comparator, you should be able to use the natural order (defined by the compareTo method in your Plane object) and not have a second argument in the Collections.sort
EDIT: Unless you have just excluded that code, you aren't creating any Plane instances and you're using empty collections here...
TreeMap<String, PlaneStore> map = new TreeMap<String, PlaneStore>();
ArrayList<Plane> copyList = new ArrayList<Plane>(map.);
and you will be sorting by PlaneStores so you have to obtain all the Planes in each PlaneStore and add them to your copyList before sorting.
I would consider researching each of the Collections a little more and deciding what the best one for your need would be.

Categories