text stringlengths 3 1.18M |
|---|
package entity.weapon;
import entity.characters.Character;
/**
*
* @author Jevgeni Krutov
*
*/
public abstract class Weapon {
protected int ammo;
protected Character host;
private long waitInterval;
public Weapon(int shotsRemaining, Character host, long waitInterval) {
this.ammo = shotsR... |
package entity.weapon;
import model.ModelFactory;
import org.lwjgl.util.vector.Vector3f;
import entity.characters.Character;
/**
*
* @author Jevgeni Krutov
*
*/
public final class RocketLauncher extends Weapon {
private static final int INITIAL_AMMO = 3;
private static final long WAIT_INTERVAL... |
package entity.weapon;
import model.Model;
import org.lwjgl.util.vector.Vector3f;
import entity.MovingEntity;
/**
*
* @author Jevgeni Krutov
*
*/
public abstract class Shot extends MovingEntity {
private long timeToLive;
private int damage;
public Shot(Vector3f position, Vector3f rotation,... |
package entity.weapon;
import model.Model;
import org.lwjgl.util.vector.Vector3f;
/**
*
* @author Jevgeni Krutov
*
*/
public final class Rocket extends Shot {
private static final int DEF_DAMAGE = 50;
private static final int DEF_MASS = 100;
private static final int DEF_LIVING_TIME = 5000;
... |
package entity;
import static org.lwjgl.input.Keyboard.*;
import static org.lwjgl.input.Mouse.getDX;
import static org.lwjgl.input.Mouse.getDY;
import static org.lwjgl.opengl.GL11.*;
import level.Level;
import org.lwjgl.util.vector.Matrix4f;
import org.lwjgl.util.vector.Vector3f;
import entity.characters.... |
package entity;
import game.util.MatrixUtil;
import java.util.HashSet;
import java.util.Set;
import model.Model;
import org.lwjgl.util.vector.Matrix3f;
import org.lwjgl.util.vector.Matrix4f;
import org.lwjgl.util.vector.Vector3f;
/**
*
* @author Jevgeni Krutov
*
*/
public class Entity {
pr... |
package entity;
import org.lwjgl.util.vector.Vector3f;
/**
*
* @author Jevgeni Krutov
*
*/
public final class Ground extends Entity {
public Ground(Vector3f position, Vector3f rotation) {
super(position, rotation);
}
@Override
public boolean isGround() {
return true;
}
}
|
package entity.characters;
import model.Model;
import org.lwjgl.util.vector.Vector3f;
import entity.MovingEntity;
import entity.weapon.RocketLauncher;
import entity.weapon.Shot;
import entity.weapon.Weapon;
/**
*
* @author Jevgeni Krutov
*
*/
public class Character extends MovingEntity {
priv... |
package entity.characters;
import static org.lwjgl.input.Keyboard.*;
import static org.lwjgl.input.Mouse.*;
import model.Model;
import org.lwjgl.util.vector.Vector3f;
import entity.Camera;
import entity.item.Item;
/**
*
* @author Jevgeni Krutov
*
*/
public final class Player extends Character {... |
package entity.characters;
import model.Model;
import org.lwjgl.util.vector.Vector3f;
/**
*
* @author Jevgeni Krutov
*
*/
public final class Enemy extends Character {
public final static long DEF_AWAIT_TIME_BETWEEN_ATTACKS = 10000;
public final static int DEF_HEALTH = 60;
private long timeToWai... |
package entity;
import org.lwjgl.util.vector.Vector3f;
import entity.characters.Character;
/**
*
* @author Jevgeni Krutov
*
*/
public class MovingEntity extends Entity {
private static final float MAX_X_ROTATION = 89;
private static final float MIN_X_ROTATION = -89;
private static final floa... |
package entity.item;
import model.ModelFactory;
import org.lwjgl.util.vector.Vector3f;
import entity.Entity;
/**
*
* @author Jevgeni Krutov
*
*/
public final class Item extends Entity {
private boolean isTaken = false;
private ItemType type;
public Item(Vector3f position, Vector3f rotation... |
package entity.item;
/**
*
* @author Jevgeni Krutov
*
*/
public enum ItemType {
ROCKET,
MEDKIT,
ENERGY,
EXIT;
}
|
package game;
import static org.lwjgl.input.Keyboard.*;
import static org.lwjgl.input.Mouse.*;
import static org.lwjgl.opengl.GL11.*;
import java.util.Iterator;
import level.Level;
import model.Model;
import model.ModelFactory;
import org.lwjgl.LWJGLException;
import org.lwjgl.Sys;
import org.lwjgl.in... |
package game;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import level.LevelDownloader;
/**
*
* @author Jevgeni Krutov
*
*/
public class Menu extends JFrame {
... |
package game.util;
import java.nio.FloatBuffer;
import org.lwjgl.BufferUtils;
import org.lwjgl.util.vector.Matrix3f;
import org.lwjgl.util.vector.Matrix4f;
/**
* A Simple utility class to deal with matrices
*
* @author Sri Harsha Chilakapati
* @author Jevgeni Krutov
*/
public class MatrixUtil {
... |
package game.util;
import static org.lwjgl.opengl.GL11.glViewport;
import game.Game;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
/**
*
* @author Jevgeni Krutov
* @author Sri Harsha Chilakapati
*/
public class DisplayUtil {
static Game in... |
package game.util;
import game.Game;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import shader.ShaderProgram;
/**
* A Utility class for dealing with files.
*
* @author Sri Harsha Chilakapa... |
package physics;
import org.lwjgl.util.vector.Vector3f;
/**
*
* @author Jevgeni Krutov
*
*/
public class Gravity {
Vector3f gravityVector;
public Gravity () {
this(/*10f*/0.000001f);
}
public Gravity (float g) {
gravityVector = new Vector3f(0, -1 * g, 0);
}
public Vector3f ... |
package physics;
import java.util.List;
import model.BoundingBox;
import org.lwjgl.util.vector.Vector3f;
import entity.Entity;
import entity.MovingEntity;
import entity.Ground;
import entity.characters.Player;
import entity.characters.Character;
import entity.item.Item;
import entity.weapon.Shot;
/... |
package shader;
/**
*
* @author Jevgeni Krutov
*
*/
public class Filter {
private static final int NATURAL = 0;
private static final int GREEN = 1;
private static final int RED = -1;
private static final int GRAY = 2;
private int currentFilter = NATURAL;
private float filterTransition = 0;
... |
package shader;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL20.*;
import game.Game;
import game.util.FileUtil;
import game.util.MatrixUtil;
import java.nio.FloatBuffer;
import org.lwjgl.BufferUtils;
import org.lwjgl.util.vector.Matrix4f;
import org.lwjgl.util.vector.Vector3f;
... |
package hud;
import static org.lwjgl.opengl.GL11.GL_BLEND;
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
import static org.lwjgl.opengl.GL11.glBlendFunc;
import static org.lwjgl.opengl.GL11.glDisable;
import static org.lwjgl.opengl.GL11.glEnable;
... |
package model;
import org.lwjgl.util.vector.Vector3f;
/**
* A simple material class
*
* @author Sri Harsha Chilakapati
*/
public class Material
{
// The diffuse color
private Vector3f diffuse;
// Name of the material
private String name;
/**
* Creates a new material ... |
package model;
import game.util.FileUtil;
import java.util.HashMap;
import org.lwjgl.util.vector.Vector3f;
/**
*
* @author Jevgeni Krutov
* @author Sri Harsha Chilakapati
*
*/
public class ModelFactory {
/**
* Mesh storage
*/
private static HashMap<String, Model> modelStorage = new Has... |
package model;
import org.lwjgl.util.vector.Vector3f;
/**
* A Face in a Model. Each face is a triangle.
*
* @author Sri Harsha Chilakapati
*/
public class Face
{
// Vertex indices
private Vector3f vertex;
// Normal indices
private Vector3f normal;
// The Material
privat... |
package model;
import org.lwjgl.util.vector.Vector3f;
/**
*
* @author Jevgeni Krutov
*
*/
public class BoundingBox {
float minX, maxX, minY, maxY, minZ, maxZ;
private float halfX, halfY, halfZ;
Vector3f centerOffset;
BoundingBox(float minX, float maxX, float minY, float maxY, float minZ, floa... |
package model;
import static org.lwjgl.opengl.GL11.GL_COLOR_ARRAY;
import static org.lwjgl.opengl.GL11.GL_FLOAT;
import static org.lwjgl.opengl.GL11.GL_NORMAL_ARRAY;
import static org.lwjgl.opengl.GL11.GL_TRIANGLES;
import static org.lwjgl.opengl.GL11.GL_VERTEX_ARRAY;
import static org.lwjgl.opengl.GL11.glColor... |
package com.gshocklab.mvp.client.mvp.view;
import com.google.gwt.user.client.ui.IsWidget;
public interface IContactsView extends IsWidget {
public void setPresenter(IContactsPresenter presenter);
public interface IContactsPresenter {
}
}
|
package com.gshocklab.mvp.client.mvp.view.contacts;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.gshocklab.mvp.client.mvp.view.IContactsView;
public class ContactsView exte... |
package com.gshocklab.mvp.client.mvp.view.mail;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.gshocklab.mvp.client.mvp.view.IMailView;
public class MailView extends Composit... |
package com.gshocklab.mvp.client.mvp.view.tasks;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.gshocklab.mvp.client.mvp.view.ITasksView;
public class TasksView extends Compo... |
package com.gshocklab.mvp.client.mvp.view;
import com.google.gwt.user.client.ui.IsWidget;
public interface IMailView extends IsWidget {
public void setPresenter(IMailPresenter presenter);
public interface IMailPresenter {
}
}
|
package com.gshocklab.mvp.client.mvp.view;
import com.google.gwt.user.client.ui.IsWidget;
public interface ITasksView extends IsWidget {
public void setPresenter(ITasksPresenter presenter);
public interface ITasksPresenter {
}
}
|
package com.gshocklab.mvp.client.mvp.place;
import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.google.gwt.place.shared.Prefix;
public class ContactsPlace extends Place {
private static final String VIEW_HISTORY_TOKEN = "contacts";
public ContactsPlace() { }
... |
package com.gshocklab.mvp.client.mvp.place;
import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.google.gwt.place.shared.Prefix;
public class TasksPlace extends Place {
private static final String VIEW_HISTORY_TOKEN = "tasks";
public TasksPlace() { }
@Prefix(v... |
package com.gshocklab.mvp.client.mvp.place;
import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.google.gwt.place.shared.Prefix;
public class MailPlace extends Place {
private static final String VIEW_HISTORY_TOKEN = "mail";
public MailPlace() { }
@Prefix(valu... |
package com.gshocklab.mvp.client.mvp;
import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import com.gshocklab.mvp.client.ClientFactory;
import com.gshocklab.mvp.client.mvp.activity.ContactsActivity;
import com.gshocklab.mvp.cl... |
package com.gshocklab.mvp.client.mvp;
import com.google.gwt.place.shared.PlaceHistoryMapper;
import com.google.gwt.place.shared.WithTokenizers;
import com.gshocklab.mvp.client.mvp.place.ContactsPlace;
import com.gshocklab.mvp.client.mvp.place.MailPlace;
import com.gshocklab.mvp.client.mvp.place.TasksPlace;
@WithToken... |
package com.gshocklab.mvp.client.mvp.activity;
import java.util.LinkedHashMap;
import java.util.Map;
import com.google.gwt.activity.shared.AbstractActivity;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.gshocklab.mvp.client.AppConstants;
public abstract class AbstractMai... |
package com.gshocklab.mvp.client.mvp.activity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.gshocklab.mvp.client.AppConstants;
import com.gshocklab.mvp.client.ClientFactory;
import com.gshocklab.mvp.client.mvp.view.ITasksView;
public class TasksActivit... |
package com.gshocklab.mvp.client.mvp.activity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.gshocklab.mvp.client.AppConstants;
import com.gshocklab.mvp.client.ClientFactory;
import com.gshocklab.mvp.client.mvp.view.IContactsView;
public class ContactsA... |
package com.gshocklab.mvp.client.mvp.activity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.gshocklab.mvp.client.AppConstants;
import com.gshocklab.mvp.client.ClientFactory;
import com.gshocklab.mvp.client.mvp.view.IMailView;
public class MailActivity ... |
package com.gshocklab.mvp.client;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.PlaceController;
import com.gshocklab.mvp.client.mvp.view.IContactsView;
import com.gshocklab.mvp.client.mvp.view.IMailView;
import com.gshocklab.mvp.client.mvp.view.ITasksView;
public interface ClientFac... |
package com.gshocklab.mvp.client;
import com.google.gwt.activity.shared.ActivityManager;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.PlaceContro... |
package com.gshocklab.mvp.client;
public final class AppConstants {
public static final String MAIL_LINK_ID = "mail-view";
public static final String CONTACTS_LINK_ID = "contacts-view";
public static final String TASKS_LINK_ID = "tasks-view";
}
|
package com.gshocklab.mvp.client;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.place.shared.PlaceController;
import com.gshocklab.mvp.client.mvp.view.IContactsView;
import com.gshocklab.mvp.client.mvp.view.IMailView;
import com.gshocklab.mvp.clie... |
package command;
public interface ICommand {
public void command(String cmd);
public String info();
public void setNextChain(ICommand nextChain);
// , 42
}
|
// LA3486 陈锋
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Stack;
import java.util.StringTokenizer;
public class Main {
static Reader stdin = new Read... |
// UVa11294 Wedding
// 陈锋
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Stack;
import java.util.StringTokenizer;
public class Main {
pri... |
import java.util.ArrayList;
import java.util.List;
public class NeuronLayer {
protected List<Neuron> neurons = new ArrayList<Neuron>();
protected int type;
public final static int LINEAR = 0;
public final static int STEP = 1;
public final static int LOGISTIC = 2;
public final static int KOHONEN ... |
import java.util.List;
public class WidrowHoffNeuron extends LinearNeuron {
public WidrowHoffNeuron(String weights) {
super(weights);
}
public WidrowHoffNeuron(int weightsNum) {
super(weightsNum);
}
public String learn(Float targetValue, NeuronLayer inputLayer) {
if(inputLayer.type ... |
public class KohonenLayer extends NeuronLayer {
public KohonenLayer(Integer neuronsNum, int weightsNum) {
super(neuronsNum,NeuronLayer.KOHONEN,weightsNum);
}
private int getNearestNeuronIndex(NeuronLayer input) {
float min = 1000;
float tmp;
int result = -1;
for(int i=0;i<neurons.size();i++)... |
public class KohonenNeuron extends LinearNeuron {
public KohonenNeuron(int weightsNum) {
super(weightsNum);
}
public float countDistance(NeuronLayer input) {
float distance = 0;
for(int i=0;i<weights.size();i++) {
distance += Math.abs(weights.get(i)-input.getNeurons().get(i).getOutput());
}... |
import java.util.List;
public class WidrowHoffLayer extends NeuronLayer {
//learning rate a;
private float a = (float) 0.1;
public WidrowHoffLayer(Integer neuronsNum, int weightsNum) {
super(neuronsNum, NeuronLayer.WIDROW_HOFF, weightsNum);
}
public float getA() {
return a;
}
public ... |
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public abstract class Neuron {
protected static int neighbourhoodRadius = 1;
protected static int neighbourhoodDimension = 0;
protected static float alpha = 0.5f; //wspolczynnik uczenia
protected float threshold = 0.0f;
prot... |
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class NeuralNetwork {
private List<NeuronLayer> layers = new ArrayList<NeuronLayer>();
List<List<Float>> targetData = new ArrayList<List<Float>>();
public void addLayer(NeuronLayer layer) {
this.layers.add(layer);
... |
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import ... |
class Attribute {
private String name;
private String attType;
public String getName()
{
return name;
}
public String getType()
{
return attType;
}
public Attribute (String inType, String inName) {
name = inName;
attType = inType;
}
public String toString()
{
return "[" + attType + ":" + na... |
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class RAJoin implements RAExpression, Cloneable {
// These left and right subexpressions are only needed if the join has a where clause with
// pre... |
/**
* This little class holds the catalog info about an attribute.
*
* Everything is pretty self explanatory, except for the "seqNumber" field,
* which stores whether this is the first, second, third, etc., attribute in the
* table to which this attribute belongs.
*/
class AttInfo implements Cloneable {
privat... |
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
/**
* Interface representing a relational algebra expression.
* @author Jonathan
*
*/
public interface RAExpression {
/**
* Runs the relational algebra expression. Returns the name
* of the output file from running ... |
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
/**
* This class orders the records in an input 490db file and writes the result to
* an output file. It does this by writing a C++ program that it com... |
import java.util.*;
import java.io.*;
/**
* This class runs a join plus a selection/project over two text input files,
* and writes the result to an output text file. It does this by "writing" a C++
* program that it compiles and executes to do the join.
*/
class Join {
private String leftAttsFile;
private Stri... |
// $ANTLR 3.2 Sep 23, 2009 12:02:23 SQL.g 2012-09-28 13:53:25
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.antlr.runtime.*;
public class SQLParser extends Parser {
public static final String[] tokenNames = new String[] {
"<invalid>", "<EOR>"... |
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/**
* Class representing a relational algebra operation to order a table based on its attributes.
* @author Jonathan
*
*/
public class RAOrder implements RAExpression, Cloneable... |
// $ANTLR 3.2 Sep 23, 2009 12:02:23 SQL.g 2012-09-28 13:53:25
import org.antlr.runtime.*;
public class SQLLexer extends Lexer {
public static final int T__29=29;
public static final int T__28=28;
public static final int T__27=27;
public static final int T__26=26;
public static final int T... |
import java.util.ArrayList;
/**
* Wrapper class for output of a relational algebra operation.
* Returns the names and data types of the output and the file
* name containing the output.
* @author Jonathan
*
*/
public class RAOutput {
public String outFile;
//public ArrayList<Attribute> inAtts;
pub... |
/**
* Note that it is asumed that funcToRun is one of "none", "avg", or "sum"
*/
class AggFunc {
private String funcToRun;
private String expr;
public String getFuncToRun () {
return funcToRun;
}
public String getExpr () {
return expr;
}
public AggFunc (String inFuncToRun, String i... |
import java.io.*;
import java.util.*;
// This class is responsible for reading in and constructing the catalog
// data structure. It does this by reading in and processing an XML file
// that encodes the catalog.
// To use this reader, specify the file to be processed in the constructor.
// Then, a call to getCatal... |
/**
* Class representing a single key used in sorting.
* @author Jonathan
*
*/
public class SortKeyExpression {
private String dataType;
private String executionString;
private boolean asc;
public SortKeyExpression(String dataType, String executionString, boolean asc)
{
this.dataType = dat... |
/**
* Class representing the statistics from estimating the cardinality of an RAExpression.
* @author Jonathan
*
*/
public class RAStatistics {
/**
* Basic constructor taking cardinality and cost.
* @param cardinality
* @param cost
*/
public RAStatistics(long cardinality, long cost)
{
... |
import java.util.*;
import java.io.*;
/**
* This class runs a selection/projection over an input text file, and writes
* the result to an output text file. It does this by "writing" a C++ program
* that it compiles and executes to do the selection/projection.
*/
class Grouping {
private String attsFile;
priva... |
import java.util.*;
class Runner {
static public void main(String[] args)
{
long startTime = System.currentTimeMillis();
System.out.println("first running a selection...");
DoSelection();
System.out.println("now running a join...");
DoJoin();
System.out.println("now running a group by...");
DoGroupBy(... |
import java.util.*;
/**
* This little class is used to hold the catalog information about a database table.
* A bunch of these objects in a Map <String, TableData> is used to store the catalog.
*/
class TableData implements Cloneable {
private int tupleCount;
private Map<String, AttInfo> attributes;
public Ta... |
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
/**
*
* @author Jonathan
*
*/
public class RAReadBaseTable implements RAExpression {
private String correlation;
private String table;
private Map<String, TableData> catalog;
public RAReadBaseTable(Map<String, Ta... |
/**
* Generic visitor for a relational algebra expression.
* @author Jonathan
*
* @param <T> return type of visitor
*/
public interface RAExpressionVisitor<T> {
public T selectionCase(RASelection raSelection, Object[] args);
public T groupingCase(RAGrouping raGrouping, Object[] args);
public T ... |
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
/**
* This is a class to hold various configuration options for the database.
* Note that the database configuration file treats boolean options as true
* if their values satisfy value.equalsIgnoreCase("true") and false o... |
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/**
* Class to represent a grouping operation within a relational
* algebra execution plan.
* @author Jonathan
*
*/
public class RAGrouping implements RAExpression, Cloneable {
... |
/**
* Class representing an expression in the sort list of a query.
* @author Jonathan
*
*/
public class SortExpression {
/**
* Expression on which to sort.
*/
private Expression exp;
/**
* Direction of sort: true for ascending, false for descending.
*/
private boolean direction;
... |
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class Expression {
private static final boolean DEBUG = false;
// this is an exhaustive list of expression types
public static final String[] validTypes = {"plus", "minus", "times",
"divided by", "or", "... |
import java.util.*;
import java.io.*;
/**
* This class runs a selection/projection over an input text file, and writes
* the result to an output text file. It does this by "writing" a C++ program
* that it compiles and executes to do the selection/projection.
*/
class Selection {
private String attsFile;
privat... |
/**
*
* @author Jonathan
*
*/
public class CorrelatedAttribute {
private String correlation;
private String attribute;
public CorrelatedAttribute(String correlation, String attribute) {
this.setCorrelation(correlation);
this.setAttribute(attribute);
}
public String getCorrelation() {
r... |
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* Class for static DB utilities.
* @author Jonathan
*
*/
public class DBUtils {
public static void setCatalogMaxCard(Map<String, TableData> tempCatalog, long card)
{
for(TableData td : tempCat... |
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class RASelection implements RAExpression {
private final Map<String, TableData> catalog;
// If evaluateSelectList is true then this RASelection will evaluate the select list
// otherwise it w... |
/*
* Copyright 2013 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) 2013 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 app... |
/*
* Copyright 2013 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 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 w... |
/*
* Copyright 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 w... |
/*
* Copyright 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 w... |
/*
* Copyright 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 w... |
/*
* Copyright 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 w... |
/*
* Copyright 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 w... |
/*
* Copyright 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 w... |
/*
* Copyright 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 w... |
/*
* Copyright 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 w... |
/*
* Copyright 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 w... |
/*
* Copyright 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 w... |
/*
* Copyright 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 w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.