rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
sb.append( " <DESCRIPTION>"+getDescription()+"</DESCRIPTION>\n" );
sb.append( " <DESCRIPTION>"+SBStringUtils.subEntities(getDescription())+"</DESCRIPTION>\n" );
public String toXML(){ StringBuffer sb = new StringBuffer(); sb.append( " <ITEM>\n" ); sb.append( " <MALT>"+getName()+"</MALT>\n" ); sb.append( " <AMOUNT>"+getAmountAs(getUnits())+"</AMOUNT>\n" ); sb.append( " <UNITS>"+getUnitsAbrv()+"</UNITS>\n" ); sb.append( " <POINTS>"...
public BasicTimeConfig(DataSetSeismogram[] seismos){ add(seismos); }
public BasicTimeConfig(){}
public BasicTimeConfig(DataSetSeismogram[] seismos){ add(seismos); }
public ConfigEvent(DataSetSeismogram[] seismos, TimeEvent time, AmpEvent amp){ this.seismos = seismos; this.time = time; this.amp = amp;
public ConfigEvent(DataSetSeismogram[] seismos, MicroSecondTimeRange[] times, UnitRangeImpl[] amps){ this(seismos, new TimeEvent(seismos, times), new AmpEvent(seismos, amps));
public ConfigEvent(DataSetSeismogram[] seismos, TimeEvent time, AmpEvent amp){ this.seismos = seismos; this.time = time; this.amp = amp; }
dayCache.remove(ChannelIdUtil.toString(channel_id));
dayCache.remove(key);
get_for_day(edu.iris.Fissures.IfNetwork.ChannelId channel_id, int year, int jday, edu.iris.Fissures.Dimension pixel_size) throws PlottableNotAvailable, UnsupportedDimension { SoftReference ref; Plottable[] plottableArray; String key = ChannelIdUtil.toString(channel_id)+"."+Integer.toString(year)+...
this.verifyPassword = "";
public void setPasswordDirty(boolean passwordDirty) { this.verifyPassword = ""; this.passwordDirty = passwordDirty; }
this.passwordDirty = true;
public void setVerifyPassword(String verifyPassword) { this.verifyPassword = verifyPassword; }
public String createFileName(DataSet dataset) {
public static String createFileName(DataSet dataset) {
public String createFileName(DataSet dataset) { String filename = dataset.getName()+".dsml"; filename = filename.replaceAll(" ","_"); filename = filename.replaceAll(",","_"); filename = filename.replaceAll("/","_"); filename = filename.replaceAll(":","_"); // filename = fil...
String childDirName = childDataSets[i].replace(' ','_');
String childDirName = createFileName(dataset.getDataSet(childDataSets[i]));
public void insertInto(Element element, DataSet dataset, File directory) throws IOException, ParserConfigurationException, MalformedURLException { Document doc = element.getOwnerDocument(); element.setAttribute("datasetid", dataset.getId()); element.appendChild(XMLUtil.createTextElement(...
return insertRef(element, dsFile.toURI().toURL().toString(), dataset.getName());
return insertRef(element, directory.getName()+"/"+dsFile.getName(), dataset.getName());
public Element insertRef(Element element, DataSet dataset, File directory) throws IOException, ParserConfigurationException, MalformedURLException { File dsFile = save(dataset, directory); return insertRef(element, dsFile.toURI().toURL().toString(), dataset.getName()); }
if(config == null) return null;
if(config == null) return new String("");
public static String getText(Element config) { if(config == null) return null; NodeList children = config.getChildNodes(); Node node; for (int i=0; i<children.getLength(); i++) { node = children.item(i); if (node instanceof Text) { return node.getNodeValue()...
return null;
return new String("");
public static String getText(Element config) { if(config == null) return null; NodeList children = config.getChildNodes(); Node node; for (int i=0; i<children.getLength(); i++) { node = children.item(i); if (node instanceof Text) { return node.getNodeValue()...
while(datasetSeismogramNames.contains(dss.getName())) {
while(datasetSeismogramNames.contains(tmpName)) {
public void addDataSetSeismogram(DataSetSeismogram dss, AuditInfo[] audit) { if (datasetSeismogramNames.contains(dss.getName())) { int n = 1; String tmpName = dss.getName(); while(datasetSeismogramNames.contains(dss.getName())) { n++; tmpName = d...
invokeQueryMoreGWebCachesRequest( false );
public void run() { try { // no gwebcache actions if we have no auto connect and are // not connected to any host NetworkHostsContainer networkHostsCont = HostManager.getInstance().getNetworkHostsContainer(); ...
invokeQueryMoreGWebCachesRequest( false );
public void run() { // no gwebcache actions if we have no auto connect and are // not connected to any host NetworkHostsContainer networkHostsCont = HostManager.getInstance().getNetworkHostsContainer(); NetworkManager networkMgr = NetworkManager....
assert !gWebCache.isPhexCache() && gWebCache.equals( connection.getGWebCache() )
assert !gWebCache.isPhexCache() && !gWebCache.equals( connection.getGWebCache() )
public boolean updateRemoteGWebCache( DestAddress myHostAddress, boolean preferPhex ) { String fullHostName = null; if ( myHostAddress != null ) { fullHostName = myHostAddress.getFullHostName(); } int retrys = 0; boolean succ = false; do { ...
OP_DOT = new XOperator(o.getDot(),XOperator.BINARY+XOperator.RIGHT); OP_CROSS = new XOperator(o.getCross(),XOperator.BINARY+XOperator.RIGHT);
OP_DOT = new XOperator(o.getDot(),XOperator.BINARY+XOperator.LEFT); OP_CROSS = new XOperator(o.getCross(),XOperator.BINARY+XOperator.LEFT);
private void annotateOperators(OperatorSet o) { OP_GT = new XOperator(o.getGT(),XOperator.BINARY+XOperator.LEFT+XOperator.TRANSITIVE); OP_LT = new XOperator(o.getLT(),XOperator.BINARY+XOperator.LEFT+XOperator.TRANSITIVE); OP_EQ = new XOperator(o.getEQ(),XOperator.BINARY+XOperator.LEFT+XOperator.EQUIVILE...
String name; name = dss.getName(); if ( name == null || name.length == 0) { name = ChannelIdUtil.toStringNoDates(dss.getRequestFilter().channel_id); } name = getUniqueName(getDataSetSeismogramNames(), name); if ( ! name.equals(dss.getName()) ) { dss.setName(name); } dssNames.add(name); dataSetSeismograms.put(name, d...
String name; name = dss.getName(); if ( name == null || name.length() == 0) { name = ChannelIdUtil.toStringNoDates(dss.getRequestFilter().channel_id); } name = getUniqueName(getDataSetSeismogramNames(), name); if ( ! name.equals(dss.getName()) ) { dss.setName(name); } dssNames.add(name); dataSetSeismograms.put(name,...
public void addDataSetSeismogram(DataSetSeismogram dss) { String name; name = dss.getName(); if ( name == null || name.length == 0) { name = ChannelIdUtil.toStringNoDates(dss.getRequestFilter().channel_id); } // end of if () name = getUniqueName(getDataSetSeismogramNames(), name); if ( ! name.equals(dss.getName...
public abstract ChangeLogSet parse(Build build, File changelogFile) throws IOException, SAXException;
public abstract ChangeLogSet<? extends Entry> parse(Build build, File changelogFile) throws IOException, SAXException;
public abstract ChangeLogSet parse(Build build, File changelogFile) throws IOException, SAXException;
if(!isPassed()) {
if(!isPassed() && failedSince==0) {
public void freeze(SuiteResult parent) { this.parent = parent; if(!isPassed()) { CaseResult prev = getPreviousResult(); if(prev!=null && !prev.isPassed()) this.failedSince = prev.failedSince; else this.failedSince = getOwner().getNumber();...
testOpSetBug();
public void runTest() { String fileName = "JEPTestExpressions.txt"; testWithFile(fileName); testGetValue(); testGetComplexValue(); }
if(value == null) return Double.NaN; if(value instanceof Complex) { Complex c = (Complex) value; if( c.im() != 0.0) return Double.NaN; return c.re(); }
public double getValue() { Object value = getValueAsObject(); if (value != null && value instanceof Number) { return ((Number)value).doubleValue(); } return Double.NaN; }
this.node = node;
if(node instanceof Slave) this.nodeName = node.getNodeName(); else this.nodeName = null;
/*package*/ void setNode(Node node) { assert node!=null; this.node = node; setNumExecutors(node.getNumExecutors()); }
public static DataSetSeismogram[][] getComponents(DataSetSeismogram[] dss, String suffix){ List names = new ArrayList(); List north = new ArrayList(); List east = new ArrayList(); List z = new ArrayList(); for(int i = 0; i < dss.length; i++){ if(!names.contains(dss[i].getSeismogram().getName())){ LocalSeismogramImpl se...
public static DataSetSeismogram[][] getComponents(DataSetSeismogram[] dss){ return getComponents(dss, "");
public static DataSetSeismogram[][] getComponents(DataSetSeismogram[] dss, String suffix){ List names = new ArrayList(); List north = new ArrayList(); List east = new ArrayList(); List z = new ArrayList(); for(int i = 0; i < dss.length; i++){ if(!names.contains(dss[i].g...
partialFile = swDownloadFile.getIncompleteFile(); long startOffset = requestedRange.getStartOffset( fileSize ); long endOffset = Math.min( requestedRange.getEndOffset( fileSize ), availableRange.getEndOffset( fileSize ) ); requestedRange.update( startOffset, endOffset ); fileStartOffset = startOffset; return;
try { partialFile = swDownloadFile.getIncompleteDownloadFile().getFile(); long startOffset = requestedRange.getStartOffset( fileSize ); long endOffset = Math.min( requestedRange.getEndOffset( fileSize ), availableRange.getEndOffset( fileSize ) ); requestedRange.update( startOffset, endOffset ); fileStartOffset = startO...
public void findFittingPartForRange( Range requestedRange ) { Range availableRange; Iterator iterator = availableRangeSet.getIterator(); long fileSize = getFileSize(); while ( iterator.hasNext() ) { availableRange = (Range)iterator.next(); if ( availableRa...
numberOfParameters = 2;
super.numberOfParameters = 2;
public Diff() { super(); numberOfParameters = 2; }
logger.warn("Caught exception, retrying "+count+" of "+retry, t);
logger.warn("Caught exception, retrying "+ ++count +" of "+retry, t);
public NetworkAttr get_attributes() { int count = 0; RuntimeException lastException = null; while (count < retry) { try { return net.get_attributes(); } catch (RuntimeException t) { lastException = t; logger.warn("Caught excepti...
count++;
public NetworkAttr get_attributes() { int count = 0; RuntimeException lastException = null; while (count < retry) { try { return net.get_attributes(); } catch (RuntimeException t) { lastException = t; logger.warn("Caught excepti...
public void mul(PNodeI term,PNodeI power) throws ParseException
public void mul(PConstant c) throws ParseException
public void mul(PNodeI term,PNodeI power) throws ParseException { for(int i=0;i<length;++i) { if(terms[i].equals(term)) { powers[i] = powers[i].add(power); return; } } // insert in correct posn PNodeI newTerms[] = new PNodeI[length+1]; PNodeI newPowers[] = new PNodeI[length+1]; int pos=0; boolean done...
for(int i=0;i<length;++i) { if(terms[i].equals(term)) { powers[i] = powers[i].add(power); return; } } PNodeI newTerms[] = new PNodeI[length+1]; PNodeI newPowers[] = new PNodeI[length+1]; int pos=0; boolean done = false; for(int i=0;i<length;++i) { if(!done && terms[i].compareTo(term) > 0) { newTerms[pos] = term; newPo...
coeff = (PConstant) coeff.mul(c);
public void mul(PNodeI term,PNodeI power) throws ParseException { for(int i=0;i<length;++i) { if(terms[i].equals(term)) { powers[i] = powers[i].add(power); return; } } // insert in correct posn PNodeI newTerms[] = new PNodeI[length+1]; PNodeI newPowers[] = new PNodeI[length+1]; int pos=0; boolean done...
coeff = (PConstant) c.pow(c);
coeff = (PConstant) coeff.pow(c);
void power(PConstant c) throws ParseException { coeff = (PConstant) c.pow(c); for(int i=0;i<length;++i) powers[i] = powers[i].mul(c); }
public Process(Entity entity, String docCode) { super(entity, docCode);
public Process() {
public Process(Entity entity, String docCode) { super(entity, docCode); }
if ( selectionPaths.length == 0 )
if ( selectionPaths == null || selectionPaths.length == 0 )
public RemoteFile[] getSelectedRemoteFiles( boolean singleForAll ) { ISearchDataModel searchDataModel = searchTreeTableModel.getDisplayedResultsData(); if (searchDataModel == null) { return EMPTY_REMOTE_FILE_ARRAY; } TreePath[] selectionPaths = searchTreeTabl...
public SWDownloadFile getDownloadFile( long fileSize, URN matchURN )
public SWDownloadFile getDownloadFile( int index )
public SWDownloadFile getDownloadFile( long fileSize, URN matchURN ) { synchronized( downloadList ) { SWDownloadFile file = getDownloadFileByURN( matchURN ); if ( file != null && file.getTotalDataSize() == fileSize ) { return file; } ...
SWDownloadFile file = getDownloadFileByURN( matchURN ); if ( file != null && file.getTotalDataSize() == fileSize )
if ( index < 0 || index >= downloadList.size() )
public SWDownloadFile getDownloadFile( long fileSize, URN matchURN ) { synchronized( downloadList ) { SWDownloadFile file = getDownloadFileByURN( matchURN ); if ( file != null && file.getTotalDataSize() == fileSize ) { return file; } ...
return file;
return null;
public SWDownloadFile getDownloadFile( long fileSize, URN matchURN ) { synchronized( downloadList ) { SWDownloadFile file = getDownloadFileByURN( matchURN ); if ( file != null && file.getTotalDataSize() == fileSize ) { return file; } ...
return null;
return downloadList.get( index );
public SWDownloadFile getDownloadFile( long fileSize, URN matchURN ) { synchronized( downloadList ) { SWDownloadFile file = getDownloadFileByURN( matchURN ); if ( file != null && file.getTotalDataSize() == fileSize ) { return file; } ...
JButton backBtn = new JButton( Localizer.getString( "WizardDialog_Back" ) );
backBtn = new JButton( Localizer.getString( "WizardDialog_Back" ) );
private void prepareComponent() { CloseEventHandler closeEventHandler = new CloseEventHandler(); addWindowListener( closeEventHandler ); Container contentPane = getContentPane(); contentPane.setLayout( new BorderLayout() ); JPanel contentPanel = new JPanel(); ...
if ( editRule != null && editRule.isDefaultRule() ) { backBtn.setEnabled(false); } else { backBtn.setEnabled(true); }
private void updatePage() { ruleEditPanel.removeAll(); JPanel newPage = null; switch ( currentPage ) { case CONDITION_PAGE: if ( conditionPanel == null ) { conditionPanel = new ConditionPanel(this); } newPage = conditio...
public UserRole findUserRoleByNaturalId(User user, Service service, String serviceExtension);
public UserRole findUserRoleByNaturalId(UserGroup userGroup, Service service, String serviceExtension);
public UserRole findUserRoleByNaturalId(User user, Service service, String serviceExtension);
if(diff>100*60)
if(abs>100*60)
public String getClockDifferenceString() { try { long diff = getClockDifference(); if(-1000<diff && diff <1000) return "In sync"; // clock is in sync long abs = Math.abs(diff); String s = Util.getTimeSpanString(abs); if(diff<0) ...
return entityDao.findDefaultEntity().getDefaultEntity().getEntity();
return entityDao.findDefaultEntity();
public Entity findDefaultEntity() { return entityDao.findDefaultEntity().getDefaultEntity().getEntity(); }
otherMagType = new String(fourBytes);
otherMagType = new String(PSNDataFile.chopToLength(fourBytes));
public PSNEventInfo(DataInputStream data) throws IOException{ dis = data; time = new PSNDateTime(dis); //System.out.println(time.toString()); lat = SacTimeSeries.swapBytes(dis.readDouble()); lon = SacTimeSeries.swapBytes(dis.readDouble()); depthKM = SacTimeSeries.swapBytes(...
reportingAgency = new String(sixBytes);
reportingAgency = new String(PSNDataFile.chopToLength(sixBytes));
public PSNEventInfo(DataInputStream data) throws IOException{ dis = data; time = new PSNDateTime(dis); //System.out.println(time.toString()); lat = SacTimeSeries.swapBytes(dis.readDouble()); lon = SacTimeSeries.swapBytes(dis.readDouble()); depthKM = SacTimeSeries.swapBytes(...
for (int j = 0; j < containedSeis.length && !found; j++) { if(containedSeis == it.next()){ found = true; }
Object o = it.next(); if(containedSeis[i] == o){ found = true;
public void run(){ LocalSeismogramImpl[] containedSeis = container.getSeismograms(); List alreadyFiltered = new ArrayList(); Iterator it = data.iterator(); boolean found = false; while(it.hasNext()){ SoftReference currentRef = (SoftReference)...
public FilteredDataSetSeismogram(DataSetSeismogram dss, ColoredFilter filter){
private FilteredDataSetSeismogram(DataSetSeismogram dss, ColoredFilter filter){
public FilteredDataSetSeismogram(DataSetSeismogram dss, ColoredFilter filter){ super(dss.getDataSet(), filter.getName()); this.filter = filter; wrappedDSS = dss; container = new SeismogramContainer(this, wrappedDSS); }
container.getSeismograms();
public FilteredDataSetSeismogram(DataSetSeismogram dss, ColoredFilter filter){ super(dss.getDataSet(), filter.getName()); this.filter = filter; wrappedDSS = dss; container = new SeismogramContainer(this, wrappedDSS); }
public edu.iris.Fissures.Time getBeginTime() {
public Time getBeginTime() {
public edu.iris.Fissures.Time getBeginTime() { return wrappedDSS.getBeginTime(); }
public edu.iris.Fissures.Time getEndTime() {
public Time getEndTime() {
public edu.iris.Fissures.Time getEndTime() { return wrappedDSS.getEndTime(); }
public void setBeginTime(edu.iris.Fissures.Time time) {
public void setBeginTime(Time time) {
public void setBeginTime(edu.iris.Fissures.Time time) { throw new UnsupportedOperationException("Cannot set begin time on filtered seismogram. It is entirely reliant on the wrapped dss time"); }
public void setEndTime(edu.iris.Fissures.Time time) {
public void setEndTime(Time time) {
public void setEndTime(edu.iris.Fissures.Time time) { throw new UnsupportedOperationException("Cannot set end time on filtered seismogram. It is entirely reliant on the wrapped dss time"); }
Node processed = j.commandv.process(node,j);
Node processed = j.preprocess(node);
public void simplifyTestString(String expr,String expected) throws ParseException { Node node = j.parse(expr); Node processed = j.commandv.process(node,j); Node simp = j.simplify(processed); String res = j.pv.toString(simp); if(!expected.equals(res)) System.out.println("Error: Value of \""+expr+"\" is \""+r...
String res = j.pv.toString(simp);
String res = j.toString(simp);
public void simplifyTestString(String expr,String expected) throws ParseException { Node node = j.parse(expr); Node processed = j.commandv.process(node,j); Node simp = j.simplify(processed); String res = j.pv.toString(simp); if(!expected.equals(res)) System.out.println("Error: Value of \""+expr+"\" is \""+r...
Node processed = j.commandv.process(node,j);
Node processed = j.preprocess(node);
public void simplifyTest(String expr,String expected) throws ParseException { Node node = j.parse(expr); Node processed = j.commandv.process(node,j); Node simp = j.simplify(processed); String res = j.pv.toString(simp); Node node2 = j.parse(expected); Node processed2 = j.commandv.process(node2,j); Node simp2 =...
String res = j.pv.toString(simp);
String res = j.toString(simp);
public void simplifyTest(String expr,String expected) throws ParseException { Node node = j.parse(expr); Node processed = j.commandv.process(node,j); Node simp = j.simplify(processed); String res = j.pv.toString(simp); Node node2 = j.parse(expected); Node processed2 = j.commandv.process(node2,j); Node simp2 =...
Node processed2 = j.commandv.process(node2,j);
Node processed2 = j.preprocess(node2);
public void simplifyTest(String expr,String expected) throws ParseException { Node node = j.parse(expr); Node processed = j.commandv.process(node,j); Node simp = j.simplify(processed); String res = j.pv.toString(simp); Node node2 = j.parse(expected); Node processed2 = j.commandv.process(node2,j); Node simp2 =...
String res2 = j.pv.toString(simp2);
String res2 = j.toString(simp2);
public void simplifyTest(String expr,String expected) throws ParseException { Node node = j.parse(expr); Node processed = j.commandv.process(node,j); Node simp = j.simplify(processed); String res = j.pv.toString(simp); Node node2 = j.parse(expected); Node processed2 = j.commandv.process(node2,j); Node simp2 =...
public StatRecord(String description, String unit, int value) { this.description = description; this.unit = unit; intValue = value;
public StatRecord(StatisticType type, long value) { this.type = type; longValue = value; this.description = type.getDescription(); this.unit = type.getUnit();
public StatRecord(String description, String unit, int value) { this.description = description; this.unit = unit; intValue = value; this.value = "" + value; }
for (File child : file.listFiles()) {
File[] files = file.listFiles(); if(files==null) return; for (File child : files) {
public static void deleteContentsRecursive(File file) throws IOException { for (File child : file.listFiles()) { if (child.isDirectory()) deleteContentsRecursive(child); if (!child.delete()) throw new IOException("Unable to delete " + child.getPath()); ...
static public int binom(int n,int i)
static public int binom(int n,int i) throws ArrayIndexOutOfBoundsException
static public int binom(int n,int i) { expand(n); return coeffs[n][i]; }
return new AssertionImpl(new SimplePrincipal("test"), new HashMap());
return new AssertionImpl(new SimplePrincipal("test"), new HashMap(), new ProxyRetriever() { public String getProxyTicketIdFor(String proxyGrantingTicketId, Service targetService) { return "test"; } }, "proxyTicketId");
public void testAuthenticateWithProxy() throws Exception { this.context = new CasSecurityContext(new TicketValidator() { public Assertion validate(String ticketId, Service service) throws ValidationException { return new AssertionImpl(new SimplePrincipal("test"), new HashMap()); ...
return new AssertionImpl(new SimplePrincipal("test"), new HashMap());
return new AssertionImpl(new SimplePrincipal("test"), new HashMap(), new ProxyRetriever() { public String getProxyTicketIdFor(String proxyGrantingTicketId, Service targetService) { return "test"; } }, "proxyTicketId");
public Assertion validate(String ticketId, Service service) throws ValidationException { return new AssertionImpl(new SimplePrincipal("test"), new HashMap()); }
if(node instanceof PVariable) { if(this.equalsIgnoreConstant(node)) { return valueOf((PConstant)coeff.add(pc.oneConstant), vars,powers); } }
public PNodeI add(PNodeI node) throws ParseException { if(node instanceof Monomial) { Monomial mon = (Monomial) node; if(this.equalsIgnoreConstant(mon)) { return valueOf((PConstant)coeff.add(mon.coeff), vars,powers); } } return super.add(node); }
if(node instanceof PVariable) { if(this.equalsIgnoreConstant(node)) { return valueOf((PConstant)coeff.sub(pc.oneConstant), vars,powers); } }
public PNodeI sub(PNodeI node) throws ParseException { if(node instanceof Monomial) { Monomial mon = (Monomial) node; if(this.equalsIgnoreConstant(mon)) { return valueOf((PConstant)coeff.sub(mon.coeff), vars,powers); } } return super.sub(node); }
public AbstractPNode(PolynomialCreator pc) { this.pc = pc; }
private AbstractPNode() {}
public AbstractPNode(PolynomialCreator pc) { this.pc = pc; }
else return new Polynomial(pc,new PNodeI[]{node,this});
return new Polynomial(pc,new PNodeI[]{node,this});
public PNodeI add(PNodeI node) throws ParseException { if(node.isZero()) return this; if(this.isZero()) return node; if(this.equals(node)) return new Monomial(pc,pc.twoConstant,this); if(node instanceof Polynomial) return node.add(this); if(this.compareTo(node) < 0) return new Polynomial(pc,new PNodeI[...
else return new Monomial(pc, pc.oneConstant, new PNodeI[]{node,this}, new PNodeI[]{pc.oneConstant,pc.oneConstant});
return new Monomial(pc, pc.oneConstant, new PNodeI[]{node,this}, new PNodeI[]{pc.oneConstant,pc.oneConstant});
public PNodeI mul(PNodeI node) throws ParseException { if(node.isZero()) return pc.zeroConstant; if(node.isOne()) return this; if(this.equals(node)) return new Monomial(pc,pc.oneConstant,this,pc.twoConstant); if(node instanceof Constant) return new Monomial(pc,(Constant) node,this); if(node instanceof Mon...
return ((Double) value).compareTo(pc.zero) < 0;
return ((Double) value).compareTo((Double) pc.zero) < 0;
public boolean isNegative() { try { return ((Double) value).compareTo(pc.zero) < 0; } catch(Exception e) { return false; } }
public FilteredSeismogramShape(ColoredFilter filter, DataSetSeismogram seismogram, JComponent parent){ super(parent, seismogram); this.seismogram = seismogram; this.filter = filter;
public FilteredSeismogramShape(ColoredFilter filter, DataSetSeismogram seismogram, JComponent parent){ super(parent, seismogram); this.seismogram = seismogram; filteredSeis = (DataSetSeismogram)seismogram.clone(); filteredSeis.setName(filter.getName()); this.filter = filter;
public FilteredSeismogramShape(ColoredFilter filter, DataSetSeismogram seismogram, JComponent parent){ super(parent, seismogram); this.seismogram = seismogram; this.filter = filter; }
this.builds = new RunMap<PromotedBuild>();
protected void onLoad(Hudson root, String name) throws IOException { this.builds.load(this,new Constructor<PromotedBuild>() { public PromotedBuild create(File dir) throws IOException { return new PromotedBuild(PromotedJob.this,dir); } }); }
throws IOException {
throws IOException, SeedFormatException {
public static Blockette parseBlockette(int type, byte[] bytes) throws IOException { try { //System.out.println(" Class.forName Blockette"+type); Class blocketteClass = Class.forName("edu.sc.seis.fissuresUtil.mseed.Blockette"+type); //System.out.println(" Cla...
byte[] fullBytes = new byte[4+bytes.length]; System.arraycopy(Utility.intToByteArray(type), 2, fullBytes, 0, 2); System.arraycopy(bytes, 0, fullBytes, 4, bytes.length);
public static Blockette parseBlockette(int type, byte[] bytes) throws IOException { try { //System.out.println(" Class.forName Blockette"+type); Class blocketteClass = Class.forName("edu.sc.seis.fissuresUtil.mseed.Blockette"+type); //System.out.println(" Cla...
arguments[0] = fullBytes;
arguments[0] = bytes;
public static Blockette parseBlockette(int type, byte[] bytes) throws IOException { try { //System.out.println(" Class.forName Blockette"+type); Class blocketteClass = Class.forName("edu.sc.seis.fissuresUtil.mseed.Blockette"+type); //System.out.println(" Cla...
return null;
throw new SeedFormatException("Can't load blockette for type="+type, e);
public static Blockette parseBlockette(int type, byte[] bytes) throws IOException { try { //System.out.println(" Class.forName Blockette"+type); Class blocketteClass = Class.forName("edu.sc.seis.fissuresUtil.mseed.Blockette"+type); //System.out.println(" Cla...
String s = new BufferedReader(new FileReader(file)).readLine(); if(s==null) return false; return s.trim().equals(contents.trim());
Reader r = new FileReader(file); try { String s = new BufferedReader(r).readLine(); if (s == null) return false; return s.trim().equals(contents.trim()); } finally { r.close(); }
private boolean checkContents(File file, String contents) { try { String s = new BufferedReader(new FileReader(file)).readLine(); if(s==null) return false; return s.trim().equals(contents.trim()); } catch (IOException e) { return false; } }
throws SeedFormatException, IOException { ControlHeader header = ControlHeader.read(inStream); if (header instanceof DataHeader) { return readDataRecord((DataHeader)header); } else { throw new SeedFormatException("Found a control record in miniseed");
throws SeedFormatException, IOException { ControlHeader header = ControlHeader.read(inStream); if (header instanceof DataHeader) { return readDataRecord((DataHeader)header); } else { throw new SeedFormatException("Found a control record in miniseed"); }
public SeedRecord getNextRecord() throws SeedFormatException, IOException { ControlHeader header = ControlHeader.read(inStream); if (header instanceof DataHeader) { return readDataRecord((DataHeader)header); } else {throw new SeedFormatException("Found a control record in miniseed");// retur...
}
public SeedRecord getNextRecord() throws SeedFormatException, IOException { ControlHeader header = ControlHeader.read(inStream); if (header instanceof DataHeader) { return readDataRecord((DataHeader)header); } else {throw new SeedFormatException("Found a control record in miniseed");// retur...
Blockette b = Blockette.parseBlockette(type,
byte[] fullBytes = new byte[4+blocketteBytes.length]; System.arraycopy(Utility.intToByteArray(type), 2, fullBytes, 0, 2); System.arraycopy(blocketteBytes, 0, fullBytes, 4, blocketteBytes.length); Blockette b = Blockette.parseBlockette(type,
protected DataRecord readDataRecord(DataHeader header) throws IOException, SeedFormatException { Assert.isTrue(header.getDataBlocketteOffset()>= header.getSize(), "Offset to first blockette must be larger than the header size"); byte[] garbage = new byte[header.getDataBlocketteOffset()- ...
dataRec.addBlockette(b); if (nextOffset == 0) { break;
dataRec.addBlockette(b); if (nextOffset == 0) { break; }
protected DataRecord readDataRecord(DataHeader header) throws IOException, SeedFormatException { Assert.isTrue(header.getDataBlocketteOffset()>= header.getSize(), "Offset to first blockette must be larger than the header size"); byte[] garbage = new byte[header.getDataBlocketteOffset()- ...
} Blockette[] allBs = dataRec.getBlockettes(1000); if (allBs.length == 0) { throw new SeedFormatException("no blockette 1000"); } else if (allBs.length > 1) { throw new SeedFormatException( "Multiple blockette 1000s in the volume. "+ allBs.length); }
Blockette[] allBs = dataRec.getBlockettes(1000); if (allBs.length == 0) { throw new SeedFormatException("no blockette 1000"); } else if (allBs.length > 1) { throw new SeedFormatException( "Multiple blockette 1000s in the volume. "+ allBs.length); }
protected DataRecord readDataRecord(DataHeader header) throws IOException, SeedFormatException { Assert.isTrue(header.getDataBlocketteOffset()>= header.getSize(), "Offset to first blockette must be larger than the header size"); byte[] garbage = new byte[header.getDataBlocketteOffset()- ...
public SeedFormatException(String s) { super(s); }
public SeedFormatException() { super(); }
public SeedFormatException(String s) { super(s); }
if (b == null) { throw new IllegalArgumentException("Blockette cannot be null"); }
public void addBlockette(Blockette b) throws SeedFormatException { if (b instanceof DataBlockette) { super.addBlockette(b); getHeader().setNumBlockettes((byte)(getHeader().getNumBlockettes()+1)); } else if (b instanceof BlocketteUnknown) { System.out.println("Bl...
assert( shareFile.getURN() != null ); urnToFileMap.put( shareFile.getURN(), shareFile ); addTimeToFile( shareFile );
rwLock.writeLock(); try { assert( shareFile.getURN() != null ); urnToFileMap.put( shareFile.getURN(), shareFile ); addTimeToFile( shareFile ); } finally { try{ rwLock.writeUnlock(); } catch (IllegalAccessException exp ) { NLogger.error( NLoggerNames.Sharing, exp, exp ); } }
public void addUrn2FileMapping( ShareFile shareFile ) { assert( shareFile.getURN() != null ); urnToFileMap.put( shareFile.getURN(), shareFile ); // only add time once we have a valid URN... // it makes no sense to return whats new files without urn. addTimeToFile( shareFile );...
colour = (lov * 2.65) - 1.2;
colour = 1.4922 * Math.pow(lov, 0.6859); colour = (colour * 2.65) - 1.2;
private double calcColour(double lov) { double colour = 0; if (colourMethod.equals("EBC")){ // From Greg Noonan's article at http://brewingtechniques.com/bmg/noonan.html colour = (lov * 2.65) - 1.2; } else { // calculates SRM based on MCU (degrees LOV) if (lov > 0) colour = 1.4922 * Math.pow(lov, 0....
double og = 0; double fg = 0; double lov = 0;
public void calcMaltTotals() { double og = 0; double fg = 0; double lov = 0; double maltPoints = 0; double mcu = 0; totalMaltLbs = 0; totalMaltCost = 0; totalMashLbs = 0; // first figure out the total we're dealing with for (int i = 0; i < fermentables.size(); i++) { Fermentable m = ((Fermentable) fermenta...
DecimalFormat df1 = new DecimalFormat("0.0"); DecimalFormat df2 = new DecimalFormat("0.00");
public String toText(){ DecimalFormat df1 = new DecimalFormat("0.0"); DecimalFormat df2 = new DecimalFormat("0.00"); MessageFormat mf; StringBuffer sb = new StringBuffer(); sb.append("StrangeBrew J1.0 recipe text output\n\n"); sb.append("Details:\n"); sb.append("Name: " + name + "\n"); sb.append("Brewer: " + b...
rwLock.writeLock(); try
try{ rwLock.assertWriteLock(); } catch (IllegalAccessException exp ) { NLogger.error( NLoggerNames.Sharing, exp, exp ); } Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get( time ); if ( shareFileSet == null )
private void addTimeToFile( ShareFile shareFile ) { rwLock.writeLock(); try { Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get( time ); if ( shareFileSet == null ) { shareFileSet = new HashSet(...
Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get( time ); if ( shareFileSet == null ) { shareFileSet = new HashSet(); timeToFileMap.put(time, shareFileSet); } shareFileSet.add( shareFile );
shareFileSet = new HashSet(); timeToFileMap.put(time, shareFileSet);
private void addTimeToFile( ShareFile shareFile ) { rwLock.writeLock(); try { Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get( time ); if ( shareFileSet == null ) { shareFileSet = new HashSet(...
finally { try{ rwLock.writeUnlock(); } catch (IllegalAccessException exp ) { NLogger.error( NLoggerNames.Sharing, exp, exp ); } }
shareFileSet.add( shareFile );
private void addTimeToFile( ShareFile shareFile ) { rwLock.writeLock(); try { Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get( time ); if ( shareFileSet == null ) { shareFileSet = new HashSet(...
rwLock.writeLock(); try
try{ rwLock.assertWriteLock(); } catch (IllegalAccessException exp ) { NLogger.error( NLoggerNames.Sharing, exp, exp ); } Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get(time); if ( shareFileSet == null )
private void removeTimeToFile( ShareFile shareFile ) { rwLock.writeLock(); try { Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get(time); if ( shareFileSet == null ) { return; } ...
Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get(time); if ( shareFileSet == null ) { return; } shareFileSet.remove(shareFile); if ( shareFileSet.size() == 0 ) { timeToFileMap.remove(time); }
return;
private void removeTimeToFile( ShareFile shareFile ) { rwLock.writeLock(); try { Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get(time); if ( shareFileSet == null ) { return; } ...
finally
shareFileSet.remove(shareFile); if ( shareFileSet.size() == 0 )
private void removeTimeToFile( ShareFile shareFile ) { rwLock.writeLock(); try { Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get(time); if ( shareFileSet == null ) { return; } ...
try{ rwLock.writeUnlock(); } catch (IllegalAccessException exp ) { NLogger.error( NLoggerNames.Sharing, exp, exp ); }
timeToFileMap.remove(time);
private void removeTimeToFile( ShareFile shareFile ) { rwLock.writeLock(); try { Long time = shareFile.getNetworkCreateTime(); Set shareFileSet = (Set) timeToFileMap.get(time); if ( shareFileSet == null ) { return; } ...
j.addFunction("zap2",new MacroFunction("zap",4,"x1+x2+x3+x4",(XJep) j)); valueTest("zap2(5,5,3,6)",19);
public void testMacroFun() throws Exception { j.addFunction("zap",new MacroFunction("zap",1,"x*(x-1)/2",(XJep) j)); valueTest("zap(10)",45); }
public void valueTest(String expr,String expected) throws Exception
public void valueTest(String expr,Object expected) throws Exception
public void valueTest(String expr,String expected) throws Exception { Object res = calcValue(expr); myAssertEquals(expr,expected,res.toString()); }
myAssertEquals(expr,expected,res.toString());
myAssertEquals(expr,expected,res);
public void valueTest(String expr,String expected) throws Exception { Object res = calcValue(expr); myAssertEquals(expr,expected,res.toString()); }
public BaseFormat(int base,String prefix) {
private BaseFormat() {
public BaseFormat(int base,String prefix) { super(); this.base = base; tb = new ToBase(base,prefix); fb = new FromBase(base,prefix); }
this.base = base; tb = new ToBase(base,prefix); fb = new FromBase(base,prefix);
tb = new ToBase(); fb = new FromBase();
public BaseFormat(int base,String prefix) { super(); this.base = base; tb = new ToBase(base,prefix); fb = new FromBase(base,prefix); }
public Comparator getColumnComparator( int column )
public Comparator<?> getColumnComparator( int column )
public Comparator getColumnComparator( int column ) { switch( column ) { case HOST_MODEL_INDEX: return new DestAddressComparator(); case PROGRESS_MODEL_INDEX: return ComparableComparator.getInstance(); case ETA_MODEL_INDEX: ...
return "";
return null;
public Object getComparableValueAt( int row, int column ) { SWDownloadCandidate candidate = downloadFile.getTransferCandidate( row ); if ( candidate == null ) { return ""; } SWDownloadSegment segment; switch( column ) { case FROM_MODE...
(double)timeLeft / 1000000.0 );
timeLeft / 1000000.0 );
public Object getComparableValueAt( int row, int column ) { SWDownloadCandidate candidate = downloadFile.getTransferCandidate( row ); if ( candidate == null ) { return ""; } SWDownloadSegment segment; switch( column ) { case FROM_MODE...