text
stringlengths
3
1.18M
/* * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free ...
/* * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1996, 1999, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1995, 1997, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1995, 1999, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1996, 1997, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1995, 1999, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free ...
/* * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free ...
/* * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1999, 2002, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1995, 2007, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
/* * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the...
// Copyright 2012 Google Inc. All Rights Reserved. package com.example.android.notepad; import android.app.Service; import android.content.Intent; import android.os.IBinder; /** * Service for the DriveSyncAdapter. */ public class DriveSyncService extends Service { private static final Object sSyncAdapterLock = ...
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
// Copyright 2012 Google Inc. All Rights Reserved. package com.example.android.notepad; import android.app.Activity; import android.app.LoaderManager; import android.app.ProgressDialog; import android.content.ContentValues; import android.content.CursorLoader; import android.content.Loader; import android.database.Cu...
// Copyright 2012 Google Inc. All Rights Reserved. package com.example.android.notepad; import android.accounts.Account; import android.content.AbstractThreadedSyncAdapter; import android.content.ContentProviderClient; import android.content.Context; import android.content.SyncResult; import android.os.Bundle; /** ...
// Copyright 2012 Google Inc. All Rights Reserved. package com.example.android.notepad; import com.google.android.gms.auth.GoogleAuthUtil; import com.google.android.gms.common.AccountPicker; import com.google.api.client.googleapis.extensions.android.accounts.GoogleAccountManager; import android.accounts.Account; imp...
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
// Copyright 2012 Google Inc. All Rights Reserved. package com.example.android.notepad; import com.google.android.gms.auth.UserRecoverableAuthException; import com.google.api.client.extensions.android.http.AndroidHttp; import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential; import...
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
/* * Copyright (c) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
/* * Copyright (c) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
/* * Copyright (c) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
/* * Copyright (c) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
/* * Copyright (c) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
/* * Copyright (c) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
/* * Copyright (c) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
/* * Copyright (c) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Message; import java.io.Serializable; import java.util.ArrayList; /** * * @author workshop */ public class QueryMessage implements Serializable{ // from client side public int queryTy...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Message; import java.io.Serializable; /** * * @author liyuchen */ public class LoginMessage implements Serializable{ /* enter from client side */ public String username; public Strin...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ExcelAccess; import java.io.File; import java.io.FileOutputStream; import java.util.ArrayList; import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.FontUnderline; import ...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ExcelAccess; import java.io.File; /** * * @author User */ public class AllocateFile { public static File GetFile(String fileName,String fileExtension, File parentDir){ if(!parentDir...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ExcelAccess; /** * * @author User */ public class ExcelFormat { public static String[] objectsFields = {"Object","Ordernumber","Client","Vessel","Equipment","Year Built"}; public static St...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package GUI; import ExcelAccess.AllocateFile; import ExcelAccess.ExcelExporter; import ExcelAccess.ExcelFormat; import Message.LoginMessage; import Message.QueryMessage; import java.awt.BorderLayout; import java.awt.Col...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package GUI; /** * * @author Zhilin */ public class PasswordVerifier { private static final int SUCCESS = 0; private static final int LENGTH_PROBLEM = 1; private static final int NOT_CONTAIN_...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package GUI; import java.awt.Color; import java.awt.Component; import java.awt.Font; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JTable; import javax.swing.JTextArea; ...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package GUI; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JComboBox; import javax.swing.JPanel; /** * * @author Zhilin */ public class DatePickerEventLis...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package GUI; /** * * @author Zhilin */ public class SecurityLevel { final public static int ADMIN= 0; final public static int MANAGER = 1; final public static int COMMITOR = 2; final pub...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Control; import Database.DB; import ExcelAccess.ExcelFormat; import ExcelAccess.ExcelHandler; import Message.LoginMessage; import Message.QueryMessage; import java.io.BufferedInputStream; import java...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Control; import Message.LoginMessage; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io....
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Control; import java.io.IOException; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; /** * * @author workshop */ public class CleanThread extends T...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Control; import java.awt.AWTException; import java.awt.Image; import java.awt.MenuItem; import java.awt.PopupMenu; import java.awt.SystemTray; import java.awt.Toolkit; import java.awt.TrayIcon; import java.awt.e...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Message; import ExcelAccess.ExcelFormat; import java.io.Serializable; import java.util.ArrayList; /** * * @author workshop */ public class QueryMessage implements Serializable{ // from cli...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Message; import java.io.Serializable; /** * * @author liyuchen */ public class LoginMessage implements Serializable{ /* enter from client side */ public String username; public Str...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ExcelAccess; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; impo...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package ExcelAccess; import java.util.ArrayList; import java.util.StringTokenizer; /** * * @author workshop */ public class ExcelFormat { public static String[] objectsFields = {"Object","Ordernumb...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package Database; import ExcelAccess.ExcelFormat; import Message.LoginMessage; import com.mysql.jdbc.Connection; import com.mysql.jdbc.Statement; import java.sql.DriverManager; import java.sql.ResultSet; imp...
/* * Project: Timeriffic * Copyright (C) 2009 ralfoide gmail com, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any l...
/* * Project: 24ClockWidget * Copyright (C) 2009 ralfoide gmail com, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) an...
/* * Project: 24ClockWidget * Copyright (C) 2009 ralfoide gmail com, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) an...
/* * Project: Timeriffic * Copyright (C) 2008 ralfoide gmail com, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any l...
/* * Project: 24ClockWidget * Copyright (C) 2009 ralfoide gmail com, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) an...
/* * Project: 24ClockWidget * Copyright (C) 2009 ralfoide gmail com, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) an...
/* * Project: 24ClockWidget * Copyright (C) 2009 ralfoide gmail com, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) an...
/* * Project: 24ClockWidget * Copyright (C) 2009 ralfoide gmail com, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) an...
package params; public enum Builder { FENDER, MARTIN, GIBSON, COLLINGS, OLSON, RYAN, PRS; @Override public String toString() { switch(this) { case FENDER: return "Fender"; case MARTIN: return "Martin"; case GIBSON: return "Gibson"; case COLLINGS: ret...
package params; public enum Type { ACOUSTIC, ELECTRIC; @Override public String toString() { switch(this) { case ACOUSTIC: return "Akustyczna"; case ELECTRIC: return "Elektryczna"; default: return "Inna"; } } }
package params; public enum Style { A, F; }
package params; public enum Wood { INDIAN_ROSEWOOD, BRAZILIAN_ROSEWOOD, MAHOGANY, MAPLE, HEBAN, OAK, EBONY, CEDAR, ALDER, SITKA; @Override public String toString() { switch (this) { case INDIAN_ROSEWOOD: return "palisander indyjski"; case BRAZILIAN_ROSEWOOD: return "pali...
import instruments.Instrument; import instruments.InstrumentType; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import params.*; import specification.InstrumentSpec; public class FindGuitarTester { public static void main(String[] args) { // Inicjalizacja zawa...
package instruments; import specification.InstrumentSpec; public class Instrument { private String serialNumber; private double price; private InstrumentSpec spec; public Instrument (String serial, double price, InstrumentSpec spec) { this.serialNumber = serial; this.price = price; ...
package instruments; public enum InstrumentType { GUITAR, BANJO, DOBRO, FIDDLE, BASS, MANDOLIN; @Override public String toString() { switch(this) { case GUITAR: return "Gitara"; case BANJO: return "Banjo"; case DOBRO: return "Dobro"; case FIDDLE: ret...
package specification; import java.util.HashMap; import java.util.Iterator; import java.util.Map; public class InstrumentSpec { private Map properties; public InstrumentSpec(Map properties) { if (properties == null) this.properties = new HashMap(); else this.properties = new HashMap(propertie...
import java.util.Iterator; import java.util.LinkedList; import java.util.List; import instruments.*; import specification.*; public class Inventory { private List inventory; public Inventory() { inventory = new LinkedList(); } public void addInstrument(String serialNumber, double price, InstrumentSpec s...
package inventory; import guitar.Guitar; import guitar.GuitarSpec; import java.util.Iterator; import java.util.LinkedList; import java.util.List; public class Inventory { private List guitars; public Inventory() { guitars = new LinkedList(); } public void addGuitar(String serial, double price...
package params; public enum Builder { FENDER, MARTIN, GIBSON, COLLINGS, OLSON, RYAN, PRS; @Override public String toString() { switch(this) { case FENDER: return "Fender"; case MARTIN: return "Martin"; case GIBSON: return "Gibson"; case COLLINGS: ret...
package params; public enum Type { ACOUSTIC, ELECTRIC; @Override public String toString() { switch(this) { case ACOUSTIC: return "Akustyczna"; case ELECTRIC: return "Elektryczna"; default: return "Inna"; } } }
package params; public enum Wood { INDIAN_ROSEWOOD, BRAZILIAN_ROSEWOOD, MAHOGANY, MAPLE, HEBAN, OAK, EBONY, CEDAR, ALDER, SITKA; @Override public String toString() { switch (this) { case INDIAN_ROSEWOOD: return "palisander indyjski"; case BRAZILIAN_ROSEWOOD: return "pali...
import guitar.Guitar; import guitar.GuitarSpec; import inventory.Inventory; import java.util.Iterator; import java.util.List; import params.*; public class FindGuitarTester { public static void main(String[] args) { Inventory inventory = new Inventory(); initializeInventory(inventory); Gui...
package guitar; public class Guitar { private String serialNumber; private double price; private GuitarSpec spec; public Guitar(String serial, double price, GuitarSpec spec) { this.serialNumber = serial; this.price = price; this.spec = spec; } public String getSerialNu...
package guitar; import params.*; public class GuitarSpec { private Builder builder; private String model; private Type type; private Wood backWood; private Wood topWood; private int numStrings; public GuitarSpec (Builder builder, String model, Type type, int numStrings, Wood bw, Wood tw) ...
import doors.BarkRecognizer; import doors.DogDoor; import remote.Remote; public class DogDoorSimulator { public static void main(String[] args) { DogDoor door = new DogDoor(); BarkRecognizer recognizer = new BarkRecognizer(door); Remote remote = new Remote(door); // Symulujemy, że ...
package doors; public class BarkRecognizer { private DogDoor door; public BarkRecognizer(DogDoor door) { this.door = door; } public void recognize(String bark) { System.out.println("Usłyszano " + bark); door.open(); } }
package doors; import java.util.Timer; import java.util.TimerTask; public class DogDoor { private boolean open; public DogDoor() { this.open = false; } public void open() { System.out.println("Drzwi otwarto."); open = true; final Timer timer = new Timer(); ti...
package remote; import doors.DogDoor; public class Remote { private DogDoor door; public Remote (DogDoor door) { this.door = door; } public void pressButton() { System.out.println("Naciśnięto przycisk."); if (door.isOpen() ) door.close(); else ...
import bark.Bark; import bark.BarkRecognizer; import doors.DogDoor; import remote.Remote; public class DogDoorSimulator { public static void main(String[] args) { DogDoor door = new DogDoor(); door.addAlowdedBark(new Bark("hauu")); door.addAlowdedBark(new Bark("Hrauu")); door.addAl...
package bark; public class Bark { private String sound; public Bark(String sound) { this.sound = sound; } public String getSound() { return this.sound; } @Override public boolean equals(Object bark) { if (bark instanceof Bark) { Bark otherBark = (Bark)...
package bark; import doors.DogDoor; import java.util.Iterator; import java.util.LinkedList; public class BarkRecognizer { private DogDoor door; public BarkRecognizer(DogDoor door) { this.door = door; } public void recognize(Bark bark) { System.out.println("Usłyszano " + bark.getSound()); Linked...
package doors; import bark.Bark; import java.util.LinkedList; import java.util.Timer; import java.util.TimerTask; public class DogDoor { private boolean open; private LinkedList allowdedBarks; public DogDoor() { this.open = false; allowdedBarks = new LinkedList(); } public void o...
package remote; import doors.DogDoor; public class Remote { private DogDoor door; public Remote (DogDoor door) { this.door = door; } public void pressButton() { System.out.println("Naciśnięto przycisk."); if (door.isOpen() ) door.close(); else ...
import doors.DogDoor; import remote.Remote; public class DogDoorSimulator { public static void main(String[] args) { Remote remote = new Remote(new DogDoor()); System.out.println("Azor szczeka by wyjść na spacer."); remote.pressButton(); System.out.println("Azor wyszedł na spacer."...