rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
|
---|---|---|
if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } | public void paint(Graphics g){ if(overSizedImage == null || overSizedImage.get() == null){ logger.debug("the image is null and is being recreated"); this.createImage(); return; } long endTime = timeConfig.getTimeRange().getEndTime().getMicroSecondTime(); long beginTime = timeConfig.getTimeRange().getBeginTime().getMicroSecondTime(); long overEndTime = overTimeRange.getEndTime().getMicroSecondTime(); long overBeginTime = overTimeRange.getBeginTime().getMicroSecondTime(); if(endTime >= overEndTime || beginTime <= overBeginTime){ logger.debug("the image has been dragged past its edge and is being recreated"); this.createImage(); return; } Graphics2D g2 = (Graphics2D)g; if(displayTime == timeConfig.getTimeRange().getInterval().getValue()){ double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * overSize.getWidth(); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); g2.drawImage(((Image)overSizedImage.get()), tx, null); } else{ double scale = displayTime/timeConfig.getTimeRange().getInterval().getValue(); double offset = (beginTime - overBeginTime)/ (double)(overEndTime - overBeginTime) * (overSize.getWidth() * scale); AffineTransform tx = AffineTransform.getTranslateInstance(-offset, 0.0); tx.scale(scale, 1); g2.drawImage(((Image)overSizedImage.get()), tx, null); synchronized(this){ displayInterval = timeConfig.getTimeRange().getInterval();} this.createImage(); } } |
|
if (ev.getCalendar() == null) { ev.setCalendar(svci.getPreferredCalendar()); } | public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { if (form.getGuest()) { // Just ignore this return "doNothing"; } BwEvent ev = form.getNewEvent(); if (ev == null) { return "doNothing"; } CalSvcI svci = form.fetchSvci(); if (!form.getEventDates().updateEvent(ev, svci.getTimezones()) || !BwWebUtil.validateEvent(svci, ev, false, // descriptionRequired form.getErr())) { return "doNothing"; } /** We might also need to add a location - for private events we don't * require a location */ BwLocation loc = null; if (form.getLocationId() != CalFacadeDefs.defaultLocationId) { loc = svci.getLocation(form.getLocationId()); } if (loc == null) { loc = form.getNewLocation(); } if (loc.getAddress() != null) { /* Location assigned */ BwLocation l = svci.ensureLocationExists(loc); boolean added = true; if (l != null) { loc = l; added = false; } ev.setLocation(loc); if (added) { form.getMsg().emit("org.bedework.client.message.locations.added", 1); } } else { ev.setLocation(null); } svci.addEvent(ev.getCalendar(), ev, null); form.resetNewEvent(); form.resetNewLocation(); form.getEventDates().setNewEvent(form.getNewEvent(), svci.getTimezones()); form.getMsg().emit("org.bedework.message.added.events", 1); form.refreshIsNeeded(); return "success"; } |
|
if (isMac()) { try { Class.forName("dg.hipster.controller.MacAppListener"); } catch(ClassNotFoundException cnfe) { cnfe.printStackTrace(); } } | public Main() { if (isMac()) { try { Class.forName("dg.hipster.controller.MacAppListener"); } catch(ClassNotFoundException cnfe) { cnfe.printStackTrace(); } } } |
|
if (isMac()) { try { Class.forName("dg.hipster.controller.MacAppListener"); } catch(ClassNotFoundException cnfe) { cnfe.printStackTrace(); } } | private void initControllers() { if (frame != null) { frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { handleQuit(); System.exit(0); } }); } } |
|
+ staticType_.getSimpleName() + " into a " + type.getSimpleName())); | + staticType_.getName() + " into a " + type.getName())); | public void castTo(Class type) throws XJavaException { if (type.isInstance(wrappedObject_)) { staticType_ = type; } else { throw new XJavaException(new ClassCastException("Failed to cast a Java object of type " + staticType_.getSimpleName() + " into a " + type.getSimpleName())); } } |
public static Method[] getMethods(Class fromClass, String selector, boolean isStatic) throws XSelectorNotFound { | public static Method[] getMethods(Class fromClass, String selector, boolean isStatic) { | public static Method[] getMethods(Class fromClass, String selector, boolean isStatic) throws XSelectorNotFound { Method[] methods = fromClass.getMethods(); Method m; Vector properMethods = new Vector(methods.length); for (int i = 0; i < methods.length; i++) { m = methods[i]; if ((Modifier.isStatic(m.getModifiers())) == isStatic && m.getName().equals(selector)) { properMethods.add(methods[i]); } } return (Method[]) properMethods.toArray(new Method[properMethods.size()]); } |
} | public void selectEvent(EventAccessOperations evo){ int rowToSelect = tableModel.getRowForEvent(evo); if (rowToSelect != -1){ selectionModel.setSelectionInterval(rowToSelect, rowToSelect); } } |
|
System.out.println("Attempting to match on " + names[i]); | public static DataSetSeismogram[] getComponents(DataSetSeismogram seismogram){ List componentSeismograms = new ArrayList(); RequestFilter rf = seismogram.getRequestFilter(); MicroSecondDate startDate = new MicroSecondDate(rf.start_time); MicroSecondDate endDate = new MicroSecondDate(rf.end_time); ChannelId chanId = rf.channel_id; DataSet dataSet = seismogram.getDataSet(); String[] names = dataSet.getDataSetSeismogramNames(); for (int i = 0; i < names.length; i++ ) { System.out.println("Attempting to match on " + names[i]); DataSetSeismogram currentSeis = dataSet.getDataSetSeismogram(names[i]); RequestFilter currentRF = currentSeis.getRequestFilter(); MicroSecondDate currentBegin = new MicroSecondDate(currentRF.start_time); MicroSecondDate currentEnd = new MicroSecondDate(currentRF.end_time); System.out.println("ID: " + ChannelIdUtil.toString(currentRF.channel_id) + "\nSITE CODE: " + currentRF.channel_id.site_code + " NETWORK ID: " + currentRF.channel_id.network_id + " CHANNEL CODE: " + currentRF.channel_id.channel_code + " STATION CODE: " + currentRF.channel_id.station_code); if(areFriends(chanId,currentRF.channel_id)){ System.out.println("the channel ids are equal"); if((currentBegin.equals(startDate) || currentBegin.before(startDate)) && (currentEnd.equals(endDate) || currentBegin.after(endDate))){ System.out.println("Found matching component"); componentSeismograms.add(currentSeis); } } } DataSetSeismogram[] components = new DataSetSeismogram[componentSeismograms.size()]; componentSeismograms.toArray(components); return components; } |
|
System.out.println("ID: " + ChannelIdUtil.toString(currentRF.channel_id) + "\nSITE CODE: " + currentRF.channel_id.site_code + " NETWORK ID: " + currentRF.channel_id.network_id + " CHANNEL CODE: " + currentRF.channel_id.channel_code + " STATION CODE: " + currentRF.channel_id.station_code); | public static DataSetSeismogram[] getComponents(DataSetSeismogram seismogram){ List componentSeismograms = new ArrayList(); RequestFilter rf = seismogram.getRequestFilter(); MicroSecondDate startDate = new MicroSecondDate(rf.start_time); MicroSecondDate endDate = new MicroSecondDate(rf.end_time); ChannelId chanId = rf.channel_id; DataSet dataSet = seismogram.getDataSet(); String[] names = dataSet.getDataSetSeismogramNames(); for (int i = 0; i < names.length; i++ ) { System.out.println("Attempting to match on " + names[i]); DataSetSeismogram currentSeis = dataSet.getDataSetSeismogram(names[i]); RequestFilter currentRF = currentSeis.getRequestFilter(); MicroSecondDate currentBegin = new MicroSecondDate(currentRF.start_time); MicroSecondDate currentEnd = new MicroSecondDate(currentRF.end_time); System.out.println("ID: " + ChannelIdUtil.toString(currentRF.channel_id) + "\nSITE CODE: " + currentRF.channel_id.site_code + " NETWORK ID: " + currentRF.channel_id.network_id + " CHANNEL CODE: " + currentRF.channel_id.channel_code + " STATION CODE: " + currentRF.channel_id.station_code); if(areFriends(chanId,currentRF.channel_id)){ System.out.println("the channel ids are equal"); if((currentBegin.equals(startDate) || currentBegin.before(startDate)) && (currentEnd.equals(endDate) || currentBegin.after(endDate))){ System.out.println("Found matching component"); componentSeismograms.add(currentSeis); } } } DataSetSeismogram[] components = new DataSetSeismogram[componentSeismograms.size()]; componentSeismograms.toArray(components); return components; } |
|
System.out.println("the channel ids are equal"); | public static DataSetSeismogram[] getComponents(DataSetSeismogram seismogram){ List componentSeismograms = new ArrayList(); RequestFilter rf = seismogram.getRequestFilter(); MicroSecondDate startDate = new MicroSecondDate(rf.start_time); MicroSecondDate endDate = new MicroSecondDate(rf.end_time); ChannelId chanId = rf.channel_id; DataSet dataSet = seismogram.getDataSet(); String[] names = dataSet.getDataSetSeismogramNames(); for (int i = 0; i < names.length; i++ ) { System.out.println("Attempting to match on " + names[i]); DataSetSeismogram currentSeis = dataSet.getDataSetSeismogram(names[i]); RequestFilter currentRF = currentSeis.getRequestFilter(); MicroSecondDate currentBegin = new MicroSecondDate(currentRF.start_time); MicroSecondDate currentEnd = new MicroSecondDate(currentRF.end_time); System.out.println("ID: " + ChannelIdUtil.toString(currentRF.channel_id) + "\nSITE CODE: " + currentRF.channel_id.site_code + " NETWORK ID: " + currentRF.channel_id.network_id + " CHANNEL CODE: " + currentRF.channel_id.channel_code + " STATION CODE: " + currentRF.channel_id.station_code); if(areFriends(chanId,currentRF.channel_id)){ System.out.println("the channel ids are equal"); if((currentBegin.equals(startDate) || currentBegin.before(startDate)) && (currentEnd.equals(endDate) || currentBegin.after(endDate))){ System.out.println("Found matching component"); componentSeismograms.add(currentSeis); } } } DataSetSeismogram[] components = new DataSetSeismogram[componentSeismograms.size()]; componentSeismograms.toArray(components); return components; } |
|
System.out.println("Found matching component"); | public static DataSetSeismogram[] getComponents(DataSetSeismogram seismogram){ List componentSeismograms = new ArrayList(); RequestFilter rf = seismogram.getRequestFilter(); MicroSecondDate startDate = new MicroSecondDate(rf.start_time); MicroSecondDate endDate = new MicroSecondDate(rf.end_time); ChannelId chanId = rf.channel_id; DataSet dataSet = seismogram.getDataSet(); String[] names = dataSet.getDataSetSeismogramNames(); for (int i = 0; i < names.length; i++ ) { System.out.println("Attempting to match on " + names[i]); DataSetSeismogram currentSeis = dataSet.getDataSetSeismogram(names[i]); RequestFilter currentRF = currentSeis.getRequestFilter(); MicroSecondDate currentBegin = new MicroSecondDate(currentRF.start_time); MicroSecondDate currentEnd = new MicroSecondDate(currentRF.end_time); System.out.println("ID: " + ChannelIdUtil.toString(currentRF.channel_id) + "\nSITE CODE: " + currentRF.channel_id.site_code + " NETWORK ID: " + currentRF.channel_id.network_id + " CHANNEL CODE: " + currentRF.channel_id.channel_code + " STATION CODE: " + currentRF.channel_id.station_code); if(areFriends(chanId,currentRF.channel_id)){ System.out.println("the channel ids are equal"); if((currentBegin.equals(startDate) || currentBegin.before(startDate)) && (currentEnd.equals(endDate) || currentBegin.after(endDate))){ System.out.println("Found matching component"); componentSeismograms.add(currentSeis); } } } DataSetSeismogram[] components = new DataSetSeismogram[componentSeismograms.size()]; componentSeismograms.toArray(components); return components; } |
|
MicroSecondTimeRange calcIntv; if(this.timeConfig == null) calcIntv = new MicroSecondTimeRange(((LocalSeismogramImpl)aSeis).getBeginTime(), ((LocalSeismogramImpl)aSeis).getEndTime()); else calcIntv = timeConfig.getTimeRange(aSeis); | public void removeSeismogram(LocalSeismogram aSeis){ if(seismos.contains(aSeis)){ MicroSecondTimeRange calcIntv; if(this.timeConfig == null) calcIntv = new MicroSecondTimeRange(((LocalSeismogramImpl)aSeis).getBeginTime(), ((LocalSeismogramImpl)aSeis).getEndTime()); else calcIntv = timeConfig.getTimeRange(aSeis); LocalSeismogramImpl seis = (LocalSeismogramImpl)aSeis; int beginIndex = SeisPlotUtil.getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), calcIntv.getBeginTime()); if (beginIndex < 0) beginIndex = 0; if (beginIndex > seis.getNumPoints()) beginIndex = seis.getNumPoints(); int endIndex = SeisPlotUtil.getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), calcIntv.getEndTime()); if (endIndex < 0) endIndex = 0; if (endIndex > seis.getNumPoints()) endIndex = seis.getNumPoints(); if (endIndex == beginIndex) { seismos.remove(aSeis); return; } try { double medDif = (seis.getMaxValue(beginIndex, endIndex).getValue()-seis.getMinValue(beginIndex, endIndex).getValue())/2; if(medDif == this.ampRange.getMaxValue()) this.ampRange = null; } catch (Exception e) { this.ampRange = null; } seismos.remove(aSeis); if(ampRange == null){ this.updateAmpSyncListeners(); } } } |
|
Iterator e = seismos.iterator(); while(e.hasNext()) this.getAmpRange(((LocalSeismogram)e.next()), calcIntv); | public void removeSeismogram(LocalSeismogram aSeis){ if(seismos.contains(aSeis)){ MicroSecondTimeRange calcIntv; if(this.timeConfig == null) calcIntv = new MicroSecondTimeRange(((LocalSeismogramImpl)aSeis).getBeginTime(), ((LocalSeismogramImpl)aSeis).getEndTime()); else calcIntv = timeConfig.getTimeRange(aSeis); LocalSeismogramImpl seis = (LocalSeismogramImpl)aSeis; int beginIndex = SeisPlotUtil.getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), calcIntv.getBeginTime()); if (beginIndex < 0) beginIndex = 0; if (beginIndex > seis.getNumPoints()) beginIndex = seis.getNumPoints(); int endIndex = SeisPlotUtil.getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), calcIntv.getEndTime()); if (endIndex < 0) endIndex = 0; if (endIndex > seis.getNumPoints()) endIndex = seis.getNumPoints(); if (endIndex == beginIndex) { seismos.remove(aSeis); return; } try { double medDif = (seis.getMaxValue(beginIndex, endIndex).getValue()-seis.getMinValue(beginIndex, endIndex).getValue())/2; if(medDif == this.ampRange.getMaxValue()) this.ampRange = null; } catch (Exception e) { this.ampRange = null; } seismos.remove(aSeis); if(ampRange == null){ this.updateAmpSyncListeners(); } } } |
|
notify("ADDED_LINK", this, other); | public void addLink(Idea other) { if (!this.equals(other)) { links.add(other); } } |
|
err.emit("org.bedework.pubevents.error.missingfield", "Name"); | err.emit("org.bedework.validation.error.missingfield", "Name"); | public boolean validateGroup(BwGroup updgrp, MessageEmit err) throws Throwable { boolean ok = true; if (updgrp == null) { // bogus call. return false; } updgrp.setAccount(Util.checkNull(updgrp.getAccount())); if (updgrp.getAccount() == null) { err.emit("org.bedework.pubevents.error.missingfield", "Name"); ok = false; } return ok; } |
setFlagTime(new MicroSecondDate().add(RTTimeRangeConfig.serverTimeOffset)); | setFlagTime(ClockUtil.now()); | public void draw(Graphics2D canvas, Dimension size, TimeEvent timeEvent, AmpEvent ampEvent){ setFlagTime(new MicroSecondDate().add(RTTimeRangeConfig.serverTimeOffset)); super.draw(canvas, size, timeEvent, ampEvent); } |
public boolean remove(){ if(internalTimeConfig.getTimeRange().getInterval().getValue()/externalTimeConfig.getTimeRange().getInterval().getValue() < .01) return true; return false; } | public void remove(){ display.remove(); } | public boolean remove(){ if(internalTimeConfig.getTimeRange().getInterval().getValue()/externalTimeConfig.getTimeRange().getInterval().getValue() < .01) return true; return false; } |
public Channel[] getSelectedChannels(){ | public Channel[] getSelectedChannels(MicroSecondDate when){ | public Channel[] getSelectedChannels(){ Channel[] inChannels = getChannels(); return getSelectedChannels(inChannels, new MicroSecondDate()); } |
return getSelectedChannels(inChannels, new MicroSecondDate()); | logger.debug("before prune channels, length="+inChannels.length); inChannels = BestChannelUtil.pruneChannels(inChannels, when); logger.debug("after prune channels, length="+inChannels.length); return getSelectedChannels(inChannels, when); | public Channel[] getSelectedChannels(){ Channel[] inChannels = getChannels(); return getSelectedChannels(inChannels, new MicroSecondDate()); } |
super.getProperties(props); | props = super.getProperties(props); | public Properties getProperties(Properties props){ super.getProperties(props); props.put("overviewLineWidth", "" + overviewLineWidth); props.put("lineWidthThreshold", "" + lineWidthThreshold); return props; } |
System.out.println("The seismogram is no null"); } else { System.out.println("The seismogram is not null"); | RequestFilter rf = new RequestFilter(seis.getChannelID(), seis.getBeginTime().getFissuresTime(), seis.getEndTime().getFissuresTime()); return new DataSetSeismogram(rf, null); | public DataSetSeismogram getDataSetSeismogram(String name) { LocalSeismogramImpl seis = getSeismogram(name); if(seis != null) { System.out.println("The seismogram is no null"); } else { System.out.println("The seismogram is not null"); } RequestFilter rf = new RequestFilter(seis.getChannelID(), seis.getBeginTime().getFissuresTime(), seis.getEndTime().getFissuresTime()); return new DataSetSeismogram(rf, null); } |
RequestFilter rf = new RequestFilter(seis.getChannelID(), seis.getBeginTime().getFissuresTime(), seis.getEndTime().getFissuresTime()); return new DataSetSeismogram(rf, null); | return null; | public DataSetSeismogram getDataSetSeismogram(String name) { LocalSeismogramImpl seis = getSeismogram(name); if(seis != null) { System.out.println("The seismogram is no null"); } else { System.out.println("The seismogram is not null"); } RequestFilter rf = new RequestFilter(seis.getChannelID(), seis.getBeginTime().getFissuresTime(), seis.getEndTime().getFissuresTime()); return new DataSetSeismogram(rf, null); } |
for (Iterator values = ((org.eclipse.uml2.uml.Package) modelObject).getPackagedElements().iterator(); values.hasNext();) { | for (Iterator values = ((Package) modelObject).getPackagedElements().iterator(); values.hasNext();) { | protected List getSemanticChildrenList() { List result = new LinkedList(); EObject modelObject = ((View) getHost().getModel()).getElement(); View viewObject = (View) getHost().getModel(); EObject nextValue; int nodeVID; for (Iterator values = ((org.eclipse.uml2.uml.Package) modelObject).getPackagedElements().iterator(); values.hasNext();) { nextValue = (EObject) values.next(); nodeVID = UMLVisualIDRegistry.getNodeVisualID(viewObject, nextValue); if (Stereotype2EditPart.VISUAL_ID == nodeVID) { result.add(nextValue); } } return result; } |
remove(display.getSeismograms()); | public boolean removeDisplay(BasicSeismogramDisplay display){ if(basicDisplays.contains(display)){ if(basicDisplays.size() == 1){ this.removeAll(); return true; } super.remove(display); basicDisplays.remove(display); remove(display.getSeismograms()); ((BasicSeismogramDisplay)basicDisplays.getFirst()).addTopTimeBorder(); ((BasicSeismogramDisplay)basicDisplays.getLast()).addBottomTimeBorder(); super.revalidate(); display.destroy(); repaint(); return true; } return false; } |
|
sb.append(getLogPrefix()); | sb.append(getLogPrefix(request)); | public LogEntry getLogEntry(HttpServletRequest request, String logname) { StringBuffer sb = new StringBuffer(logname); sb.append(":"); sb.append(getSessionId(request)); sb.append(":"); sb.append(getLogPrefix()); return new LogEntryImpl(sb, this); } |
private String getLogPrefix() { | protected String getLogPrefix(HttpServletRequest request) { | private String getLogPrefix() { try { if (logPrefix == null) { logPrefix = JspUtil.getProperty(getMessages(), "edu.rpi.sss.util.action.logprefix", "unknown"); } return logPrefix; } catch (Throwable t) { error(t); return "LOG-PREFIX-EXCEPTION"; } } |
return AGSymbol.alloc(javaToAmbientTalkSelector(jSelector)); | return AGSymbol.jAlloc(javaToAmbientTalkSelector(jSelector)); | public static final ATSymbol downSelector(String jSelector) { return AGSymbol.alloc(javaToAmbientTalkSelector(jSelector)); } |
System.out.println("Checking "+ChannelIdUtil.toStringNoDates(allSeis.getRequestFilter().channel_id)); | public static DataSetSeismogram[] retrieveSeismogramGrouping(DataSet dataset, DataSetSeismogram dss) { ChannelId channelId = dss.getRequestFilter().channel_id; ChannelId[] channelGroup = DataSetChannelGrouper.retrieveGrouping(dataset, channelId); DataSetSeismogram[] chGrpSeismograms = new DataSetSeismogram[3]; String[] allSeisNames = dataset.getDataSetSeismogramNames(); for(int counter = 0; counter < channelGroup.length; counter++) { for (int i=0; i < allSeisNames.length; i++) { DataSetSeismogram allSeis = dataset.getDataSetSeismogram(allSeisNames[i]); if (ChannelIdUtil.areEqual(channelGroup[counter], allSeis.getRequestFilter().channel_id) && dss.getBeginTime().date_time.equals(allSeis.getBeginTime().date_time) && dss.getEndTime().date_time.equals(allSeis.getEndTime().date_time)) { // found a match chGrpSeismograms[counter] = allSeis; break; } } } return chGrpSeismograms; } |
|
public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { | public Channel[] retrieve_grouping( Channel[] channels, Channel channel) { ChannelId channelId = channel.get_id(); | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); | Channel[] rtnchannels = new Channel[3]; for(int j = 0; j < channels.length; j++) { System.out.println("THe channel Str is "+ ChannelIdUtil.toString(channels[j].get_id())); | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
|
logger.debug("The search String is "+searchString); | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
|
logger.debug("The search string after is "+searchString); | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
|
return new ChannelId[0]; | return new Channel[0]; | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; | rtnchannels = new Channel[3]; rtnchannels[count] = channel; | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; | for(int counter = 0; counter < channels.length; counter++) { String channelStr = channels[counter].get_id().channel_code; | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
|
rtnchannels[count] = channelIds[counter]; | rtnchannels[count] = channels[counter]; | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); | public ChannelId[] retrieve_grouping( ChannelId[] channelIds, ChannelId channelId) { String givenChannelStr = channelId.channel_code; String givenPrefixStr = givenChannelStr.substring(0, givenChannelStr.length() - 1); char givenOrientation = givenChannelStr.charAt(givenChannelStr.length() - 1); String searchString = ""; ChannelId[] rtnchannels = new ChannelId[3]; logger.debug("The given prefixxStr is "+givenPrefixStr); for(int j = 0; j < channelIds.length; j++) { logger.debug("THe channel Str is "+ ChannelIdUtil.toString(channelIds[j])); } logger.debug("The given Channel is "+givenChannelStr+" given Orientation is "+givenOrientation); for(int i = 0; i < patterns.length; i++) { if(patterns[i].indexOf(givenOrientation) != -1) { searchString = patterns[i]; logger.debug("The search String is "+searchString); searchString = searchString.replace(givenOrientation, '_'); logger.debug("The search string after is "+searchString); } else { return new ChannelId[0]; } int count = 0; rtnchannels = new ChannelId[3]; rtnchannels[count] = channelId; count++; logger.debug("The length of the channels is "+channelIds.length); for(int counter = 0; counter < channelIds.length; counter++) { String channelStr = channelIds[counter].channel_code; String prefixStr = channelStr.substring(0, channelStr.length() - 1); char orientation = channelStr.charAt(channelStr.length() - 1); logger.debug("The channelstr is "+channelStr); logger.debug("The prefixStr is "+prefixStr); logger.debug("orientation is "+orientation); //the below if will not be need once the sac is fixed //if(orientation == givenOrientation) rtnchannels[0] = channelIds[counter]; if(prefixStr.equals(givenPrefixStr) && searchString.indexOf(orientation) != -1) { //if(givenPrefixStr.indexOf(prefixStr) != -1 && searchString.indexOf(orientation) != -1) { logger.debug("The searchString is "+searchString); searchString = searchString.replace(orientation,'_'); rtnchannels[count] = channelIds[counter]; count++; logger.debug("ORIENTATION "+orientation+"The matched channelStr is "+channelStr); } } if( searchString.equals("___") ) { //System.out.println("---------------___----------> RETURNING THE CHANNELS"); for(int counter = 0; counter < rtnchannels.length; counter++) { //if(rtnchannels[counter] == null) //System.out.println(" IS NULL "); // else //System.out.println(" IS NOT NULL "); } return rtnchannels; } } return new ChannelId[0]; } |
|
byte[] seqBytes = new byte[6]; in.readFully(seqBytes); String seqNumString = new String(seqBytes); int sequenceNum =0; try { sequenceNum = Integer.valueOf(seqNumString).intValue(); } catch (NumberFormatException e) { System.err.println("seq num unreadable, setting to 0 "+e.toString()); } | byte[] seqBytes = new byte[6]; in.readFully(seqBytes); | public static ControlHeader read(DataInput in) throws IOException, SeedFormatException { byte[] seqBytes = new byte[6]; in.readFully(seqBytes); String seqNumString = new String(seqBytes); int sequenceNum =0; try { sequenceNum = Integer.valueOf(seqNumString).intValue(); } catch (NumberFormatException e) { System.err.println("seq num unreadable, setting to 0 "+e.toString()); } // end of try-catch byte typeCode = in.readByte(); int b = in.readByte(); boolean continuationCode; if (b == 32) { // a space, so no continuation continuationCode = false; } else if (b == 42) { // an asterisk, so is a continuation continuationCode = true; } else { throw new SeedFormatException("ControlHeader, expected space or *, but got"+b); } if (typeCode == (byte)'D') { // Data Header return DataHeader.read(in, sequenceNum, (char)typeCode, continuationCode); } else { // Control header return new ControlHeader(sequenceNum, typeCode, continuationCode); } } |
finally { release(); } | public int doEndTag() throws JspException { try { JspWriter out = pageContext.getOut(); SelectTag select = (SelectTag) findAncestorWithClass(this, SelectTag.class); if (select == null) throw new JspException("option tag must be nested inside a select tag"); Collection<String> values = select.getCurrentValues(); String testValue = getValue(); if (testValue == null) testValue = text; boolean selected = values.contains(testValue); out.write("<option"); if (getStyleId() != null) out.write(" id=\"" + HtmlHelper.encodeAttribute(getStyleId()) + "\""); if (getValue() != null) out.write(" value=\"" + HtmlHelper.encodeAttribute(getValue()) + "\""); if (label != null) out.write(" label=\"" + HtmlHelper.encodeAttribute(label) + "\""); if (selected) out.write(" selected=\"selected\""); out.write(buildOptions()); out.write(">"); out.write(HtmlHelper.encodePCData(text)); out.write("</option>"); } catch (IOException ioe) { throw new JspException(ioe); } return EVAL_PAGE; } |
|
omgraphics.add(new OMStation(stations[i])); | synchronized(omgraphics){ omgraphics.add(new OMStation(stations[i])); } | public void stationDataChanged(StationDataEvent s) { Station[] stations = s.getStations(); for (int i = 0; i < stations.length; i++){ if (!stationMap.containsKey(stations[i].name)){ stationNames.add(stations[i].name); omgraphics.add(new OMStation(stations[i])); } List stationList = (List)stationMap.get(stations[i].name); if (stationList == null){ stationList = new LinkedList(); stationMap.put(stations[i].name, stationList); } stationList.add(stations[i]); } repaint(); } |
Evaluator.defineParamsForArgs(name_.getText().asNativeText().javaValue, scope, parameters_, arguments); | Evaluator.defineParamsForArgs(name_.base_getText().asNativeText().javaValue, scope, parameters_, arguments); | public ATObject base_apply(ATTable arguments, ATContext ctx) throws NATException { NATCallframe scope = new NATCallframe(ctx.base_getLexicalScope()); Evaluator.defineParamsForArgs(name_.getText().asNativeText().javaValue, scope, parameters_, arguments); return body_.meta_eval(ctx.base_withLexicalEnvironment(scope)); } |
return new BwRecurrence((Collection)((TreeSet)getRrules()).clone(), (Collection)((TreeSet)getExrules()).clone(), (Collection)((TreeSet)getRdates()).clone(), (Collection)((TreeSet)getExdates()).clone(), | return new BwRecurrence(clone(getRrules()), clone(getExrules()), clone(getRdates()), clone(getExdates()), | public Object clone() { return new BwRecurrence((Collection)((TreeSet)getRrules()).clone(), (Collection)((TreeSet)getExrules()).clone(), (Collection)((TreeSet)getRdates()).clone(), (Collection)((TreeSet)getExdates()).clone(), getRecurrenceId(), getLatestDate(), getExpanded()); } |
getEvent().getDtend(), | dt, | public DateTimeFormatter getEnd() { try { if (end == null) { end = new DateTimeFormatter(getCalInfo(), getEvent().getDtend(), ctz); } } catch (Throwable t) { error(t); } return end; } |
hrefs = new Vector(); | hrefs = new ArrayList(); | private int processDoc(Document doc) throws WebdavException { try { WebdavNsIntf intf = getNsIntf(); Element root = doc.getDocumentElement(); /* Get hold of the PROPFIND method instance - we need it to process possible prop requests. */ PropFindMethod pm = (PropFindMethod)intf.findMethod( WebdavMethods.propFind); if (pm == null) { return HttpServletResponse.SC_INTERNAL_SERVER_ERROR; } if (nodeMatches(root, CaldavTags.calendarQuery)) { reportType = reportTypeQuery; } else if (nodeMatches(root, CaldavTags.calendarMultiget)) { reportType = reportTypeMultiGet; } else if (nodeMatches(root, CaldavTags.freeBusyQuery)) { reportType = reportTypeFreeBusy; } else if (nodeMatches(root, WebdavTags.expandProperty)) { reportType = reportTypeExpandProperty; } else { throw new WebdavBadRequest(); } Element[] children = getChildren(root); for (int i = 0; i < children.length; i++) { Element curnode = children[i]; /** The names come through looking something like A:allprop etc. */ String nm = curnode.getLocalName(); String ns = curnode.getNamespaceURI(); if (debug) { trace("reqtype: " + nm + " ns: " + ns); } if (reportType == reportTypeFreeBusy) { freeBusy = new FreeBusyQuery(intf, debug); freeBusy.parse(curnode); } else if (reportType == reportTypeExpandProperty) { } else { /* Two possibilities: <!ELEMENT calendar-multiget (DAV:allprop | DAV:propname | DAV:prop)? calendar-data? DAV:href+> <!ELEMENT calendar-query (DAV:allprop | DAV:propname | DAV:prop)? calendar-data? filter> */ /* First try for a property request */ PropFindMethod.PropRequest pr = pm.tryPropRequest(curnode); if (pr != null) { if (preq != null) { if (debug) { trace("REPORT: preq not null"); } throw new WebdavBadRequest(); } preq = pr; } else if (nodeMatches(curnode, CaldavTags.calendarData)) { if (caldata != null) { if (debug) { trace("REPORT: caldata not null"); } throw new WebdavBadRequest(); } caldata = new CalendarData(debug); caldata.parse(curnode); } else if ((reportType == reportTypeQuery) && nodeMatches(curnode, CaldavTags.filter)) { if (filter != null) { if (debug) { trace("REPORT: filter not null"); } throw new WebdavBadRequest(); } filter = new Filter(intf, debug); int st = filter.parse(curnode); if (st != HttpServletResponse.SC_OK) { return st; } } else if ((reportType == reportTypeMultiGet) && nodeMatches(curnode, WebdavTags.href)) { String href = XmlUtil.getElementContent(curnode); if ((href == null) || (href.length() == 0)) { throw new WebdavBadRequest(); } if (hrefs == null) { hrefs = new Vector(); } hrefs.add(href); } else { if (debug) { trace("REPORT: unexpected element"); } throw new WebdavBadRequest(); } } } // Final validation if (reportType == reportTypeMultiGet) { if (hrefs == null) { // need at least 1 throw new WebdavBadRequest(); } } else if (reportType == reportTypeQuery) { if (caldata == null) { // same as empty element? caldata = new CalendarData(debug); } if (filter == null) { // filter required throw new WebdavBadRequest(); } } if (debug) { trace("REPORT: "); if (reportType == reportTypeFreeBusy) { trace("free-busy"); freeBusy.dump(); } else if (reportType == reportTypeQuery) { // Query - optional props + optional calendar data + filter if (caldata != null) { caldata.dump(); } else { trace("No caldata"); } filter.dump(); } else if (reportType == reportTypeMultiGet) { // Multi-get - optional props + optional calendar data + one or more hrefs if (caldata != null) { caldata.dump(); } else { trace("No caldata"); } Iterator it = hrefs.iterator(); while (it.hasNext()) { String href = (String)it.next(); trace(" <DAV:href>" + href + "</DAV:href>"); } } else { } } return HttpServletResponse.SC_OK; } catch (WebdavException wde) { throw wde; } catch (Throwable t) { System.err.println(t.getMessage()); if (debug) { t.printStackTrace(); } return HttpServletResponse.SC_INTERNAL_SERVER_ERROR; } } |
nodes = new Vector(); | nodes = new ArrayList(); | public void processResp(HttpServletRequest req, HttpServletResponse resp, int depth) throws WebdavException { resp.setStatus(WebdavStatusCode.SC_MULTI_STATUS); resp.setContentType("text/xml; charset=UTF-8"); String resourceUri = getResourceUri(req); CaldavBWIntf intf = (CaldavBWIntf)getNsIntf(); WebdavNsNode node = intf.getNode(resourceUri); openTag(WebdavTags.multistatus); int status = HttpServletResponse.SC_OK; Collection nodes = null; if (reportType == reportTypeQuery) { try { int retrieveRecur; if (caldata.getErs() != null) { /* expand XXX use range */ retrieveRecur = CalFacadeDefs.retrieveRecurExpanded; } else if (caldata.getLrs() != null) { /* expand XXX use range */ retrieveRecur = CalFacadeDefs.retrieveRecurOverrides; } else { retrieveRecur = CalFacadeDefs.retrieveRecurMaster; } nodes = intf.query(node, retrieveRecur, filter); } catch (WebdavException wde) { status = wde.getStatusCode(); } } else if (reportType == reportTypeMultiGet) { nodes = new Vector(); if (hrefs != null) { Iterator it = hrefs.iterator(); while (it.hasNext()) { String href = intf.getUri((String)it.next()); try { nodes.add(intf.getNode(href)); } catch (WebdavException we) { nodes.add(new CaldavCalNode(we.getStatusCode(), debug)); } } } } else if (reportType == reportTypeFreeBusy) { try { nodes = intf.getFreeBusy(node, freeBusy); } catch (WebdavException wde) { if (debug) { trace("intf.getFreeBusy exception"); } status = wde.getStatusCode(); } } else if (reportType == reportTypeExpandProperty) { } if (status != HttpServletResponse.SC_OK) { if (debug) { trace("REPORT status " + status); } // Entire request failed. node.setStatus(status); doNode(node); } else if (nodes != null) { Iterator it = nodes.iterator(); while (it.hasNext()) { WebdavNsNode curnode = (WebdavNsNode)it.next(); doNode(curnode); } } closeTag(WebdavTags.multistatus); flush(); } |
encryptedClassName = "6975"; | Class defaultClass = Class.forName("com.idega.workspace.WorkspaceLoginPage"); encryptedClassName = IWMainApplication.getEncryptedClassName(defaultClass); | 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"; } else{ encryptedClassName = urlArray[0]; } //String encryptedClassName=urlArray[1]; //} String realClassName = IWMainApplication.decryptClassName(encryptedClassName); return Class.forName(realClassName); } |
else{ | else if(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"; } else{ encryptedClassName = urlArray[0]; } //String encryptedClassName=urlArray[1]; //} String realClassName = IWMainApplication.decryptClassName(encryptedClassName); return Class.forName(realClassName); } |
} else if(urlArray.length==2){ encryptedClassName = urlArray[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"; } else{ encryptedClassName = urlArray[0]; } //String encryptedClassName=urlArray[1]; //} String realClassName = IWMainApplication.decryptClassName(encryptedClassName); return Class.forName(realClassName); } |
|
child.getChildren().add(child); | this.child.getChildren().add(child); | public PageWrapper(UIComponent child){ if(child instanceof com.idega.presentation.Page){ this.child=child; } else{ this.child = new com.idega.presentation.Page(); child.getChildren().add(child); } } |
Graphics2D copy = (Graphics2D)g; | Graphics2D copy = (Graphics2D)g.create(); | public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { Graphics2D copy = (Graphics2D)g; if (copy != null) { try { AffineTransform insetMove = AffineTransform.getTranslateInstance(x, y); copy.transform(insetMove); FontMetrics fm = copy.getFontMetrics(); copy.drawString(title, left+(width-left - right - fm.stringWidth(title))/2, (height-bottom/2)+(fm.getAscent())/2); } finally { copy.dispose(); } } } |
return this.meta_defineField(field.getName(), field.getValue()); | return this.meta_defineField(field.getName(), field.getFieldValue()); | public ATNil meta_addField(ATField field) throws NATException { return this.meta_defineField(field.getName(), field.getValue()); } |
System.out.println("mouseClicked"); | public boolean mouseClicked(MouseEvent e){ System.out.println("mouseClicked"); synchronized(circles){ Iterator it = circles.iterator(); while(it.hasNext()){ OMEvent current = (OMEvent)it.next(); if(current.getBigCircle().contains(e.getX(), e.getY())){ System.out.println("Selection of event " + current.getEvent()); int rowToSelect = tableModel.getRowForEvent(current.getEvent()); if (rowToSelect != -1){ selectionModel.setSelectionInterval(rowToSelect, rowToSelect); } return true; } } } return false; } |
|
System.out.println("Selection of event " + current.getEvent()); | public boolean mouseClicked(MouseEvent e){ System.out.println("mouseClicked"); synchronized(circles){ Iterator it = circles.iterator(); while(it.hasNext()){ OMEvent current = (OMEvent)it.next(); if(current.getBigCircle().contains(e.getX(), e.getY())){ System.out.println("Selection of event " + current.getEvent()); int rowToSelect = tableModel.getRowForEvent(current.getEvent()); if (rowToSelect != -1){ selectionModel.setSelectionInterval(rowToSelect, rowToSelect); } return true; } } } return false; } |
|
if (module.getInformationResource() != null) { | if (module.getInfoURL() != null) { | private void addModule(final ModuleContainer module) { if (!module.isPanel() && !module.isConfigurable()) { return; } String name = module.getName(); if (name == null || name.length() == 0) { name = "Untitled"; } JMenu m = new JMenu(name); m.setMnemonic(name.charAt(0)); if (module.isPanel()) { JMenuItem i = new JMenuItem("New instance"); i.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { ModuleFactory.newInstance(module); } catch (Exception exc) { ExceptionDialog.show("Module could not be instantiated", exc); } } }); m.add(i); } if (module.isConfigurable()) { JMenuItem i = new JMenuItem("Configure"); i.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { IPanel config = ModuleConfigFactory.newInstance(module); addTab(config); } catch (Exception exc) { ExceptionDialog.show("Module configuration could not " + "be started", exc); } } }); m.add(i); } if (module.getInformationResource() != null) { JMenuItem i = new JMenuItem("Info"); i.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { URL url = module.getInformationResource(); HTMLBrowser browser = new HTMLBrowser(url) { public String getTitle() { return module.getName() +" Info"; } }; addTab(browser); } catch (Exception exc) { ExceptionDialog.show("Module information could not " + "be started", exc); } } }); m.add(i); } add(m, getMenuCount() - 1); table.put(module, m); } |
URL url = module.getInformationResource(); | URL url = module.getInfoURL(); | private void addModule(final ModuleContainer module) { if (!module.isPanel() && !module.isConfigurable()) { return; } String name = module.getName(); if (name == null || name.length() == 0) { name = "Untitled"; } JMenu m = new JMenu(name); m.setMnemonic(name.charAt(0)); if (module.isPanel()) { JMenuItem i = new JMenuItem("New instance"); i.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { ModuleFactory.newInstance(module); } catch (Exception exc) { ExceptionDialog.show("Module could not be instantiated", exc); } } }); m.add(i); } if (module.isConfigurable()) { JMenuItem i = new JMenuItem("Configure"); i.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { IPanel config = ModuleConfigFactory.newInstance(module); addTab(config); } catch (Exception exc) { ExceptionDialog.show("Module configuration could not " + "be started", exc); } } }); m.add(i); } if (module.getInformationResource() != null) { JMenuItem i = new JMenuItem("Info"); i.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { URL url = module.getInformationResource(); HTMLBrowser browser = new HTMLBrowser(url) { public String getTitle() { return module.getName() +" Info"; } }; addTab(browser); } catch (Exception exc) { ExceptionDialog.show("Module information could not " + "be started", exc); } } }); m.add(i); } add(m, getMenuCount() - 1); table.put(module, m); } |
private static final long serialVersionUID = 2883659303596869565L; | private void addModule(final ModuleContainer module) { if (!module.isPanel() && !module.isConfigurable()) { return; } String name = module.getName(); if (name == null || name.length() == 0) { name = "Untitled"; } JMenu m = new JMenu(name); m.setMnemonic(name.charAt(0)); if (module.isPanel()) { JMenuItem i = new JMenuItem("New instance"); i.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { ModuleFactory.newInstance(module); } catch (Exception exc) { ExceptionDialog.show("Module could not be instantiated", exc); } } }); m.add(i); } if (module.isConfigurable()) { JMenuItem i = new JMenuItem("Configure"); i.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { IPanel config = ModuleConfigFactory.newInstance(module); addTab(config); } catch (Exception exc) { ExceptionDialog.show("Module configuration could not " + "be started", exc); } } }); m.add(i); } if (module.getInformationResource() != null) { JMenuItem i = new JMenuItem("Info"); i.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { URL url = module.getInformationResource(); HTMLBrowser browser = new HTMLBrowser(url) { public String getTitle() { return module.getName() +" Info"; } }; addTab(browser); } catch (Exception exc) { ExceptionDialog.show("Module information could not " + "be started", exc); } } }); m.add(i); } add(m, getMenuCount() - 1); table.put(module, m); } |
|
URL url = module.getInformationResource(); | URL url = module.getInfoURL(); | public void actionPerformed(ActionEvent arg0) { try { URL url = module.getInformationResource(); HTMLBrowser browser = new HTMLBrowser(url) { public String getTitle() { return module.getName() +" Info"; } }; addTab(browser); } catch (Exception exc) { ExceptionDialog.show("Module information could not " + "be started", exc); } } |
private static final long serialVersionUID = 2883659303596869565L; | public void actionPerformed(ActionEvent arg0) { try { URL url = module.getInformationResource(); HTMLBrowser browser = new HTMLBrowser(url) { public String getTitle() { return module.getName() +" Info"; } }; addTab(browser); } catch (Exception exc) { ExceptionDialog.show("Module information could not " + "be started", exc); } } |
|
splitPane.add(new JScrollPane(license)); | splitPane.add(license); | private LicensePanel() { super(new GridLayout(1, 1)); final JLabel label = new JLabel(Messages.getString("LicensePanel.LOADING")); //$NON-NLS-1$ add(label); new Thread() { public void run() { JTextComponent copyright = createCopyrightPanel(); HTMLBrowser license = new HTMLBrowser(LICENSE_HTML); remove(label); JSplitPane splitPane = new JSplitPane( JSplitPane.VERTICAL_SPLIT); splitPane.add(new JScrollPane(copyright)); splitPane.add(new JScrollPane(license)); int location = (int)((double)getHeight() * 0.4); splitPane.setDividerLocation((location > 0) ? location : 100); add(splitPane); repaint(); revalidate(); } }.start(); } |
return new BwCalendar((BwUser)getOwner().clone(), | BwCalendar cal = new BwCalendar((BwUser)getOwner().clone(), | public Object clone() { return new BwCalendar((BwUser)getOwner().clone(), getPublick(), (BwUser)getCreator().clone(), getAccess(), getName(), getPath(), getSummary(), getDescription(), getMailListId(), getCalendarCollection(), getCalendar(), getChildren(), getCalType()); } |
cal.setId(getId()); cal.setSeq(getSeq()); return cal; | public Object clone() { return new BwCalendar((BwUser)getOwner().clone(), getPublick(), (BwUser)getCreator().clone(), getAccess(), getName(), getPath(), getSummary(), getDescription(), getMailListId(), getCalendarCollection(), getCalendar(), getChildren(), getCalType()); } |
|
return new BwCalendar((BwUser)getOwner().clone(), | BwCalendar cal = new BwCalendar((BwUser)getOwner().clone(), | public BwCalendar shallowClone() { return new BwCalendar((BwUser)getOwner().clone(), getPublick(), (BwUser)getCreator().clone(), getAccess(), getName(), getPath(), getSummary(), getDescription(), getMailListId(), getCalendarCollection(), getCalendar(), null, getCalType()); } |
cal.setId(getId()); cal.setSeq(getSeq()); return cal; | public BwCalendar shallowClone() { return new BwCalendar((BwUser)getOwner().clone(), getPublick(), (BwUser)getCreator().clone(), getAccess(), getName(), getPath(), getSummary(), getDescription(), getMailListId(), getCalendarCollection(), getCalendar(), null, getCalType()); } |
|
index = insertOnlyStation(sta, stmt, index, locTable, time); | index = insertOnlyStation(sta, stmt, index, netTable, locTable, time); | public static int insertAll(Station sta, PreparedStatement stmt, int index, JDBCNetwork netTable, JDBCLocation locTable, JDBCTime time) throws SQLException { index = insertId(sta.get_id(), stmt, index, netTable, time); index = insertOnlyStation(sta, stmt, index, locTable, time); return index; } |
int index, JDBCLocation locTable, JDBCTime time) | int index, JDBCNetwork netTable, JDBCLocation locTable, JDBCTime time) | public static int insertOnlyStation(Station sta, PreparedStatement stmt, int index, JDBCLocation locTable, JDBCTime time) throws SQLException { stmt.setInt(index++, time.put(sta.effective_time.end_time)); stmt.setString(index++, sta.name); stmt.setString(index++, sta.operator); stmt.setString(index++, sta.description); stmt.setInt(index++, locTable.put(sta.my_location)); return index; } |
int notUsed = netTable.put(sta.my_network); | public static int insertOnlyStation(Station sta, PreparedStatement stmt, int index, JDBCLocation locTable, JDBCTime time) throws SQLException { stmt.setInt(index++, time.put(sta.effective_time.end_time)); stmt.setString(index++, sta.name); stmt.setString(index++, sta.operator); stmt.setString(index++, sta.description); stmt.setInt(index++, locTable.put(sta.my_location)); return index; } |
|
int index = insertOnlyStation(sta, updateSta, 1, locTable, time); | int index = insertOnlyStation(sta, updateSta, 1, netTable, locTable, time); | public int put(Station sta) throws SQLException { int dbid; try { dbid = getDBId(sta.get_id()); // No NotFound exception, so already added the id // now check if the attrs are added getIfNameExists.setInt(1, dbid); ResultSet rs = getIfNameExists.executeQuery(); if (!rs.next()) {//No name, so we need to add the attr part int index = insertOnlyStation(sta, updateSta, 1, locTable, time); updateSta.setInt(index, dbid); updateSta.executeUpdate(); } } catch (NotFound notFound) { // no id found so ok to add the whole thing dbid = seq.next(); putAll.setInt(1, dbid); insertAll(sta, putAll, 2, netTable, locTable, time); dbIdsToStations.put(new Integer(dbid), sta); putAll.executeUpdate(); } return dbid; } |
active.remove(this); | public void run() { while (noQuit) { try { Runnable r = getFromQueue(); r.run(); } catch (Exception e) { GlobalExceptionHandler.handle(e); } } } |
|
protected synchronized Runnable getFromQueue() throws InterruptedException { | private synchronized Runnable getFromQueue() throws InterruptedException { | protected synchronized Runnable getFromQueue() throws InterruptedException { while (queue.isEmpty()) { wait(); } return (Runnable)queue.removeLast(); } |
o.setId(CalFacadeDefs.unsavedItemKey); | public void restoreUserPrefs(BwPreferences o) throws Throwable { if (!globals.onlyUsersMap.check(o)) { return; } openHibSess(); /* Unset the subscription id - hibernate cascades cause an error * We'll just have to go with a new id */ Iterator it = o.iterateSubscriptions(); while (it.hasNext()) { BwSubscription sub = (BwSubscription)it.next(); sub.setId(CalFacadeDefs.unsavedItemKey); globals.subscriptions++; } /* Same for views */ it = o.iterateViews(); while (it.hasNext()) { BwView view = (BwView)it.next(); view.setId(CalFacadeDefs.unsavedItemKey); globals.views++; } hibSave(o); closeHibSess(); } |
|
private CalEnv getEnv(HttpServletRequest request, | private CalEnvI getEnv(HttpServletRequest request, | private CalEnv getEnv(HttpServletRequest request, BwActionFormBase frm) throws Throwable { CalEnv env = frm.getEnv(); if (env != null) { return env; } HttpSession session = request.getSession(); ServletContext sc = session.getServletContext(); String appName = sc.getInitParameter("bwappname"); if ((appName == null) || (appName.length() == 0)) { appName = "unknown-app-name"; } String envPrefix = "org.bedework.app." + appName + "."; env = new CalEnv(envPrefix, debug); frm.assignEnv(env); return env; } |
CalEnv env = frm.getEnv(); | CalEnvI env = frm.getEnv(); | private CalEnv getEnv(HttpServletRequest request, BwActionFormBase frm) throws Throwable { CalEnv env = frm.getEnv(); if (env != null) { return env; } HttpSession session = request.getSession(); ServletContext sc = session.getServletContext(); String appName = sc.getInitParameter("bwappname"); if ((appName == null) || (appName.length() == 0)) { appName = "unknown-app-name"; } String envPrefix = "org.bedework.app." + appName + "."; env = new CalEnv(envPrefix, debug); frm.assignEnv(env); return env; } |
env = new CalEnv(envPrefix, debug); | env = CalEnvFactory.getEnv(envPrefix, debug); | private CalEnv getEnv(HttpServletRequest request, BwActionFormBase frm) throws Throwable { CalEnv env = frm.getEnv(); if (env != null) { return env; } HttpSession session = request.getSession(); ServletContext sc = session.getServletContext(); String appName = sc.getInitParameter("bwappname"); if ((appName == null) || (appName.length() == 0)) { appName = "unknown-app-name"; } String envPrefix = "org.bedework.app." + appName + "."; env = new CalEnv(envPrefix, debug); frm.assignEnv(env); return env; } |
CalEnv env = getEnv(request, form); | CalEnvI env = getEnv(request, form); | public String performAction(HttpServletRequest request, HttpServletResponse response, UtilActionForm frm, MessageResources messages) throws Throwable { String forward = "success"; BwActionFormBase form = (BwActionFormBase)frm; String adminUserId = null; CalEnv env = getEnv(request, form); setConfig(request, form); setSessionAttr(request, "org.bedework.logprefix", form.retrieveConfig().getLogPrefix()); boolean guestMode = env.getAppBoolProperty("guestmode"); 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 = getReqPar(request, "adminUserId"); if (temp != null) { adminUserId = temp; } } 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); } if (form.getNewSession() && !getPublicAdmin(form)) { // Set to default view setView(null, form); } /* Set up ready for the action */ int temp = actionSetup(request, response, form); if (temp != forwardNoAction) { return forwards[temp]; } if (form.getNewSession()) { // Set the default skin BwPreferences prefs = form.fetchSvci().getUserPrefs(); String skinName = prefs.getSkinName(); form.getPresentationState().setSkinName(skinName); form.getPresentationState().setSkinNameSticky(true); } /* see if we got cancelled */ String reqpar = request.getParameter("cancelled"); if (reqpar != null) { /** Set the objects to null so we get new ones. */ initFields(form); form.getMsg().emit("org.bedework.client.message.cancelled"); return "cancelled"; } if (!getPublicAdmin(form)) { /* Set up or refresh frequently used information, */ getSubscriptions(form); } try { forward = doAction(request, response, s, form); if (!getPublicAdmin(form)) { /* 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; } |
for(int i = 0; i < seismos.length; i++){ ampData.put(seismos[i], new AmpConfigData(seismos[i], new UnitRangeImpl(-1, 1, edu.iris.Fissures.model.UnitImpl.COUNT), null, shift, scale)); seismos[i].addSeisDataChangeListener(this); seismos[i].retrieveData(this); } | for(int i = 0; i < seismos.length; i++){ if(!ampData.containsKey(seismos[i])){ ampData.put(seismos[i], new AmpConfigData(seismos[i], DisplayUtils.ONE_RANGE, DisplayUtils.ONE_TIME, shift, scale)); } seismos[i].addSeisDataChangeListener(this); seismos[i].retrieveData(this); } | public void add(DataSetSeismogram[] seismos){ for(int i = 0; i < seismos.length; i++){ ampData.put(seismos[i], new AmpConfigData(seismos[i], new UnitRangeImpl(-1, 1, edu.iris.Fissures.model.UnitImpl.COUNT), null, shift, scale)); seismos[i].addSeisDataChangeListener(this); seismos[i].retrieveData(this); } } |
if ( data.getSeismograms().length == 0) { return data.setCleanRange(DisplayUtils.ZERO_RANGE); } LocalSeismogramImpl seismogram = (LocalSeismogramImpl)data.getSeismograms()[0]; int[] seisIndex = DisplayUtils.getSeisPoints(seismogram, data.getTime()); if(seisIndex[1] < 0 || seisIndex[0] >= seismogram.getNumPoints()) { data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seismogram.getNumPoints()){ seisIndex[1] = seismogram.getNumPoints() -1; } double[] minMax = data.getStatistics(seismogram).minMaxMean(seisIndex[0], seisIndex[1]); data.setCalcIndex(seisIndex); return data.setCleanRange(new UnitRangeImpl(minMax[0], minMax[1], UnitImpl.COUNT)); | if ( data.getSeismograms().length == 0) { return data.setCleanRange(DisplayUtils.ZERO_RANGE); } LocalSeismogramImpl seismogram = data.getSeismograms()[0]; int[] seisIndex = DisplayUtils.getSeisPoints(seismogram, data.getTime()); if(seisIndex[1] < 0 || seisIndex[0] >= seismogram.getNumPoints()) { data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seismogram.getNumPoints()){ seisIndex[1] = seismogram.getNumPoints() -1; } double[] minMax = data.getStatistics(seismogram).minMaxMean(seisIndex[0], seisIndex[1]); data.setCalcIndex(seisIndex); return data.setCleanRange(new UnitRangeImpl(minMax[0], minMax[1], UnitImpl.COUNT)); | private boolean setAmpRange(DataSetSeismogram seismo){ AmpConfigData data = (AmpConfigData)ampData.get(seismo); if ( data.getSeismograms().length == 0) { return data.setCleanRange(DisplayUtils.ZERO_RANGE); } // end of if () LocalSeismogramImpl seismogram = (LocalSeismogramImpl)data.getSeismograms()[0]; int[] seisIndex = DisplayUtils.getSeisPoints(seismogram, data.getTime()); if(seisIndex[1] < 0 || seisIndex[0] >= seismogram.getNumPoints()) { //no data points in window, set range to 0 data.setCalcIndex(seisIndex); return data.setCleanRange(DisplayUtils.ZERO_RANGE); } if(seisIndex[0] < 0){ seisIndex[0] = 0; } if(seisIndex[1] >= seismogram.getNumPoints()){ seisIndex[1] = seismogram.getNumPoints() -1; } double[] minMax = data.getStatistics(seismogram).minMaxMean(seisIndex[0], seisIndex[1]); data.setCalcIndex(seisIndex); return data.setCleanRange(new UnitRangeImpl(minMax[0], minMax[1], UnitImpl.COUNT)); } |
return null; | return result; | public Set entrySet() { Set result = new HashSet(); Set keys = internal_.keySet(); for (Iterator iter = keys.iterator(); iter.hasNext();) { Object key = iter.next(); Set values = (Set)get(key); for (Iterator iterator = values.iterator(); iterator.hasNext();) { Object value = iterator.next(); result.add(new Entry(key, value)); } } return null; } |
public Chronology getChronology(Object object, Chronology chrono) { if (chrono == null) { return ISOChronology.getInstance(); } return chrono; | public Chronology getChronology(Object object) { return ISOChronology.getInstance(); | public Chronology getChronology(Object object, Chronology chrono) { if (chrono == null) { return ISOChronology.getInstance(); } return chrono; } |
if(basicDisplays.size() > 0) this.addDisplay((LocalSeismogramImpl)seis,((SeismogramDisplay)basicDisplays.getFirst()).getTimeConfig(), ((SeismogramDisplay)basicDisplays.getFirst()).getAmpConfig()); else this.addDisplay((LocalSeismogramImpl)seis, new BoundedTimeConfig(), new RMeanAmpConfig()); | this.addDisplay((LocalSeismogramImpl)seis); | public void addDisplay(LocalSeismogram seis){ if(basicDisplays.size() > 0) this.addDisplay((LocalSeismogramImpl)seis,((SeismogramDisplay)basicDisplays.getFirst()).getTimeConfig(), ((SeismogramDisplay)basicDisplays.getFirst()).getAmpConfig()); else this.addDisplay((LocalSeismogramImpl)seis, new BoundedTimeConfig(), new RMeanAmpConfig()); } |
repaint(); | public void removeAll(){ seismograms.removeAll(); remove(seismograms); basicDisplays = new LinkedList(); } |
|
if(basicDisplays.size() == 1){ this.removeAll(); return; } | public void removeSeismogram(MouseEvent me){ if(basicDisplays.size() == 1){ this.removeAll(); return; } BasicSeismogramDisplay clicked = ((BasicSeismogramDisplay)me.getComponent()); seismograms.remove(clicked); basicDisplays.remove(clicked); ((SeismogramDisplay)basicDisplays.getFirst()).addTopTimeBorder(); this.redraw(); seismograms.revalidate(); } |
|
clicked.removeAllSeismograms(); | public void removeSeismogram(MouseEvent me){ if(basicDisplays.size() == 1){ this.removeAll(); return; } BasicSeismogramDisplay clicked = ((BasicSeismogramDisplay)me.getComponent()); seismograms.remove(clicked); basicDisplays.remove(clicked); ((SeismogramDisplay)basicDisplays.getFirst()).addTopTimeBorder(); this.redraw(); seismograms.revalidate(); } |
|
form.getMsg().emit("org.bedework.client.message.calendar.referenced"); | form.getErr().emit("org.bedework.client.error.calendar.referenced"); | public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "noAccess"; // First line of defence } BwCalendar cal = form.getCalendar(); int delResult = form.getCalSvcI().deleteCalendar(cal); if (delResult == 2) { form.getMsg().emit("org.bedework.client.message.calendar.referenced"); return "inUse"; } if (delResult == 1) { form.getErr().emit("org.bedework.client.error.nosuchcalendar", cal.getId()); return "notFound"; } form.getMsg().emit("org.bedework.client.message.calendar.deleted"); return "continue"; } |
int pixels = size.width; | int pixels = seisEndIndex - seisStartIndex + 1; | protected static int[][] scaleXvalues(LocalSeismogram seismogram, MicroSecondTimeRange timeRange, UnitRangeImpl ampRange, Dimension size) throws UnsupportedDataEncoding { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; int[][] out = new int[2][]; int seisIndex = 0; int pixelIndex = 0; int numAdded = 0; if ( seis.getEndTime().before(timeRange.getBeginTime()) || seis.getBeginTime().after(timeRange.getEndTime()) ) { out[0] = new int[0]; out[1] = new int[0]; logger.info("The end time is before the beginTime in simple seismogram"); return out; } MicroSecondDate tMin = timeRange.getBeginTime(); MicroSecondDate tMax = timeRange.getEndTime(); double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); int seisStartIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), tMin); int seisEndIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), tMax); if (seisStartIndex < 0) { seisStartIndex = 0; } if (seisEndIndex >= seis.getNumPoints()) { seisEndIndex = seis.getNumPoints()-1; } MicroSecondDate tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStartIndex); int pixelStartIndex = getPixel(size.width, tMin, tMax, tempdate); tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEndIndex); int pixelEndIndex = getPixel(size.width, tMin, tMax, tempdate); int pixels = size.width; out[0] = new int[2*pixels]; out[1] = new int[out[0].length]; int tempYvalues[] = new int [out[0].length]; seisIndex = seisStartIndex; numAdded = 0; int xvalue = 0; int tempValue = 0; xvalue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); seisIndex++; int j; j = 0; while (seisIndex <= seisEndIndex) { tempValue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); tempYvalues[j++] = (int)seis.getValueAt(seisIndex).getValue(); if(tempValue != xvalue) { out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = getMinValue(tempYvalues, 0, j-1); out[1][numAdded+1] = (int)getMaxValue(tempYvalues, 0, j-1); j = 0; xvalue = tempValue; numAdded = numAdded+2; } seisIndex++; } xvalue = tempValue; /*if(j == 0){ out[1][numAdded] = getMinValue(tempYvalues, 0, 0); out[1][numAdded+1] = (int)getMaxValue(tempYvalues, 0, 0); } else{ out[1][numAdded] = getMinValue(tempYvalues, 0, j-1); out[1][numAdded + 1] = (int)getMaxValue(tempYvalues, 0, j-1); }*/ int temp[][] = new int[2][numAdded]; System.arraycopy(out[0], 0, temp[0], 0, numAdded); System.arraycopy(out[1], 0, temp[1], 0, numAdded); return temp; } |
for(int i = 0; i < values.length; i++) { values[i] *= freqValues.length; } | public LocalSeismogramImpl apply(LocalSeismogramImpl seis, SacPoleZero poleZero, float lowCut, float lowPass, float highPass, float highCut) throws FissuresException { double sampFreq = seis.getSampling() .getFrequency() .getValue(UnitImpl.HERTZ); float[] values = seis.get_as_floats(); /* sac premultiplies the data by the sample period before doing the fft. Later it * seems to be cancled out by premultiplying the pole zeros by a similar factor. * I don't understand why they do this, but am reporducing it in order to be * compatible. */ for(int i = 0; i < values.length; i++) { values[i] /= (float)sampFreq; } Cmplx[] freqValues = Cmplx.fft(values); freqValues = combine(freqValues, sampFreq, poleZero, lowCut, lowPass, highPass, highCut); values = Cmplx.fftInverse(freqValues, values.length); LocalSeismogramImpl out = new LocalSeismogramImpl(seis, values); out.y_unit = UnitImpl.METER; return out; } |
|
if (false && freq < 0.01) { System.out.println("zero "+i+" freq "+freq+" "+zeroOut+" pz "+pz.getZeros()[i]);} | public static Cmplx evalPoleZeroInverse(SacPoleZero pz, double freq) { Cmplx s = new Cmplx(0, 2 * Math.PI * freq); Cmplx zeroOut = new Cmplx(1, 0); Cmplx poleOut = new Cmplx(1, 0); for(int i = 0; i < pz.getPoles().length; i++) { poleOut = Cmplx.mul(poleOut, Cmplx.sub(s, pz.getPoles()[i])); } for(int i = 0; i < pz.getZeros().length; i++) { if(s.real() == pz.getZeros()[i].real() && s.imag() == pz.getZeros()[i].imag()) { return ZERO; } zeroOut = Cmplx.mul(zeroOut, Cmplx.sub(s, pz.getZeros()[i])); if (false && freq < 0.01) { System.out.println("zero "+i+" freq "+freq+" "+zeroOut+" pz "+pz.getZeros()[i]);} } Cmplx out = Cmplx.div(poleOut, zeroOut); return Cmplx.div(out, pz.getConstant()).conjg(); } |
|
if (dayTimeDuration.equals(val)) { setWeeks(0); } | public void setType(String val) { type = val; } |
|
return this.meta_defineField(field.base_getName(), field.base_getFieldValue()); | return this.meta_defineField(field.base_getName(), field.base_getValue()); | public ATNil meta_addField(ATField field) throws NATException { return this.meta_defineField(field.base_getName(), field.base_getFieldValue()); } |
method.base_getName().getText().asNativeText().javaValue + | method.base_getName().base_getText().asNativeText().javaValue + | public ATNil meta_addMethod(ATMethod method) throws NATException { throw new XIllegalOperation("Cannot add method "+ method.base_getName().getText().asNativeText().javaValue + " to a call frame. Add it as a closure field instead."); } |
throw new XDuplicateSlot("field ", name.getText().asNativeText().javaValue); | throw new XDuplicateSlot("field ", name.base_getText().asNativeText().javaValue); | public ATNil meta_defineField(ATSymbol name, ATObject value) throws NATException { boolean fieldAdded = variableMap_.put(name); if (!fieldAdded) { // field already exists... throw new XDuplicateSlot("field ", name.getText().asNativeText().javaValue); } else { // field now defined, add its value to the state vector stateVector_.add(value); } return NATNil._INSTANCE_; } |
try { ATObject method = atTestObject.meta_select(atTestObject, AGSymbol.alloc("overloadedmatch2")); ATObject castedMethod = method.meta_invoke(method, AGSymbol.alloc("cast"), new NATTable(new ATObject[] { atTestClass })); castedMethod.base_asMethod().base_apply(new NATTable(new ATObject[] { atTestObject }), null); } catch (InterpreterException e) { fail(e.getMessage()); } | public void testCasting() { } |
|
try { ATField result = atTestObject.meta_grabField(AGSymbol.alloc("xtest")).base_asField(); assertEquals("xtest", result.base_getName().toString()); assertEquals(TEST_OBJECT_INIT, result.base_getValue().asNativeNumber().javaValue); result = atTestClass.meta_grabField(AGSymbol.alloc("ytest")).base_asField(); assertEquals("ytest", result.base_getName().toString()); assertEquals(ytest, result.base_getValue().asNativeText().javaValue); } catch (InterpreterException e) { fail(e.getMessage()); } | public void testFirstClassFields() { } |
|
try { ATMethod result = atTestObject.meta_grabMethod(AGSymbol.alloc("gettertest")).base_asMethod(); assertEquals("gettertest", result.base_getName().toString()); assertEquals(TEST_OBJECT_INIT, result.base_apply(NATTable.EMPTY, null).asNativeNumber().javaValue); result = atTestClass.meta_grabMethod(AGSymbol.alloc("prefix")).base_asMethod(); assertEquals("prefix", result.base_getName().toString()); assertEquals(ytest, result.base_apply(new NATTable(new ATObject[] { NATText.atValue("") }), null).asNativeText().javaValue); } catch (InterpreterException e) { fail(e.getMessage()); } | public void testFirstClassMethods() { } |
|
System.out.println("0 link = " + link); | private void addLinks() { for (int i = 0; i < links.size(); i++) { IdeaLink link = links.get(i); System.out.println("0 link = " + link); int linkIndex = linkTos.get(i); Idea linkTo = ideaIndex.get(linkIndex); System.out.println("linkTo = " + linkTo); link.setTo(linkTo); System.out.println("1 link = " + link); link.getFrom().addLink(link); System.out.println("2 link = " + link); } } |
|
System.out.println("linkTo = " + linkTo); | private void addLinks() { for (int i = 0; i < links.size(); i++) { IdeaLink link = links.get(i); System.out.println("0 link = " + link); int linkIndex = linkTos.get(i); Idea linkTo = ideaIndex.get(linkIndex); System.out.println("linkTo = " + linkTo); link.setTo(linkTo); System.out.println("1 link = " + link); link.getFrom().addLink(link); System.out.println("2 link = " + link); } } |
|
System.out.println("1 link = " + link); | private void addLinks() { for (int i = 0; i < links.size(); i++) { IdeaLink link = links.get(i); System.out.println("0 link = " + link); int linkIndex = linkTos.get(i); Idea linkTo = ideaIndex.get(linkIndex); System.out.println("linkTo = " + linkTo); link.setTo(linkTo); System.out.println("1 link = " + link); link.getFrom().addLink(link); System.out.println("2 link = " + link); } } |
|
System.out.println("2 link = " + link); | private void addLinks() { for (int i = 0; i < links.size(); i++) { IdeaLink link = links.get(i); System.out.println("0 link = " + link); int linkIndex = linkTos.get(i); Idea linkTo = ideaIndex.get(linkIndex); System.out.println("linkTo = " + linkTo); link.setTo(linkTo); System.out.println("1 link = " + link); link.getFrom().addLink(link); System.out.println("2 link = " + link); } } |
|
System.out.println("linking from " + current); System.out.println("current class = " + current.getClass()); | public void startElement(String namespaceURI, String sName, // simple name (localName) String qName, // qualified name Attributes attrs) throws SAXException { if ("outline".equals(qName)) { if (attrs != null) { String type = attrs.getValue("type"); if (type != null) { type = type.toUpperCase(); } else { type = ""; } String url = attrs.getValue("url"); if (url == null) { url = ""; } if (!url.startsWith("#")) { String text = attrs.getValue("text"); Idea i = new Idea(text); i.setUrl(url); String id = attrs.getValue("id"); if ((id != null) && (id.length() > 0)) { ideaIndex.put(new Integer(id), i); } String notes = attrs.getValue("notes"); if (notes == null) { notes = ""; } i.setNotes(notes); String description = attrs.getValue("description"); if (description == null) { description = ""; } i.setDescription(description); String angleString = attrs.getValue("angle"); if ((angleString != null) && (angleString.length() > 0)) { i.setAngle(Double.valueOf(angleString)); anglesRead = true; } if (idea == null) { idea = i; } else if (current != null) { current.add(i); } else { Idea i2 = new Idea("root"); i2.add(idea); idea = i2; stack.push(idea); idea.add(i); } current = i; stack.push(current); } else { String indexNo = url.substring(1); System.out.println("linking from " + current); System.out.println("current class = " + current.getClass()); IdeaLink link = new IdeaLink(current, null); System.out.println("link initially " + link); String description = attrs.getValue("description"); if (description == null) { description = ""; } link.setDescription(description); links.add(link); linkTos.add(new Integer(indexNo)); stack.push(null); } } } } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.