rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
svci.beginTransaction(); | public void in(boolean actionUrl) throws Throwable { synchronized (form) { CalSvcI svci = form.fetchSvci(); if (svci != null) { if (svci.isOpen()) { // double-clicking on our links eh? form.incWaiters(); form.wait(); } form.decWaiters(); if (actionUrl) { svci.flushAll(); } svci.open(); } } } |
|
form.initFields(); | initFields(form); | public String performAction(HttpServletRequest request, HttpServletResponse response, UtilActionForm frm, MessageResources messages) throws Throwable { String forward = "success"; BwActionFormBase form = (BwActionFormBase)frm; String adminUserId = null; boolean guestMode = getGuestMode(frm); if (guestMode) { form.assignCurrentUser(null); } else { adminUserId = form.getCurrentAdminUser(); if (adminUserId == null) { adminUserId = form.getCurrentUser(); } } if (getPublicAdmin(form)) { /** We may want to masquerade as a different user */ String temp = request.getParameter("adminUserId"); if (temp != null) { adminUserId = temp; } } /* UWCalCallback cb = new Callback(form); HttpSession sess = request.getSession(); sess.setAttribute(UWCalCallback.cbAttrName, cb); */ BwSession s = getState(request, form, messages, adminUserId, getPublicAdmin(form)); if (s == null) { /* An error should have been emitted. The superclass will return an error forward.*/ return forward; } form.setSession(s); form.setGuest(s.isGuest()); if (form.getGuest()) { // force public view on - off by default form.setPublicView(true); } String appBase = form.getAppBase(); if (appBase != null) { // Embed in request for pages that cannot access the form (loggedOut) request.setAttribute("org.bedework.action.appbase", appBase); } /* Set up ready for the action */ if (getPublicAdmin(form)) { /* Set some options from the environment */ CalEnv env = getEnv(form); form.setAutoCreateSponsors(env.getAppBoolProperty("app.autocreatesponsors")); form.setAutoCreateLocations(env.getAppBoolProperty("app.autocreatelocations")); form.setAutoDeleteSponsors(env.getAppBoolProperty("app.autodeletesponsors")); form.setAutoDeleteLocations(env.getAppBoolProperty("app.autodeletelocations")); if (debug) { logIt("form.getGroupSet()=" + form.getGroupSet()); } /** Show the owner we are administering */ form.setAdminUserId(form.fetchSvci().getUser().getAccount()); if (debug) { logIt("-------- isSuperUser: " + form.getUserAuth().isSuperUser()); } if (!form.getAuthorisedUser()) { return "noAccess"; } String temp = checkGroup(request, form, true); if (temp != null) { if (debug) { logIt("form.getGroupSet()=" + form.getGroupSet()); } return temp; } /** Ensure we have prefs and other values for the AuthUser */ setAuthUser(form); } else { form.setAutoCreateSponsors(true); form.setAutoCreateLocations(true); form.setAutoDeleteSponsors(true); form.setAutoDeleteLocations(true); String refreshAction = form.getEnv().getAppOptProperty("app.refresh.action"); if (refreshAction == null) { refreshAction = form.getActionPath(); } if (refreshAction != null) { setRefreshInterval(request, response, form.getEnv().getAppIntProperty("app.refresh.interval"), refreshAction, form); } if (debug) { log.debug("curTimeView=" + form.getCurTimeView()); } } /* see if we got cancelled */ String reqpar = request.getParameter("cancelled"); if (reqpar != null) { /** Set the objects to null so we get new ones. */ form.initFields(); form.getMsg().emit("org.bedework.client.message.cancelled"); return "cancelled"; } try { forward = doAction(request, response, s, form); if (getPublicAdmin(form)) { } else { /* See if we need to refresh */ checkRefresh(form); } } catch (CalFacadeAccessException cfae) { form.getErr().emit("org.bedework.client.error.noaccess", "for that action"); forward="noaccess"; } catch (Throwable t) { form.getErr().emit("org.bedework.client.error.exc", t.getMessage()); form.getErr().emit(t); } return forward; } |
contentBytes = sb.toString().getBytes(); | contentBytes = detokenizeContent(sb); | private byte[] getBytes() { if (contentBytes != null) { return contentBytes; } StringBuffer sb = new StringBuffer(); for (int i = 0; i < content.length; i++) { sb.append(content[i]); sb.append("\n"); } contentBytes = sb.toString().getBytes(); return contentBytes; } |
contentBytes = baos.toByteArray(); | contentBytes = detokenizeContent(new StringBuffer(baos.toString())); | private byte[] getFileBytes() throws Throwable { if (contentBytes != null) { return contentBytes; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); FileInputStream in = new FileInputStream(contentFileName); do { int x = in.read(); if (x < 0) { break; } baos.write(x); } while (true); contentBytes = baos.toByteArray(); return contentBytes; } |
globals.getFixOwner().getAccount()); | globals.getPublicUser().getAccount()); | public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } } |
entity.setCreator(globals.getFixOwner()); | entity.setCreator(globals.getPublicUser()); | public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } } |
BwUser owner; | warn(name + " " + entity.getId() + " has no owner, set to " + globals.getPublicUser().getAccount()); | public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } } |
if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); | entity.setOwner(globals.getPublicUser()); if (!entity.getPublick()) { warn(name + " " + entity.getId() + " is NOT public"); | public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } } |
warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); | public void fixSharableEntity(BwShareableDbentity entity, String name) throws Exception { try { if (entity.getCreator() == null) { warn(name + " " + entity.getId() + " has no creator, set to " + globals.getFixOwner().getAccount()); entity.setCreator(globals.getFixOwner()); } if (entity.getOwner() == null) { BwUser owner; if (entity.getPublick()) { owner = globals.getPublicUser(); } else { owner = globals.getFixOwner(); } warn(name + " " + entity.getId() + " has no owner, set to " + owner.getAccount()); entity.setOwner(owner); } } catch (Throwable t) { throw new Exception(t); } } |
|
form.getErr().emit("org.bedework.client.notfound", str); | form.getErr().emit("org.bedework.client.error.usernotfound", str); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String str = getReqPar(request, "user"); if (str == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = getReqPar(request, "viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = getReqPar(request, "skin"); if (str != null) { prefs.setSkinName(str); } str = getReqPar(request, "skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); form.getMsg().emit("org.bedework.client.message.prefs.updated"); return "success"; } |
str = getReqPar(request, "view"); | str = getReqPar(request, "preferredView"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String str = getReqPar(request, "user"); if (str == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = getReqPar(request, "viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = getReqPar(request, "skin"); if (str != null) { prefs.setSkinName(str); } str = getReqPar(request, "skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); form.getMsg().emit("org.bedework.client.message.prefs.updated"); return "success"; } |
form.getErr().emit("org.bedework.client.notfound", str); | form.getErr().emit("org.bedework.client.error.viewnotfound", str); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.getCalSvcI(); String str = getReqPar(request, "user"); if (str == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } BwPreferences prefs = svc.getUserPrefs(user); str = getReqPar(request, "view"); if (str != null) { if (svc.findView(str) == null) { form.getErr().emit("org.bedework.client.notfound", str); return "notFound"; } prefs.setPreferredView(str); } str = getReqPar(request, "viewPeriod"); if (str != null) { prefs.setPreferredViewPeriod(form.validViewPeriod(str)); } str = getReqPar(request, "skin"); if (str != null) { prefs.setSkinName(str); } str = getReqPar(request, "skinStyle"); if (str != null) { prefs.setSkinStyle(str); } svc.updateUserPrefs(prefs); form.getMsg().emit("org.bedework.client.message.prefs.updated"); return "success"; } |
suite.addTestSuite(SerializationTest.class); | public static Test suite() { TestSuite suite = new TestSuite("All AT2 Interpreter-related tests."); //$JUnit-BEGIN$ suite.addTestSuite(InvocationTest.class); suite.addTestSuite(MirrorTest.class); suite.addTestSuite(MirageTest.class); suite.addTestSuite(ReflectionTest.class); suite.addTestSuite(NATObjectClosureTest.class); suite.addTestSuite(NATObjectTest.class); suite.addTestSuite(TestFieldMap.class); suite.addTestSuite(TestEval.class); suite.addTestSuite(PrimitivesTest.class); suite.addTestSuite(LexicalRootTest.class); suite.addTestSuite(NATNamespaceTest.class); suite.addTestSuite(CoercionTest.class); suite.addTestSuite(ExceptionHandlingTest.class); suite.addTestSuite(EscapeTest.class); suite.addTestSuite(MirrorsOnNativesTest.class); suite.addTestSuite(SymbiosisTest.class); suite.addTestSuite(CustomFieldsTest.class); suite.addTestSuite(TestParameterBinding.class); //$JUnit-END$ return suite; } |
|
protected static void writeLittleEndian(OutputStream out, int value) | protected static void writeLittleEndian(DataOutput out, int value) | protected static void writeLittleEndian(OutputStream out, int value) throws IOException { byte[] tmpBytes; tmpBytes = Utility.intToByteArray(value); out.write(tmpBytes[0]); out.write(tmpBytes[1]); out.write(tmpBytes[2]); out.write(tmpBytes[3]); } |
OutputStream out) { /* out.write("RIFF"); int size = 0; | DataOutput out) throws IOException { out.writeBytes("RIFF"); int size = 36 + 2*seis.getNumPoints(); | public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ } |
out.write("WAVE"); | out.writeBytes("WAVE"); | public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ } |
out.write("fmt "); | out.writeBytes("fmt "); | public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ } |
out.write("data"); writeLittleEndian(out, num_points*2); | out.writeBytes("data"); writeLittleEndian(out, seis.getNumPoints()*2); | public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ } |
*/ | public static void writeWAV(LocalSeismogramImpl seis, int speedUp, OutputStream out) { /* out.write("RIFF"); int size = 0; writeLittleEndian(out, size); out.write("WAVE"); // write fmt subchunk out.write("fmt "); writeLittleEndian(out, 16); writeLittleEndian(out, (short)1); // linear quantization, PCM writeLittleEndian(out, (short)1); // mono, 1 channel writeLittleEndian(out, samp); // sample rate writeLittleEndian(out, samp*2); // byte rate, 2 bytes per sample writeLittleEndian(out, (short)2); // block align writeLittleEndian(out, (short)16); // bits per sample // write data subchunk out.write("data"); writeLittleEndian(out, num_points*2); // subchunk2 size int[] data = seis.get_as_longs(); for ( int i=0; i<seis.getNumPoints(); i++) { writeLittleEndian(out, (short)data[i]); } // end of for () */ } |
|
sess.delete(val); | BwCalendar parent = val.getCalendar(); if (parent == null) { throw new CalFacadeException(CalFacadeException.cannotDeleteCalendarRoot); } parent.removeChild(val); sess.update(parent); | public boolean deleteCalendar(BwCalendar val) throws CalFacadeException { checkOpen(); sess.delete(val); return true; } |
String s = browser.getText(); | String s = loggingDir.getText(); | private void addLoggingDir(JPanel p) { final JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); final JButton button = new JButton("Choose"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String s = browser.getText(); if (s != null) { fileChooser.setSelectedFile(new File(s)); } int ret = fileChooser.showOpenDialog(EVI.getInstance().getMainFrame()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); if (f != null) { loggingDir.setText(f.toString()); } } } }); JPanel sub = new JPanel(new BorderLayout()); sub.add(new JPanel(), BorderLayout.NORTH); sub.add(new JPanel(), BorderLayout.SOUTH); sub.add(loggingDir, BorderLayout.WEST); sub.add(button, BorderLayout.EAST); JPanel row = new JPanel(new GridLayout(0, 2)); row.add(new JLabel("Logging directory:")); row.add(sub); p.add(row); } |
String s = browser.getText(); | String s = loggingDir.getText(); | public void actionPerformed(ActionEvent e) { String s = browser.getText(); if (s != null) { fileChooser.setSelectedFile(new File(s)); } int ret = fileChooser.showOpenDialog(EVI.getInstance().getMainFrame()); if (ret == JFileChooser.APPROVE_OPTION) { File f = fileChooser.getSelectedFile(); if (f != null) { loggingDir.setText(f.toString()); } } } |
if(startPoint < 0 && startPoint >= -3) { startPoint = 0; } | private void plotExpansion(double unroundStartPoint, int[][] points, double minAmp, double range, int height, int point){ int startPoint = (int)Math.floor(unroundStartPoint); int endPoint = startPoint + 1; double firstPoint = 0; double lastPoint = 0; try{ firstPoint = seis[0].getValueAt(startPoint).getValue(); lastPoint = seis[0].getValueAt(endPoint).getValue(); }catch(CodecException e){ logger.debug("Error getting a point from a local seismogram"); e.printStackTrace(); } double difference = unroundStartPoint - startPoint; double value = firstPoint * (1 - difference) + (lastPoint * difference); points[0][point] = (int)((value - minAmp)/range * height); points[1][point] = points[0][point]; } |
|
public Object getFieldValue(JRField field) throws JRException { return getFieldValue(new ReportableField(field)); | public Object getFieldValue(JRField jrField) throws JRException { return getFieldValue(new ReportableField(jrField)); | public Object getFieldValue(JRField field) throws JRException { return getFieldValue(new ReportableField(field)); } |
if(_reportIterator == null){ _reportIterator = this.iterator(); | if(_source == null){ _source = (IWDataSource)getJRDataSource(); | public boolean next() throws JRException { if(_reportIterator == null){ _reportIterator = this.iterator(); } try { if(_reportIterator.hasNext()){ _currentJRDataSource = (IDOReportableEntity)_reportIterator.next(); return true; } else { _currentJRDataSource = null; return false; } } catch (ClassCastException e) { _currentJRDataSource=null; e.printStackTrace(); throw new JRException(e); } } |
try { if(_reportIterator.hasNext()){ _currentJRDataSource = (IDOReportableEntity)_reportIterator.next(); return true; } else { _currentJRDataSource = null; return false; } } catch (ClassCastException e) { _currentJRDataSource=null; e.printStackTrace(); throw new JRException(e); } | return _source.next(); | public boolean next() throws JRException { if(_reportIterator == null){ _reportIterator = this.iterator(); } try { if(_reportIterator.hasNext()){ _currentJRDataSource = (IDOReportableEntity)_reportIterator.next(); return true; } else { _currentJRDataSource = null; return false; } } catch (ClassCastException e) { _currentJRDataSource=null; e.printStackTrace(); throw new JRException(e); } } |
ExceptionDialog.show(Messages.getString("TabBar.UNEXPECTED_ERROR"), exc); | ExceptionDialog.show(Messages.getString("ToolBar.UNEXPECTED_ERROR"), exc); | public void disposed(IModule disposedInstance) { try { IApplet applet = (IApplet)disposedInstance; removeApplet(applet); } catch (Exception exc) { ExceptionDialog.show(Messages.getString("TabBar.UNEXPECTED_ERROR"), exc); //$NON-NLS-1$ } } |
Messages.getString("MODULE_INSTANTIATION_EXCEPTION_NOTICE") | Messages.getString("ToolBar.MODULE_INSTANTIATION_EXCEPTION_NOTICE") | private JButton getDefaultButton(final ModuleContainer module) { JButton button = new JButton(module.getName()); button.setFocusPainted(false); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { ModuleFactory.newInstance(module); } catch (Exception exc) { ExceptionDialog.show( Messages.getString("MODULE_INSTANTIATION_EXCEPTION_NOTICE") //$NON-NLS-1$ +":\n"+ //$NON-NLS-1$ module.getId(), exc); } } }); return button; } |
Messages.getString("MODULE_INSTANTIATION_EXCEPTION_NOTICE") | Messages.getString("ToolBar.MODULE_INSTANTIATION_EXCEPTION_NOTICE") | public void actionPerformed(ActionEvent e) { try { ModuleFactory.newInstance(module); } catch (Exception exc) { ExceptionDialog.show( Messages.getString("MODULE_INSTANTIATION_EXCEPTION_NOTICE") //$NON-NLS-1$ +":\n"+ //$NON-NLS-1$ module.getId(), exc); } } |
if (debug) { trace("PublicAdmin: " + pars.getPublicAdmin() + " user: " + pars.getUser()); } if (pars.getPublicAdmin()) { dbi.close(); BwUser user = cali.getUser(pars.getUser()); dbi = new CalSvcDb(this, user); } | Calintf getCal() throws CalFacadeException { if (cali != null) { return cali; } try { cali = (Calintf)CalEnv.getGlobalObject("calintfclass", Calintf.class); } catch (Throwable t) { throw new CalFacadeException(t); } try { cali.open(); // Just for the user interactions cali.beginTransaction(); boolean userCreated = cali.init(pars.getAuthUser(), pars.getUser(), pars.getPublicAdmin(), pars.isSuperUser(), getGroups(), pars.getSynchId(), debug); // Prepare for call below. publicUserAccount = cali.getSyspars().getPublicUser(); BwUser auth;// XXX if (isPublicAdmin() || isGuest()) { if (isGuest()) { auth = getPublicUser(); } else { auth = cali.getUser(pars.getAuthUser()); } if (debug) { trace("Got auth user object " + auth); } dbi = new CalSvcDb(this, auth); if (userCreated) { // Add preferences BwPreferences prefs = new BwPreferences(); BwCalendar cal = cali.getDefaultCalendar(); prefs.setOwner(auth); prefs.setDefaultCalendar(cal); // Add default subscription for default calendar. BwSubscription defSub = BwSubscription.makeSubscription(cal, cal.getName(), true, true, false); setupOwnedEntity(defSub); prefs.addSubscription(defSub); // Add default subscription for trash calendar. cal = cali.getTrashCalendar(); BwSubscription sub = BwSubscription.makeSubscription(cal, cal.getName(), false, false, false); setupOwnedEntity(sub); prefs.addSubscription(sub); // Add a default view for the default calendar subscription BwView view = new BwView(); view.setName(getSyspars().getDefaultUserViewName()); view.addSubscription(defSub); view.setOwner(auth); prefs.addView(view); dbi.updatePreferences(prefs); } return cali; } finally { cali.endTransaction(); cali.close(); } } |
|
if (in.length() > 27) | if (in.length() >= 27) | public String make27(String in) { String out = ""; if (in.length() > 27) { out = in.substring(0, 27); } if (in.length() < 27) { out = in + Tool.space(27 - in.length()); } out = codingToDtaus(out); return out; } |
if (cei != null) { cei.setEvent(new BwEventProxy((BwEventAnnotation)cei.getEvent())); } | public Collection getEvent(BwCalendar calendar, String guid, String rid, int recurRetrieval) throws CalFacadeException { CoreEventInfo cei = null; BwEvent master = null; TreeSet ts = new TreeSet(); HibSession sess = getSess(); /* This (seems) to work as follows: * * First try to retrieve the event from the events table. * * If not there try the annotations table. If it's there, it's a reference * to an event owned by somebody else. Otherwise we drew a blank. * * If we want the recurrences and the event is recurring we go on to try to * retrieve the rest. */ if (rid == null) { // First look in the events table for the master. eventQuery(BwEventObj.class, calendar, guid, rid, true); /* There should be one only */ cei = postGetEvent((BwEvent)sess.getUnique(), privRead, noAccessReturnsNull, false); // XXX Don't want annotations in the trash if (cei == null) { /* Look for an annotation to that event by the current user. */ eventQuery(BwEventAnnotation.class, calendar, guid, rid, true); cei = postGetEvent((BwEvent)sess.getUnique(), privRead, noAccessReturnsNull, false); if (cei != null) { cei.setEvent(new BwEventProxy((BwEventAnnotation)cei.getEvent())); } } if (cei == null) { return ts; } master = cei.getEvent(); ts.add(cei); if ((recurRetrieval == CalFacadeDefs.retrieveRecurMaster) || (!master.getRecurring())) { return ts; } // Fetch all overrrides for this master event. /* FIXME Note that master.getOwner() cripples looking for user overrides of * the instances. * * We probably need to be able to fetch overrides by a user of instances * owned by another user. For the moment we just use the original * overrides - if any */ /* eventQuery(BwEventAnnotation.class, guid, rid, seqnum, false); Collection ovs = sess.getList(); Collection overrides = new TreeSet(); Iterator it = ovs.iterator(); while (it.hasNext()) { BwEventAnnotation override = (BwEventAnnotation)it.next(); BwEventProxy proxy = (BwEventProxy)postGetEvent( makeProxy(null, override, null, CalFacadeDefs.retrieveRecurExpanded), privRead, noAccessReturnsNull); if (proxy != null) { overrides.add(proxy); } } if (recurRetrieval == CalFacadeDefs.retrieveRecurOverrides) { // Overrides only - we're done ts.addAll(overrides); return ts; } */ if (recurRetrieval == CalFacadeDefs.retrieveRecurOverrides) { eventQuery(BwEventAnnotation.class, calendar, guid, rid, false); Collection ovs = sess.getList(); Collection overrides = new TreeSet(); Iterator it = ovs.iterator(); while (it.hasNext()) { BwEventAnnotation override = (BwEventAnnotation)it.next(); cei = makeProxy(null, override, null, CalFacadeDefs.retrieveRecurExpanded, false); if (cei != null) { overrides.add(cei); } } ts.addAll(overrides); return ts; } /* We want all instances. Get them and return. * Note that the overrides come with the instances. */ StringBuffer sb = new StringBuffer(); sb.append("from "); sb.append(BwRecurrenceInstance.class.getName()); sb.append(" rec "); sb.append(" where rec.master=:master "); sess.createQuery(sb.toString()); sess.setEntity("master", master); Collection instances = sess.getList(); Iterator it = instances.iterator(); while (it.hasNext()) { BwRecurrenceInstance instance = (BwRecurrenceInstance)it.next(); ts.add(makeProxy(instance, null, null, CalFacadeDefs.retrieveRecurExpanded, false)); } return ts; } /* Rid is non-null - look first for an override then for the instance. */ eventQuery(BwEventAnnotation.class, calendar, guid, rid, false); BwEventAnnotation override = (BwEventAnnotation)sess.getUnique(); if (override != null) { cei = makeProxy(null, override, null, CalFacadeDefs.retrieveRecurExpanded, false); } else { // Look in the recurrences table StringBuffer sb = new StringBuffer(); sb.append("from "); sb.append(BwRecurrenceInstance.class.getName()); sb.append(" rec "); sb.append(" where rec.master.guid=:guid "); sb.append(" and rec.recurrenceId=:rid "); sess.createQuery(sb.toString()); sess.setString("guid", guid); sess.setString("rid", rid); BwRecurrenceInstance inst = (BwRecurrenceInstance)sess.getUnique(); if (inst == null) { return ts; } cei = makeProxy(inst, null, null, CalFacadeDefs.retrieveRecurExpanded, false); } if (cei != null) { ts.add(cei); } return ts; } |
|
BwEvent ev = cnode.getEvent(); | BwEvent ev = cnode.getEventInfo().getEvent(); | public void delete(WebdavNsNode node) throws WebdavIntfException { try { CaldavBwNode uwnode = getBwnode(node); if (!(uwnode instanceof CaldavComponentNode)) { throw WebdavIntfException.unauthorized(); } CaldavComponentNode cnode = (CaldavComponentNode)uwnode; BwEvent ev = cnode.getEvent(); if (ev != null) { if (debug) { trace("About to delete event " + ev); } svci.deleteEvent(ev, true); } else { if (debug) { trace("No event object available"); } } } catch (WebdavIntfException we) { throw we; } catch (Throwable t) { throw new WebdavIntfException(t); } } |
acl = getSvci().getAcl(cdUri.getCal()); | acl = cdUri.getCal().getCurrentAccess().acl; | public void emitAcl(WebdavNsNode node) throws WebdavIntfException { CaldavBwNode uwnode = getBwnode(node); CaldavURI cdUri = uwnode.getCDURI(); Acl acl = null; try { if (cdUri.isCalendar()) { acl = getSvci().getAcl(cdUri.getCal()); } else { acl = getSvci().getAcl(((CaldavComponentNode)node).getEvent()); } emitAccess.emitAcl(acl); } catch (Throwable t) { throw new WebdavIntfException(t); } } |
acl = getSvci().getAcl(((CaldavComponentNode)node).getEvent()); | acl = ((CaldavComponentNode)node).getEventInfo().getCurrentAccess().acl; | public void emitAcl(WebdavNsNode node) throws WebdavIntfException { CaldavBwNode uwnode = getBwnode(node); CaldavURI cdUri = uwnode.getCDURI(); Acl acl = null; try { if (cdUri.isCalendar()) { acl = getSvci().getAcl(cdUri.getCal()); } else { acl = getSvci().getAcl(((CaldavComponentNode)node).getEvent()); } emitAccess.emitAcl(acl); } catch (Throwable t) { throw new WebdavIntfException(t); } } |
BwEvent ev = ((CaldavComponentNode)node).getEvent(); | BwEvent ev = ((CaldavComponentNode)node).getEventInfo().getEvent(); | public void updateAccess(AclInfo ainfo) throws WebdavIntfException { CdAclInfo info = (CdAclInfo)ainfo; CaldavBwNode node = (CaldavBwNode)getNode(info.what); CalSvcI svci = getSvci(); try { if (node.isCalendar()) { BwCalendar cal = node.getCDURI().getCal(); svci.changeAccess(cal, info.aces); svci.updateCalendar(cal); } else { BwEvent ev = ((CaldavComponentNode)node).getEvent(); svci.changeAccess(ev, info.aces); svci.updateEvent(ev); } } catch (WebdavIntfException wi) { throw wi; } catch (Throwable t) { throw new WebdavIntfException(t); } } |
String pathToFile = file.getAbsolutePath(); FileUtil.deleteAllFilesInDirectory(pathToFile); file.delete(); | FileUtil.deleteFileAndChildren(file); | private String getRealPathToReportFile(String fileName, String extension, long folderIdentifier) { IWMainApplication mainApp = getIWApplicationContext().getIWMainApplication(); String separator = FileUtil.getFileSeparator(); StringBuffer path = new StringBuffer(mainApp.getApplicationRealPath()); path.append(IWCacheManager.IW_ROOT_CACHE_DIRECTORY) .append(separator) .append(REPORT_FOLDER); // check if the folder exists create it if necessary // usually the folder should be already be there. // the folder is never deleted by this class String folderPath = path.toString(); File[] files = FileUtil.getAllFilesInDirectory(folderPath); if(files!=null){ long currentTime = System.currentTimeMillis(); for (int i = 0; i < files.length; i++) { File file = files[i]; long modifiedFile = file.lastModified(); if (currentTime - modifiedFile > 300000) { String pathToFile = file.getAbsolutePath(); FileUtil.deleteAllFilesInDirectory(pathToFile); file.delete(); } } } path.append(separator); path.append(folderIdentifier); folderPath = path.toString(); FileUtil.createFolder(folderPath); path.append(separator) .append(fileName) .append(DOT) .append(extension); return path.toString(); } |
ATObject newhost = initargs.base_at(NATNumber.ONE); if (newhost.isJavaObjectUnderSymbiosis()) { return new JavaField(newhost.asJavaObjectUnderSymbiosis().getWrappedObject(), field_); | if (initargs.base_getLength() != NATNumber.ONE) { return super.meta_newInstance(initargs); | public ATObject meta_newInstance(ATTable initargs) throws InterpreterException { ATObject newhost = initargs.base_at(NATNumber.ONE); if (newhost.isJavaObjectUnderSymbiosis()) { return new JavaField(newhost.asJavaObjectUnderSymbiosis().getWrappedObject(), field_); } else { throw new XIllegalArgument("Java Field re-initialization requires a symbiotic Java object, given " + newhost); } } |
throw new XIllegalArgument("Java Field re-initialization requires a symbiotic Java object, given " + newhost); | ATObject newhost = initargs.base_at(NATNumber.ONE); if (newhost.isJavaObjectUnderSymbiosis()) { return new JavaField(newhost.asJavaObjectUnderSymbiosis().getWrappedObject(), field_); } else { throw new XIllegalArgument("Java Field re-initialization requires a symbiotic Java object, given " + newhost); } | public ATObject meta_newInstance(ATTable initargs) throws InterpreterException { ATObject newhost = initargs.base_at(NATNumber.ONE); if (newhost.isJavaObjectUnderSymbiosis()) { return new JavaField(newhost.asJavaObjectUnderSymbiosis().getWrappedObject(), field_); } else { throw new XIllegalArgument("Java Field re-initialization requires a symbiotic Java object, given " + newhost); } } |
try { MultivaluedPersonAttributeUtils.parseAttributeToAttributeMapping(nullKeyMap); } catch (IllegalArgumentException iae) { return; } fail("Should have rejected map argument containing null value."); | final Map attrMapping = MultivaluedPersonAttributeUtils.parseAttributeToAttributeMapping(nullKeyMap); final Map expected = new HashMap(); expected.put("A", Collections.singleton("B")); expected.put("wombat", null); assertEquals(expected, attrMapping); | public void testNullValueMapping() { Map nullKeyMap = new HashMap(); nullKeyMap.put("A", "B"); nullKeyMap.put("wombat", null); try { MultivaluedPersonAttributeUtils.parseAttributeToAttributeMapping(nullKeyMap); } catch (IllegalArgumentException iae) { // good return; } fail("Should have rejected map argument containing null value."); } |
if(urlArray.length<1){ | if(urlArray == null || urlArray.length<1){ | private Class getDescriptorClassNameForViewId(String viewId) throws ClassNotFoundException{ String encryptedClassName = null; //if(viewId.startsWith("/window")){ // encryptedClassName = viewId.substring(11,viewId.length()); //} //else{ String[] urlArray= StringHandler.breakDownURL(viewId); if(urlArray.length<1){ //encryptedClassName = "6975"; Class defaultClass = Class.forName("com.idega.workspace.WorkspaceLoginPage"); encryptedClassName = IWMainApplication.getEncryptedClassName(defaultClass); } else if(urlArray.length==1){ encryptedClassName = urlArray[0]; } else if(urlArray.length==2){ encryptedClassName = urlArray[1]; } //String encryptedClassName=urlArray[1]; //} String realClassName = IWMainApplication.decryptClassName(encryptedClassName); return Class.forName(realClassName); } |
CalSvcIPars pars = new CalSvcIPars(user, user, | CalSvcIPars pars = new CalSvcIPars(user, user, null, | public CalSvcTestWrapper(String user, int access, boolean publicEvents, boolean debug) throws Throwable { super(); //this.debug = debug; isPublic = publicEvents; this.user = user; String envPrefix; if (publicEvents) { envPrefix = webAdminAppPrefix; } else if (user == null) { envPrefix = webPublicAppPrefix; } else { envPrefix = webPersonalAppPrefix; } CalSvcIPars pars = new CalSvcIPars(user, user, envPrefix, publicEvents, false, // caldav null, // synch debug); init(pars); } |
labelStr = particleMotion.hseis.getSeismogram().getName(); | labelStr = particleMotion.hseis.getName(); | public synchronized void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { logger.debug("IN DRAW LABELS"); Color color = new Color(0, 0, 0, 128); graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 20; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); String labelStr = new String(); labelStr = particleMotion.hseis.getSeismogram().getName(); int x = (dimension.width - (int)(labelStr.length()*fontSize)) / 2 - getInsets().left - getInsets().right; int y = dimension.height - 4; graphics2D.drawString(labelStr, x, y); labelStr = particleMotion.vseis.getSeismogram().getName(); x = font.getSize(); y = (dimension.height - (int)(labelStr.length()*fontSize)) / 2 - getInsets().top - getInsets().bottom; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance(Math.PI/2)); graphics2D.drawString(labelStr, 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); } |
labelStr = particleMotion.vseis.getSeismogram().getName(); | labelStr = particleMotion.vseis.getName(); | public synchronized void drawLabels(ParticleMotion particleMotion, Graphics2D graphics2D) { logger.debug("IN DRAW LABELS"); Color color = new Color(0, 0, 0, 128); graphics2D.setColor(color); java.awt.Dimension dimension = getSize(); float fontSize = dimension.width / 20; if(fontSize < 4) fontSize = 4; else if(fontSize > 32) fontSize = 32; Font font = new Font("serif", Font.BOLD, (int)fontSize); graphics2D.setFont(font); String labelStr = new String(); labelStr = particleMotion.hseis.getSeismogram().getName(); int x = (dimension.width - (int)(labelStr.length()*fontSize)) / 2 - getInsets().left - getInsets().right; int y = dimension.height - 4; graphics2D.drawString(labelStr, x, y); labelStr = particleMotion.vseis.getSeismogram().getName(); x = font.getSize(); y = (dimension.height - (int)(labelStr.length()*fontSize)) / 2 - getInsets().top - getInsets().bottom; //get the original AffineTransform AffineTransform oldTransform = graphics2D.getTransform(); AffineTransform ct = AffineTransform.getTranslateInstance(x, y); graphics2D.transform(ct); graphics2D.transform(AffineTransform.getRotateInstance(Math.PI/2)); graphics2D.drawString(labelStr, 0, 0); //restore the original AffineTransform graphics2D.setTransform(oldTransform); } |
form.initFields(); | initFields(form); | public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getUserAuth().isSuperUser()) { return "noAccess"; } /** Set the objects to null so we get new ones. */ form.initFields(); form.assignAddingAdmingroup(false); return "continue"; } |
fbc.setType(getFreeBusyType(periodEvents)); | public BwFreeBusy getFreeBusy(Collection subs, BwCalendar cal, BwPrincipal who, BwDateTime start, BwDateTime end, BwDuration granularity, boolean returnAll) throws CalFacadeException { if (!(who instanceof BwUser)) { throw new CalFacadeException("Unsupported: non user principal for free-busy"); } BwUser u = (BwUser)who; if (subs != null) { // Use these } else if (cal != null) { getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); BwSubscription sub = BwSubscription.makeSubscription(cal); subs = new ArrayList(); subs.add(sub); } else if (currentUser().equals(who)) { subs = getSubscriptions(); } else { cal = getCal().getCalendars(u, PrivilegeDefs.privReadFreeBusy); if (cal == null) { throw new CalFacadeAccessException(); } getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); subs = dbi.fetchPreferences(u).getSubscriptions(); } BwFreeBusy fb = new BwFreeBusy(who, start, end); Collection events = new TreeSet(); Iterator subit = subs.iterator(); while (subit.hasNext()) { BwSubscription sub = (BwSubscription)subit.next(); if (!sub.getAffectsFreeBusy()) { continue; } // XXX If it's an external subscription we probably just get free busy and // merge it in. Collection evs = getEvents(sub, null, start, end, CalFacadeDefs.retrieveRecurExpanded, true); // Filter out transparent events Iterator it = evs.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); if (!sub.getIgnoreTransparency() && BwEvent.transparencyTransparent.equals(ev.getTransparency())) { // Ignore this one. continue; } if (BwEvent.statusCancelled.equals(ev.getStatus())) { // Ignore this one. continue; } events.add(ei); } } try { if (granularity != null) { // chunked. GetPeriodsPars gpp = new GetPeriodsPars(); gpp.periods = events; gpp.startDt = start; gpp.dur = granularity; gpp.tzcache = getTimezones(); BwFreeBusyComponent fbc = null; if (!returnAll) { // One component fbc = new BwFreeBusyComponent(); fb.addTime(fbc); } int limit = 10000; // XXX do this better /* endDt is null first time through, then represents end of last * segment. */ while ((gpp.endDt == null) || (gpp.endDt.before(end))) { //if (debug) { // trace("gpp.startDt=" + gpp.startDt + " end=" + end); //} if (limit < 0) { throw new CalFacadeException("org.bedework.svci.limit.exceeded"); } limit--; Collection periodEvents = CalFacadeUtil.getPeriodsEvents(gpp); if (returnAll) { fbc = new BwFreeBusyComponent(); fb.addTime(fbc); DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); if (periodEvents.size() == 0) { fbc.setType(BwFreeBusyComponent.typeFree); } } else if (periodEvents.size() != 0) { /* Some events fall in the period. Add an entry. * We eliminated cancelled events earler. Now we should set the * free/busy type based on the events status. */ DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); if (fbc == null) { fbc = new BwFreeBusyComponent(); fb.addTime(fbc); } fbc.addPeriod(new Period(psdt, pedt)); } } return fb; } Iterator it = events.iterator(); TreeSet eventPeriods = new TreeSet(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); if (BwEvent.statusCancelled.equals(ev.getStatus())) { // Ignore this one. continue; } // Ignore if times were specified and this event is outside the times BwDateTime estart = ev.getDtstart(); BwDateTime eend = ev.getDtend(); /* Don't report out of the requested period */ String dstart; String dend; if (estart.before(start)) { dstart = start.getDtval(); } else { dstart = estart.getDtval(); } if (eend.after(end)) { dend = end.getDtval(); } else { dend = eend.getDtval(); } DateTime psdt = new DateTime(dstart); DateTime pedt = new DateTime(dend); psdt.setUtc(true); pedt.setUtc(true); int type = BwFreeBusyComponent.typeBusy; if (BwEvent.statusTentative.equals(ev.getStatus())) { type = BwFreeBusyComponent.typeBusyTentative; } eventPeriods.add(new EventPeriod(psdt, pedt, type)); } /* iterate through the sorted periods combining them where they are adjacent or overlap */ Period p = null; /* For the moment just build a single BwFreeBusyComponent */ BwFreeBusyComponent fbc = null; int lastType = 0; it = eventPeriods.iterator(); while (it.hasNext()) { EventPeriod ep = (EventPeriod)it.next(); if (debug) { trace(ep.toString()); } if (p == null) { p = new Period(ep.start, ep.end); lastType = ep.type; } else if ((lastType != ep.type) || ep.start.after(p.getEnd())) { // Non adjacent periods if (fbc == null) { fbc = new BwFreeBusyComponent(); fbc.setType(lastType); fb.addTime(fbc); } fbc.addPeriod(p); if (lastType != ep.type) { fbc = null; } p = new Period(ep.start, ep.end); lastType = ep.type; } else if (ep.end.after(p.getEnd())) { // Extend the current period p = new Period(p.getStart(), ep.end); } // else it falls within the existing period } if (p != null) { if ((fbc == null) || (lastType != fbc.getType())) { fbc = new BwFreeBusyComponent(); fbc.setType(lastType); fb.addTime(fbc); } fbc.addPeriod(p); } } catch (Throwable t) { if (debug) { error(t); } throw new CalFacadeException(t); } return fb; } |
|
throw new DtausException(DtausException.A_KONTO_FEHLERHAFT); | throw new DtausException(DtausException.A_KONTO_FEHLERHAFT, value); | public void setKonto(String value) throws DtausException { try { aKonto = Long.parseLong(value); } catch (NumberFormatException e) { throw new DtausException(DtausException.A_KONTO_FEHLERHAFT); } } |
if (p.getOwner().getId() != intFld()) { | BwUser sowner = userFld(); if (!p.getOwner().equals(sowner)) { | public void field(String name) throws java.lang.Exception{ BwPreferences p = (BwPreferences)top(); if (ownedEntityTags(p, name)) { return; } if (name.equals("email")) { p.setEmail(stringFld()); } else if (name.equals("default-calendar")) { p.setDefaultCalendar(calendarFld()); } else if (name.equals("skinName")) { p.setSkinName(stringFld()); } else if (name.equals("skinStyle")) { p.setSkinStyle(stringFld()); } else if (name.equals("preferredView")) { p.setPreferredView(stringFld()); } else if (name.equals("subscriptions")) { // Nothing to do now } else if (name.equals("workDays")) { p.setWorkDays(stringFld()); } else if (name.equals("workdayStart")) { p.setWorkdayStart(intFld()); } else if (name.equals("workdayEnd")) { p.setWorkdayEnd(intFld()); // subscription fields } else if (name.equals("subscription")) { globals.subscriptionsTbl.put(p.getOwner(), globals.curSub); p.addSubscription(globals.curSub); globals.curSub = null; } else if (name.equals("sub-id")) { globals.curSub = new BwSubscription(); globals.curSub.setId(intFld()); } else if (name.equals("sub-seq")) { globals.curSub.setSeq(intFld()); } else if (name.equals("sub-name")) { globals.curSub.setName(stringFld()); } else if (name.equals("sub-owner")) { if (p.getOwner().getId() != intFld()) { error("Subscription owners don't match for " + globals.curSub); error(" Found owner id " + intFld() + " expected " + p); } globals.curSub.setOwner(p.getOwner()); } else if (name.equals("sub-uri")) { globals.curSub.setUri(stringFld()); } else if (name.equals("sub-affectsFreeBusy")) { globals.curSub.setAffectsFreeBusy(booleanFld()); } else if (name.equals("sub-display")) { globals.curSub.setDisplay(booleanFld()); } else if (name.equals("sub-style")) { globals.curSub.setStyle(stringFld()); } else if (name.equals("sub-internalSubscription")) { globals.curSub.setInternalSubscription(booleanFld()); } else if (name.equals("sub-emailNotifications")) { globals.curSub.setEmailNotifications(booleanFld()); } else if (name.equals("sub-calendarDeleted")) { globals.curSub.setCalendarDeleted(booleanFld()); } else if (name.equals("sub-unremoveable")) { globals.curSub.setUnremoveable(booleanFld()); // view fields } else if (name.equals("view")) { p.addView(globals.curView); globals.curView = null; } else if (name.equals("view-id")) { globals.curView = new BwView(); globals.curView.setId(intFld()); } else if (name.equals("view-seq")) { globals.curView.setSeq(intFld()); } else if (name.equals("view-name")) { globals.curView.setName(stringFld()); } else if (name.equals("view-owner")) { if (p.getOwner().getId() != intFld()) { error("Viewowners don't match for " + globals.curView); error(" Found owner id " + intFld() + " expected " + p.getOwner()); } globals.curView.setOwner(p.getOwner()); } else if (name.equals("view-subscriptions")) { } else if (name.equals("view-sub-id")) { BwSubscription sub = globals.subscriptionsTbl.getSub(p.getOwner(), intFld()); if (sub == null) { error(" Missing subscription " + intFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } } |
error(" Found owner id " + intFld() + " expected " + p); | error(" Found owner " + sowner + " expected " + p.getOwner()); | public void field(String name) throws java.lang.Exception{ BwPreferences p = (BwPreferences)top(); if (ownedEntityTags(p, name)) { return; } if (name.equals("email")) { p.setEmail(stringFld()); } else if (name.equals("default-calendar")) { p.setDefaultCalendar(calendarFld()); } else if (name.equals("skinName")) { p.setSkinName(stringFld()); } else if (name.equals("skinStyle")) { p.setSkinStyle(stringFld()); } else if (name.equals("preferredView")) { p.setPreferredView(stringFld()); } else if (name.equals("subscriptions")) { // Nothing to do now } else if (name.equals("workDays")) { p.setWorkDays(stringFld()); } else if (name.equals("workdayStart")) { p.setWorkdayStart(intFld()); } else if (name.equals("workdayEnd")) { p.setWorkdayEnd(intFld()); // subscription fields } else if (name.equals("subscription")) { globals.subscriptionsTbl.put(p.getOwner(), globals.curSub); p.addSubscription(globals.curSub); globals.curSub = null; } else if (name.equals("sub-id")) { globals.curSub = new BwSubscription(); globals.curSub.setId(intFld()); } else if (name.equals("sub-seq")) { globals.curSub.setSeq(intFld()); } else if (name.equals("sub-name")) { globals.curSub.setName(stringFld()); } else if (name.equals("sub-owner")) { if (p.getOwner().getId() != intFld()) { error("Subscription owners don't match for " + globals.curSub); error(" Found owner id " + intFld() + " expected " + p); } globals.curSub.setOwner(p.getOwner()); } else if (name.equals("sub-uri")) { globals.curSub.setUri(stringFld()); } else if (name.equals("sub-affectsFreeBusy")) { globals.curSub.setAffectsFreeBusy(booleanFld()); } else if (name.equals("sub-display")) { globals.curSub.setDisplay(booleanFld()); } else if (name.equals("sub-style")) { globals.curSub.setStyle(stringFld()); } else if (name.equals("sub-internalSubscription")) { globals.curSub.setInternalSubscription(booleanFld()); } else if (name.equals("sub-emailNotifications")) { globals.curSub.setEmailNotifications(booleanFld()); } else if (name.equals("sub-calendarDeleted")) { globals.curSub.setCalendarDeleted(booleanFld()); } else if (name.equals("sub-unremoveable")) { globals.curSub.setUnremoveable(booleanFld()); // view fields } else if (name.equals("view")) { p.addView(globals.curView); globals.curView = null; } else if (name.equals("view-id")) { globals.curView = new BwView(); globals.curView.setId(intFld()); } else if (name.equals("view-seq")) { globals.curView.setSeq(intFld()); } else if (name.equals("view-name")) { globals.curView.setName(stringFld()); } else if (name.equals("view-owner")) { if (p.getOwner().getId() != intFld()) { error("Viewowners don't match for " + globals.curView); error(" Found owner id " + intFld() + " expected " + p.getOwner()); } globals.curView.setOwner(p.getOwner()); } else if (name.equals("view-subscriptions")) { } else if (name.equals("view-sub-id")) { BwSubscription sub = globals.subscriptionsTbl.getSub(p.getOwner(), intFld()); if (sub == null) { error(" Missing subscription " + intFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } } |
if (p.getOwner().getId() != intFld()) { error("Viewowners don't match for " + globals.curView); error(" Found owner id " + intFld() + " expected " + p.getOwner()); | BwUser vowner = userFld(); if (!p.getOwner().equals(vowner)) { error("View owners don't match for " + globals.curView); error(" Found owner " + vowner + " expected " + p.getOwner()); | public void field(String name) throws java.lang.Exception{ BwPreferences p = (BwPreferences)top(); if (ownedEntityTags(p, name)) { return; } if (name.equals("email")) { p.setEmail(stringFld()); } else if (name.equals("default-calendar")) { p.setDefaultCalendar(calendarFld()); } else if (name.equals("skinName")) { p.setSkinName(stringFld()); } else if (name.equals("skinStyle")) { p.setSkinStyle(stringFld()); } else if (name.equals("preferredView")) { p.setPreferredView(stringFld()); } else if (name.equals("subscriptions")) { // Nothing to do now } else if (name.equals("workDays")) { p.setWorkDays(stringFld()); } else if (name.equals("workdayStart")) { p.setWorkdayStart(intFld()); } else if (name.equals("workdayEnd")) { p.setWorkdayEnd(intFld()); // subscription fields } else if (name.equals("subscription")) { globals.subscriptionsTbl.put(p.getOwner(), globals.curSub); p.addSubscription(globals.curSub); globals.curSub = null; } else if (name.equals("sub-id")) { globals.curSub = new BwSubscription(); globals.curSub.setId(intFld()); } else if (name.equals("sub-seq")) { globals.curSub.setSeq(intFld()); } else if (name.equals("sub-name")) { globals.curSub.setName(stringFld()); } else if (name.equals("sub-owner")) { if (p.getOwner().getId() != intFld()) { error("Subscription owners don't match for " + globals.curSub); error(" Found owner id " + intFld() + " expected " + p); } globals.curSub.setOwner(p.getOwner()); } else if (name.equals("sub-uri")) { globals.curSub.setUri(stringFld()); } else if (name.equals("sub-affectsFreeBusy")) { globals.curSub.setAffectsFreeBusy(booleanFld()); } else if (name.equals("sub-display")) { globals.curSub.setDisplay(booleanFld()); } else if (name.equals("sub-style")) { globals.curSub.setStyle(stringFld()); } else if (name.equals("sub-internalSubscription")) { globals.curSub.setInternalSubscription(booleanFld()); } else if (name.equals("sub-emailNotifications")) { globals.curSub.setEmailNotifications(booleanFld()); } else if (name.equals("sub-calendarDeleted")) { globals.curSub.setCalendarDeleted(booleanFld()); } else if (name.equals("sub-unremoveable")) { globals.curSub.setUnremoveable(booleanFld()); // view fields } else if (name.equals("view")) { p.addView(globals.curView); globals.curView = null; } else if (name.equals("view-id")) { globals.curView = new BwView(); globals.curView.setId(intFld()); } else if (name.equals("view-seq")) { globals.curView.setSeq(intFld()); } else if (name.equals("view-name")) { globals.curView.setName(stringFld()); } else if (name.equals("view-owner")) { if (p.getOwner().getId() != intFld()) { error("Viewowners don't match for " + globals.curView); error(" Found owner id " + intFld() + " expected " + p.getOwner()); } globals.curView.setOwner(p.getOwner()); } else if (name.equals("view-subscriptions")) { } else if (name.equals("view-sub-id")) { BwSubscription sub = globals.subscriptionsTbl.getSub(p.getOwner(), intFld()); if (sub == null) { error(" Missing subscription " + intFld() + " for view " + globals.curView); } else { globals.curView.addSubscription(sub); } } } |
transform(graphics2d, orientation, xc, yc); | transform(graphics2d, orient, xc, yc); | private void drawString(Graphics2D graphics2d, String string, Point p, int alignment, double orientation) { int xc = p.x; int yc = p.y; AffineTransform transform = graphics2d.getTransform(); transform(graphics2d, orientation, xc, yc); FontMetrics fm = graphics2d.getFontMetrics(); double realTextWidth = fm.stringWidth(string); double realTextHeight = fm.getHeight() - fm.getDescent(); int offsetX = (int) (realTextWidth * (double) (alignment % 3) / 2.0); int offsetY = (int) (-realTextHeight * (double) (alignment / 3) / 2.0); if ((graphics2d != null) && (string != null)) { graphics2d.drawString(string, xc - offsetX, yc - offsetY); } graphics2d.setTransform(transform); } |
new AGDefMethod(superSemantics, NATTable.EMPTY, | new AGDefFunction(superSemantics, NATTable.EMPTY, | public void testExtend() { try { NATObject parent = new NATObject(lexicalRoot_); ATSymbol superSemantics = AGSymbol.alloc(NATText.atValue("superSemantics")); AGScopeTest test = new AGScopeTest(null, null, parent); NATObject child = (NATObject)parent.meta_extend( new NATClosure( new NATMethod(AGSymbol.alloc(NATText.atValue("lambda")), NATTable.EMPTY, new AGDefMethod(superSemantics, NATTable.EMPTY, new AGBegin( new NATTable( new ATObject[] { test } )))), lexicalRoot_)); test.scope_ = child; test.self_ = child; ATSymbol lateBoundSelf = AGSymbol.alloc(NATText.atValue("lateBoundSelf")); ATMethod lateBoundSelfTestMethod = new NATMethod( lateBoundSelf, NATTable.EMPTY, new AGScopeTest(parent, child, NATNil._INSTANCE_)); parent.meta_addMethod(lateBoundSelfTestMethod); child.meta_invoke(child, lateBoundSelf, NATTable.EMPTY); child.meta_invoke(child, superSemantics, NATTable.EMPTY); } catch (NATException e) { e.printStackTrace(); fail(); } } |
owningActor_ = (ELActor) EventLoop.currentEventLoop(); | wrappingThread_ = Thread.currentThread(); | private Coercer(NATObject principal) { principal_ = principal; owningActor_ = (ELActor) EventLoop.currentEventLoop(); } |
if (!(Thread.currentThread() instanceof EventProcessor)) { | if (Thread.currentThread() != wrappingThread_) { if (Thread.currentThread() instanceof EventProcessor) { throw new XIllegalOperation("Detected illegal invocation: sharing via Java level of object " + principal_); } | public Object invoke(Object receiver, final Method method, Object[] arguments) throws Throwable { // handle toString, hashCode and equals in a dedicated fashion if (method.getDeclaringClass() == Object.class) { // invoke these methods on the principal rather than on the proxy try { return method.invoke(principal_, arguments); } catch (InvocationTargetException e) { throw e.getTargetException(); } // intercept access to the wrapped object for Java->AT value conversion } else if (method.getDeclaringClass() == SymbioticATObjectMarker.class) { return principal_; } else { final ATObject[] symbioticArgs; // support for variable-arity invocations from within AmbientTalk if ((arguments != null) && (arguments.length == 1) && (arguments[0] instanceof ATObject[])) { // no need to convert arguments symbioticArgs = (ATObject[]) arguments[0]; } else { symbioticArgs = new ATObject[(arguments == null) ? 0 : arguments.length]; for (int i = 0; i < symbioticArgs.length; i++) { symbioticArgs[i] = Symbiosis.javaToAmbientTalk(arguments[i]); } } // if the current thread is not an actor thread, treat the Java invocation // as a message send instead and enqueue it in my actor's thread if (!(Thread.currentThread() instanceof EventProcessor)) { // because a message send is asynchronous and Java threads work synchronously, // we'll have to make the Java thread wait for the result return owningActor_.sync_event_symbioticInvocation(new Callable() { public Object call(Object actorMirror) throws Exception { ATObject result = Reflection.downInvocation(principal_, method, symbioticArgs); return Symbiosis.ambientTalkToJava(result, method.getReturnType()); } }); } else { if (owningActor_ == EventLoop.currentEventLoop()) { // perform a synchronous invocation ATObject result = Reflection.downInvocation(principal_, method, symbioticArgs); // properly 'cast' the returned object into the appropriate interface return Symbiosis.ambientTalkToJava(result, method.getReturnType()); } else { // another event loop has direct access to this object, this means // an AT object has been shared between actors via Java, signal an error throw new XIllegalOperation("Detected illegal invocation: sharing via Java level of object " + principal_); } } } } |
return owningActor_.sync_event_symbioticInvocation(new Callable() { | ELActor owningActor = (ELActor) EventLoop.toEventLoop(wrappingThread_); return owningActor.sync_event_symbioticInvocation(new Callable() { | public Object invoke(Object receiver, final Method method, Object[] arguments) throws Throwable { // handle toString, hashCode and equals in a dedicated fashion if (method.getDeclaringClass() == Object.class) { // invoke these methods on the principal rather than on the proxy try { return method.invoke(principal_, arguments); } catch (InvocationTargetException e) { throw e.getTargetException(); } // intercept access to the wrapped object for Java->AT value conversion } else if (method.getDeclaringClass() == SymbioticATObjectMarker.class) { return principal_; } else { final ATObject[] symbioticArgs; // support for variable-arity invocations from within AmbientTalk if ((arguments != null) && (arguments.length == 1) && (arguments[0] instanceof ATObject[])) { // no need to convert arguments symbioticArgs = (ATObject[]) arguments[0]; } else { symbioticArgs = new ATObject[(arguments == null) ? 0 : arguments.length]; for (int i = 0; i < symbioticArgs.length; i++) { symbioticArgs[i] = Symbiosis.javaToAmbientTalk(arguments[i]); } } // if the current thread is not an actor thread, treat the Java invocation // as a message send instead and enqueue it in my actor's thread if (!(Thread.currentThread() instanceof EventProcessor)) { // because a message send is asynchronous and Java threads work synchronously, // we'll have to make the Java thread wait for the result return owningActor_.sync_event_symbioticInvocation(new Callable() { public Object call(Object actorMirror) throws Exception { ATObject result = Reflection.downInvocation(principal_, method, symbioticArgs); return Symbiosis.ambientTalkToJava(result, method.getReturnType()); } }); } else { if (owningActor_ == EventLoop.currentEventLoop()) { // perform a synchronous invocation ATObject result = Reflection.downInvocation(principal_, method, symbioticArgs); // properly 'cast' the returned object into the appropriate interface return Symbiosis.ambientTalkToJava(result, method.getReturnType()); } else { // another event loop has direct access to this object, this means // an AT object has been shared between actors via Java, signal an error throw new XIllegalOperation("Detected illegal invocation: sharing via Java level of object " + principal_); } } } } |
if (owningActor_ == EventLoop.currentEventLoop()) { ATObject result = Reflection.downInvocation(principal_, method, symbioticArgs); return Symbiosis.ambientTalkToJava(result, method.getReturnType()); } else { throw new XIllegalOperation("Detected illegal invocation: sharing via Java level of object " + principal_); } | ATObject result = Reflection.downInvocation(principal_, method, symbioticArgs); return Symbiosis.ambientTalkToJava(result, method.getReturnType()); | public Object invoke(Object receiver, final Method method, Object[] arguments) throws Throwable { // handle toString, hashCode and equals in a dedicated fashion if (method.getDeclaringClass() == Object.class) { // invoke these methods on the principal rather than on the proxy try { return method.invoke(principal_, arguments); } catch (InvocationTargetException e) { throw e.getTargetException(); } // intercept access to the wrapped object for Java->AT value conversion } else if (method.getDeclaringClass() == SymbioticATObjectMarker.class) { return principal_; } else { final ATObject[] symbioticArgs; // support for variable-arity invocations from within AmbientTalk if ((arguments != null) && (arguments.length == 1) && (arguments[0] instanceof ATObject[])) { // no need to convert arguments symbioticArgs = (ATObject[]) arguments[0]; } else { symbioticArgs = new ATObject[(arguments == null) ? 0 : arguments.length]; for (int i = 0; i < symbioticArgs.length; i++) { symbioticArgs[i] = Symbiosis.javaToAmbientTalk(arguments[i]); } } // if the current thread is not an actor thread, treat the Java invocation // as a message send instead and enqueue it in my actor's thread if (!(Thread.currentThread() instanceof EventProcessor)) { // because a message send is asynchronous and Java threads work synchronously, // we'll have to make the Java thread wait for the result return owningActor_.sync_event_symbioticInvocation(new Callable() { public Object call(Object actorMirror) throws Exception { ATObject result = Reflection.downInvocation(principal_, method, symbioticArgs); return Symbiosis.ambientTalkToJava(result, method.getReturnType()); } }); } else { if (owningActor_ == EventLoop.currentEventLoop()) { // perform a synchronous invocation ATObject result = Reflection.downInvocation(principal_, method, symbioticArgs); // properly 'cast' the returned object into the appropriate interface return Symbiosis.ambientTalkToJava(result, method.getReturnType()); } else { // another event loop has direct access to this object, this means // an AT object has been shared between actors via Java, signal an error throw new XIllegalOperation("Detected illegal invocation: sharing via Java level of object " + principal_); } } } } |
semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.EnumerationEditPart.VISUAL_ID); | semanticHint = UMLVisualIDRegistry.getType(EnumerationEditPart.VISUAL_ID); | protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) { if (semanticHint == null) { semanticHint = UMLVisualIDRegistry.getType(org.eclipse.uml2.diagram.profile.edit.parts.EnumerationEditPart.VISUAL_ID); view.setType(semanticHint); } super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted); if (!ProfileEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(containerView))) { EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation(); shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ shortcutAnnotation.getDetails().put("modelID", ProfileEditPart.MODEL_ID); //$NON-NLS-1$ view.getEAnnotations().add(shortcutAnnotation); } getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(EnumerationNameEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint()); getViewService().createNode(semanticAdapter, view, UMLVisualIDRegistry.getType(EnumerationLiteralsEditPart.VISUAL_ID), ViewUtil.APPEND, true, getPreferencesHint()); } |
double[] acfVals = acf(maxlag); double[] out = new double[acfVals.length]; double sumsqrs=0; for (int i=0; i<acfVals.length; i++) { sumsqrs += acfVals[i]*acfVals[i]; out[i] = 1.96*Math.sqrt(1+2*sumsqrs) / Math.sqrt(getLength()); | double[] acfVals = acf(maxlag); double[] out = new double[acfVals.length]; double sumsqrs=0; for (int i=0; i<acfVals.length; i++) { sumsqrs += acfVals[i]*acfVals[i]; out[i] = 1.96*Math.sqrt(1+2*sumsqrs) / Math.sqrt(getLength()); } return out; | public double[] acf95conf(int maxlag) { double[] acfVals = acf(maxlag); double[] out = new double[acfVals.length]; double sumsqrs=0; for (int i=0; i<acfVals.length; i++) { sumsqrs += acfVals[i]*acfVals[i]; out[i] = 1.96*Math.sqrt(1+2*sumsqrs) / Math.sqrt(getLength()); } return out; } |
return out; } | public double[] acf95conf(int maxlag) { double[] acfVals = acf(maxlag); double[] out = new double[acfVals.length]; double sumsqrs=0; for (int i=0; i<acfVals.length; i++) { sumsqrs += acfVals[i]*acfVals[i]; out[i] = 1.96*Math.sqrt(1+2*sumsqrs) / Math.sqrt(getLength()); } return out; } |
|
double[] acfVals = acf(maxlag); double[] conf = acf95conf(maxlag); double[] out = new double[acfVals.length]; for (int i=0; i<acfVals.length; i++) { out[i] = 1.96* Math.abs(acfVals[i]) / conf[i]; | double[] acfVals = acf(maxlag); double[] conf = acf95conf(maxlag); double[] out = new double[acfVals.length]; for (int i=0; i<acfVals.length; i++) { out[i] = 1.96* Math.abs(acfVals[i]) / conf[i]; } return out; | public double[] acfTRatio(int maxlag) { double[] acfVals = acf(maxlag); double[] conf = acf95conf(maxlag); double[] out = new double[acfVals.length]; for (int i=0; i<acfVals.length; i++) { out[i] = 1.96* Math.abs(acfVals[i]) / conf[i]; } return out; } |
return out; } | public double[] acfTRatio(int maxlag) { double[] acfVals = acf(maxlag); double[] conf = acf95conf(maxlag); double[] out = new double[acfVals.length]; for (int i=0; i<acfVals.length; i++) { out[i] = 1.96* Math.abs(acfVals[i]) / conf[i]; } return out; } |
|
double[] outMinMaxMean = new double[3]; outMinMaxMean[0] = Double.POSITIVE_INFINITY; outMinMaxMean[1] = Double.NEGATIVE_INFINITY; outMinMaxMean[2] = 0; if (iSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], iSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], iSeries[i]); outMinMaxMean[2] += iSeries[i]; } } else if (sSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], sSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], sSeries[i]); outMinMaxMean[2] += sSeries[i]; } } else if (fSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], fSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], fSeries[i]); outMinMaxMean[2] += fSeries[i]; } } else if (dSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], dSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], dSeries[i]); outMinMaxMean[2] += dSeries[i]; } | double[] outMinMaxMean = new double[3]; outMinMaxMean[0] = Double.POSITIVE_INFINITY; outMinMaxMean[1] = Double.NEGATIVE_INFINITY; outMinMaxMean[2] = 0; if (iSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], iSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], iSeries[i]); outMinMaxMean[2] += iSeries[i]; } } else if (sSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], sSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], sSeries[i]); outMinMaxMean[2] += sSeries[i]; } } else if (fSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], fSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], fSeries[i]); outMinMaxMean[2] += fSeries[i]; } } else if (dSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], dSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], dSeries[i]); outMinMaxMean[2] += dSeries[i]; } } outMinMaxMean[2] /= (endIndex - beginIndex); return outMinMaxMean; | private double[] calculateMinMaxMean(int beginIndex, int endIndex){ double[] outMinMaxMean = new double[3]; outMinMaxMean[0] = Double.POSITIVE_INFINITY; outMinMaxMean[1] = Double.NEGATIVE_INFINITY; outMinMaxMean[2] = 0; if (iSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], iSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], iSeries[i]); outMinMaxMean[2] += iSeries[i]; } // end of for (int i=0; i<iSeries.length; i++) } else if (sSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], sSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], sSeries[i]); outMinMaxMean[2] += sSeries[i]; } // end of for (int i=0; i<sSeries.length; i++) } else if (fSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], fSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], fSeries[i]); outMinMaxMean[2] += fSeries[i]; } // end of for (int i=0; i<fSeries.length; i++) } else if (dSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], dSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], dSeries[i]); outMinMaxMean[2] += dSeries[i]; } // end of for (int i=0; i<dSeries.length; i++) } outMinMaxMean[2] /= (endIndex - beginIndex); return outMinMaxMean; } |
outMinMaxMean[2] /= (endIndex - beginIndex); return outMinMaxMean; } | private double[] calculateMinMaxMean(int beginIndex, int endIndex){ double[] outMinMaxMean = new double[3]; outMinMaxMean[0] = Double.POSITIVE_INFINITY; outMinMaxMean[1] = Double.NEGATIVE_INFINITY; outMinMaxMean[2] = 0; if (iSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], iSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], iSeries[i]); outMinMaxMean[2] += iSeries[i]; } // end of for (int i=0; i<iSeries.length; i++) } else if (sSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], sSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], sSeries[i]); outMinMaxMean[2] += sSeries[i]; } // end of for (int i=0; i<sSeries.length; i++) } else if (fSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], fSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], fSeries[i]); outMinMaxMean[2] += fSeries[i]; } // end of for (int i=0; i<fSeries.length; i++) } else if (dSeries != null) { for (int i = beginIndex; i < endIndex; i++) { outMinMaxMean[0] = Math.min(outMinMaxMean[0], dSeries[i]); outMinMaxMean[1] = Math.max(outMinMaxMean[1], dSeries[i]); outMinMaxMean[2] += dSeries[i]; } // end of for (int i=0; i<dSeries.length; i++) } outMinMaxMean[2] /= (endIndex - beginIndex); return outMinMaxMean; } |
|
if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * dSeries[i]; | if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinaryIndexSum(start, middle) + dBinaryIndexSum(middle, finish); | private double dBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); } } |
return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); | private double dBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); } } |
|
} | private double dBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); } } |
|
if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += dSeries[i]; | if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); | private double dBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); } } |
return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); | private double dBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); } } |
|
} | private double dBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); } } |
|
double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (dSeries[i]-mean)*(dSeries[i+lag]-mean); | double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (dSeries[i]-mean)*(dSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevLag(start, middle, mean, lag) + dBinarySumDevLag(middle, finish, mean, lag); | private double dBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (dSeries[i]-mean)*(dSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevLag(start, middle, mean, lag) + dBinarySumDevLag(middle, finish, mean, lag); } } |
return val; } else { int middle = (start + finish) / 2; return dBinarySumDevLag(start, middle, mean, lag) + dBinarySumDevLag(middle, finish, mean, lag); | private double dBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (dSeries[i]-mean)*(dSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevLag(start, middle, mean, lag) + dBinarySumDevLag(middle, finish, mean, lag); } } |
|
} | private double dBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (dSeries[i]-mean)*(dSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevLag(start, middle, mean, lag) + dBinarySumDevLag(middle, finish, mean, lag); } } |
|
if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (dSeries[i]-mean)*(dSeries[i]-mean); | if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (dSeries[i]-mean)*(dSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevSqr(start, middle, mean) + dBinarySumDevSqr(middle, finish, mean); | private double dBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (dSeries[i]-mean)*(dSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevSqr(start, middle, mean) + dBinarySumDevSqr(middle, finish, mean); } } |
return val; } else { int middle = (start + finish) / 2; return dBinarySumDevSqr(start, middle, mean) + dBinarySumDevSqr(middle, finish, mean); | private double dBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (dSeries[i]-mean)*(dSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevSqr(start, middle, mean) + dBinarySumDevSqr(middle, finish, mean); } } |
|
} | private double dBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (dSeries[i]-mean)*(dSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevSqr(start, middle, mean) + dBinarySumDevSqr(middle, finish, mean); } } |
|
if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * fSeries[i]; | if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinaryIndexSum(start, middle) + fBinaryIndexSum(middle, finish); | private double fBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); } } |
return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); | private double fBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); } } |
|
} | private double fBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); } } |
|
if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += fSeries[i]; | if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); | private double fBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); } } |
return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); | private double fBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); } } |
|
} | private double fBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); } } |
|
double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (fSeries[i]-mean)*(fSeries[i+lag]-mean); | double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (fSeries[i]-mean)*(fSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevLag(start, middle, mean, lag) + fBinarySumDevLag(middle, finish, mean, lag); | private double fBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (fSeries[i]-mean)*(fSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevLag(start, middle, mean, lag) + fBinarySumDevLag(middle, finish, mean, lag); } } |
return val; } else { int middle = (start + finish) / 2; return fBinarySumDevLag(start, middle, mean, lag) + fBinarySumDevLag(middle, finish, mean, lag); | private double fBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (fSeries[i]-mean)*(fSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevLag(start, middle, mean, lag) + fBinarySumDevLag(middle, finish, mean, lag); } } |
|
} | private double fBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (fSeries[i]-mean)*(fSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevLag(start, middle, mean, lag) + fBinarySumDevLag(middle, finish, mean, lag); } } |
|
if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (fSeries[i]-mean)*(fSeries[i]-mean); | if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (fSeries[i]-mean)*(fSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevSqr(start, middle, mean) + fBinarySumDevSqr(middle, finish, mean); | private double fBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (fSeries[i]-mean)*(fSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevSqr(start, middle, mean) + fBinarySumDevSqr(middle, finish, mean); } } |
return val; } else { int middle = (start + finish) / 2; return fBinarySumDevSqr(start, middle, mean) + fBinarySumDevSqr(middle, finish, mean); | private double fBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (fSeries[i]-mean)*(fSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevSqr(start, middle, mean) + fBinarySumDevSqr(middle, finish, mean); } } |
|
} | private double fBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (fSeries[i]-mean)*(fSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevSqr(start, middle, mean) + fBinarySumDevSqr(middle, finish, mean); } } |
|
int[] histo = new int[number]; int bin; if (iSeries != null) { for (int i=0; i< iSeries.length; i++) { bin = (int)Math.floor((iSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } } return histo; | int[] histo = new int[number]; int bin; if (iSeries != null) { for (int i=0; i< iSeries.length; i++) { bin = (int)Math.floor((iSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } } return histo; } if (sSeries != null) { for (int i=0; i< sSeries.length; i++) { bin = (int)Math.floor((sSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } } return histo; } if (fSeries != null) { for (int i=0; i< fSeries.length; i++) { bin = (int)Math.floor((fSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } } return histo; } if (dSeries != null) { for (int i=0; i< dSeries.length; i++) { bin = (int)Math.floor((dSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } } return histo; } return new int[0]; | public int[] histogram(double start, double width, int number) { int[] histo = new int[number]; int bin; if (iSeries != null) { for (int i=0; i< iSeries.length; i++) { bin = (int)Math.floor((iSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } // end of if (bin >= 0 && bin < number) } // end of for (int i=0; i< iSeries.length; i++) return histo; } if (sSeries != null) { for (int i=0; i< sSeries.length; i++) { bin = (int)Math.floor((sSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } // end of if (bin >= 0 && bin < number) } // end of for (int i=0; i< iSeries.length; i++) return histo; } if (fSeries != null) { for (int i=0; i< fSeries.length; i++) { bin = (int)Math.floor((fSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } // end of if (bin >= 0 && bin < number) } // end of for (int i=0; i< iSeries.length; i++) return histo; } if (dSeries != null) { for (int i=0; i< dSeries.length; i++) { bin = (int)Math.floor((dSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } // end of if (bin >= 0 && bin < number) } // end of for (int i=0; i< iSeries.length; i++) return histo; } return new int[0]; } |
if (sSeries != null) { for (int i=0; i< sSeries.length; i++) { bin = (int)Math.floor((sSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } } return histo; } if (fSeries != null) { for (int i=0; i< fSeries.length; i++) { bin = (int)Math.floor((fSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } } return histo; } if (dSeries != null) { for (int i=0; i< dSeries.length; i++) { bin = (int)Math.floor((dSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } } return histo; } return new int[0]; } | public int[] histogram(double start, double width, int number) { int[] histo = new int[number]; int bin; if (iSeries != null) { for (int i=0; i< iSeries.length; i++) { bin = (int)Math.floor((iSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } // end of if (bin >= 0 && bin < number) } // end of for (int i=0; i< iSeries.length; i++) return histo; } if (sSeries != null) { for (int i=0; i< sSeries.length; i++) { bin = (int)Math.floor((sSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } // end of if (bin >= 0 && bin < number) } // end of for (int i=0; i< iSeries.length; i++) return histo; } if (fSeries != null) { for (int i=0; i< fSeries.length; i++) { bin = (int)Math.floor((fSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } // end of if (bin >= 0 && bin < number) } // end of for (int i=0; i< iSeries.length; i++) return histo; } if (dSeries != null) { for (int i=0; i< dSeries.length; i++) { bin = (int)Math.floor((dSeries[i]-start)/width); if (bin >= 0 && bin < number) { histo[bin]++; } // end of if (bin >= 0 && bin < number) } // end of for (int i=0; i< iSeries.length; i++) return histo; } return new int[0]; } |
|
if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * iSeries[i]; | if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinaryIndexSum(start, middle) + iBinaryIndexSum(middle, finish); | private double iBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); } } |
return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); | private double iBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); } } |
|
} | private double iBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); } } |
|
if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += iSeries[i]; | if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); | private double iBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); } } |
return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); | private double iBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); } } |
|
} | private double iBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); } } |
|
double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (iSeries[i]-mean)*(iSeries[i+lag]-mean); | double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (iSeries[i]-mean)*(iSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevLag(start, middle, mean, lag) + iBinarySumDevLag(middle, finish, mean, lag); | private double iBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (iSeries[i]-mean)*(iSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevLag(start, middle, mean, lag) + iBinarySumDevLag(middle, finish, mean, lag); } } |
return val; } else { int middle = (start + finish) / 2; return iBinarySumDevLag(start, middle, mean, lag) + iBinarySumDevLag(middle, finish, mean, lag); | private double iBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (iSeries[i]-mean)*(iSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevLag(start, middle, mean, lag) + iBinarySumDevLag(middle, finish, mean, lag); } } |
|
} | private double iBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (iSeries[i]-mean)*(iSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevLag(start, middle, mean, lag) + iBinarySumDevLag(middle, finish, mean, lag); } } |
|
if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (iSeries[i]-mean)*(iSeries[i]-mean); | if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (iSeries[i]-mean)*(iSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevSqr(start, middle, mean) + iBinarySumDevSqr(middle, finish, mean); | private double iBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (iSeries[i]-mean)*(iSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevSqr(start, middle, mean) + iBinarySumDevSqr(middle, finish, mean); } } |
return val; } else { int middle = (start + finish) / 2; return iBinarySumDevSqr(start, middle, mean) + iBinarySumDevSqr(middle, finish, mean); | private double iBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (iSeries[i]-mean)*(iSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevSqr(start, middle, mean) + iBinarySumDevSqr(middle, finish, mean); } } |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.