rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
logger.debug("The name of the data set is "+getName()); logger.debug("The name of the seismogram is "+name);
public LocalSeismogramImpl getSeismogram(String name) { if (seismogramCache.containsKey(name)) { return (LocalSeismogramImpl)seismogramCache.get(name); } // end of if (seismogramCache.containsKey(name)) String urlString = "NONE"; NodeList nList = evalNodeList(conf...
public String getUniqueName(String name) { String[] nameList = getSeismogramNames();
public String getUniqueName(String[] nameList, String name) {
public String getUniqueName(String name) { String[] nameList = getSeismogramNames(); int counter = 0; for(int i = 0; i < nameList.length; i++) { if(nameList[i].equals(name)) counter++; } if(counter == 0) return name; return name+"_"+counter; }
if(nameList[i].equals(name)) counter++;
if(nameList[i].indexOf(name) != -1) counter++;
public String getUniqueName(String name) { String[] nameList = getSeismogramNames(); int counter = 0; for(int i = 0; i < nameList.length; i++) { if(nameList[i].equals(name)) counter++; } if(counter == 0) return name; return name+"_"+counter; }
return name+"_"+counter;
return name+"_"+(counter+1);
public String getUniqueName(String name) { String[] nameList = getSeismogramNames(); int counter = 0; for(int i = 0; i < nameList.length; i++) { if(nameList[i].equals(name)) counter++; } if(counter == 0) return name; return name+"_"+counter; }
jLabel8 = new JLabel(); jPanel2.add(jLabel8, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); jLabel8.setText("BU:GU:"); ogbuLbl = new JLabel(); jPanel2.add(ogbuLbl, new GridBagConstraints(2, 5, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridB...
private void initGUI() { try { GridBagLayout pnlStyleLayout = new GridBagLayout(); pnlStyleLayout.rowWeights = new double[] {0.1,0.1}; pnlStyleLayout.rowHeights = new int[] {7,7}; pnlStyleLayout.columnWeights = new double[] {0.1,0.1}; pnlStyleLayout.columnWidths = new int[] {7,7}; this.setLayout(pnlStyleL...
double bugu = myRecipe.getIbu() / (myRecipe.getEstOg() - 1) * 1000; ogbuLbl.setText("" + SBStringUtils.format(bugu, 1));
public void setStyleData(){ Style s = (Style) cmbStyle2Model.getSelectedItem(); // descriptionTextArea.setText(s.getDescription()); // cmbStyle2.setToolTipText(multiLineToolTip(50,s.getDescription())); stlLowOG.setText(SBStringUtils.format(s.ogLow, 3)); stlRcpOG.setText(SBStringUtils.format(myRecipe.getEstOg(), 3...
while(r!=null && r.getResult()!=null && r.getResult().isWorseThan(Result.SUCCESS))
while(r!=null && (r.getResult()==null || r.getResult().isWorseThan(Result.SUCCESS)))
public synchronized RunT getLastStableBuild() { RunT r = getLastBuild(); while(r!=null && r.getResult()!=null && r.getResult().isWorseThan(Result.SUCCESS)) r=r.getPreviousBuild(); return r; }
while(r!=null && r.getResult()!=null && r.getResult().isWorseThan(Result.UNSTABLE))
while(r!=null && (r.getResult()==null || r.getResult().isWorseThan(Result.UNSTABLE)))
public synchronized RunT getLastSuccessfulBuild() { RunT r = getLastBuild(); while(r!=null && r.getResult()!=null && r.getResult().isWorseThan(Result.UNSTABLE)) r=r.getPreviousBuild(); return r; }
results.setBrowseHostStatus( BrowseHostResults.FETCHING );
public void sendBrowseHostRequest() throws IOException, BrowseHostException { NLogger.debug(BrowseHostConnection.class, "Connection for Browse Host to " + address ); SocketFacade socket; try { socket = OIOSocketFactory.connect( address, Serv...
public static Message parseMessage( MsgHeader header, Connection connection )
public static Message parseMessage( Connection connection )
public static Message parseMessage( MsgHeader header, Connection connection ) throws IOException, InvalidMessageException { byte[] body = readMessageBody( connection, header.getDataLength() ); Message message = createMessageFromBody( header, body ); return message; }
byte[] body = readMessageBody( connection, header.getDataLength() ); Message message = createMessageFromBody( header, body ); return message;
MsgHeader header = parseMessageHeader( connection, new byte[ MsgHeader.DATA_LENGTH ] ); if ( header == null ) { throw new IOException("Connection closed by remote host"); } return parseMessage( header, connection );
public static Message parseMessage( MsgHeader header, Connection connection ) throws IOException, InvalidMessageException { byte[] body = readMessageBody( connection, header.getDataLength() ); Message message = createMessageFromBody( header, body ); return message; }
if(!file.exists()) return createEmptyChangeLog(changelogFile,listener);
public boolean calcChangeLog(Build build, File changelogFile, BuildListener listener) throws IOException { if(build.getPreviousBuild()==null) { // nothing to compare against return createEmptyChangeLog(changelogFile, listener); } PrintStream logger = listener.getLogger(); ...
rsp.sendRedirect(req.getContextPath()+'/'+getBuildStatusUrl());
rsp.sendRedirect(req.getContextPath()+"/nocacheImages/48x48/"+getBuildStatusUrl());
public void doBuildStatus( StaplerRequest req, StaplerResponse rsp ) throws IOException { rsp.sendRedirect(req.getContextPath()+'/'+getBuildStatusUrl()); }
public Node substitute(Node orig,String name,Node replacement,XJep xjep) throws ParseException
public Node substitute(Node orig,String name,Node replacement,XJep xj) throws ParseException
public Node substitute(Node orig,String name,Node replacement,XJep xjep) throws ParseException { this.names = new String[]{name}; this.replacements = new Node[]{replacement}; this.xjep=xjep; Node res = (Node) orig.jjtAccept(this,null); return res; }
this.xjep=xjep;
this.xjep=xj;
public Node substitute(Node orig,String name,Node replacement,XJep xjep) throws ParseException { this.names = new String[]{name}; this.replacements = new Node[]{replacement}; this.xjep=xjep; Node res = (Node) orig.jjtAccept(this,null); return res; }
j.pv.setFullBrackets(true);
j.getPrintVisitor().setFullBrackets(true);
public static void main(String[] args) { XJep j = new XJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setImplicitMul(true); j.setAllowAssignment(true); try { // parse expression Node node = j.parse("a*b+c*(d+sin(x))"); // print it j.println(nod...
j.pv.setFullBrackets(false);
j.getPrintVisitor().setFullBrackets(false);
public static void main(String[] args) { XJep j = new XJep(); j.addStandardConstants(); j.addStandardFunctions(); j.addComplex(); j.setAllowUndeclared(true); j.setImplicitMul(true); j.setAllowAssignment(true); try { // parse expression Node node = j.parse("a*b+c*(d+sin(x))"); // print it j.println(nod...
if(signaled) throw new IllegalStateException();
if(signaled) return;
public synchronized void signal() { if(signaled) throw new IllegalStateException(); // already signaled this.signaled = true; notify(); }
public void setStatus( HostStatus status, String msg, long statusTime)
public void setStatus( HostStatus status)
public void setStatus( HostStatus status, String msg, long statusTime) { if ( this.status == status && lastStatusMsg != null && lastStatusMsg.equals(msg) ) { return; } this.status = status; lastStatusMsg = msg; this.statusTime = statusTime; hostsContainer.fireNetwork...
if ( this.status == status && lastStatusMsg != null && lastStatusMsg.equals(msg) ) { return; } this.status = status; lastStatusMsg = msg; this.statusTime = statusTime; hostsContainer.fireNetworkHostChanged(this);
setStatus(status, null, System.currentTimeMillis());
public void setStatus( HostStatus status, String msg, long statusTime) { if ( this.status == status && lastStatusMsg != null && lastStatusMsg.equals(msg) ) { return; } this.status = status; lastStatusMsg = msg; this.statusTime = statusTime; hostsContainer.fireNetwork...
case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) );
case 2 : return new Double(data.getStepStartTemp(row)) ;
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(r...
return data.df1.format( new Double(data.getStepEndTemp(row)) );
return new Double(data.getStepEndTemp(row)) ;
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(r...
return new Double(data.getStepRampMin(row));
return new Integer(data.getStepRampMin(row));
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(r...
return new Double(data.getStepMin(row));
return new Integer(data.getStepMin(row));
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(r...
Debug.print(e.toString());
public Object getValueAt(int row, int col) { try { switch (col) { case 0 : return data.getStepType(row); case 1 : return data.getStepMethod(row); case 2 : return data.df1.format( new Double(data.getStepStartTemp(row)) ); case 3 : return data.df1.format( new Double(data.getStepEndTemp(r...
data.setStepStartTemp(row, Integer.parseInt(value.toString()));
data.setStepStartTemp(row, Double.parseDouble(value.toString()));
public void setValueAt(Object value, int row, int col) { try { switch (col) { case 0 : data.setStepType(row, value.toString()); break; case 1 : data.setStepMethod(row, value.toString()); break; case 2 : data.setStepStartTemp(row, Integer.parseInt(value.toString())); break; ...
data.setStepEndTemp(row, Integer.parseInt(value.toString()));
data.setStepEndTemp(row, Double.parseDouble(value.toString()));
public void setValueAt(Object value, int row, int col) { try { switch (col) { case 0 : data.setStepType(row, value.toString()); break; case 1 : data.setStepMethod(row, value.toString()); break; case 2 : data.setStepStartTemp(row, Integer.parseInt(value.toString())); break; ...
for( int i=0; i<env.length; i+=2 ) { if(env[i+1]==null) m.remove(env[i]);
for (String e : env) { int index = e.indexOf('='); String key = e.substring(0,index); String value = e.substring(index+1); if(value.length()==0) m.remove(key);
private Map<String,String> inherit(String[] env) { Map<String,String> m = new HashMap<String,String>(EnvVars.masterEnvVars); for( int i=0; i<env.length; i+=2 ) { if(env[i+1]==null) m.remove(env[i]); else m.put(env[i],env[i+1]); } return...
m.put(env[i],env[i+1]);
m.put(key,value);
private Map<String,String> inherit(String[] env) { Map<String,String> m = new HashMap<String,String>(EnvVars.masterEnvVars); for( int i=0; i<env.length; i+=2 ) { if(env[i+1]==null) m.remove(env[i]); else m.put(env[i],env[i+1]); } return...
public void testBad() throws ParseException
public void testBad() throws Exception
public void testBad() throws ParseException { if(SHOW_BAD) { simplifyTest("1&&(1||x)","1"); simplifyTest("diff(sgn(x),x)","0"); // sgn not implemented simplifyTest("diff(re(x+i y),x)","1"); // not smart enought to work out re(i) = 1 simplifyTest("diff(re(x+i y),y)","0"); simplifyTest("diff(im(x+i y),x)","0...
valueTest("recurse = recurse+1",null);
public void testBad() throws ParseException { if(SHOW_BAD) { simplifyTest("1&&(1||x)","1"); simplifyTest("diff(sgn(x),x)","0"); // sgn not implemented simplifyTest("diff(re(x+i y),x)","1"); // not smart enought to work out re(i) = 1 simplifyTest("diff(re(x+i y),y)","0"); simplifyTest("diff(im(x+i y),x)","0...
} else if (value instanceof Complex) { return (Complex)value;
public Complex getComplexValue() { Object value = getValueAsObject(); if (value == null) { return null; } else if (value instanceof Number) { return new Complex(((Number)value).doubleValue(), 0); } else if (value instanceof Complex) { return (Complex)value; } else { return null; } }
m_status = GET_REVISION;
m_status = GET_SYMBOLIC_NAMES;
private void processFile(final String line) { if (line.startsWith("Working file:")) { m_file = line.substring(14, line.length()); m_status = GET_REVISION; } }
branches.clear();
private void reset() { m_file = null; m_date = null; m_author = null; m_comment = null; m_revision = null; m_previousRevision = null; m_dead = false; }
entry = (CVSEntry) m_entries.get(entryKey);
entry = m_entries.get(entryKey);
private void saveEntry() { final String entryKey = m_date + m_author + m_comment; CVSEntry entry; if (!m_entries.containsKey(entryKey)) { entry = new CVSEntry(parseDate(m_date), m_author, m_comment); m_entries.put(entryKey, entry); } else { entry = (CVSEn...
entry.addFile(m_file, m_revision, m_previousRevision, m_dead);
entry.addFile(m_file, m_revision, m_previousRevision, findBranch(m_revision), m_dead);
private void saveEntry() { final String entryKey = m_date + m_author + m_comment; CVSEntry entry; if (!m_entries.containsKey(entryKey)) { entry = new CVSEntry(parseDate(m_date), m_author, m_comment); m_entries.put(entryKey, entry); } else { entry = (CVSEn...
case GET_SYMBOLIC_NAMES: processSymbolicName(line); break;
public void stdout(final String line) { if(dead) return; try { switch(m_status) { case GET_FILE: // make sure attributes are reset when // working on a 'new' file. reset(); processFile(line...
downloadCandidate.addToCandidateLog( "Max downloads for candidate IP already reached." );
public synchronized SWDownloadSet allocateDownloadSet( SWDownloadWorker worker ) { synchronized( downloadList ) { SWDownloadCandidate downloadCandidate = null; for ( SWDownloadFile downloadFile : downloadList ) { if ( !downloadFile.isAbleToBeAllocated...
if ( !managedFile.getFile().exists() )
if ( !managedFile.exists() )
public static XJBPhex loadXJBPhexFromFile( ManagedFile managedFile ) throws JAXBException { if ( !managedFile.getFile().exists() ) { return null; } //NLogger.debug(NLoggerNames.GLOBAL, "Loading XJBPhex from: " + managedFile ); XJBPhex phex; InputStream ...
for( Executor e : executors ) e.interrupt();
if(executors!=null) { for( Executor e : executors ) e.interrupt(); } ExternalJob.reloadThread.interrupt();
public void cleanUp() { shuttingDown = true; for( Executor e : executors ) e.interrupt(); }
Reader r = new InputStreamReader(new FileInputStream(getConfigFile()),"UTF-8"); createConfiguredStream().unmarshal(new XppReader(r),this); r.close();
Reader r = new BufferedReader(new InputStreamReader(new FileInputStream(getConfigFile()),"UTF-8")); try { createConfiguredStream().unmarshal(new XppReader(r),this); } catch(StreamException e) { throw new IOException(e.getMessage()); } finally { r.close(); }
private void load() throws IOException { if(getConfigFile().exists()) { Reader r = new InputStreamReader(new FileInputStream(getConfigFile()),"UTF-8"); createConfiguredStream().unmarshal(new XppReader(r),this); r.close(); } File projectsDir = new File(root,"jobs...
for (final File subdir : subdirs) {
for (File subdir : subdirs) {
private void load() throws IOException { if(getConfigFile().exists()) { Reader r = new InputStreamReader(new FileInputStream(getConfigFile()),"UTF-8"); createConfiguredStream().unmarshal(new XppReader(r),this); r.close(); } File projectsDir = new File(root,"jobs...
super("Executor #"+owner.getExecutors().size()+" for "+owner.getDisplayName());
public Executor(Computer owner) { this.owner = owner; this.queue = Hudson.getInstance().getQueue(); start(); }
Writer w = new OutputStreamWriter(new FileOutputStream(getConfigFile()),"UTF-8");
Writer w = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(getConfigFile()),"UTF-8"));
public synchronized void save() throws IOException { Writer w = new OutputStreamWriter(new FileOutputStream(getConfigFile()),"UTF-8"); w.write("<?xml version='1.0' encoding='UTF-8'?>\n"); createConfiguredStream().toXML(this,w); w.close(); }
Reader r = new InputStreamReader(new FileInputStream(new File(dir,"config.xml")),"UTF-8"); Job job = (Job)createConfiguredStream().unmarshal(new XppReader(r)); r.close();
Reader r = new BufferedReader(new InputStreamReader(new FileInputStream(new File(dir,"config.xml")),"UTF-8")); try { Job job = (Job)createConfiguredStream().unmarshal(new XppReader(r)); } catch(StreamException e) { throw new IOException(e.getMessage()); } finally { r.close(); }
static Job load(Hudson root, File dir) throws IOException { Reader r = new InputStreamReader(new FileInputStream(new File(dir,"config.xml")),"UTF-8"); Job job = (Job)createConfiguredStream().unmarshal(new XppReader(r)); r.close(); job.onLoad(root,dir.getName()); return job; }
Writer w = new OutputStreamWriter(new FileOutputStream(f),"UTF-8");
Writer w = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f),"UTF-8"));
public void toXML( Object o, File f ) throws IOException { Writer w = new OutputStreamWriter(new FileOutputStream(f),"UTF-8"); w.write("<?xml version='1.0' encoding='UTF-8'?>\n"); toXML(o,w); w.close(); }
new Proc(new String[]{"rm","../latest"},new String[0],listener.getLogger(),getProject().getBuildDir()).join();
new Proc(new String[]{"rm","../lastSuccessful"},new String[0],listener.getLogger(),getProject().getBuildDir()).join();
public void run() { run(new Runner() { public Result run(BuildListener listener) throws IOException { if(!project.checkout(Build.this,listener)) return Result.FAILURE; if(!project.getScm().calcChangeLog(Build.this,new File(getRootDir(),"changelog.xm...
new Proc(new String[]{"rm","../latest"},new String[0],listener.getLogger(),getProject().getBuildDir()).join();
new Proc(new String[]{"rm","../lastSuccessful"},new String[0],listener.getLogger(),getProject().getBuildDir()).join();
public Result run(BuildListener listener) throws IOException { if(!project.checkout(Build.this,listener)) return Result.FAILURE; if(!project.getScm().calcChangeLog(Build.this,new File(getRootDir(),"changelog.xml"),listener)) return Result.F...
SQETestAction(Build owner, DirectoryScanner results, BuildListener listener) {
SQETestAction(Build owner, DirectoryScanner results, BuildListener listener, boolean considerTestAsTestObject) {
SQETestAction(Build owner, DirectoryScanner results, BuildListener listener) { super(owner); listener.getLogger().println("Collecting JWSDP SQE reports"); int counter=0; File dataDir = getDataDir(); dataDir.mkdirs(); long buildTime = owner.getTimestamp().getTimeInMillis(); ...
this.considerTestAsTestObject = considerTestAsTestObject;
SQETestAction(Build owner, DirectoryScanner results, BuildListener listener) { super(owner); listener.getLogger().println("Collecting JWSDP SQE reports"); int counter=0; File dataDir = getDataDir(); dataDir.mkdirs(); long buildTime = owner.getTimestamp().getTimeInMillis(); ...
public ChangeLogSet getChangeSet() {
public ChangeLogSet<?> getChangeSet() {
public ChangeLogSet getChangeSet() { if(scm==null) scm = new CVSChangeLogParser(); if(changeSet==null) // cached value changeSet = calcChangeSet(); return changeSet; }
rsp.sendRedirect(req.getContextPath()+"/nocacheImages/48x48/"+getBuildStatusUrl());
rsp.sendRedirect2(req.getContextPath()+"/nocacheImages/48x48/"+getBuildStatusUrl());
public void doBuildStatus( StaplerRequest req, StaplerResponse rsp ) throws IOException { rsp.sendRedirect(req.getContextPath()+"/nocacheImages/48x48/"+getBuildStatusUrl()); }
rsp.sendRedirect(req.getContextPath()+"/");
rsp.sendRedirect2(req.getContextPath()+"/");
public synchronized void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException { if(!Hudson.adminCheck(req,rsp)) return; Util.deleteRecursive(root); getParent().deleteJob(this); rsp.sendRedirect(req.getContextPath()+"/"); }
return "job/"+WHITESPACE_REPLACER.matcher(name).replaceAll("%20")+'/';
return "job/"+name+'/';
public String getUrl() { return "job/"+WHITESPACE_REPLACER.matcher(name).replaceAll("%20")+'/'; }
name = edu.iris.Fissures.network.ChannelIdUtil.toStringNoDates(seis.channel_id);
name = seis.channel_id.network_id.network_code+"."+ seis.channel_id.station_code+"."+ seis.channel_id.channel_code;
public void addSeismogram(LocalSeismogramImpl seis, AuditInfo[] audit) { seismogramNameCache = null; // Note this does not set the xlink, as the seis has not been saved anywhere yet. Document doc = config.getOwnerDocument(); Element localSeismogram = doc.createEleme...
seismogramNameCache = null;
public void addSeismogram(LocalSeismogramImpl seis, AuditInfo[] audit) { seismogramNameCache = null; // Note this does not set the xlink, as the seis has not been saved anywhere yet. Document doc = config.getOwnerDocument(); Element localSeismogram = doc.createEleme...
final File file = lastDownloadFile.getIncompleteFile();
File file = null; try { file = lastDownloadFile.getIncompleteDownloadFile().getFile(); } catch ( ManagedFileException exp ) { NLogger.error( DownloadOverviewPanel.class, exp ); } catch ( FileHandlingException exp ) { NLogger.error( DownloadOverviewPanel.class, exp ); }
public void actionPerformed( ActionEvent e ) { if ( lastDownloadFile == null ) { return; } final File file = lastDownloadFile.getIncompleteFile(); if ( file == null ) { return; } ...
String path = lastDownloadFile.getIncompleteFile().getAbsolutePath(); if ( !incompleteFileTxt.getText().equals( path ) )
try
private void updateInterface() { if ( lastDownloadFile == null ) { progressBar.setDownloadFile( null ); progressLabel.setText(""); downloadedLabel.setText(""); downloadedLabel.setToolTipText(""); remainingLabel.setText(""); remaining...
incompleteFileTxt.setText( path ); incompleteFileTxt.setCaretPosition(0);
String path = lastDownloadFile.getIncompleteDownloadFile().getAbsolutePath(); if ( !incompleteFileTxt.getText().equals( path ) ) { incompleteFileTxt.setText( path ); incompleteFileTxt.setCaretPosition(0); } } catch ( ManagedFileException exp ) { NLogger.error( DownloadOverviewPanel.class, exp ); } catch ( FileHandlingE...
private void updateInterface() { if ( lastDownloadFile == null ) { progressBar.setDownloadFile( null ); progressLabel.setText(""); downloadedLabel.setText(""); downloadedLabel.setToolTipText(""); remainingLabel.setText(""); remaining...
public ASTFunNode buildUnfinishedOperatorNode(Operator op) throws ParseException
public ASTFunNode buildUnfinishedOperatorNode(Operator op)
public ASTFunNode buildUnfinishedOperatorNode(Operator op) throws ParseException { ASTFunNode res = new ASTFunNode(ParserTreeConstants.JJTFUNNODE); res.setOperator(op); return res; }
if(!var.isConstant()) var.setValidValue(false);
var.setValidValue(false);
public void clearValues() { for(Enumeration e = this.elements(); e.hasMoreElements(); ) { Variable var = (Variable) e.nextElement(); if(!var.isConstant()) var.setValidValue(false); } }
this.parser.setInitialTokenManagerState(Parser.NO_DOT_IN_IDENTIFIERS);
this.parser.setInitialTokenManagerState(ParserConstants.NO_DOT_IN_IDENTIFIERS);
public VectorJep() { super(); opSet = new VOperatorSet(); this.ev = new VectorEvaluator(); this.parser.setInitialTokenManagerState(Parser.NO_DOT_IN_IDENTIFIERS); }
else return res;
return res;
public Object evaluate(Node node) throws Exception { Object res = ev.getValue(node,new Vector(),this.getSymbolTable()); if(res instanceof Scaler) return ((Scaler) res).getEle(0); else return res; }
ResultSet rs = prep.executeQuery();
rs = prep.executeQuery();
@Test public void utf() throws SQLException { PreparedStatement prep = conn.prepareStatement( "select ?,?,?,?,?,?,?,?;"); prep.setString(1, utf01); prep.setString(2, utf02); prep.setString(3, utf03); prep.setString(4, utf04); prep.setString(5, utf05); prep.setString(6, utf06);...
nameElement.setNodeValue(name);
Text text = config.getOwnerDocument().createTextNode(name); nameElement.appendChild(text); config.appendChild(nameElement);
public void setName(String name) { Element nameElement = evalElement(config, "name"); nameElement.setNodeValue(name); }
for(int i=r.size()-1; i>=0; i--) { CVSChangeLog log = (CVSChangeLog)r.get(i); boolean merged = false; for(int j=0;j<i;j++) { CVSChangeLog c = (CVSChangeLog) r.get(j); if(c.canBeMergedWith(log)) { c.merge(log); merged = true; break; } } if(merged) r.remove(log); }
public static CVSChangeLog[] parse( java.io.File f ) throws IOException, SAXException { if(!f.exists()) return new CVSChangeLog[0]; Digester digester = new Digester(); ArrayList r = new ArrayList(); digester.push(r); digester.addObjectCreate("*/entry",CVSChangeLog.class...
public EORelationship addBlankRelationship(String _name, EORelationshipPath _flattenRelationship) throws DuplicateNameException { String newRelationshipNameBase = _name; String newRelationshipName = newRelationshipNameBase; int newRelationshipNum = 0; while (getRelationshipNamed(newRelationshipName) != null) { newRelat...
public EORelationship addBlankRelationship(String _name) throws DuplicateNameException { return addBlankRelationship(_name, null);
public EORelationship addBlankRelationship(String _name, EORelationshipPath _flattenRelationship) throws DuplicateNameException { String newRelationshipNameBase = _name; String newRelationshipName = newRelationshipNameBase; int newRelationshipNum = 0; while (getRelationshipNamed(newRelationshipName) != nu...
value.nextBuild = prev.nextBuild; value.previousBuild = prev; if(value.nextBuild!=null) value.nextBuild.previousBuild = value; prev.nextBuild=value;
value.previousBuild = prev.previousBuild; value.nextBuild = prev; if(value.previousBuild!=null) value.previousBuild.nextBuild = value; prev.previousBuild=value;
private R update(TreeMap<Integer, R> m, Integer key, R value) { R first = m.isEmpty() ? null : m.get(m.firstKey()); R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); value.nextBuild = prev.next...
value.nextBuild = first; value.previousBuild = null;
value.previousBuild = first; value.nextBuild = null;
private R update(TreeMap<Integer, R> m, Integer key, R value) { R first = m.isEmpty() ? null : m.get(m.firstKey()); R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); value.nextBuild = prev.next...
first.previousBuild = value;
first.nextBuild = value;
private R update(TreeMap<Integer, R> m, Integer key, R value) { R first = m.isEmpty() ? null : m.get(m.firstKey()); R r = m.put(key, value); SortedMap<Integer,R> head = m.headMap(key); if(!head.isEmpty()) { R prev = m.get(head.lastKey()); value.nextBuild = prev.next...
if (param instanceof Number) {
if (param instanceof Complex) return ((Complex)param).neg(); if (param instanceof Number)
public Object umin(Object param) throws ParseException { if (param instanceof Number) { return new Double(-((Number)param).doubleValue()); } else if (param instanceof Complex) { return ((Complex)param).neg(); } throw new ParseException("Invalid parameter type"); }
} else if (param instanceof Complex) { return ((Complex)param).neg(); }
public Object umin(Object param) throws ParseException { if (param instanceof Number) { return new Double(-((Number)param).doubleValue()); } else if (param instanceof Complex) { return ((Complex)param).neg(); } throw new ParseException("Invalid parameter type"); }
g2.translate(-1* rowWidth * row, yLoc + titleHeight);
g2.translate(-1* rowWidth * row + LABEL_X_SHIFT, yLoc + titleHeight);
void drawPlottableNew(Graphics g) { int mean = getMean(); // get new graphics to avoid messing up original Graphics2D g2 = (Graphics2D)g.create(); g2.setClip(LABEL_X_SHIFT, 0, rowWidth, Integer.MAX_VALUE); AffineTransform originalTransform = AffineTransform.getTranslateInstance(LA...
public PVariable(PolynomialCreator pc,XVariable var) throws ParseException {
public PVariable(PolynomialCreator pc,XVariable var) {
public PVariable(PolynomialCreator pc,XVariable var) throws ParseException { super(pc); this.variable = var; }
if(eqn instanceof ASTVarNode) { return isConstantVar((XVariable)((ASTVarNode) eqn).getVar()); }
public boolean isConstantVar(XVariable var) { if(!var.hasEquation()) return true; Node eqn = var.getEquation(); if(eqn instanceof ASTConstant) return true; if(eqn instanceof ASTVarNode) { return isConstantVar((XVariable)((ASTVarNode) eqn).getVar()); } return false; }
public Object visit(ASTFunNode node, Object data) throws ParseException
public Object visit(ASTConstant node, Object data) throws ParseException
public Object visit(ASTFunNode node, Object data) throws ParseException { Node children[]=acceptChildrenAsArray(node,data); return xjep.getNodeFactory().buildFunctionNode(node,children); }
Node children[]=acceptChildrenAsArray(node,data); return xjep.getNodeFactory().buildFunctionNode(node,children);
return xjep.getNodeFactory().buildConstantNode(node);
public Object visit(ASTFunNode node, Object data) throws ParseException { Node children[]=acceptChildrenAsArray(node,data); return xjep.getNodeFactory().buildFunctionNode(node,children); }
public PartialDerivative findDerivative(String derivname,DJep jep)
public PartialDerivative findDerivative(String derivnames[],DJep jep)
public PartialDerivative findDerivative(String derivname,DJep jep) throws ParseException { String newnames[] = new String[1]; newnames[0]=derivname; return findDerivativeSorted(newnames,jep); }
String newnames[] = new String[1]; newnames[0]=derivname;
String newnames[] = sortedNames(derivnames);
public PartialDerivative findDerivative(String derivname,DJep jep) throws ParseException { String newnames[] = new String[1]; newnames[0]=derivname; return findDerivativeSorted(newnames,jep); }
return Integer.parseInt(id);
int value = Integer.parseInt(id); return value;
protected Serializable resolveId(String id) { return Integer.parseInt(id); }
Object value = getHibernateTemplate().load(clazz, resolveId(id));
Serializable key = resolveId(id); Object value = getHibernateTemplate().load(clazz, key);
protected void setAsText(String id, Class clazz) { if (logger.isDebugEnabled()) { logger.debug("Loaded "+clazz.getName()+" property editor"); } try { Object value = getHibernateTemplate().load(clazz, resolveId(id)); super.setValue(value); if (logger.i...
LocalSeismogramImpl[] alreadyContained = container.getSeismograms(); int maxTries = 100; while(maxTries > 0 && alreadyContained.length < 3){ maxTries--; try { Thread.sleep(5); } catch (InterruptedException e) {} alreadyContained = container.getSeismograms(); } assertEquals("problem getting initial seismograms", 3, alre...
public void setUp(){ seismograms = DisplayUtilsTest.createThreeSeisArray(); dss = new MemoryDataSetSeismogram(seismograms, null); container = new SeismogramContainer(dss); }
while(contained.length < 3){ try { Thread.sleep(5); } catch (InterruptedException e) {} contained = container.getSeismograms(); }
public void testGetSeismograms(){ LocalSeismogramImpl[] contained = container.getSeismograms(); while(contained.length < 3){ try { Thread.sleep(5); } catch (InterruptedException e) {} contained = container.getSeismograms(); } Arr...
while(alreadyContained.length < 3){ try { Thread.sleep(5); } catch (InterruptedException e) {} alreadyContained = container.getSeismograms(); }
public void testPushAlreadyAddedData(){ LocalSeismogramImpl[] alreadyContained = container.getSeismograms(); while(alreadyContained.length < 3){ try { Thread.sleep(5); } catch (InterruptedException e) {} alreadyContained = container.getSeismog...
assertEquals("must be exactly 6 seismograms", 6, nowContains.length);
public void testPushNewData(){ LocalSeismogramImpl[] alreadyContained = container.getSeismograms(); LocalSeismogramImpl[] otherSeis = DisplayUtilsTest.createOtherSeisArray(); container.pushData(new SeisDataChangeEvent(otherSeis, null, container)); LocalSeismogramImpl[] nowContains = cont...
System.out.println("nowContains "+i+" "+nowContains[i].get_id());
public void testPushNewData(){ LocalSeismogramImpl[] alreadyContained = container.getSeismograms(); LocalSeismogramImpl[] otherSeis = DisplayUtilsTest.createOtherSeisArray(); container.pushData(new SeisDataChangeEvent(otherSeis, null, container)); LocalSeismogramImpl[] nowContains = cont...
boolean calledRetrieved = false;
boolean callRetrieve = false;
public synchronized LocalSeismogramImpl[] getSeismograms(){ if(softSeis.size() == 0){ return EMPTY_ARRAY; } List existant = new ArrayList(); Iterator it = softSeis.iterator(); boolean calledRetrieved = false; while(it.hasNext()){ SoftReference current ...
if(current.get() != null){ existant.add(current.get());
Object o = current.get(); if(o != null){ existant.add(o);
public synchronized LocalSeismogramImpl[] getSeismograms(){ if(softSeis.size() == 0){ return EMPTY_ARRAY; } List existant = new ArrayList(); Iterator it = softSeis.iterator(); boolean calledRetrieved = false; while(it.hasNext()){ SoftReference current ...
if(!calledRetrieved){ seismogram.retrieveData(this); calledRetrieved = true; }
public synchronized LocalSeismogramImpl[] getSeismograms(){ if(softSeis.size() == 0){ return EMPTY_ARRAY; } List existant = new ArrayList(); Iterator it = softSeis.iterator(); boolean calledRetrieved = false; while(it.hasNext()){ SoftReference current ...
} if(callRetrieve){ seismogram.retrieveData(this);
public synchronized LocalSeismogramImpl[] getSeismograms(){ if(softSeis.size() == 0){ return EMPTY_ARRAY; } List existant = new ArrayList(); Iterator it = softSeis.iterator(); boolean calledRetrieved = false; while(it.hasNext()){ SoftReference current ...
protected FreeMarkerView prepareView(String templateName) {
protected FreeMarkerView prepareView(String templateName) throws Exception {
protected FreeMarkerView prepareView(String templateName) { FreeMarkerView fv = new FreeMarkerView(); fv.setUrl(templateName); fv.setApplicationContext(wac); fv.setExposeSpringMacroHelpers(true); return fv; }
fv.setBeanName(templateName); fv.afterPropertiesSet();
protected FreeMarkerView prepareView(String templateName) { FreeMarkerView fv = new FreeMarkerView(); fv.setUrl(templateName); fv.setApplicationContext(wac); fv.setExposeSpringMacroHelpers(true); return fv; }
System.out.println(request.getAttribute("errors"));
protected MockHttpServletResponse processView(String templateName, Map<String, Object> model, boolean visualTest) throws Exception { MockHttpServletResponse expectedResponse = new MockHttpServletResponse(); FreeMarkerView fv = prepareView(templateName); fv.render(model, request, expectedRespons...
search.addSearchChangeListener(this);
public SearchButton( Search search ) { super( ); this.search = search; updateButtonDisplay(); setUI( new SearchButtonUI() ); setBorder( GUIUtils.ROLLOVER_BUTTON_BORDER ); setRolloverEnabled( true ); setHorizontalAlignment( SwingConstants.LEFT ); set...
private void updateButtonDisplay()
public void updateButtonDisplay()
private void updateButtonDisplay() { StringBuffer textBuf = new StringBuffer(); if ( search instanceof KeywordSearch ) { textBuf.append( ((KeywordSearch)search).getSearchString() ); setIcon( GUIRegistry.getInstance().getIconFactory().getIcon("Search") ); } ...
textBuf.append( filteredElem )
textBuf.append( totalElem )
private void updateButtonDisplay() { StringBuffer textBuf = new StringBuffer(); if ( search instanceof KeywordSearch ) { textBuf.append( ((KeywordSearch)search).getSearchString() ); setIcon( GUIRegistry.getInstance().getIconFactory().getIcon("Search") ); } ...
textBuf.append( totalElem )
textBuf.append( filteredElem )
private void updateButtonDisplay() { StringBuffer textBuf = new StringBuffer(); if ( search instanceof KeywordSearch ) { textBuf.append( ((KeywordSearch)search).getSearchString() ); setIcon( GUIRegistry.getInstance().getIconFactory().getIcon("Search") ); } ...
return (SearchResultsDataModel) searchToDataModelMap.get( search );
return searchToDataModelMap.get( search );
public static SearchResultsDataModel lookupResultDataModel( Search search ) { return (SearchResultsDataModel) searchToDataModelMap.get( search ); }
super(aView);
super(aView, aRecipe);
public RecipeDetailsController(RecipeDetailsView aView, Recipe aRecipe) { super(aView); myContents = aView; myRecipe = aRecipe; }
myRecipe = aRecipe;
public RecipeDetailsController(RecipeDetailsView aView, Recipe aRecipe) { super(aView); myContents = aView; myRecipe = aRecipe; }