id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
9b9f09fc-c253-48cb-9662-786b555ab6b2 | public static Product getProduct2(String name) {
//definimos el producto y la clase vacia
Product p = null;
Class c = null;
try {
// la clase objet tiene metodos por defecto y atributos y son
// heredados por todos
// El metodo Class.forName tu le metes el nombre de la clase y el te
// devuelte la... |
a84afb50-29a3-4eca-9184-3a8b22af9241 | public int getId() {
return id;
} |
7f0a3391-c07a-45af-ad53-404be2147dd7 | public void setId(int id) {
this.id = id;
} |
f22bffc9-877c-4ec8-a03e-c2becf847b09 | public void manipulated()
{
} |
cce5e895-9d57-4e4e-998b-fc143a52c1e6 | @Override
public void manipulate() {
// TODO Auto-generated method stub
} |
7191a491-ce4b-4955-a2ce-0d67f23dc69e | @Override
public void vender() {
// TODO Auto-generated method stub
} |
cd427d7c-de44-4e91-95f9-cd4908f515e7 | public void manipulate(); |
ef59acde-3397-4495-8f5e-cd1eb5343829 | public void vender(); |
40bf1360-a339-45ec-8031-4aeeee151d0d | public static void main(String[] args)
{
MainWindow myMainWindow = new MainWindow(); //Create the window
JMenuBar bar = new JMenuBar(); //Menu bar
JMenu fileMenu = new JMenu("File");
JMenu levelMenu = new JMenu("Level");
JMenu levelSelectionMenu = new JMenu("Choose level");
JMenu helpMenu = new JMenu("Help... |
0db3fa62-8fe1-41df-98e3-d66129ebb9b5 | public Vec2()
{
this.x = 0.0;
this.y = 0.0;
} |
4cf5592e-c418-4fcf-9714-9cfb45f448fc | public Vec2(double theX, double theY)
{
this.x = theX;
this.y = theY;
} |
f7b01e14-de88-457f-be14-875985326bee | public double[] getValues()
{
double[] values = {x, y};
return values;
} |
1a5ea5b3-3c4e-4280-98c7-bfbc97c31757 | public double getX()
{
return this.x;
} |
b0ad7c96-df21-4276-8f78-560d15039d89 | public double getY()
{
return this.y;
} |
fe233bee-652d-4620-97c7-143b26acc768 | public double magnitude()
{
magnitude = Math.sqrt(Math.pow(x, 2.0) + Math.pow(y, 2.0));
return magnitude;
} |
bc3c7c35-e59c-454e-ba9a-1a8c6d03e637 | public Vec2 normalize()
{
double newX, newY, magnitude;
magnitude = this.magnitude();
if(magnitude != 0.0)
{
newX = (this.x / magnitude);
newY = (this.y / magnitude);
}
else
{
newX = this.x;
newY = this.y;
}
Vec2 newVec2 = new Vec2(newX, newY);
return newVec2;
} |
efc5478d-99a5-4074-8e6c-3342f56a3905 | public void set(Vec2 otherVec2)
{
this.x = otherVec2.getX();
this.y = otherVec2.getY();
} |
841e86c7-13a0-4a4f-a59c-a9fc4efbe7b6 | public void set(double theX, double theY)
{
this.x = theX;
this.y = theY;
} |
3851b31f-6945-4387-88ca-68c706404c50 | public Vec2 add(Vec2 otherVec2)
{
double[] newValues = new double[2];
for(int i = 0; i < 2; i++)
{
newValues[i] = (this.getValues()[i] + otherVec2.getValues()[i]);
}
Vec2 newVec2 = new Vec2(newValues[0], newValues[1]);
return newVec2;
} |
25d945a1-4745-4ffc-a134-227619811d03 | public Vec2 add(double theX, double theY)
{
Vec2 newVec2 = new Vec2(this.x + theX, this.y + theY);
return newVec2;
} |
ae9fa95d-3c32-48f9-ae6f-5d1fcd53097a | public Vec2 subtract(Vec2 otherVec2)
{
double[] newValues = new double[2];
for(int i = 0; i < 2; i++)
{
newValues[i] = (this.getValues()[i] - otherVec2.getValues()[i]);
}
Vec2 newVec2 = new Vec2(newValues[0], newValues[1]);
return newVec2;
} |
cf95723c-6fb8-4c83-a142-8b2785184e87 | public Vec2 subtract(double theX, double theY)
{
Vec2 newVec2 = new Vec2(this.x - theX, this.y - theY);
return newVec2;
} |
f320d390-fa0b-4091-91f3-3a34ee49d9ea | public Vec2 multiply(double scalar)
{
double newX, newY;
newX = (this.x * scalar);
newY = (this.y * scalar);
Vec2 newVec2 = new Vec2(newX, newY);
return newVec2;
} |
aa49fae8-8530-4c4b-a54c-e3df9d3393e9 | public double dot(Vec2 otherVec2)
{
double[] newValues = new double[3];
double dotProduct = 0.0;
for(int i = 0; i < 2; i++)
{
newValues[i] = (this.getValues()[i] * otherVec2.getValues()[i]);
}
for(int i = 0; i < 2; i++)
{
dotProduct += newValues[i];
}
return dotProduct;
} |
5b2ea05b-40a2-4794-be10-02d25afb7924 | public HowToPlayWindow()
{
super();
this.setSize(WIDTH, HEIGHT);
this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
this.setResizable(false);
this.setTitle("How to Play");
this.setLocationRelativeTo(null);
ImagePanel theImagePanel = new ImagePanel();
this.add(theImagePanel);
} |
f27970e5-ffc8-4f8d-a997-96a0150a077d | public ImagePanel()
{
super();
try
{
howToPlayTexture = ImageIO.read(new File("textures/howtoplay.jpg"));
}
catch(IOException e)
{
}
} |
9cca472c-0fb9-45cf-95c7-6ec1b322cb95 | public void paint(Graphics canvas)
{
super.paint(canvas);
canvas.drawImage(howToPlayTexture, 0, 0, null);
} |
7b5870c2-af72-4698-96f2-ee59b5b07633 | public MainWindow()
{
super();
this.setSize(WIDTH, HEIGHT);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
this.setTitle("Vortex");
this.getContentPane().setBackground(Color.BLACK);
this.add(theGamePanel);
this.setLocationRelativeTo(null);
} |
ec072784-109a-45ec-933e-1315bd1b5d03 | public void actionPerformed(ActionEvent e) //Handles the JMenuItems
{
String buttonString = e.getActionCommand();
if(buttonString.equals("Exit"))
{
System.exit(0);
} else if(buttonString.equals("Reset level"))
{
theGamePanel.loadLevel(theGamePanel.getCurrentLevelNumber());
} else if(buttonString.e... |
1f222d66-6c74-4590-9ebb-6b5edd48126e | public GamePanel()
{
super();
this.setFocusable(true); //Allows for keyboard listener
this.setBackground(Color.BLACK);
this.setDoubleBuffered(true);
firstPaint = true;
playerX = 100.0;
playerY = 500.0;
boxX = -200.0;
boxY = -50.0;
playerPos = new Vec2(playerX, playerY);
playerVel = new V... |
c56b9cca-4dc9-420f-aeda-121c453f5a14 | private void initialize()
{
firstPaint = false;
thePainter = new Painter();
thePainter.setName("Painter Thread");
theAnimator = new Animator();
theAnimator.setName("Animator Thread");
theRenderingHints = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
theRenderi... |
749d3d91-bcf5-4b8c-b943-77b16fcbbf99 | public void loadLevel(int theLevelNumber)
{
currentLevelNumber = theLevelNumber;
resetVariables();
if(theLevelNumber == 1)
{
//Button code
levelHasButton = false;
//Player code
playerPos.set(100, 617);
//Level structure code
panel1.setFrame(50, 400, 400, 50);
panel2.setFrame(... |
7c334b44-bce0-4b9d-af1b-c3ec8968a8fa | private void resetVariables()
{
allCollidableSurfaces.clear();
portalableSurfaces.clear();
nonPortalableSurfaces.clear();
loadNextLevel = false;
playerX = 100.0;
playerY = 500.0;
boxX = -200.0;
boxY = -50.0;
buttonX = 0.0;
buttonY = -200;
entranceDoorX = -100;
entranceDoorY = -100;
exitDoo... |
fbb20c9d-a528-4fde-9b5f-d09563261a55 | public int getCurrentLevelNumber()
{
return this.currentLevelNumber;
} |
0decd391-714b-41c6-99e7-839fbaebca6a | public void paint(Graphics canvas)
{
super.paint(canvas);
canvas2D = (Graphics2D)canvas;
if(firstPaint) //Only ran once
{
this.initialize();
}
canvas2D.setRenderingHints(theRenderingHints);
canvas2D.drawImage(backgroundTexture, 0, 0, this); //Background image
canvas2D.drawImage(doorTe... |
3e6f8c9e-1428-44dd-8843-6f2c836fbc0f | public void run()
{
while(true) //While the game is running
{
animatorInitialTime = System.currentTimeMillis();
if(!levelHasButton)
{
buttonIntersection = true;
}
this.checkMaxVelocity(playerVel); //Check against the maximum velocity
this.checkBounds(playerPos); //Makes su... |
abb23b63-32c5-428c-8933-9315e6e3cf21 | private void checkMaxVelocity(Vec2 thePhysicsObjectVel) //Check against the maximum velocity
{
if(thePhysicsObjectVel.getX() > MAXIMUM_VELOCITY)
{
thePhysicsObjectVel.set(MAXIMUM_VELOCITY, thePhysicsObjectVel.getY());
}
else if(thePhysicsObjectVel.getX() < -MAXIMUM_VELOCITY)
{
thePhysicsObjectV... |
aae01d95-82bc-4966-b724-caa045699517 | private void checkBounds(Vec2 thePhysicsObjectPos) //Resets the level if the player/box exit the visible area
{
if(thePhysicsObjectPos.getX() < 0.0
|| thePhysicsObjectPos.getX() > 1008.0
|| thePhysicsObjectPos.getY() < 0.0
|| thePhysicsObjectPos.getY() > 707.0)
{
levelResetRequired = true;
}
} |
513abd2e-277b-4a0b-a87f-131c5519a82b | private void checkCollisions(Rectangle2D thePhysicsObject, Vec2 thePhysicsObjectPos, Vec2 thePhysicsObjectVel, Vec2 thePhysicsObjectAcc) //Handles collisions
{
onGround = false;
if(thePhysicsObject == player)
{
playerOnGround = false;
}
for(int i = 0; i < allCollidableSurfaces.size(); i++) //Fo... |
b67eaea8-6dba-4918-89cf-54894bd4b11e | private void setUpPortalPhysics(int firstPortalRelativeLocation, int secondPortalRelativeLocation, Vec2 thePhysicsObjectPos, Vec2 thePhysicsObjectVel, Vec2 thePhysicsObjectAcc) //Sets up the portal physics (dependent upon the relative placement of the portals: above, below etc.)
{
switch(firstPortalRelativeLocatio... |
d483d711-b14c-468f-9a7e-8fa4fef8e33d | private void addFriction(Vec2 thePhysicsObjectVel, Vec2 thePhysicsObjectAcc) //Applies friction (if on the ground)
{
if((thePhysicsObjectVel == playerVel) && (aPressed || dPressed))
{
playerMovementIssue = true;
}
else
{
playerMovementIssue = false;
}
if(onGround && !playerMovementIss... |
5671fde2-2b36-4a79-8307-dca90e8731ac | private void sumAccVelPos(Vec2 thePhysicsObjectPos, Vec2 thePhysicsObjectVel, Vec2 thePhysicsObjectAcc)
{
//Calculate the new velocity/position for the player
thePhysicsObjectVel.set(thePhysicsObjectVel.add(thePhysicsObjectAcc));
thePhysicsObjectPos.set(thePhysicsObjectPos.add(thePhysicsObjectVel));
... |
1247838d-44ca-4066-8ca7-7eb5479af7c1 | private void setNewPosition() //Move the player to the new location
{
player.setRect(playerX, playerY, 20, 40);
box.setRect(boxX, boxY, 25, 25);
} |
f2ce2c3b-bec5-4229-a9bc-b8a249d5af3b | private void setDrawnRay()
{
drawnRay.set((mouseX - player.getCenterX()), (mouseY - player.getCenterY()));
drawnRay = drawnRay.normalize();
drawnRay = drawnRay.multiply(1200);
drawnRayline.setLine(player.getCenterX(), player.getCenterY(), drawnRay.getX() + player.getCenterX(), drawnRay.getY() + player.get... |
a63351af-da00-419c-be58-f7fe95bde60e | private void doNothing()
{
animatorDeltaTime = (animatorFinalTime - animatorInitialTime);
animatorSleepTime = (ANIMATOR_SLEEP_TIME - animatorDeltaTime);
if(animatorSleepTime < 0) //If the animations took longer than ANIMATOR_SLEEP_TIME to run
{
animatorSleepTime = 0;
}
try
{
Threa... |
c774cb5b-e78f-4edd-841a-ace5a94a80b3 | public void run()
{
while(true)
{
painterInitialTime = System.currentTimeMillis();
repaint();
painterFinalTime = System.currentTimeMillis();
painterDeltaTime = (painterFinalTime - painterInitialTime);
painterSleepTime = (PAINTER_SLEEP_TIME - painterDeltaTime);
if(painterSleepTime < ... |
f71f4e44-84fd-4894-8a1f-69e18976793e | public void keyPressed(KeyEvent e)
{
int theKey = e.getKeyCode();
double boxDistance;
if((theKey == KeyEvent.VK_A) && (!aPressed) && (!playerJustPortaled)) //!justPortaled prevents the user from going backwards, potentially through the level
{
aPressed = true;
if(playerVel.getX() > -3.0) //If ... |
3cfb6cd0-077e-4e5e-bb86-60aed1a3d7b4 | public void keyReleased(KeyEvent e)
{
int theKey = e.getKeyCode();
if(theKey == KeyEvent.VK_A)
{
aPressed = false;
}
if(theKey == KeyEvent.VK_D)
{
dPressed = false;
}
if(theKey == KeyEvent.VK_E)
{
boxToggle = true;
}
} |
e5b48b22-f1f1-41ce-8b25-f7aadab3a378 | public void mouseMoved(MouseEvent e)
{
mouseX = e.getX();
mouseY = e.getY();
} |
23b1a33b-38f4-4834-83ed-b3fd2b60ff6d | public void mouseDragged(MouseEvent e)
{
mouseX = e.getX();
mouseY = e.getY();
} |
e4ba252f-eec4-491f-bf84-cde4b0636888 | public void mousePressed(MouseEvent e)
{
int surfaceNumber = 0;
double distanceBetweenPortals;
ray.set((e.getX() - player.getCenterX()), (e.getY() - player.getCenterY()));
ray = ray.normalize();
for(int i = 0; i < 1200; i++)
{
testRay = ray.multiply(i); //Each run of the for loop, the te... |
4dfd13ee-a6e7-4491-9e17-85cc4d108332 | private void findPortalRelativeLocations()
{
switch(portalRelativeLocation) //Where the portal is going to be drawn relative to the object it is being drawn on
{
case Rectangle2D.OUT_TOP:
portalWidth = 40.0;
portalHeight = 20.0;
if(lastShotBluePortal && raylineIntersection)
{
porta... |
be81d255-9ce6-4b73-a16a-72c7173db72f | public void init(ServletConfig config) throws ServletException {
//Initialize the servlet
super.init(config);
message = "Hello out there";
} |
ac7d551b-db6d-49c1-9756-7604607fb2c4 | protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// catch back name from submitted form
String name = request.getParameter("name");
String pass = request.getParameter("password");
// Set refresh, auto load time as 5 seconds
res... |
8465aed8-e049-400c-9afe-b9fcf5898840 | @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// Set refresh, auto load time as 5 seconds
resp.setIntHeader("Refresh", 10);
PrintWriter pw = resp.getWriter();
pw.println("<title>Example with GET request</title>");
... |
4d857ac3-34a3-42ee-8d0a-2d24de49cc34 | @Override
public void destroy() {
super.destroy();
// Does nothing for now
} |
d295b2ef-88f2-4c47-b1c9-15c54860bbce | public Config() {
this.getAllConfigs();
} |
88d285bc-85fa-4ae6-bf0a-67a7bd1249fc | public String getGlobalConfig(String msg){
return config.get(msg);
} |
c8d9829a-21e1-4b2c-837d-def0cb263009 | protected HashMap<String, String> getAllConfigs() {
config.put(LOGGER_NAME, "log4jConfig");
config.put(JSP_LOCAL_FILE, "/WEB-INF/include/test.jsp");
return config;
} |
69bc7828-d75e-4cf3-a0af-9877addf913b | public void init(ServletConfig scon) throws ServletException {
super.init(scon);
ctx = scon.getServletContext();
jspFile = config.getGlobalConfig(Config.JSP_LOCAL_FILE);
} |
0e52bb65-8070-404b-a277-ca19dd013b02 | protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// set the attribute
String message = "My name is devon what's yours?";
request.setAttribute("message", message);
request.getRequestDispatcher(jspFile).forward(request, response);
} |
6bd4465c-f548-4ef6-afee-7ff1b1f47078 | protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doGet(request, response);
} |
c2337b2a-7db2-4b6f-9f37-b24b79db5adb | public void destroy() {
} |
976548e3-da40-4f56-9ecc-6da8c874b95a | public void init(FilterConfig fConfig) throws ServletException {
} |
054e36d8-5b32-4ed0-b256-091918ea57ca | public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
String client = request.getRemoteAddr();
String host = request.getLocalName();
myLog.info("Client address:" + client +" HostName:" + host);
// pass the request along the f... |
6f83affc-301d-4551-8475-95a4b69050b8 | @Override
/**
* Handles the event when the app is initialized(starts)
*/
public void contextInitialized(ServletContextEvent sce) {
try {
ServletContext sc = sce.getServletContext();
String root = sc.getInitParameter(cf.getGlobalConfig(Config.LOGGER_NAME));
actualPath = sc.getRealPath(root);
Prope... |
73158e57-6c0e-47fa-845e-0c9c9b437e1d | @Override
/**
* Handles the event when the app is destroyed(ends)
*/
public void contextDestroyed(ServletContextEvent arg0) {
myLog.info(message);
} |
76d1969b-b217-42db-841e-fdae79dd85eb | public static void generate(String reportName, ReportsTypes type,
Map<String, Object> params, OutputStream out, Connection conn) throws FileNotFoundException, JRException {
ReportFileUtil rFile = ReportFileUtil.getReport(reportName);
JasperPrint jPrint = JasperFillManager.fillReport(new FileInputStream(rFile.get... |
d315f828-970d-4753-a35f-4d756d9201bd | private static void makeXml(JasperPrint jPrint, OutputStream out) throws JRException {
JRXmlExporter exporter = new JRXmlExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, out);
exporter.exportReport();
} |
27943912-2425-4934-9a2b-41f5c9daeca1 | private static void makeHtml(JasperPrint jPrint, OutputStream out) throws JRException {
JRHtmlExporter exporter = new JRHtmlExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, out);
exporter.exportReport();
} |
1ced4c32-a146-46e0-ae2f-6c07c5b28d44 | private static void makeXls(JasperPrint jPrint, OutputStream out) throws JRException {
JRXlsExporter exporter = new JRXlsExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jPrint);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, out);
exporter.exportReport();
} |
4b736d25-e434-469c-9358-63c326dc5968 | private static void makePdf(JasperPrint jPrint, OutputStream out) throws JRException {
JasperExportManager.exportReportToPdfStream(jPrint, out);
} |
acf96f6d-99da-4e50-b1fa-b5493e6d7406 | public static ReportsTypes getReportType(String type) {
for(ReportsTypes r : ReportsTypes.values()) {
if(r.toString().equalsIgnoreCase(type)) {
return r;
}
}
return null;
} |
495bb560-34ca-42b6-8e9b-86f26c14d3fd | public ReportFileUtil(File relatorio) {
this.relatorio = relatorio;
this.name = relatorio.getName();
this.cleanName = this.name.split("\\.")[0];
} |
8c2662f6-56ce-4955-b5fe-0c32d1056038 | public String getCleanName() {
return cleanName;
} |
a6e586d5-619f-493c-96e3-d1808a7abadc | public void setCleanName(String cleanName) {
this.cleanName = cleanName;
} |
a89b1b99-77cd-4347-bd45-2740f5c1d669 | public String getName() {
return name;
} |
1fe57917-0a2c-4b52-85b7-b7f6821ecdf8 | public void setName(String name) {
this.name = name;
} |
0cb9ffcb-8c89-4bba-9c30-a5382da068b0 | public File getRelatorio() {
return relatorio;
} |
9d333be3-77a9-49b6-90c7-329c173cdf6a | public void setRelatorio(File relatorio) {
this.relatorio = relatorio;
} |
64af8549-5d4e-4203-980a-b7808d0e6555 | public static List<ReportFileUtil> getRelatorios() {
return relatorios;
} |
802fe19a-af2d-4c7c-a699-5d003164423e | public static boolean exists(String reportName) {
return exists(new File(PropUtil.get("reports-path")), reportName);
} |
5edab7bf-effd-4356-b431-b4fa59cbad4f | public static boolean exists(File path, String reportName) {
try {
for(File file : path.listFiles()) {
if(file.isFile() && file.getName().equals(reportName + ".jasper")) {
return true;
}
if(file.isDirectory()) {
return exists(file, reportName);
}
}
} catch(Exception e) {
e.printSt... |
20dab9e7-f3b1-4edd-8bbe-1d1f608e5114 | public static void loadReports() {
loadReports(new File(PropUtil.get("reports-path")));
} |
12185a4f-2196-4001-a94b-58a4f3ac0a94 | public static void loadReports(File path) {
try {
for(File file : path.listFiles()) {
if(file.isFile() && file.getName().endsWith(".jasper")) {
relatorios.add(new ReportFileUtil(file));
}
if(file.isDirectory()) {
loadReports(file);
}
}
} catch(Exception e) {
e.printStackTrace();
... |
1ef880cc-6598-4b2b-a51b-e22b3b7edefc | public static ReportFileUtil getReport(String reportName) {
if(relatorios == null || relatorios.isEmpty()) {
loadReports();
}
for(ReportFileUtil report : relatorios) {
if(report.getCleanName().equals(reportName)) {
return report;
}
}
return null;
} |
560264bf-7a5f-4884-83e3-60b727962bb0 | @Override
public String toString() {
return this.cleanName + " - " + this.name + " - " + this.relatorio.getAbsolutePath();
} |
75aa8aea-691b-436e-88f1-78f32b9dd015 | public static String get(String key) {
try {
prop.load(PropUtil.class.getClassLoader().getResourceAsStream("config.properties"));
Object value = prop.get(key);
if(value != null) {
return value.toString();
}
} catch (IOException e) {
e.printStackTrace();
}
return null;
} |
a5b85d9c-f041-4084-a2e4-3261e4891054 | public GroupedParameter(final String name) {
super(name, null);
values = new ArrayList<Parameter>();
} |
dc46d4cf-0464-4d53-a2f9-a5157258f397 | public GroupedParameter(final String name, final ArrayList<Parameter> values) {
super(name, null);
this.values = values;
} |
8cfaebe8-8eb8-445a-bac6-70c8119b7298 | public ArrayList<Parameter> getValues() {
return values;
} |
10a3badb-4c5e-4545-9776-83c204b1dc63 | public void add(final Parameter param) {
values.add(param);
} |
a542b089-4557-47a4-bda1-92fa9f1f1d77 | public Parameter get(final String name) {
Parameter parameterToReturn = null;
for (final Parameter param : values) {
if (param.getName().equals(name)) {
parameterToReturn = param;
}
}
if (parameterToReturn == null) {
throw new IllegalAr... |
f4f9a7fa-9f27-46c9-9eab-ffa49266ecfa | public void setValues(Parameter[] params) {
values = new ArrayList<Parameter>();
for (int i = 0; i < params.length; i++) {
values.add(params[i]);
}
} |
bbaf35c5-ba86-4080-833a-297adaa6db2b | public Object getValue() {
Object objectToReturn = null;
try {
objectToReturn = (Object) toJSONObject(Message.EncodeMode.VERBOSE);
} catch (JSONException e) {
e.printStackTrace();
}
return objectToReturn;
} |
931179a4-3dc6-40ac-9bf8-6cd5d40b5b00 | JSONObject toJSONObject(final Message.EncodeMode encodeMode) throws JSONException {
JSONObject objectGroup = null;
if (values != null) {
objectGroup = new JSONObject();
for (int i = 0; i < values.size(); i++) {
Parameter param = values.get(i);
Stri... |
db17312b-c802-4864-b9ae-7eb975384011 | public Message(final Parameter... parameters) {
this.name = null;
this.parameters = parameters;
} |
bad5fbdb-4e55-44d1-b31e-c1baa2d4e7c2 | public Message(final String name, final ArrayParameter parameters) {
this.name = name;
this.parameters = new Parameter[] { parameters };
} |
ad509c18-ae42-4154-b9cb-52894033efb4 | public Message(final String msgText) throws JSONException {
new Decoder().decode(msgText, this);
} |
ca4858b8-97cb-4218-ab91-81b914b1ed15 | public String getName() {
return name;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.