diff --git a/src/Core/ContextStrategy.java b/src/Core/ContextStrategy.java new file mode 100644 index 0000000000000000000000000000000000000000..bf082c8e3fe91a2315370c3cdce0f6bfed208944 --- /dev/null +++ b/src/Core/ContextStrategy.java @@ -0,0 +1,9 @@ +package Core; + +import Exception.ExceptionUnknownStartegyType; + +public interface ContextStrategy { + public abstract void setStrategy(String strategyName) throws ExceptionUnknownStartegyType; + public abstract void execute(MyFoodora myFoodora, double targetProfit); + +} diff --git a/src/Core/MyFoodora.java b/src/Core/MyFoodora.java index 7c8445070abf191d84d3a8c307fd425c15715146..dccd139d20fe21ddfa8c32a03c4a207a883c3ca9 100644 --- a/src/Core/MyFoodora.java +++ b/src/Core/MyFoodora.java @@ -4,17 +4,20 @@ import java.util.ArrayList; import Exception.ExceptionUnknownDishType; import Exception.ExceptionUnknownMealType; +import Exception.ExceptionUnknownStartegyType; import Item.Dish; import Item.FactoryDish; import Item.FactoryMeal; import Item.Meal; -/* to be deleted */ -import provisoire.entities.ContextDeliveryPolicy; -import provisoire.entities.ContextTargetProfit; -import provisoire.entities.Courier; -import provisoire.entities.Customer; -import provisoire.entities.Manager; -import provisoire.entities.Restaurant; +import Order.HistoricOrder; +import StrategyProfit.ContextTargetProfitStrategy; +import User.Courier; +import User.Customer; +import User.ListUser; +import User.Manager; +import User.Restaurant; +import User.User; +import DeliveryStrategy.ContextDeliveryStartegy; /** * Heart of the project, concatenate all the fonctionalities this project @@ -27,28 +30,42 @@ public class MyFoodora { private double markupPercentage; private double deliveryCost; - private ContextTargetProfit contextTargetProfit; - private ContextDeliveryPolicy contextDeliveryPolicy; + private ContextTargetProfitStrategy contextTargetProfitStrategy; + private ContextDeliveryStartegy contextDeliveryPolicy; - // a mettre dans la logique des user - private class ListUser<T>{ - private ArrayList<T> listUser = new ArrayList<T>(); - - public void addUser(T e){ - listUser.add(e); - } - public void removeUser(int id){ - // todo - } - public ArrayList<T> getList(){ - return listUser; - } + private ArrayList<ListUser<User>> globalListUser; + private ListUser<Restaurant> listRestaurant; + private ListUser<Customer> listCustomer; + private ListUser<Manager> listManager; + private ListUser<Courier> listCourier; + + private HistoricOrder globalHistoric; + + /** CONSTRUCTOR + * @throws ExceptionUnknownStartegyType **/ + + public MyFoodora() throws ExceptionUnknownStartegyType{ + this.contextTargetProfitStrategy = new ContextTargetProfitStrategy("DeliveryCost"); + this.contextDeliveryPolicy = new ContextDeliveryStartegy("FairOccupation"); + this.listRestaurant = new ListUser<Restaurant>(); + this.listCustomer = new ListUser<Customer>(); + this.listManager = new ListUser<Manager>(); + this.listCourier = new ListUser<Courier>(); + this.globalHistoric = new HistoricOrder(); } - private ArrayList<Restaurant> listRestaurant = new ArrayList<Restaurant>(); - private ArrayList<Customer> listCustomer = new ArrayList<Customer>(); - private ArrayList<Manager> listManager = new ArrayList<Manager>(); - private ArrayList<Courier> listCourier = new ArrayList<Courier>(); + /** CUSTOM **/ + public int getTypeOfUser(String usernameTest, String passwordTest){ + if(this.getListCustomer().isContainingCorrectLogin(usernameTest, passwordTest)) + return User.CUSTOMER; + if(this.getListCourier().isContainingCorrectLogin(usernameTest, passwordTest)) + return User.COURIER; + if(this.getListRestaurant().isContainingCorrectLogin(usernameTest, passwordTest)) + return User.RESTAURANT; + if(this.getListManager().isContainingCorrectLogin(usernameTest, passwordTest)) + return User.MANAGER; + return User.UNKNOWN; + } /** CUSTOM GETTER AND SETTER **/ @@ -62,26 +79,27 @@ public class MyFoodora { return priceOrder*markupPercentage + serviceFee - deliveryCost; } - /** CUSTOM ADDING ENTITIES **/ - - public void addRestaurant(Restaurant e){ - listRestaurant.add(e); - } - public void addCustomer(Customer e){ - listCustomer.add(e); - } - public void addCourier(Courier e){ - listCourier.add(e); - } - public void addManager(Manager e){ - listManager.add(e); - } - /** GENERIC GETTER AND SETTER **/ public double getServiceFee() { return serviceFee; } + public ListUser<Restaurant> getListRestaurant() { + return listRestaurant; + } + public ListUser<Customer> getListCustomer() { + return listCustomer; + } + public ListUser<Manager> getListManager() { + return listManager; + } + public ListUser<Courier> getListCourier() { + return listCourier; + } + public HistoricOrder getGlobalHistoric() { + return globalHistoric; + } + public void setServiceFee(double serviceFee) { this.serviceFee = serviceFee; } @@ -100,18 +118,29 @@ public class MyFoodora { /** END GENERIC GETTER AND SETTER * @throws ExceptionUnknownMealType - * @throws ExceptionUnknownDishType **/ + * @throws ExceptionUnknownDishType + * @throws ExceptionUnknownStartegyType **/ - public static void main(String[] args) throws ExceptionUnknownMealType, ExceptionUnknownDishType { + public static void main(String[] args) throws ExceptionUnknownMealType, ExceptionUnknownDishType, ExceptionUnknownStartegyType { // TODO Auto-generated method stub + MyFoodora myFoodora = new MyFoodora(); FactoryDish dishFactory = new FactoryDish(); FactoryMeal mealFactory = new FactoryMeal(); Dish d1 = dishFactory.createDish("MainDish", "French Fries", "Vegan", 3.0); Dish d2 = dishFactory.createDish("MainDish", "French Fries", "Vegan", 3.0); Meal m1 = mealFactory.createMeal("HalfMeal"); Meal m2 = mealFactory.createMeal("HalfMeal"); + //myFoodora.listRestaurant.add(); System.out.println(d1.equals(d2)); System.out.println(m1.equals(m2)); } + public double getLastMonthIncome() { + // TODO Auto-generated method stub + return 0; + } + public int getNumberOfOrder() { + // TODO Auto-generated method stub + return 0; + } } diff --git a/src/DeliveryStrategy/ContextDeliveryStartegy.java b/src/DeliveryStrategy/ContextDeliveryStartegy.java new file mode 100644 index 0000000000000000000000000000000000000000..88a80bc0ff6267016ddf1cab2cb4f5c238947b30 --- /dev/null +++ b/src/DeliveryStrategy/ContextDeliveryStartegy.java @@ -0,0 +1,40 @@ +package DeliveryStrategy; + +import Core.ContextStrategy; +import Core.MyFoodora; +import Exception.ExceptionUnknownStartegyType; +import StrategyProfit.StrategyTargetProfitPolicy; +import StrategyProfit.TargetProfitDeliveryCost; +import StrategyProfit.TargetProfitMarkup; +import StrategyProfit.TargetProfitServiceFee; + +public class ContextDeliveryStartegy implements ContextStrategy { + + private StrategyTargetProfitPolicy strategy; + + public ContextDeliveryStartegy(String strategyName) throws ExceptionUnknownStartegyType { + setStrategy(strategyName); + } + + public void setStrategy(String strategyName) throws ExceptionUnknownStartegyType{ + strategyName = strategyName.toLowerCase().trim(); + switch(strategyName){ + case "deliverycost": + strategy = new TargetProfitDeliveryCost(); + break; + case "servicefee": + strategy = new TargetProfitServiceFee(); + break; + case "markup": + strategy = new TargetProfitMarkup(); + break; + default: + throw new ExceptionUnknownStartegyType("Unknown startegy '"+strategyName+"', DeliveryCost, ServiceFee and Markup available."); + } + } + + public void execute(MyFoodora myFoodora, double targetProfit){ + strategy.chooseTargetProfit(myFoodora, targetProfit); + } + +} diff --git a/src/Exception/ExceptionUnknownStartegyType.java b/src/Exception/ExceptionUnknownStartegyType.java new file mode 100644 index 0000000000000000000000000000000000000000..866da06f679554648df0faa4870a30a1c071f5f2 --- /dev/null +++ b/src/Exception/ExceptionUnknownStartegyType.java @@ -0,0 +1,35 @@ +package Exception; + +public class ExceptionUnknownStartegyType extends Exception { + + /** + * + */ + private static final long serialVersionUID = -7678301440060327944L; + + public ExceptionUnknownStartegyType() { + // TODO Auto-generated constructor stub + } + + public ExceptionUnknownStartegyType(String message) { + super(message); + // TODO Auto-generated constructor stub + } + + public ExceptionUnknownStartegyType(Throwable cause) { + super(cause); + // TODO Auto-generated constructor stub + } + + public ExceptionUnknownStartegyType(String message, Throwable cause) { + super(message, cause); + // TODO Auto-generated constructor stub + } + + public ExceptionUnknownStartegyType(String message, Throwable cause, boolean enableSuppression, + boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + // TODO Auto-generated constructor stub + } + +} diff --git a/src/Item/Item.java b/src/Item/Item.java index 58010116ea5b2bad07789556a83d8cb67efd57a9..24cdd6d93b8770c974cecef7986c3317690cd1cf 100644 --- a/src/Item/Item.java +++ b/src/Item/Item.java @@ -1,9 +1,12 @@ package Item; +import Order.HistoricOrder; + public abstract class Item implements VisitablePrice { String typeOfFood; String name; + HistoricOrder historic; /** CONSTRUCTOR **/ diff --git a/src/Order/HistoricOrder.java b/src/Order/HistoricOrder.java new file mode 100644 index 0000000000000000000000000000000000000000..9cdacd5f4f6603b2c19f0c015c91d92736e9f627 --- /dev/null +++ b/src/Order/HistoricOrder.java @@ -0,0 +1,21 @@ +package Order; + +import java.util.ArrayList; +import java.util.Collections; + +public class HistoricOrder { + + private ArrayList<Order> listOrder; + + public HistoricOrder() { + listOrder = new ArrayList<Order>(); + } + public void addOrder(Order o){ + listOrder.add(o); + } + public ArrayList<Order> getOrdered(){ + Collections.sort(listOrder); + return listOrder; + } + +} diff --git a/src/Order/Order.java b/src/Order/Order.java index d4717f95226f02414bdc175d9356f572430b01d8..49a7cb24fea34a5a36a2fd02939793b986945320 100644 --- a/src/Order/Order.java +++ b/src/Order/Order.java @@ -1,15 +1,18 @@ package Order; import java.util.ArrayList; +import java.util.Date; import Item.Dish; import Item.Meal; import Item.VisitablePrice; import Item.VisitorPrice; -public class Order implements VisitorPrice{ +public class Order implements VisitorPrice, Comparable<Order>{ private double price; + private Date date; + private boolean finalized; ArrayList<Dish> listDish; ArrayList<Meal> listMeal; @@ -18,6 +21,13 @@ public class Order implements VisitorPrice{ // TODO Auto-generated constructor stub } + /** CUSTOM **/ + + public void finalize(){ + Date date = new Date(); + finalized = true; + } + /** AND & REMOVE **/ public void add(Dish d){ @@ -41,14 +51,18 @@ public class Order implements VisitorPrice{ /** GETTER AND SETTER **/ + public boolean isFinalised(){ + return finalized; + } public double getPrice(){ return price; } - public void setPrice(double price) { this.price = price; } - + public Date getDate(){ + return date; + } @Override public void visitPrice(VisitablePrice v) { for(Dish dish:listDish){ @@ -58,5 +72,10 @@ public class Order implements VisitorPrice{ meal.acceptPrice(this); } } + + @Override + public int compareTo(Order o) { + return date.compareTo(o.getDate()); + } } diff --git a/src/Others/Date.java b/src/Others/Date.java index ee90a9c4f12e73f0be9640c200af242d59e66320..059ce83202b7218555d533163502075879d0416e 100644 --- a/src/Others/Date.java +++ b/src/Others/Date.java @@ -1,22 +1,39 @@ package Others; +@SuppressWarnings("Changed by java.util.Date") public class Date { private String year,month,day; - @Override - public String toString() { - return "Date dd/mm/yyyy : " + day + "-" + month + "-" + year ; + /** CONSTRUCTOR **/ + + public Date(String year, String month, String day) { + super(); + this.year = year; + this.month = month; + this.day = day; + } + public Date(int year, int month, int day) { + super(); + this.year = Integer.toString(year); + this.month = Integer.toString(month); + if(this.month.length()<2) + this.month="0"+this.month; + this.day = Integer.toString(day); + if(this.day.length()<2) + this.day="0"+this.day; } + + /** CUSTOM **/ + /** GETTER & SETTER **/ + public String getYear() { return year; } - public void setYear(String year) { this.year = year; } - public String getMonth() { return month; } @@ -32,12 +49,12 @@ public class Date { public void setDay(String day) { this.day = day; } - - public Date(String year, String month, String day) { - super(); - this.year = year; - this.month = month; - this.day = day; + + /** OVERRIDE **/ + + @Override + public String toString() { + return "Date dd/mm/yyyy : " + day + "/" + month + "/" + year ; } } diff --git a/src/StrategyProfit/ContextTargetProfitStrategy.java b/src/StrategyProfit/ContextTargetProfitStrategy.java new file mode 100644 index 0000000000000000000000000000000000000000..944a3348c0b35436ca4cc6b8b597bc526757fa49 --- /dev/null +++ b/src/StrategyProfit/ContextTargetProfitStrategy.java @@ -0,0 +1,35 @@ +package StrategyProfit; + +import Core.MyFoodora; +import Exception.ExceptionUnknownStartegyType; + +public class ContextTargetProfitStrategy { + + public StrategyTargetProfitPolicy strategy; + + public ContextTargetProfitStrategy(String strategyName) throws ExceptionUnknownStartegyType { + setStrategy(strategyName); + } + + public void setStrategy(String strategyName) throws ExceptionUnknownStartegyType{ + strategyName = strategyName.toLowerCase().trim(); + switch(strategyName){ + case "deliverycost": + strategy = new TargetProfitDeliveryCost(); + break; + case "servicefee": + strategy = new TargetProfitServiceFee(); + break; + case "markup": + strategy = new TargetProfitMarkup(); + break; + default: + throw new ExceptionUnknownStartegyType("Unknown startegy '"+strategyName+"', DeliveryCost, ServiceFee and Markup available."); + } + } + + public void execute(MyFoodora myFoodora, double targetProfit){ + strategy.chooseTargetProfit(myFoodora, targetProfit); + } + +} diff --git a/src/StrategyProfit/StrategyTargetProfitPolicy.java b/src/StrategyProfit/StrategyTargetProfitPolicy.java new file mode 100644 index 0000000000000000000000000000000000000000..c1e5f7d44ba75c3231a9b4ac657439cdc382b0bc --- /dev/null +++ b/src/StrategyProfit/StrategyTargetProfitPolicy.java @@ -0,0 +1,15 @@ +package StrategyProfit; + +import Core.MyFoodora; + +public abstract class StrategyTargetProfitPolicy { + private String nameOfStrategy="undefined"; + public abstract void chooseTargetProfit(MyFoodora myFoodora, double targetProfit); + + public String getNameOfStrategy() { + return nameOfStrategy; + } + protected void setNameOfStrategy(String nameOfStrategy) { + this.nameOfStrategy = nameOfStrategy; + } +} diff --git a/src/StrategyProfit/TargetProfitDeliveryCost.java b/src/StrategyProfit/TargetProfitDeliveryCost.java new file mode 100644 index 0000000000000000000000000000000000000000..31ce9bd8af62d827fafa77b0bc5ed5644423623a --- /dev/null +++ b/src/StrategyProfit/TargetProfitDeliveryCost.java @@ -0,0 +1,19 @@ +package StrategyProfit; + +import Core.MyFoodora; + +public class TargetProfitDeliveryCost extends StrategyTargetProfitPolicy { + + public TargetProfitDeliveryCost(){ + this.setNameOfStrategy("DeliveryCost"); + } + + @Override + public void chooseTargetProfit(MyFoodora myFoodora, double targetProfit) { + // TODO Auto-generated method stub + double lastMonthIncome = myFoodora.getLastMonthIncome(); + int numberOfOrder = myFoodora.getNumberOfOrder(); + myFoodora.setDeliveryCost(lastMonthIncome*myFoodora.getMarkupPercentage()+myFoodora.getServiceFee()*numberOfOrder-targetProfit); + } + +} diff --git a/src/StrategyProfit/TargetProfitMarkup.java b/src/StrategyProfit/TargetProfitMarkup.java new file mode 100644 index 0000000000000000000000000000000000000000..c3120298931c38729cddd6d9a1e9e11a192d9d3d --- /dev/null +++ b/src/StrategyProfit/TargetProfitMarkup.java @@ -0,0 +1,19 @@ +package StrategyProfit; + +import Core.MyFoodora; + +public class TargetProfitMarkup extends StrategyTargetProfitPolicy { + + public TargetProfitMarkup(){ + this.setNameOfStrategy("Markup"); + } + + @Override + public void chooseTargetProfit(MyFoodora myFoodora, double targetProfit) { + // TODO Auto-generated method stub + double lastMonthIncome = myFoodora.getLastMonthIncome(); + int numberOfOrder = myFoodora.getNumberOfOrder(); + myFoodora.setMarkupPercentage((targetProfit-myFoodora.getServiceFee()*numberOfOrder+myFoodora.getDeliveryCost()*numberOfOrder)/lastMonthIncome); + } + +} diff --git a/src/StrategyProfit/TargetProfitServiceFee.java b/src/StrategyProfit/TargetProfitServiceFee.java new file mode 100644 index 0000000000000000000000000000000000000000..aeb5a3f16f2442ba20639fde83c64d8f4db03370 --- /dev/null +++ b/src/StrategyProfit/TargetProfitServiceFee.java @@ -0,0 +1,19 @@ +package StrategyProfit; + +import Core.MyFoodora; + +public class TargetProfitServiceFee extends StrategyTargetProfitPolicy { + + public TargetProfitServiceFee(){ + this.setNameOfStrategy("ServiceFee"); + } + + @Override + public void chooseTargetProfit(MyFoodora myFoodora, double targetProfit) { + // TODO Auto-generated method stub + double lastMonthIncome = myFoodora.getLastMonthIncome(); + int numberOfOrder = myFoodora.getNumberOfOrder(); + myFoodora.setServiceFee(targetProfit-lastMonthIncome*myFoodora.getMarkupPercentage()+myFoodora.getDeliveryCost()*numberOfOrder); + } + +} diff --git a/src/User/Courrier.java b/src/User/Courrier.java deleted file mode 100644 index 068aabe0671b38841f6baaf257e5148a6b264d74..0000000000000000000000000000000000000000 --- a/src/User/Courrier.java +++ /dev/null @@ -1,59 +0,0 @@ -package User; - -import Core.MyFoodora; -import Others.Adress; -import Others.Position; - -public class Courrier extends HumanUser { - - private Position position; - private long nbOfLivraison; - private boolean available; - - - public Courrier(long phoneNumber, String name, String username, String mail, String password, - Adress adress, boolean activated, String birthdayDate, String surname,Position position, boolean available) { - super(phoneNumber, name, username, mail, password, adress, activated, birthdayDate, surname); - this.position = position; - this.nbOfLivraison = 0; - this.available = available; - } - - - public Position getPosition() { - return position; - } - - - public void setPosition(Position position) { - this.position = position; - } - - - public long getNbOfLivraison() { - return nbOfLivraison; - } - - - public void setAvailable(boolean available) { - this.available = available; - } - - public void register(MyFoodora foodora){ - - } - - public void unregister(MyFoodora foodora){ - - } - - public void acceptDelivery(){ - - } - - public void refuseDelivery(){ - - } - - -} diff --git a/src/User/ListUser.java b/src/User/ListUser.java index daf3392bd877c6b1540c5167b5d8cc44fa66d8bb..6f5ca36125c90854983e5dca9c39c2dfa5790df9 100644 --- a/src/User/ListUser.java +++ b/src/User/ListUser.java @@ -1,21 +1,32 @@ package User; import java.util.ArrayList; +import java.util.Collections; +import java.util.List; - +public class ListUser<T extends User>{ + private ArrayList<T> listUser = new ArrayList<T>(); + /** CUSTOM **/ - public class ListUser<T>{ - private ArrayList<T> listUser = new ArrayList<T>(); - - public void addUser(T e){ - listUser.add(e); - } - public void removeUser(int id){ - // todo - } - public ArrayList<T> getList(){ - return listUser; + public boolean isContainingCorrectLogin(String username, String password){ + for(User u : listUser){ + if(u.isLoginCorrect(username,password)) + return true; } + return false; + } + public void addUser(T e){ + listUser.add(e); + } + public void removeUser(int id){ + // todo + } + + /** GETTER & SETTER **/ + + public ArrayList<T> getList(){ + return listUser; } +} \ No newline at end of file diff --git a/src/User/User.java b/src/User/User.java index d0f6817ab23ea7fcb6f52550c4cbd7609c98ba72..eaff9e79a5588819fcf0f1bc3f697902f4304bf1 100644 --- a/src/User/User.java +++ b/src/User/User.java @@ -2,26 +2,41 @@ package User; import Others.Adress; import java.io.*; -import java.lang.*; import java.util.*; +import Cli.Input; import Core.MyFoodora; +import Order.HistoricOrder; -public abstract class User { - +public abstract class User implements Comparable<User> { protected long id; private long phoneNumber; private String name,username,mail,password; private Adress adress; private boolean activated; + private HistoricOrder historic; + private boolean isLogged; + private int typeOfUser; + + public static final int UNKNOWN = 0; + public static final int COURIER = 1; + public static final int RESTAURANT = 2; + public static final int CUSTOMER = 3; + public static final int MANAGER = 4; + + /** CONSTRUCTOR **/ public User(long phoneNumber, String name, String username, String mail, String password, Adress adress, boolean activated) { super(); IDUser idUser = IDUser.getInstance(); this.id = idUser.getNextSerialNumber(); + this.historic = new HistoricOrder(); + this.isLogged = false; + this.typeOfUser = 0; + this.phoneNumber = phoneNumber; this.name = name; this.username = username; @@ -31,93 +46,95 @@ public abstract class User { this.activated = activated; } - + /** CUSTOM **/ + + public void register(MyFoodora foodora){ + String usernameTest = Input.string("Please writte your username"); + String passwordTest = Input.string("Please writte your password"); + this.typeOfUser = foodora.getTypeOfUser(usernameTest, passwordTest); + if(this.typeOfUser == User.UNKNOWN){ + this.isLogged=false; + }else{ + this.isLogged=true; + } + } + public boolean isLoginCorrect(String username, String password) { + if(this.username == username && this.password == password) + return true; + return false; + } + + /** OVERRIDE **/ + + @Override + public int compareTo(User u){ + return username.compareTo(u.getUsername()); + } + + @Override + public String toString() { + return "User [id=" + id + ", phoneNumber=" + phoneNumber + ", name=" + name + ", username=" + username + + ", mail=" + mail + ", password=" + password + ", adress=" + adress + ", activated=" + activated + "]"; + } + + /** GETTER & SETTER **/ + public long getId() { return id; } - - - + + public HistoricOrder getHistoricOrder() { + return historic; + } + + public boolean isLogged(){ + return this.isLogged; + } + public long getPhoneNumber() { return phoneNumber; } - - public void setPhoneNumber(long phoneNumber) { this.phoneNumber = phoneNumber; } - - + public String getName() { return name; } - - public void setName(String name) { this.name = name; } - - + public String getUsername() { return username; } - - public void setUsername(String username) { this.username = username; } - - + public String getMail() { return mail; } - - public void setMail(String mail) { this.mail = mail; } - - + public void setpassword(String password) { this.password = password; } - - + public Adress getAdress() { return adress; } - - public void setAdress(Adress adress) { this.adress = adress; } - - + public boolean isActivated() { return activated; } - - public void setActivated(boolean activated) { this.activated = activated; } - - - @Override - public String toString() { - return "User [id=" + id + ", phoneNumber=" + phoneNumber + ", name=" + name + ", username=" + username - + ", mail=" + mail + ", password=" + password + ", adress=" + adress + ", activated=" + activated + "]"; - } - - public void register(MyFoodora foodora){ - System.out.println("Please writte your username"); - Scanner sc = new Scanner(System.in); - String usernametest = sc.nextLine(); - System.out.println("Please enter your password"); - String passwordtest = sc.nextLine(); - - } - - }