java – add an array to an object

I explain that I have a class of materials, then an array of work pieces that, among other attributes, includes the array of materials.
The idea is: I mainly create some of the work and assign values ​​in case 1 to all the attributes of the work part minus the materials in case 2. I add the materials to a part because it has an attribute. What are you looking for based on the name of the client and the date of a room and the one that motivated the idea is to add the material objects that I have created in case 2 every time you press for case 2 I create a material object and you have to add it to the list of tables I have searched by year and by customer name.

I put the code of the main because it will not let me put it in the other classes (I have class company with an arraylist of Parts of Work a class Part of work that you have among other things atriubiuto a materials arraylist and a class of materials that has type of material and quantity) If you want to see another course that is not the main saying and that I pass it to you, I do not know what to show you.

    Scanner input = new Scanner (System.in);
Boolean output = false;
int option; // we will save the option of the user

while (! exit) {
System.out.println ("****************************************** * * ");
System.out.println ("1. Add a new work piece");
System.out.println ("2. Add a material to the part");
System.out.println ("3. Delete a letter");
System.out.println ("4. List all letters");
System.out.println ("5. List all new letters");
System.out.println ("6. List all second hand cards");
System.out.println ("7. Find the most expensive card");
System.out.println ("8. Search for the cheapest card");
System.out.println ("9. Find the oldest map");
System.out.println ("10. Quit");
System.out.println ("****************************************** * * ");
System.out.println ("Choose one of the options");

option = Integer.parseInt (input.nextLine ());

switch (option) {
case 1:
String aux = "";
String aux1 = null;
String aux2 = "";
char aux3 = & # 39;
String aux4 = null;
double aux5 = 0;
String aux6 = "";
Part of work p = new Part of work ();


System.out.println ("Enter the customer name:");
aux = input.nextLine ();
System.out.println ("Enter the date of the document in the format (year-month-day):");
aux1 = input.nextLine ();
LocalDate localDate = LocalDate.parse (aux1);
System.out.println ("Enter the worker's name:");
aux2 = input.nextLine ();
System.out.println ("Enter the repair status:");
aux3 = input.nextLine (). charAt (0);
System.out.println ("Enter the repair date:");
aux4 = input.nextLine ();
LocalDate localDate1 = LocalDate.parse (aux4);
System.out.println ("Enter repair minutes:");
aux5 = Double.parseDouble (input.nextLine ());
System.out.println ("Enter the fix description:");
aux6 = input.nextLine ();

p.setCustomerName (aux);
p.setState (aux3);
p.setTractorName (aux2);
p.setTimeRepair (aux5);
p.setDateRepair (localDate1);
p.setDatePart (localDate);
e.anadirPart (p);

pause
case 2:
String aux7 = "";
double aux8 = 0;
String aux9 = "";
String aux10 = "";
System.out.println ("Enter the amount of material:");
aux8 = Double.parseDouble (input.nextLine ());
System.out.println ("Enter the material used:");
aux7 = input.nextLine ();
System.out.println ("Enter the customer name:");
aux9 = input.nextLine ();
System.out.println ("Enter the date of the part:");
aux10 = input.nextLine ();
LocalDate localDate2 = LocalDate.parse (aux10);
Material m = new Material ();
e.buscarPorFechaYCliente (aux9, localDate2);
p.landdirMaterials (p1)
pause

it's the part class of the work

The public class ParteDeTrabajo implements Comparable {

private String customerName;
private LocalDate datePart;
private String nameWorker;
private character status;
private LocalDate dateReparation;
private double timeReparation;
private String descriptionArray;
private list the materials;

public String getCustomerName () {
return customerName;
}

public void setCustomerName (String customerName) {
this.ClientName = CustomerName;
}

public LocalDate getFechaPart () {
return datePart;
}

public void setFechaParte (LocalDate fechaPart) {
this.fechaPart = datePart;
}

public String getNameWorker () {
return the nomworker;
}

public void setWorkerName (String nameWorker) {
this.workername = jobname;
}

public character getEstado () {
return condition;
}

empty public setEstado (char estado) {
if (this.estado == & # 39; || this.estado == & rd; r)
this.estado = state;
}

}

public LocalDate getFechaReparation () {
return dateRepair;
}

public void setFechaReparation (LocalDate fechaReparacion) {
this.dateRepair = dateRepair;
}

public double getTimeReparation () {
return timeRepair;
}

public void setTimeReparation (double timeRepair) {
if (this.timeRepair> = 0) {
this.timeRepair = timeRepair;
}
}

public String getDescriptionArray () {
returns descriptionArray;
}

public void setDescriptionArray (String descriptionArray) {
this.descriptionArray = descriptionArray;
}

public list getMaterials () {
return the materials;
}

public void setMaterials (List materials) {
this.materials = materials;
}

Public WorkPart (String customerName, LocalDate datePart, String workerName, character status, LocalDate dateRepair, double timeRepair, String descriptionArray, List materials) {
this.ClientName = CustomerName;
this.fechaPart = datePart;
this.workername = jobname;
setState;
this.dateRepair = dateRepair;
setTimeRepair (timeRepair);
this.descriptionArray = descriptionArray;
this.materials = materials;
}

Public Public Part () {
this.ClientName = "";
this.fechaPart = null;
this.workername = "";
this.estado = p #;
this.dateRepair = null;
this.timeReparation = 0;
this.descriptionArray = "";
this.materiales = new ArrayList();
}

public String aniadirMaterials (Material a) {
materials.add (a);
return "seized material";
}

@Override
public channel toString () {
String str = "";
str + = "Working part" + " n";
str + = "part date:" + datePart + " n customer name:" + customer name + " n sent by:" + managerName
+ " n copier status:" + status + " n repair date:" + dateReparation + " n was delayed:" + timeRepair
+ "minutes  n";
for (material m: materials) {
str + = m.toString ();
}

return str;
}

@Override
public int compareTo (Object o) {
Part of work p = (Part of work) or;
if (this.getFechaPart (). isAfter (p.getFechaPart ())) {
returns 1;
}
if (this.getFechaPart (). equals (p.getFechaPart ())) {
returns 0;
} else {
return -1;
}
}

}

Thank you very much for that, I hope to finish the work that I do and deliver it.