text stringlengths 3 1.18M |
|---|
package com.techera.eventos.explorer;
import java.util.List;
public class Explorer<T> {
private String title = null;
private int total = 0;
private int rows = 10;
private ListProvider<T> listProvider = null;
public void loadList(int page, List<T> list) throws Exception {
total = listProvider.loadList(page... |
package com.techera.eventos.explorer;
import java.util.List;
public interface ListProvider<T> {
public int loadList(int page, int filas, List<T> list) throws Exception;
//public String getTitle() throws Exception;
}
|
package com.techera.eventos.explorer;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import com.techera.eventos.bean.DepartamentoBean;
import com.techera.eventos.bean.DistritoBean;
import com.techera.eventos.bean.OfertaBean;
import com.techera.eventos.bean.PaisBean;
import com.techera.even... |
package com.techera.eventos.explorer;
import java.util.Date;
import java.util.List;
import com.techera.eventos.bean.EventoBean;
import com.techera.eventos.service.EventoService;
public class EventosPorPeriodoProvider implements ListProvider<EventoBean> {
private EventoService eventosService = null;
private Da... |
package com.techera.eventos.explorer;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import com.techera.eventos.bean.DepartamentoBean;
import com.techera.eventos.bean.DistritoBean;
import com.techera.eventos.bean.PaisBean;
import com.techera.eventos.bean.ProvinciaBean;
import com.techera.e... |
package com.techera.eventos.explorer;
import java.text.SimpleDateFormat;
import java.util.LinkedList;
import java.util.List;
import com.techera.eventos.bean.DepartamentoBean;
import com.techera.eventos.bean.DiaFestivoBean;
import com.techera.eventos.bean.DistritoBean;
import com.techera.eventos.bean.PaisBean;
import ... |
package com.techera.eventos.action;
import java.util.LinkedList;
import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
import c... |
package com.techera.eventos.action;
import java.util.LinkedList;
import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
import c... |
package com.techera.eventos.action;
import java.util.LinkedList;
import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation... |
package com.techera.eventos.action;
import java.util.List;
import java.util.Map;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result... |
package com.techera.eventos.action;
import java.util.LinkedList;
import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation... |
package com.techera.eventos.action.interceptors;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class EmpresaRequerida extends AbstractInterceptor {
private static final long serialVersionUID = 1L;
@Override
public String intercept(ActionIn... |
package com.techera.eventos.action.interceptors;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import org.apache.commons.lang.ArrayUtils;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Abstract... |
package com.techera.eventos.action.interceptors;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class UsuarioRequerido extends AbstractInterceptor {
private static final long serialVersionUID = 1L;
@Override
public String intercept(ActionIn... |
package com.techera.eventos.action.interceptors;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class AllowOriginInterceptor extends AbstractInterce... |
package com.techera.eventos.action.interceptors;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.techera.eventos.bean.UsuarioBean;
public class AdministradorRequerido extends AbstractInterceptor {
private static final long serialVersionUID ... |
package com.techera.eventos.action.interceptors;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.apache.struts2.dispatcher.ServletActionRedirectResult;
import com.opensymphony.xwork2.ActionChainResult;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork... |
package com.techera.eventos.action.interceptors;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class PostOnlyInterceptor extends AbstractInterceptor... |
package com.techera.eventos.action.interceptors;
import java.util.Map;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONObject;
import net.sf.json.JSONSerializer;
import org.apache.struts2.ServletActionContext;
impo... |
package com.techera.eventos.action;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2... |
package com.techera.eventos.action;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.A... |
package com.techera.eventos.action;
import java.util.LinkedList;
import java.util.Map;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.interceptor.SessionAware;
imp... |
package com.techera.eventos.action;
import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
import com.techera.eventos.bean.Espec... |
package com.techera.eventos.action;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.strut... |
package com.techera.eventos.action;
import java.util.LinkedList;
import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
import c... |
package com.techera.eventos.util;
import java.io.File;
import java.io.StringWriter;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import com.techera.eventos.service.NotificacionService.TipoNotificadoBean;
import freemarker.template.Configurati... |
package com.techera.eventos.util;
//import java.net.InetAddress;
import java.net.InetAddress;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
import javax.mail.Address;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.... |
package client3g21cn.data;
import java.util.ArrayList;
import java.util.List;
public class SkinConfig {
protected String currentSkin;
protected List<String> skins;
public SkinConfig(){
skins=new ArrayList<String>();
currentSkin="default";
}
public String getCurrentSkin() {
return currentSkin;
... |
package client3g21cn.data;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import client3g21cn.util.SDCardManager;
public class UIConfig {
public static SkinConfig mSkinConfig=null;
p... |
package client3g21cn.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import android.os.Environment;
import android.util.Log;
public class SDCardManager {
public final static String ABSOLUTE_PATH=Environment.getExternalStorageDirectory(... |
package client3g21cn.main;
import android.os.Bundle;
import android.widget.ImageButton;
import client3g21cn.data.UIConfig;
public class HomeAct
extends BaseAct {
private ImageButton categ1_bt;
private ImageButton categ2_bt;
private ImageButton categ3_bt;
private ImageButton categ4_bt;
private ImageButton cate... |
package corpo;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Ma... |
package corpo;
import excecoes.ValorDesconhecidoException;
/**
* Cont�m os poss�veis valores que um usu�rio atribuir� a um estabelecimento para denotar sua qualidade. Cada valor possui seu inteiro correspondente, entre -5 e 5, e sua forma em String. Foram adicionados m�todos para facilitar a convers�o de um int... |
package corpo;
import excecoes.ValorDesconhecidoException;
/**
* A classe Estabelecimento � respons�vel por gerenciar as informa��es relevantes (nome, endere�o e tipo de servi�o) de um estabelecimento para o reposit�rio do programa.
*
* @author Pedro Augustus Diniz Falc�o Silva
*
*/
public class Est... |
package corpo;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import excecoes.ItemNaoContidoException;
/**
* Classe respons�vel por gerenciar as informa��es relevantes (nome, mapa de prefer�ncias e data de emiss�o das prefer�n... |
package excecoes;
import java.io.Serializable;
import java.util.MissingResourceException;
public class ItemNaoContidoException extends MissingResourceException implements Serializable {
public ItemNaoContidoException(String mensagem, String nomeDaClasse, String nomeDoItem) {
super(mensagem, nomeDaClasse, ... |
package excecoes;
import java.io.Serializable;
public class ValorDesconhecidoException extends IllegalArgumentException implements Serializable {
public ValorDesconhecidoException() {}
public ValorDesconhecidoException(String s) {
super(s);
}
public ValorDesconhecidoException(Throwable cause) {
... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation;
/**
*
* @author Panos
*/
public class RadioStation {
/**
* @param args the command li... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation_POJO;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
imp... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation_POJO;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.per... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation_POJO;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.per... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation_POJO;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import ... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation_POJO;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
imp... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation_POJO;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
imp... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation_POJO;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.per... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation_POJO;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.per... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation_POJO;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import ... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package radiostation_POJO;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import ... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package GUI;
/**
*
* @author Panos
*/
public class MainMenu extends javax.swing.JFrame {
/**
* Creates new form MainMenu
... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package GUI;
/**
*
* @author Panos
*/
public class R9_GroupAlbum_Management extends javax.swing.JFrame {
/**
* Creates ne... |
import java.io.*;
import java.net.*;
import java.util.ArrayList;
public class HW1 {
public static void main(String[]args) throws Exception {
//TODO: Maybe spin this into a separate method, return the stored arraylist; also maybe store a question number and filter accordingly in the initial reading
/*
Request t... |
/*
Michael Eng, mse2124
This class takes in a geographical coordinate pair and stores it as an lat, long tuple. If longitude is West, long is stored as a negative number. If latitude is South, lat is stored as a negative number.
*/
public class XYCoordinate {
private double lat;
private double longi;
... |
/*
Michael Eng, mse2124
COMS 4156 HW1 main class
Driver class that prompts the user to choose a question from HW1, then answers the user's question, prompting the user for necessary parameters.
*/
import java.io.*;
import java.net.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.It... |
package control;
import view.GameBoundary;
import view.Input;
import boundaryToMatador.GUI;
import model.*;
/**
* The GameController stores variable representing all players, the current player, startbonus and dices,
* it also offers methods to control the logic of our Matador game
* @author Group 20
*/
... |
package control;
import view.MenuBoundary;
/**
* The MenuController takes care of the menu in which the player decides whether the game should start
* or the program end.
*/
public class MenuController
{
/**
* Runs the menu
*/
public void start()
{
int menuChoise;
final int EXIT = 3;
M... |
package view;
/**
* MenuBoundary is the boundary that handles interaction with the player when the game first starts.
* @author Group 20
*
*/
public class MenuBoundary
{
/**
* The users choices in the menu when the game starts.
* @return the user input
*/
public int menu()
{
String inp... |
package view;
import model.CustomArray;
/**
* GameBoundary is the boundary that handles most interaction with the player
* @author Group 20
*/
public class GameBoundary
{
/**
* The car color choices
*/
String[] colorNames = {"Blue", "Green", "Red" , "Yellow", "White", "Black"};
/**
... |
package testMatador;
import model.*;
public class TestMatadorspil {
private Players players;
public void run()
{
resetPlayers();
/*
* --------------------------------
* ------------ TEST 1 ------------
* --------------------------------
* */
System.out.println("TEST 1\n");
/*
* -... |
package testMatador;
import testMatador.TestMatadorspil;
public class main {
/**
* @param args
*/
public static void main(String[] args) {
TestMatadorspil test = new TestMatadorspil();
test.run();
}
}
|
package model;
/**
* For all those cards which transfer money to the player from the bank.
* @author Group 20.
*
*/
public class FromBank extends Income
{
/**
* Constructor.
* @param description: Card description.
* @param amount: The amount that the bank has to pay.
*/
public FromBank(S... |
package model;
/**
* The Brewery class contains information and methods for the Brewery fields.
*/
public class Brewery extends Ownable
{
final int FACTOR = 100;
private int dicesSum, numOfFieldTypeOwned;
/**
* Constructor
* @param number: Field number
* @param name: Field name
* @par... |
package model;
/**
* Taxes is a field where the user has to pay an amount when he lands on it.
* @author Group 20
*/
public class Taxes extends Field
{
private int tax;
/**
* Constructor
* @param number: Field number
* @param name: Field name
* @param description: Field description
* @p... |
package model;
/**
* A type of ownable field where the rent is determined by the number of shipping fields the player has.
* @author Group 20
*
*/
public class Shipping extends Ownable
{
final private int RENT = 500;
private int numOfFieldTypeOwned;
/**
* Constructor
* @param number: Field... |
package model;
/**
* Class extending Move moving the player back 3 spaces when drawn.
* @author Group 20
*
*/
public class MoveBack extends Move
{
/**
* Constructor adds the value for description.
* @param description Card description
*/
public MoveBack(String description) {
super(description);
}
/**
... |
package model;
/**
* Represents a chance field on the game board.
* @author Group 20
*
*/
public class Chance extends Field
{
/**
* Constructor
* @param number: Card number
* @param name: Card name
* @param description: Card description
*/
public Chance(int number, String name, String description)
{
... |
package model;
/**
* Dice cup with two dices. Roll dices. Get the dice face values and compare for equals.
* @author Group 20
*
*/
public class DiceCup
{
private Dice dice1 = new Dice(); // Two dices in the dice cup
private Dice dice2 = new Dice();
/**
* Sums the face values of the dices
... |
package model;
import java.util.Random;
/**
* Dice class. One object represents one dice.
* @author Group 20
*/
public class Dice
{
/**
* Current dice face value
*/
private int faceValue; // Dice face value
/**
* Random object. Used to create a random number.
*/
private Random rando... |
package model;
/**
* The player class containing variables and methods for the players of the games.
* @author Group 20
*
*/
public class Player
{
private String name;
private int color;
private Konto konto = new Konto(30000);
private int number;
private int standOnField;
private boolean inJa... |
package model;
/**
* Super class for all field types. Forces subclasses to implement the landOnField and getPaymentmethods.
* @author Group 20.
*
*/
public abstract class Field
{
/**
* Field number on game board
*/
protected int number;
/**
* Field name on game board
*/
protected St... |
package model;
/**
* Abstract class representing a change card. Includes the information and
* methods all chance cards have in common.
* @author Group 20
*/
public abstract class Card
{
protected String description;
protected int payment;
private boolean drawn = false;
/**
* Constructor
... |
package model;
/**
* A class extending Card containing common methods for classes moving the player.
* @author Group 20
*
*/
public abstract class Move extends Card
{
/**
* the constructor adds the value for description.
* @param description: Card description
*/
public Move(String descriptio... |
package model;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* CustomArray is a dynamic array. Add and remove objects without concerning about the length of the array. A basic ArrayList.
* @author Group 20
* @param <ObjectType> Add any kind of object
*/
public class CustomArr... |
package model;
/**
* Class extending income, for when a card gives a player money from other players.
* @author Group 20
*
*/
public class PlayerToPlayer extends Income
{
Player[] players;
/**
* Constructor, adds values for description, amount and the array players.
* @param description: Card d... |
package model;
/**
* ToLocation is a type of card that moves you to another field.
* @author Group 20
*
*/
public class ToLocation extends Move
{
/**
* startBonus is the amount you get if you pass start, unless otherwise specified.
* fieldNumber is the field that you are moved to
* payment is th... |
package model;
/**
* ToClosestShipping is a card that takes the player to the nearest shipping and makes him pay double the rent if the field is owned.
* @author Group 20
*
*/
public class ToClosestShipping extends Move
{
private int payment, shipping1FieldNum = 6, shipping2FieldNum = 16, shipping3Fiel... |
package model;
/**
*HouseHotelDebendency is a type of card that takes money for each house and hotel a player owns.
* @author Group 20
*/
public class HouseHotelDependency extends Expense
{
private int numOfHouses, numOfHotels, payPerHouse, payPerHotel;
/**
* The constructor adds values for Descrip... |
package model;
/**
*
* @author Group 20
*
*/
public class ToBank extends Expense
{
/**
* Constructor
* @param description: Card description
* @param pay: Card pay value
*/
public ToBank(String description, int pay) {
super(description, pay);
}
/**
* toString Method
*/
@... |
package model;
import java.util.Random;
/**
* The game board stores all the fields and all the cards. It offers a lot of methods
* for finding an exact card/field or a specific data within.
* @author Group 20.
*/
public class GameBoard
{
public static Field fields[] = new Field[40];
public static ... |
package model;
/**
* Class extending field containing common methods for fields that can be owned.
* @author Mike
*
*/
public abstract class Ownable extends Field
{
protected int price;
protected Player owner = null;
protected int payment;
protected boolean pawned;
/**
* Constructor adds ... |
package model;
/**
* An array of players for use in the game.
* @author Group 20
*
*/
public class Players
{
int activePlayerIndex = 0;
Player[] players;
/**
* Constructor, adds the value for number of players.
* @param numberOfPlayers: number of players
*/
public Playe... |
package model;
/**
* Super class for all cards that forces money from the player. The draw method is the main
* method which determines whether the player has enough money or not.
* @author Group 20
*/
public abstract class Expense extends Card
{
protected int pay;
public Expense(String description... |
package model;
/**
* Refuge, a field that deposits a bonus.
* @author Group 20
*/
public class Refuge extends Field
{
final private int BONUS;
/**
* Constructor
* @param number: Field number
* @param name: Field name
* @param description: Field description
* @param bonus: value for ... |
package model;
/**
* ToJailCard is a card that puts the player in jail
* @author Group 20
*
*/
public class ToJailCard extends Move
{
/**
* The field number that the card moves the player to
*/
private int fieldNumber;
/**
* Constructor
* @param description: Card description
* @param fieldNumber: fie... |
package model;
/**
* Grants a player a get of of jail card.
* @author Group 20.
*/
public class GetOutOfJail extends Card
{
/**
* Constructor
* @param description: Description of the card.
*/
public GetOutOfJail(String description) {
super(description);
}
/**
* Grant the player a get... |
package model;
/**
* ValueDependency is a card that might deposit money, depending on the value of all your assets.
* @author Group 20
*
*/
public class ValueDependency extends Income
{
/**
* maxBalance is the integer for the maximum value of assets you can have while still getting the bonus.
* value... |
package model;
/**
* Data-class, contains data and relevant methods.
* @author Group 20
*
*/
public class Konto
{
private int saldo = 0;
/**
* sets the saldo to match the balance.
* @param balance: player balance.
*/
public Konto(int balance)
{
this.saldo = balance;
}
/**
... |
package model;
/**
* Street is a type of field where the rent is determined by the number of houses the user has on the field.
* @author Group 20
*
*/
public class Street extends Ownable
{
private int rent, rentOneHouse, rentTwoHouses, rentThreeHouses, rentFourHouses, rentHotel, housePrice;
private... |
package model;
/**
* TaxSelect is a type of field where the player has to pay a tax, where he can choose between two options.
* @author Group 20
*/
public class TaxSelect extends Field
{
private int tax;
/**
* Constructor
* @param number: Field number
* @param name: Field name
* @param descr... |
package JUnitTest;
public class EnCap {
private String name;
private int age;
public String getName(){
return name;
}
public void setName(String name){
if (name.length() > 1 && name.length() < 30){
this.name = name;
}else this.name = "John Doe";
}
public int getAge() {
return... |
package JUnitTest;
import static org.junit.Assert.*;
import org.junit.AfterClass;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class EnCapTest {
@Before
public void setUp()
{
}
@After
public void tearDown()
{
}
@Test
public void testGetName()
... |
package Abstraction;
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
CoffeeMachine c = new CoffeeMachine(90);
c.cleaned();
}
}
|
package Abstraction;
public class LabtopComputer extends GenericComputer {
private int batteryStatus;
public LabtopComputer(int batteryStatus ){
this.batteryStatus = batteryStatus;
}
public void boot(){
if (batteryStatus <= 10){
turnedOn = false;
System.out.println("low batterylevel");
} ... |
package Abstraction;
public class CoffeeMachine extends KitchenMachine {
private int waterTemp;
public CoffeeMachine(int waterTemp){
this.waterTemp = waterTemp;
}
public void cleaned(){
if (waterTemp <= 89){
System.out.println("Warming Water");
}else {
System.out.println("CoffeeMachine... |
package Abstraction;
public class DesktopComputer extends GenericComputer {
public DesktopComputer(){
}
public void boot(){
System.out.println("Booting");
}
}
|
package Abstraction;
public abstract class GenericComputer {
boolean turnedOn = false;
public GenericComputer(){
}
public void turnOn(){
turnedOn = true;
boot();
}
public void turnOff(){
turnedOn = false;
}
public abstract void boot();
}
|
package Abstraction;
public abstract class KitchenMachine {
private boolean pluggedIn = false;
public void turnedOn(){
pluggedIn = true;
}
public void turnedOff(){
pluggedIn = false;
}
public abstract void cleaned();
}
|
package HelloRMI;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
public class Client {
private Client() {}
/**
* @param args
*/
public static void main(String[] args) {
String host = (args.length < 1) ? null : args[0];
try {
Registry registry = LocateReg... |
package HelloRMI;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Hello extends Remote {
String sayHello() throws RemoteException;
}
|
package HelloRMI;
import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
public class Server implements Hello {
public Server(){
}
public String sayHello(){
return "Hello, World";
}
... |
package engineRMI;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import computeRMI.Compute;
import computeRMI.Task;
public class ComputeEngine implements Compute {
public ComputeEngine(){
super();
}
public <T> T execute... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.