text stringlengths 3 1.18M |
|---|
package is.client;
import is.client.controller.ClientController;
/**
* User: aspr0
* Date: 01.04.12
* Time: 2:35
*/
public class Main
{
private static ClientController controller;
public static ClientController getController()
{
return controller;
}
public static void main(String[] ... |
package is.client;
/**
* Server locale constants class
*
* @author aspr0
*/
public class Locale
{
// public static final String = "";
public static final String WARN_UNIQUE_CHECK_FAILED = "Such name already exists";
public static final String WARN_ROW_NOT_FOUND = "Department or boss does not exist"... |
package is.client.ui;
import java.util.Comparator;
/**
* @author aspr0
* Date: 31.05.12
* Time: 17:11
*/
public class TableComparator implements Comparator<String>
{
private boolean comparingNumberValues;
public TableComparator(int sectionNum, int colNum)
{
switch (sectionNum... |
package is.client.ui;
import is.client.Locale;
import is.client.controller.command.*;
import is.common.exception.ImpossibleException;
import is.common.exception.NumberFormatInsteadRuntimeException;
import is.common.interfaces.mvc.UserInterface;
import is.common.util.Regex;
import javax.swing.*;
import javax.swing.eve... |
package is.client.controller.command;
import is.client.Main;
import is.common.interfaces.Command;
import java.io.IOException;
/**
* @author aspr0
* Date: 12.05.12
* Time: 16:26
*/
public class FindCommand implements Command
{
private String[] masks;
private int sectionNum;
public Fin... |
package is.client.controller.command;
import is.client.Locale;
import is.client.Main;
import is.common.exception.RowNotFoundException;
import is.common.exception.UniqueCheckFailedException;
import is.common.interfaces.Command;
import java.io.IOException;
/**
* @author aspr0
* Date: 26.04.12
* Time... |
package is.client.controller.command;
import is.client.Main;
import is.common.interfaces.Command;
import java.io.IOException;
/**
* @author aspr0
* Date: 12.05.12
* Time: 21:51
*/
public class ListCommand implements Command
{
private int sectionNum;
public ListCommand(int sectionNum)
... |
package is.client.controller.command;
import is.client.Locale;
import is.client.Main;
import is.common.exception.DroppingNonEmptyDepartmentException;
import is.common.interfaces.Command;
import java.io.IOException;
/**
* @author aspr0
* Date: 16.05.12
* Time: 14:16
*/
public class DropCommand imp... |
package is.client.controller.command;
import is.client.Locale;
import is.client.Main;
import is.common.exception.RowNotFoundException;
import is.common.exception.UniqueCheckFailedException;
import is.common.interfaces.Command;
import java.io.IOException;
/**
* @author aspr0
* Date: 16.05.12
* Time... |
package is.client.controller.command;
import is.client.Main;
import is.common.interfaces.Command;
import java.io.IOException;
import java.net.SocketException;
/**
* @author aspr0
* Date: 22.05.12
* Time: 2:48
*/
public class ConnectionLostCommand implements Command
{
@Override
public void... |
package is.client.controller.command;
import is.client.Locale;
import is.client.Main;
import is.common.interfaces.Command;
import java.io.IOException;
import java.net.ConnectException;
import java.net.UnknownHostException;
/**
* @author aspr0
* Date: 26.04.12
* Time: 5:51
*/
public class ConnectC... |
package is.client.controller.command;
import is.client.Main;
import is.common.interfaces.Command;
import java.io.IOException;
/**
* @author aspr0
* Date: 29.04.12
* Time: 5:48
*/
public class DisconnectCommand implements Command
{
@Override
public void execute()
{
try
... |
package is.client.controller.command;
import is.client.Main;
import is.common.interfaces.Command;
/**
* @author aspr0
* Date: 07.04.12
* Time: 21:47
*/
public class QuitCommand implements Command
{
public void execute()
{
Main.getController().deactivate();
}
}
|
package is.client.controller;
import is.client.model.ClientModel;
import is.client.ui.Gui;
import is.common.interfaces.mvc.Controller;
import java.io.IOException;
/**
* @author aspr0
*/
public class ClientController implements Controller
{
private Gui userInterface;
private ClientModel model;
public C... |
package is.client.model;
import is.client.controller.command.ConnectionLostCommand;
import is.common.datatype.Request;
import is.common.exception.DroppingNonEmptyDepartmentException;
import is.common.exception.RowNotFoundException;
import is.common.exception.UniqueCheckFailedException;
import is.common.interfaces.mvc.... |
package is.server;
/**
* Holds server configuration defaults
* <p/>
* User: aspr0
* Date: 01.04.12
* Time: 4:47
*/
public class Conf
{
public static final int PORT = 10000;
public static final int CONTROL_PORT = 10001;
public static final String XSD_SCHEMA_FILE_NAME = "schema.xsd";
}
|
package is.server;
import is.server.controller.ServerController;
/**
* User: aspr0
* Date: 01.04.12
* Time: 2:35
*/
public class Main
{
private static ServerController controller;
public static ServerController getController()
{
return controller;
}
public static void main(String[] a... |
package is.server;
/**
* Server locale constants class
*
* @author aspr0
*/
public class Locale
{
/**
* Root's session command line invitation
*/
public static final String INVITATION_ROOT = "# ";
public static final String INFO_STOPPING_SERVER = "Closing sockets, stopping server...";
p... |
package is.server.ui;
import is.common.interfaces.mvc.UserInterface;
import is.server.Locale;
import is.server.controller.session.local.LocalSessionThread;
import java.io.PrintStream;
/**
* CLI functionality for use in command calls.
*
* @author aspr0
* Date: 02.04.12
* Time: 0:59
*/
public cla... |
package is.server.controller;
import is.common.interfaces.mvc.Controller;
import is.server.Locale;
import is.server.controller.session.local.command.OpenCommand;
import is.server.model.ServerModel;
import is.server.ui.Cli;
import javax.xml.transform.TransformerException;
import java.io.IOException;
/**
* @author as... |
package is.server.controller.session.local;
import is.common.interfaces.Command;
import is.common.interfaces.DeactivationNeededThread;
import is.common.util.Regex;
import is.server.Main;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Provides user session console ... |
package is.server.controller.session.local.command;
import is.common.interfaces.Command;
import is.server.Conf;
import is.server.Locale;
import is.server.Main;
import java.io.IOException;
import java.net.ConnectException;
import java.net.UnknownHostException;
/**
* @author aspr0
* Date: 06.04.12
* ... |
package is.server.controller.session.local.command;
import is.common.exception.RowNotFoundException;
import is.common.exception.RowsAreaIncorrectException;
import is.common.interfaces.Command;
import is.server.Main;
/**
* @author aspr0
* Date: 06.04.12
* Time: 23:07
*/
public class ListCommand imp... |
package is.server.controller.session.local.command;
import is.common.interfaces.Command;
import is.server.Conf;
import is.server.Main;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import j... |
package is.server.controller.session.local.command;
import is.common.interfaces.Command;
import is.server.Main;
/**
* @author aspr0
* Date: 07.04.12
* Time: 21:47
*/
public class QuitCommand implements Command
{
public void execute()
{
Main.getController().deactivate();
}
}
|
package is.server.controller.session.local.command;
import is.server.Locale;
import is.server.Main;
import is.common.interfaces.Command;
/**
* @author aspr0
* Date: 06.04.12
* Time: 23:07
*/
public class UnknownCommand implements Command
{
public void execute()
{
Main.getController... |
package is.server.controller.session.local;
import is.common.interfaces.Command;
import is.common.syntax.CommandQualifier;
import is.server.controller.session.local.command.*;
import java.util.Arrays;
/**
* Factory returns commands according to user input.
*
* @author aspr0
* Date: 07.04.12
* Ti... |
package is.server.controller.session.remote.command;
import is.common.interfaces.Command;
import is.common.util.ObjectStreamer;
import is.server.Main;
import org.w3c.dom.Document;
import java.io.IOException;
/**
* @author aspr0
* Date: 30.05.12
* Time: 3:41
*/
public class ConcatCommand implement... |
package is.server.controller.session.remote.command;
import is.common.datatype.Request;
import is.common.exception.RowNotFoundException;
import is.common.interfaces.Command;
import is.common.util.ObjectStreamer;
import is.server.Main;
import java.io.IOException;
/**
* @author aspr0
* Date: 01.05.12
* ... |
package is.server.controller.session.remote.command;
import is.common.datatype.Request;
import is.common.exception.RowNotFoundException;
import is.common.exception.UniqueCheckFailedException;
import is.common.interfaces.Command;
import is.common.syntax.TransactionStatus;
import is.common.util.ObjectStreamer;
import is... |
package is.server.controller.session.remote.command;
import is.common.datatype.Request;
import is.common.interfaces.Command;
import is.common.util.ObjectStreamer;
import is.server.Main;
import java.io.IOException;
/**
* @author aspr0
* Date: 01.05.12
* Time: 3:53
*/
public class ListHeaderCommand... |
package is.server.controller.session.remote.command;
import is.common.datatype.Request;
import is.common.exception.DroppingNonEmptyDepartmentException;
import is.common.interfaces.Command;
import is.common.syntax.TransactionStatus;
import is.common.util.ObjectStreamer;
import is.server.Main;
import java.io.IOExceptio... |
package is.server.controller.session.remote.command;
import is.common.datatype.Request;
import is.common.exception.RowNotFoundException;
import is.common.exception.UniqueCheckFailedException;
import is.common.interfaces.Command;
import is.common.syntax.TransactionStatus;
import is.common.util.ObjectStreamer;
import is... |
package is.server.controller.session.remote.command;
import is.common.datatype.Request;
import is.common.exception.RowNotFoundException;
import is.common.exception.RowsAreaIncorrectException;
import is.common.interfaces.Command;
import is.common.util.ObjectStreamer;
import is.server.Main;
import java.io.IOException;
... |
package is.server.controller.session.remote.command;
import is.common.interfaces.Command;
import is.server.Locale;
import is.server.Main;
/**
* @author aspr0
* Date: 01.05.12
* Time: 3:53
*/
public class UnknownCommand implements Command
{
@Override
public void execute()
{
Mai... |
package is.server.controller.session.remote;
import is.common.datatype.Request;
import is.common.interfaces.Command;
import is.common.interfaces.DeactivationNeededThread;
import is.common.util.ObjectStreamer;
import java.io.EOFException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Obj... |
package is.server.controller.session.remote;
import is.common.datatype.Request;
import is.common.interfaces.Command;
import is.common.syntax.CommandQualifier;
import is.common.util.ObjectStreamer;
import is.server.controller.session.remote.command.*;
/**
* Factory returns commands according to user input.
*
* @aut... |
package is.server.model;
import is.common.datatype.Request;
import is.common.exception.DroppingNonEmptyDepartmentException;
import is.common.exception.RowNotFoundException;
import is.common.exception.RowsAreaIncorrectException;
import is.common.exception.UniqueCheckFailedException;
import is.common.interfaces.mvc.Mode... |
package is.server.model.xtool;
import is.common.exception.RowNotFoundException;
import is.common.exception.RowsAreaIncorrectException;
import is.common.exception.UniqueCheckFailedException;
import is.common.interfaces.SectionAdapter;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* @author aspr0
* ... |
package is.server.model.xtool;
import is.common.exception.DroppingNonEmptyDepartmentException;
import is.common.exception.RowNotFoundException;
import is.common.exception.RowsAreaIncorrectException;
import is.common.exception.UniqueCheckFailedException;
import is.common.util.Compressor;
import org.w3c.dom.Document;
im... |
package is.server.model.xtool;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
/**
* @author aspr0
* Date: 01.06.12
* Time: 16:03
*/
public class ParseErrorHandler implements ErrorHandler
{
@Override
public void warning(SAXParseExcept... |
package is.server.model.xtool;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.Arrays;
/**
* @author aspr0
* Date: 27.05.12
* Time: 0:15
*/
public class ConcatDupless
{
private Document dbDoc;
NodeList sections;
NodeList sectionsAlie... |
package is.server.model.xtool;
import is.common.exception.RowNotFoundException;
import is.common.interfaces.SectionAdapter;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
* Resolving dependencies
*
* @author aspr0
* Date: 18.04.12
* ... |
package is.server.model.xtool;
import is.common.interfaces.SectionAdapter;
import is.common.util.Regex;
import is.common.exception.DroppingNonEmptyDepartmentException;
import is.common.exception.RowNotFoundException;
import is.common.exception.RowsAreaIncorrectException;
import org.w3c.dom.Node;
import org.w3c.dom.Nod... |
package is.server.model.xtool;
import is.common.exception.DroppingNonEmptyDepartmentException;
import is.common.exception.RowNotFoundException;
import is.common.exception.RowsAreaIncorrectException;
import is.common.exception.UniqueCheckFailedException;
import is.common.interfaces.SectionAdapter;
import is.common.util... |
package is.server.model.xtool;
/**
* @author aspr0
* Date: 20.05.12
* Time: 19:01
*/
public class Name
{
public static class Tag
{
public static final String root = "section";
public static final String row = "row";
public static class Employee
{
... |
package is.server.model;
import is.common.interfaces.DeactivationNeededThread;
import is.server.controller.session.remote.RemoteSessionThread;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.SocketException;
import java.util.LinkedList;
/**
* @author aspr0
* Date: 26.04.12
* ... |
package is.common.interfaces.mvc;
/**
* UI functions unification
*
* @author aspr0
* Date: 05.04.12
* Time: 16:27
*/
public interface UserInterface
{
/**
* @param msg message
* @param subs substrings inserted instead of %s markers in msg
*/
public void exposeInfoMsg(String... |
package is.common.interfaces.mvc;
/**
* Controller doesn't throw exceptions, all of them should be caught here or in commands.
*
* @author aspr0
* Date: 26.04.12
* Time: 5:41
*/
public interface Controller
{
public UserInterface getUserInterface();
public Model getModel();
}
|
package is.common.interfaces.mvc;
import is.common.exception.DroppingNonEmptyDepartmentException;
import is.common.exception.RowNotFoundException;
import is.common.exception.RowsAreaIncorrectException;
import is.common.exception.UniqueCheckFailedException;
import java.io.IOException;
/**
* @author aspr0
* ... |
package is.common.interfaces;
/**
* @author aspr0
* Date: 06.04.12
* Time: 23:06
*/
public interface Command
{
public void execute();
}
|
package is.common.interfaces;
import is.common.exception.DroppingNonEmptyDepartmentException;
import is.common.exception.RowNotFoundException;
import is.common.exception.UniqueCheckFailedException;
import is.common.exception.RowsAreaIncorrectException;
import org.w3c.dom.Node;
/**
* Base methods for section adapters... |
package is.common.interfaces;
import java.io.IOException;
/**
* @author aspr0
* Date: 09.04.12
* Time: 14:47
*/
public interface DeactivationNeededThread
{
public void deactivate() throws IOException;
}
|
package is.common.exception;
/**
* @author aspr0
* Date: 01.05.12
* Time: 12:38
*/
public class RowsAreaIncorrectException extends Exception
{
}
|
package is.common.exception;
/**
* @author aspr0
* Date: 17.05.12
* Time: 23:48
*/
public class DroppingNonEmptyDepartmentException extends Exception
{
}
|
package is.common.exception;
/**
* @author aspr0
* Date: 13.05.12
* Time: 15:38
*/
public class UniqueCheckFailedException extends Exception
{
}
|
package is.common.exception;
/**
* @author aspr0
* Date: 12.05.12
* Time: 16:58
*/
public class ImpossibleException extends RuntimeException
{
public ImpossibleException(String s)
{
super(s);
}
}
|
package is.common.exception;
/**
* @author aspr0
* Date: 13.05.12
* Time: 18:58
*/
public class NumberFormatInsteadRuntimeException extends Exception
{
}
|
package is.common.exception;
/**
* @author aspr0
* Date: 10.05.12
* Time: 14:31
*/
public class RowNotFoundException extends Exception
{
}
|
package is.common.watchdog;
import is.common.interfaces.Command;
import is.common.interfaces.DeactivationNeededThread;
import is.common.util.ObjectStreamer;
import java.io.EOFException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java... |
package is.common.watchdog;
import is.common.interfaces.DeactivationNeededThread;
import is.common.util.ObjectStreamer;
import java.io.EOFException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.net.SocketException;
/**
* @author... |
package is.common.watchdog;
import is.common.interfaces.DeactivationNeededThread;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.LinkedList;
/**
* @author aspr0
* Date: 27.04.12
* Time: 22:45
*/
public class WatchdogServerThread extends WatchdogAbstractThread implement... |
package is.common.watchdog;
import is.common.util.ObjectStreamer;
/**
* @author aspr0
* Date: 27.04.12
* Time: 22:46
*/
public abstract class WatchdogAbstractThread extends Thread
{
protected ObjectStreamer objectStreamer;
/**
* if server don't respond in pollTimeout millis it's offli... |
package is.common.datatype;
import java.io.Serializable;
/**
* @author aspr0
* Date: 16.05.12
* Time: 14:24
*/
public class Request implements Serializable
{
private String commandQualifier;
private int sectionNum;
private String[] data;
public Request(String commandQualifier)
... |
package is.common.syntax;
/**
* @author aspr0
* Date: 14.05.12
* Time: 14:42
*/
public class TransactionStatus
{
public static final String TRANSACTION_OK = "tOk";
public static final String TRANSACTION_FAILED_UNIQUE_CHECK = "tFailedUC";
public static final String TRANSACTION_FAILED_ROW... |
package is.common.syntax;
/**
* @author aspr0
* Date: 05.05.12
* Time: 10:17
*/
public class CommandQualifier
{
public static final String QUIT = "q";
public static final String OPEN = "o";
public static final String CONCAT = "c";
public static final String ADD = "a";
public s... |
package is.common.util;
import is.common.datatype.Request;
import org.w3c.dom.Document;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
/**
* @author aspr0
* Date: 02.05.12
* Time: 5:35
*/
public class ObjectStreamer
{
private ObjectInputStream... |
package is.common.util;
import java.util.regex.Pattern;
/**
* @author aspr0
* Date: 21.04.12
* Time: 19:27
*/
public class Regex
{
public static boolean stringMatches(String stringToCheck, String checkMask)
{
Pattern checkMaskPattern = Pattern.compile(checkMask);
return che... |
package is.common.util;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
/**
* Holds static compressing and uncompressing operations.
*
* @author aspr0
*/
public class Compressor
{
/**
* @para... |
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
public class ConnectMenu extends JMenuBar{
// Don't change
private static final long serialVersionUID = 8120173... |
public class Column {
int _numRows;
int _numPieces;
Tile[] _row;
Column _left;
Column _right;
Board _board;
Error addPiece(Player player) {
if (_numPieces < _numRows) {
_row[_numPieces].SetPlayer(player);
_board._lastTile = _row[_numPieces];
++_numPieces;
return Error.SUCCESS;
}... |
import java.util.Arrays;
public class Node {
Node[] _child;
Board _board;
byte[] _moves;
Player alternatePlayer(Player player) {
if (player == Player.ONE) {
return Player.TWO;
} else {
return Player.ONE;
}
}
int getValue(Player player) {
int removePieces = 0;
int[] removeMo... |
import java.awt.event.MouseListener;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class GameOverPanel extends JPanel {
// Don't change
private static final long serialVersionUID = 5846962362948417488L;
JLabel label1 = new JLabel("The game is over");
JLabel label2 = new JLabel("Don... |
import java.awt.event.MouseListener;
import javax.swing.*;
// Display something when program starts.
// click to continue
public class WelcomePanel extends JPanel {
// Don't change
private static final long serialVersionUID = -8306816261060042328L;
JLabel Title = new JLabel("CONNECT4");
JLabel... |
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.zip.DataFormatException;
import javax.management.NotificationListener;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
impo... |
import java.awt.Point;
import java.awt.geom.*;
public class Tile extends Area {
Tile _left;
Tile _right;
Tile _top;
Tile _bottom;
int _column;
int _row;
private Rectangle2D.Double Square;
private Ellipse2D.Double Circle;
Area Center;
private Player _player = Player.NONE;
public Tile(double ... |
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.management.NotificationListener;
import javax.swing.*;
import java.awt.event.ActionEvent;
public class GamePanel extends JPanel {
// Don't change
private static ... |
public enum Error {
SUCCESS, COLUMN_NOT_ENOUGH_SPACE, WRONG_PLAYER, CHECK_GAMESTATE
}
|
public class Tree {
Node _Root = null;
Board _Board;
int _value;
boolean error;
int _Depth;
Player _Player;
Tree (Board board, Player player, int depth, int move) {
_Board = board;
_Depth = depth;
_Player = player;
generateTree(move);
}
int alphabeta(Node node, int depth, int a, in... |
public enum GameStateEnum {
PLAYER_1_TURN, PLAYER_2_TURN, DRAW, PLAYER_1_WIN, PLAYER_2_WIN
}
|
public class GameState {
Board _board;
int _4Count;
int _3Count;
int _2Count;
int _1Count;
GameStateEnum _GameStateEnum = GameStateEnum.PLAYER_1_TURN;
GameState(Board board) {
_board = board;
}
GameStateEnum alternatePlayerTurn() {
if (_GameStateEnum == GameStateEnum.PLAYER_1_TURN) {
... |
public enum Player {
NONE, ONE, TWO
}
|
import java.awt.Point;
public class Board {
int _numRows;
int _numColumns;
int _numPieces;
int _maxPieces;
double wlength; //side width of tile
double hlength; //side height of tile
double LeftX;
double TopY;
Point TopRight;
Point BottomLeft;
int _boardWidth;
int _boardHeight;
Column[] ... |
import javax.management.Notification;
import javax.management.NotificationListener;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
public class ConnectWindow extends JFrame {
// Don't change
private static final long serialVersionUID = -840... |
package ModelLayer;
public class Product
{
private int productNumber;
private int serialNumber;
private String productName;
private Double purchasePrice;
private Double salesPrice;
private Double rentPrice;
private String countryOfOrigin;
private String fabricant;
private String description;
private Strin... |
package ModelLayer;
public class Store
{
private String adress;
private int phoneNumber;
private int zipcode;
private String email;
//Empty constructor
public Store()
{
}
//Constructor which takes; phonenumber, adress, zipcode and email as a parameter
public Store(int phoneNumber, String ... |
package ModelLayer;
public class Person
{
private String name;
private String adress;
private int zipCode;
private String city;
private int phoneNumber;
private String email;
//Empty Constructor
public Person()
{
}
//Constructer which takes; name, adress, zipcode, city, phonenumber and ema... |
package ModelLayer;
public class Tire extends Product {
private String tireType;
private String tireSize;
//Constructor which catches the superclass
public Tire()
{
super(0, 0, "", 0, 0, 0, "", "", "", "", 0, 0, 0);
}
//Constructor which builds the object
public Tire(int productNumber, int... |
package ModelLayer;
public class Amount
{
private int pAmount;
//Constructor which takes amount as a parameter
public Amount(int pAmount)
{
this.pAmount = pAmount;
}
//Returns the amount
public int getPAmount()
{
return pAmount;
}
//Sets the amount
public void setPAmount(int pAm... |
package ModelLayer;
public class BrakeDisc extends Product
{
private String discType;
//Constructor which catches the superclass
public BrakeDisc()
{
super(0, 0, "", 0, 0, 0, "", "", "", "", 0, 0, 0);
}
//Constructor which builds the onbject
public BrakeDisc(int productNumber, int se... |
package ModelLayer;
public class SalesOrderLine
{
private int amount;
private int salesLineId;
private Product product;
private Store store;
private SalesOrder sale;
//Empty Constructor
public SalesOrderLine()
{
}
//Constructor which takes; amount, product and store as a parameter
... |
package ModelLayer;
import java.util.ArrayList;
public class Employee extends Person
{
private String jobType;
private ArrayList<SalesOrder> salesOrder;
//Constructor which returns the superclass values
public Employee()
{
super("","",0,"",0,"");
}
//Constructor which takes; name, adress, ... |
package ModelLayer;
import java.util.ArrayList;
public class Supplier
{
private int supplierId;
private String supplierName;
private String country;
private int phoneNumber;
private String email;
private ArrayList<Product> products;
//Empty constructor
public Supplier()
{
}
//Con... |
package ModelLayer;
import java.util.ArrayList;
public class SalesOrder
{
private int saleId;
private String orderType;
private String date;
private String deliveryStatus;
private String deliveryDate;
private Customer customer;
private Employee employee;
private ArrayList<SalesOrderLine> sols;
p... |
package ModelLayer;
public class Headlights extends Product
{
private String lightsType;
//Constructor which catches the superclass
public Headlights()
{
super(0, 0, "", 0, 0, 0, "", "", "", "", 0, 0, 0);
}
//Constructor which builds the object
public Headlights(int productNumber, int serial... |
package ModelLayer;
import java.util.ArrayList;
public class Customer extends Person
{
private String customerType;
private String companyName;
private int CVRnr;
private ArrayList<SalesOrder> salesOrder;
//Constructor which returns the superclass values
public Customer()
{
super("","",0,"",0,"... |
package ModelLayer;
import java.util.ArrayList;
public class Invoice
{
private int invoiceId;
private String paymentDate;
private double totalPrice;
private Employee employee;
private ArrayList<SalesOrder> salesOrders;
//Constructor which takes; invoiceId, payment date, total price and employee a... |
package ModelLayer;
public class Glass extends Product
{
private String height;
private String width;
private String thickness;
//Constructor which catches the superclass
public Glass()
{
super(0, 0, "", 0, 0, 0, "", "", "", "", 0, 0, 0);
}
//Constructor which builds the object
public Gl... |
package ModelLayer;
public class Gearbox extends Product
{
private String gearboxType;
private int gearAmount;
//Constructor which catches the superclass attributes
public Gearbox()
{
super();
}
//Constructor which builds the gearbox object
public Gearbox(int productNumber, int serialNu... |
package TestPackage;
import static org.junit.Assert.*;
import java.sql.Connection;
import java.util.ArrayList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import DBLayer.*;
import ModelLayer.*;
public class DBProductTest {
private DBProduct dbProduct;
@Before
pub... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.