code
stringlengths
10
174k
nl
stringlengths
3
129k
protected boolean hasOutstandingChanges(){ return (fAmtFrom.hasChanged() || fAmtTo.hasChanged() || fBankAccount_ID.hasChanged()|| fCash_ID.hasChanged()|| fCashBook_ID.hasChanged()|| fCharge_ID.hasChanged()|| fDateFrom.hasChanged()|| fDateTo.hasChanged()|| fInvoice_ID.hasChanged()|| fPayment_ID.hasChanged()|| cbAbsolute.hasChanged()); }
Does the parameter panel have outstanding changes that have not been used in a query?
public void addListener(final IZyEditModeListener<NodeType,EdgeType> listener){ m_listeners.add(listener); }
Adds a listener object that is notified about changes in the edit mode.
public PurchasePanel(final GameData data,final MapPanel map){ super(data,map); m_purchasedPreviousRoundsUnits=new SimpleUnitPanel(map.getUIContext()); m_purhcasedUnits=new SimpleUnitPanel(map.getUIContext()); m_buyButton=new JButton(BUY); m_buyButton.addActionListener(PURCHASE_ACTION); m_purchasedPreviousRoundsLabel=new JLabel("Unplaced from previous rounds"); }
Creates new PurchasePanel
protected void paintTabBorder(final Graphics g,final int tabPlacement,final int tabIndex,final int x,final int y,final int w,final int h,final boolean isSelected){ g.setColor(lightHighlight); switch (tabPlacement) { case LEFT: g.drawLine(x + 1,y + h - 2,x + 1,y + h - 2); g.drawLine(x,y + 2,x,y + h - 3); g.drawLine(x + 1,y + 1,x + 1,y + 1); g.drawLine(x + 2,y,x + w - 1,y); g.setColor(shadow); g.drawLine(x + 2,y + h - 2,x + w - 1,y + h - 2); g.setColor(darkShadow); g.drawLine(x + 2,y + h - 1,x + w - 1,y + h - 1); break; case RIGHT: g.drawLine(x,y,x + w - 3,y); g.setColor(shadow); g.drawLine(x,y + h - 2,x + w - 3,y + h - 2); g.drawLine(x + w - 2,y + 2,x + w - 2,y + h - 3); g.setColor(darkShadow); g.drawLine(x + w - 2,y + 1,x + w - 2,y + 1); g.drawLine(x + w - 2,y + h - 2,x + w - 2,y + h - 2); g.drawLine(x + w - 1,y + 2,x + w - 1,y + h - 3); g.drawLine(x,y + h - 1,x + w - 3,y + h - 1); break; case BOTTOM: g.drawLine(x,y,x,y + h - 3); g.drawLine(x + 1,y + h - 2,x + 1,y + h - 2); g.setColor(shadow); g.drawLine(x + 2,y + h - 2,x + w - 3,y + h - 2); g.drawLine(x + w - 2,y,x + w - 2,y + h - 3); g.setColor(darkShadow); g.drawLine(x + 2,y + h - 1,x + w - 3,y + h - 1); g.drawLine(x + w - 2,y + h - 2,x + w - 2,y + h - 2); g.drawLine(x + w - 1,y,x + w - 1,y + h - 3); break; case TOP: default : g.drawLine(x,y + 2,x,y + h - 1); g.drawLine(x + 1,y + 1,x + 1,y + 1); g.drawLine(x + 2,y,x + w - 3,y); g.setColor(shadow); g.drawLine(x + w - 2,y + 2,x + w - 2,y + h - 1); g.setColor(darkShadow); g.drawLine(x + w - 1,y + 2,x + w - 1,y + h - 1); g.drawLine(x + w - 2,y + 1,x + w - 2,y + 1); } }
this function draws the border around each tab note that this function does now draw the background of the tab. that is done elsewhere
private void analize(){ StringTokenizer tokenizer2=new StringTokenizer(sourceData,"|"); String nextToken=tokenizer2.nextToken(); ver=nextToken.substring(1,nextToken.length() - 1); StringTokenizer tokenizer=new StringTokenizer(tokenizer2.nextToken(),","); nextToken=tokenizer.nextToken(); logDocColName=nextToken.substring(1,nextToken.length() - 1); nextToken=tokenizer.nextToken(); docColName=nextToken.substring(1,nextToken.length() - 1); nextToken=tokenizer.nextToken(); docColFmtDef=Integer.parseInt(nextToken); nextToken=tokenizer.nextToken(); logSustColName=nextToken.substring(1,nextToken.length() - 1); nextToken=tokenizer.nextToken(); sustColName=nextToken.substring(1,nextToken.length() - 1); nextToken=tokenizer.nextToken(); sustColFmtDef=Integer.parseInt(nextToken); nextToken=tokenizer.nextToken(); primaryColName=nextToken.substring(1,nextToken.length() - 1); nextToken=tokenizer.nextToken(); from=nextToken.substring(1,nextToken.length() - 1); nextToken=tokenizer.nextToken(); where=nextToken.substring(1,nextToken.length() - 1); nextToken=tokenizer.nextToken(); docOrderBy=nextToken.substring(1,nextToken.length() - 1); nextToken=tokenizer.nextToken(); sustOrderBy=nextToken.substring(1,nextToken.length() - 1); }
Private methods
public SliderListener(JLabel f){ tf=f; }
Instantiates a new slider listener.
public boolean isConst(){ return const_; }
<!-- begin-user-doc --> <!-- end-user-doc -->
public void logError(Object message,Throwable exception){ logInternal(ERROR,message,exception); }
Logs the given message and Throwable at the 'error' level.
@Override protected void populateMBeanDescriptor(Descriptor desc,Object managedBean,String beanKey){ Class intf=findJmxInterface(beanKey,AopUtils.getTargetClass(managedBean)); ManagedResource mr=this.attributeSource.getManagedResource(intf); if (mr == null) { applyDefaultCurrencyTimeLimit(desc); return; } applyCurrencyTimeLimit(desc,mr.getCurrencyTimeLimit()); if (mr.isLog()) { desc.setField(FIELD_LOG,"true"); } if (StringUtils.hasLength(mr.getLogFile())) { desc.setField(FIELD_LOG_FILE,mr.getLogFile()); } if (StringUtils.hasLength(mr.getPersistPolicy())) { desc.setField(FIELD_PERSIST_POLICY,mr.getPersistPolicy()); } if (mr.getPersistPeriod() >= 0) { desc.setField(FIELD_PERSIST_PERIOD,Integer.toString(mr.getPersistPeriod())); } if (StringUtils.hasLength(mr.getPersistName())) { desc.setField(FIELD_PERSIST_NAME,mr.getPersistName()); } if (StringUtils.hasLength(mr.getPersistLocation())) { desc.setField(FIELD_PERSIST_LOCATION,mr.getPersistLocation()); } }
Adds descriptor fields from the <code>ManagedResource</code> attribute to the MBean descriptor. Specifically, adds the <code>currencyTimeLimit</code>, <code>persistPolicy</code>, <code>persistPeriod</code>, <code>persistLocation</code> and <code>persistName</code> descriptor fields if they are present in the metadata.
private String concatSubNameSpace(Application application) throws UnsupportedEncodingException { String subNameSpace=AlphaNumericsCharactersCheckUtils.convertToAlphaNumerics(application.getName()) + "-" + AlphaNumericsCharactersCheckUtils.convertToAlphaNumerics(application.getUser().getLogin())+ "-"+ AlphaNumericsCharactersCheckUtils.convertToAlphaNumerics(application.getUser().getOrganization()); return subNameSpace; }
concat Name of application + "-" + Login of User + "-" + Organization
public FindClubAction(int entityId){ super(entityId); }
Creates new FindClubAction
public static Iterator allCSS2PropertyNames(){ return ALL_PROPERTY_NAMES.keySet().iterator(); }
Iterator of ALL CSS 2 visual property names.
public String businessObjectDefinitionKeyToString(BusinessObjectDefinitionKey businessObjectDefinitionKey){ return String.format("namespace: \"%s\", businessObjectDefinitionName: \"%s\"",businessObjectDefinitionKey.getNamespace(),businessObjectDefinitionKey.getBusinessObjectDefinitionName()); }
Returns a string representation of the business object definition key.
public void runTest() throws Throwable { Document doc; EntityReference entRef; CharacterData entText; doc=(Document)load("staff",true); entRef=doc.createEntityReference("ent3"); assertNotNull("createdEntRefNotNull",entRef); entText=(CharacterData)entRef.getFirstChild(); assertNotNull("entTextNotNull",entText); { boolean success=false; try { entText.setNodeValue("newValue"); } catch ( DOMException ex) { success=(ex.code == DOMException.NO_MODIFICATION_ALLOWED_ERR); } assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR",success); } }
Runs the test case.
public static long monthBefore(final long time){ return timeFrom(time,1,CalendarUnit.MONTH,Occurrence.BEFORE); }
Finds the time value for one month before the specified time.
private void addRate(Map<String,Map<String,Double>> ratesMap,String sourceCurrencyCode,String targetCurrencyCode,double rate){ Map<String,Double> rhs=ratesMap.get(sourceCurrencyCode); if (rhs == null) { rhs=new HashMap<>(); ratesMap.put(sourceCurrencyCode,rhs); } rhs.put(targetCurrencyCode,rate); }
Registers the specified exchange rate.
public String queryType(){ return qryType; }
Gets query type.
public void init(){ setCanGrabGraphic(false); Debug.message("eomg","EditableOMCircle.init()"); setStateMachine(new CircleStateMachine(this)); gPoints=new GrabPoint[11]; }
Create and initialize the state machine that interprets the modifying gestures/commands, as well as initialize the grab points. Also allocates the grab point array needed by the EditableOMCircle.
public void pointerDragged(final int[] x,final int[] y){ if (impl.getCurrentForm() == null) { return; } longPointerCharged=false; if (x.length == 1) { addPointerDragEventWithTimestamp(x[0],y[0]); } else { addPointerEvent(POINTER_DRAGGED_MULTI,x,y); } }
Pushes a pointer drag event with the given coordinates into Codename One
private static void deletePortMapping(final UPnPMapping mapping){ if (mapping.getPort() > 0 && gatewayDevice != null) { boolean unmapped; String msg; try { unmapped=gatewayDevice.deletePortMapping(mapping.getPort(),mapping.getProtocol()); msg="port " + mapping.getPort() + " on device "+ gatewayDevice.getFriendlyName(); if (unmapped) { LOG.info("unmapped " + msg); } else { LOG.warn("could not unmap " + msg); } } catch ( SAXException|IOException e) { LOG.severe("unmapping error: " + e.getMessage()); } } mapping.setPort(0); }
Delete current port mapping.
public static RxYouTubeExtractor create(){ return create(null,null); }
Create a YouTubeExtractor
@Override public void destroy(){ uberRidesService=null; credential=null; super.destroy(); }
Clear the in memory credential and Uber API service once a call has ended.
String sourceFormForInitializer(AnnotationValue annotationValue,ProcessingEnvironment processingEnv,String memberName,Element context){ SourceFormVisitor visitor=new InitializerSourceFormVisitor(processingEnv,memberName,context); StringBuilder sb=new StringBuilder(); visitor.visit(annotationValue,sb); return sb.toString(); }
Returns a string representation of the given annotation value, suitable for inclusion in a Java source file as the initializer of a variable of the appropriate type.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:34:35.862 -0500",hash_original_method="60FAB9592DF6A1D398A3997EC9565FA6",hash_generated_method="FAE26D84A1A415F192AC1D3B16BA7F0C") public final int countDataPaths(){ return mDataPaths != null ? mDataPaths.size() : 0; }
Return the number of data paths in the filter.
public ClientHttpRequest(final Link link){ assert link != null : "The Link containing the URI and method for the client's HTTP request cannot be null!"; this.link=link; }
Constructs an instance of the ClientHttpRequest class initialized with the specified Link containing the URI and method for the client's HTTP request. <p/>
public boolean hasExtensions(){ return extensions != null; }
Return whether or not the holder's certificate contains extensions.
@POST @Path("backup/upload/") @CheckPermission(roles={Role.SYSTEM_ADMIN,Role.RESTRICTED_SYSTEM_ADMIN}) public Response uploadBackup(@QueryParam("tag") final String backupTag){ log.info("Received upload backup request, backup tag={}",backupTag); BackupUploadStatus job=new BackupUploadStatus(); job.setBackupName(backupTag); job.setStatus(Status.NOT_STARTED); jobProducer.enqueue(job); backupScheduler.getUploadExecutor().addPendingUploadTask(backupTag); return Response.status(ASYNC_STATUS).build(); }
Upload the specific backup files from each controller node of cluster to external server
private SPUIComponentProvider(){ }
Prevent Instance creation as utility class.
@NoInline public static void write(String value){ if (value == null) { write("null"); } else { if (runningVM) { char[] chars=java.lang.JikesRVMSupport.getBackingCharArray(value); int numChars=java.lang.JikesRVMSupport.getStringLength(value); int offset=java.lang.JikesRVMSupport.getStringOffset(value); for (int i=0; i < numChars; i++) { write(chars[offset + i]); } } else { writeNotRunningVM(value); } } }
Low level print to console.
public void testRandomStrings() throws Exception { checkRandomData(random(),analyzer,1000 * RANDOM_MULTIPLIER); }
blast some random strings through the analyzer
public void removeAll(){ int i=myMaps.size(); myMaps.retainAll(myMaps); notifyItemRangeRemoved(0,i); }
remove all items
public void acceptChanges() throws SyncProviderException { throw new UnsupportedOperationException(); }
Propagates all row update, insert, and delete changes to the underlying data source backing this <code>CachedRowSetImpl</code> object. <P> <b>Note</b>In the reference implementation an optimistic concurrency implementation is provided as a sample implementation of a the <code>SyncProvider</code> abstract class. <P> This method fails if any of the updates cannot be propagated back to the data source. When it fails, the caller can assume that none of the updates are reflected in the data source. When an exception is thrown, the current row is set to the first "updated" row that resulted in an exception unless the row that caused the exception is a "deleted" row. In that case, when deleted rows are not shown, which is usually true, the current row is not affected. <P> If no <code>SyncProvider</code> is configured, the reference implementation leverages the <code>RIOptimisticProvider</code> available which provides the default and reference synchronization capabilities for disconnected <code>RowSets</code>.
public Boolean isIpPoolEnabled(){ return ipPoolEnabled; }
Gets the value of the ipPoolEnabled property.
@Override public void updateNClob(String columnLabel,NClob x) throws SQLException { throw unsupported("NClob"); }
[Not supported]
public Boolean isLogonBannerDisabled(){ return logonBannerDisabled; }
Check if the logon banner is disabled.
private ColorPickerSwatch createColorSwatch(int color,int selectedColor){ ColorPickerSwatch view=new ColorPickerSwatch(getContext(),color,color == selectedColor,mOnColorSelectedListener); TableRow.LayoutParams params=new TableRow.LayoutParams(mSwatchLength,mSwatchLength); params.setMargins(mMarginSize,mMarginSize,mMarginSize,mMarginSize); view.setLayoutParams(params); return view; }
Creates a color swatch.
public Comparator<Point2D> polarOrder(){ return new PolarOrder(); }
Compares two points by polar angle (between 0 and 2pi) with respect to this point.
public MBeanServerDelegate(){ stamp=getStamp(); broadcaster=new NotificationBroadcasterSupport(); }
Create a MBeanServerDelegate object.
public final boolean isVisualPadding(){ return visualPadding; }
If visual padding should be automatically used and compensated for by this layout instance.
@Nonnull public BugInstance addSuperclass(PreorderVisitor visitor){ String className=ClassName.toDottedClassName(visitor.getSuperclassName()); addClass(className); return this; }
Add a class annotation for the superclass of the class the visitor is currently visiting.
public SparseDoubleMatrix1D(double[] values){ this(values.length); assign(values); }
Constructs a matrix with a copy of the given values. The values are copied. So subsequent changes in <tt>values</tt> are not reflected in the matrix, and vice-versa.
public void tag(Tag tag){ if (!enabled) { return; } TagType tagType=tag.getType(); Element node; switch (tagType) { case START: if (domBuilder.config.isIgnoreWhitespacesBetweenTags()) { removeLastChildNodeIfEmptyText(parentNode,false); } node=createElementNode(tag); if (domBuilder.config.isImpliedEndTags()) { while (true) { String parentNodeName=parentNode.getNodeName(); if (!implRules.implicitlyCloseParentTagOnNewTag(parentNodeName,node.getNodeName())) { break; } parentNode=parentNode.getParentNode(); if (log.isDebugEnabled()) { log.debug("Implicitly closed tag <" + node.getNodeName() + "> "); } } } parentNode.addChild(node); if (node.isVoidElement() == false) { parentNode=node; } break; case END: if (domBuilder.config.isIgnoreWhitespacesBetweenTags()) { removeLastChildNodeIfEmptyText(parentNode,true); } String tagName=tag.getName().toString(); Node matchingParent=findMatchingParentOpenTag(tagName); if (matchingParent == parentNode) { parentNode=parentNode.getParentNode(); break; } if (matchingParent == null) { error("Orphan closed tag ignored: </" + tagName + "> "+ tag.getTagPosition()); break; } if (domBuilder.config.isImpliedEndTags()) { boolean fixed=false; while (implRules.implicitlyCloseParentTagOnTagEnd(parentNode.getNodeName(),tagName)) { parentNode=parentNode.getParentNode(); if (log.isDebugEnabled()) { log.debug("Implicitly closed tag <" + tagName + ">"); } if (parentNode == matchingParent) { parentNode=matchingParent.parentNode; fixed=true; break; } } if (fixed) { break; } } fixUnclosedTagsUpToMatchingParent(tag,matchingParent); break; case SELF_CLOSING: if (domBuilder.config.isIgnoreWhitespacesBetweenTags()) { removeLastChildNodeIfEmptyText(parentNode,false); } node=createElementNode(tag); parentNode.addChild(node); break; } }
Visits tags.
public static BufferedImage createCompatibleImage(BufferedImage image,int width,int height){ return getGraphicsConfiguration().createCompatibleImage(width,height,image.getTransparency()); }
<p>Returns a new compatible image of the specified width and height, and the same transparency setting as the image specified as a parameter.</p>
public static <T extends BaseFragment>T newInstance(Class<T> fragmentClazz,Bundle args){ T fragment=null; try { fragment=fragmentClazz.newInstance(); fragment.setArguments(args); } catch ( java.lang.InstantiationException e) { e.printStackTrace(); } catch ( IllegalAccessException e) { e.printStackTrace(); } return fragment; }
create fragment instance
public boolean isEnabledForCurrentJRE(){ if ("".equals(requireJRE)) { return true; } try { JavaVersion requiredVersion=new JavaVersion(requireJRE); JavaVersion runtimeVersion=JavaVersion.getRuntimeVersion(); if (DEBUG_JAVA_VERSION) { System.out.println("Checking JRE version for " + getShortName() + " (requires "+ requiredVersion+ ", running on "+ runtimeVersion+ ")"); } boolean enabledForCurrentJRE=runtimeVersion.isSameOrNewerThan(requiredVersion); if (DEBUG_JAVA_VERSION) { System.out.println("\t==> " + enabledForCurrentJRE); } return enabledForCurrentJRE; } catch ( JavaVersionException e) { if (DEBUG_JAVA_VERSION) { System.out.println("Couldn't check Java version: " + e.toString()); e.printStackTrace(System.out); } return false; } }
Check to see if we are running on a recent-enough JRE for this detector to be enabled.
public void validate(String name,StringMap scope,String value,boolean isCheckDuplicate){ CustomConfigType item=getCustomConfigType(name); if (item == null) { throw CustomConfigControllerException.exceptions.configTypeNotFound(name); } if (isCheckDuplicate) { CustomConfig config=getUserDefinedCustomConfig(constructConfigName(name,scope)); if (config != null && config.getScope().equals(scope)) { throw CustomConfigControllerException.exceptions.customConfigAlreadyExists(config.getLabel()); } for ( String key : scope.keySet()) { if (!item.getScope().containsKey(key)) { throw CustomConfigControllerException.exceptions.scopeTypeNotSupported(key,name); } List<String> scopeVals=java.util.Arrays.asList(item.getScope().get(key).split(",")); if (!scopeVals.contains(scope.get(key))) { throw CustomConfigControllerException.exceptions.scopeValueNotSupported(scope.get(key),key,name); } } } value=getCustomConfigPreviewValue(name,value,scope,null); for ( CustomConfigConstraint constraint : item.getConstraints()) { constraint.validate(value,scope.values().iterator().next()); } }
Performs the necessary checks to ensure the user-specified value for a configuration is valid. <ol> <li>if isCheckDuplicate is set to true, ensure that a user-created configuration does not already exist for this configuration type and scope</li> <li>check that a configuration type exists for the name</li> <li>check that the scope is supported based on the definition of the scope in the type of this configuration</li> <li>check that the value is of the right type and that it is compliant with the constraints defined for this configuration type</li> </ol>
@Override protected EClass eStaticClass(){ return UmplePackage.eINSTANCE.getEntity_(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public static long mod(long a,long m){ long result=a % m; if (result < 0) { result+=m; } return result; }
Returns a long integer whose value is <tt>(a mod m</tt>). This method differs from <tt>%</tt> in that it always returns a <i>non-negative</i> integer.
public static void main(final String[] args) throws Exception { if (args.length != 1) { System.err.println("Verifies the given class."); System.err.println("Usage: CheckClassAdapter " + "<fully qualified class name or class file name>"); return; } ClassReader cr; if (args[0].endsWith(".class")) { cr=new ClassReader(new FileInputStream(args[0])); } else { cr=new ClassReader(args[0]); } verify(cr,false,new PrintWriter(System.err)); }
Checks a given class. <p> Usage: CheckClassAdapter &lt;binary class name or class file name&gt;
public static Set<SootClass> loadClassesFromJar(JarFile jarFile,boolean appClass,Set<String> doNotLoad){ LinkedHashSet<SootClass> classSet=new LinkedHashSet<SootClass>(); Enumeration<JarEntry> allEntries=jarFile.entries(); while (allEntries.hasMoreElements()) { JarEntry entry=allEntries.nextElement(); String name=entry.getName(); if (!name.endsWith(".class")) { continue; } String clsName=name.substring(0,name.length() - 6).replace('/','.'); if (doNotLoad.contains(clsName)) { continue; } if (appClass) { SootClass clz=Scene.v().loadClass(clsName,SootClass.BODIES); classSet.add(clz); clz.setApplicationClass(); logger.debug("Loading from {}: {} (app)",jarFile.getName(),clsName); } else { SootClass clz=Scene.v().loadClass(clsName,SootClass.SIGNATURES); classSet.add(clz); clz.setLibraryClass(); logger.debug("Loading from {}: {} (lib)",jarFile.getName(),clsName); } } return classSet; }
Load classes from the given jar file into Soot's current scene. Load the classes as application classes if appClass is true. If overwrite is true, then overwrite any classes that were previously loaded. If overwrite is false, then don't load from this jar any previously loaded classes. Return a set of all classes loaded from the jar.
public Matrix4f scaleAround(float sx,float sy,float sz,float ox,float oy,float oz){ return scaleAround(sx,sy,sz,ox,oy,oz,this); }
Apply scaling to this matrix by scaling the base axes by the given sx, sy and sz factors while using <tt>(ox, oy, oz)</tt> as the scaling origin. <p> If <code>M</code> is <code>this</code> matrix and <code>S</code> the scaling matrix, then the new matrix will be <code>M * S</code>. So when transforming a vector <code>v</code> with the new matrix by using <code>M * S * v</code>, the scaling will be applied first! <p> This method is equivalent to calling: <tt>translate(ox, oy, oz).scale(sx, sy, sz).translate(-ox, -oy, -oz)</tt>
public void testNegateNegative(){ String a="-92948782094488478231212478987482988429808779810457634781384756794987"; int aScale=41; String c="92948782094488478231212478987482988429808779810457634781384756794987"; int cScale=41; BigDecimal aNumber=new BigDecimal(new BigInteger(a),aScale); BigDecimal cNumber=new BigDecimal(new BigInteger(c),cScale); assertEquals("incorrect value",cNumber,aNumber.negate()); }
negate() for a negative BigDecimal
public boolean dynInit() throws Exception { log.config(""); super.dynInit(); window.setTitle(getTitle()); initBPartner(true); bPartnerField.addValueChangeListener(this); loadRMA(); return true; }
Dynamic Init
public LinearKernel(double c){ this.c=c; }
Creates a new Linear Kernel that computes the dot product and offsets it by a specified value
public List<Metric> union(List<Metric> metrics){ SystemAssert.requireArgument(metrics != null,"Cannot transform empty metric/metrics"); if (metrics.isEmpty()) { return metrics; } List<Metric> newMetricsList=new ArrayList<Metric>(); Metric newMetric=reduce(metrics); Map<Long,String> reducedDatapoints=newMetric.getDatapoints(); Set<Long> sharedTimestamps=reducedDatapoints.keySet(); Map<Long,String> unionDatapoints=new TreeMap<Long,String>(); for ( Metric metric : metrics) { for ( Map.Entry<Long,String> entry : metric.getDatapoints().entrySet()) { if (!sharedTimestamps.contains(entry.getKey())) { unionDatapoints.put(entry.getKey(),entry.getValue()); } } } unionDatapoints.putAll(reduce(metrics).getDatapoints()); newMetric.setDatapoints(unionDatapoints); newMetricsList.add(newMetric); return newMetricsList; }
Performs a columnar union of metrics.
public boolean resourceSupportAR(int id){ boolean flag=false; if (id < 0) { flag=false; } else { flag=checkResource(arList,id); } return flag; }
Checks whether a given resource ID supports Advanced Reservations or not.
static AttrAccept createFromString(final String str) throws BOSHException { if (str == null) { return null; } else { return new AttrAccept(str); } }
Creates a new attribute instance from the provided String.
private void commit() throws SQLException { if (m_conn != null && !m_conn.getAutoCommit()) { m_conn.commit(); } }
Commit (if local)
public boolean isStandby(){ return getRole().equals(DataSourceRole.standby.toString()); }
Returns the standby value.
public GitlabMergeRequest updateMergeRequest(Serializable projectId,Integer mergeRequestId,String targetBranch,Integer assigneeId,String title,String description,String stateEvent,String labels) throws IOException { Query query=new Query().appendIf("target_branch",targetBranch).appendIf("assignee_id",assigneeId).appendIf("title",title).appendIf("description",description).appendIf("state_event",stateEvent).appendIf("labels",labels); String tailUrl=GitlabProject.URL + "/" + sanitizeProjectId(projectId)+ "/merge_request/"+ mergeRequestId+ query.toString(); return retrieve().method("PUT").to(tailUrl,GitlabMergeRequest.class); }
Updates a Merge Request
@Override public boolean isResetted(){ return (leftTop.isResetted() && rightBottom.isResetted()); }
reset methods
public static Number plus(Number left,Character right){ return NumberNumberPlus.plus(left,Integer.valueOf(right)); }
Add a Number and a Character. The ordinal value of the Character is used in the addition (the ordinal value is the unicode value which for simple character sets is the ASCII value).
public static void addClipboardListener(final ClipboardListener l){ listenerList.add(l); }
Add the specified clipboard listener.
private void resizeFramebufferTexture(){ glDeleteTextures(raytraceTexture); glDeleteTextures(positionTexture); glDeleteTextures(normalTexture); glDeleteRenderbuffers(depthBuffer); glDeleteFramebuffers(fbo); createRaytracingTexture(); createRasterizerTextures(); createRasterFrameBufferObject(); }
Resize the framebuffer textures for both rasterization and ray tracing.
public void readMetaData(Transfer transfer) throws IOException { dataType=transfer.readInt(); precision=transfer.readLong(); scale=transfer.readInt(); nullable=transfer.readInt(); }
Write the parameter meta data from the transfer object.
public void clearSelectedFeatures(){ selectedFeatures=new BooleanBitArray1D((int)lasFile.getNumPointRecords() + 1); selectedFeatureNumbers.clear(); this.selectedFeatureNumber=-2; this.pcs.firePropertyChange("selectedFeatureNumber",-1,selectedFeatureNumber); }
Clears all of the selected features from a LAS layer.
public static WritableDoubleDataStore makeDoubleStorage(DBIDs ids,int hints,double def){ return DataStoreFactory.FACTORY.makeDoubleStorage(ids,hints,def); }
Make a new storage, to associate the given ids with an object of class dataclass.
public final double y(){ return this.y; }
Reader for y in internal axis representation (positive into screen).
public boolean showDialog(){ setVisible(true); return continueQueue; }
Shows the dialog and returns whether the work on the queue should be continued.
@Override public void writeToParcel(Parcel dest,int flags){ super.writeToParcel(dest,flags,TYPE_WCDMA); mCellIdentityWcdma.writeToParcel(dest,flags); mCellSignalStrengthWcdma.writeToParcel(dest,flags); }
Implement the Parcelable interface
public static List<MethodNode> findMethodsWithParameter(Collection<MethodNode> methodNodes,Type expectedParamType){ Validate.notNull(methodNodes); Validate.notNull(expectedParamType); Validate.noNullElements(methodNodes); Validate.isTrue(expectedParamType.getSort() != Type.METHOD && expectedParamType.getSort() != Type.VOID); List<MethodNode> ret=new ArrayList<>(); for ( MethodNode methodNode : methodNodes) { Type methodDescType=Type.getType(methodNode.desc); Type[] methodParamTypes=methodDescType.getArgumentTypes(); if (Arrays.asList(methodParamTypes).contains(expectedParamType)) { ret.add(methodNode); } } return ret; }
Find methods within a class where the parameter list contains a certain list of type.
public static String toHexString(byte[] input,String prefix,String seperator){ String result=new String(prefix); for (int i=0; i < input.length; i++) { result+=HEX_CHARS[(input[i] >>> 4) & 0x0f]; result+=HEX_CHARS[(input[i]) & 0x0f]; if (i < input.length - 1) { result+=seperator; } } return result; }
Convert a byte array to the corresponding hex string.
public MarketplaceAccessTypeUneligibleForOperationException(String message,ApplicationExceptionBean bean,Throwable cause){ super(message,bean,cause); }
Constructs a new exception with the specified detail message, cause, and bean for JAX-WS exception serialization.
public boolean equals(Object obj){ if (!(obj instanceof XorOnlyAttribute)) return false; if (obj == this) return true; XorOnlyAttribute att=(XorOnlyAttribute)obj; if (att.getAttributeType() != getAttributeType() || att.getDataLength() != getDataLength()) return false; return true; }
Compares two STUN Attributes. Two attributes are considered equal when they have the same type length and value.
public static <T>DecomposableMatchBuilder0<List<T>> headTail(MatchesExact<T> head,MatchesExact<List<T>> tail){ List<Matcher<Object>> matchers=Lists.of(ArgumentMatchers.eq(head.t),ArgumentMatchers.eq(tail.t)); return new DecomposableMatchBuilder0<List<T>>(matchers,new ListConsHeadTailFieldExtractor<>()); }
Matches a list with a head element and a tail of remaining elements.
public ByteIterator(byte[] primitiveArray){ super(primitiveArray); }
Construct new ByteIterator for given primitive array.
public NioDatagramConnector(int processorCount){ super(new DefaultDatagramSessionConfig(),NioProcessor.class,processorCount); }
Creates a new instance.
protected static ConditionOperand BIT_TEST(int x,ConditionOperand cond){ if (VM.VerifyAssertions) opt_assert((x == 0) || (x == 1)); if (VM.VerifyAssertions) opt_assert(EQ_NE(cond)); if ((x == 1 && cond.isEQUAL()) || (x == 0 && cond.isNOT_EQUAL())) { return ConditionOperand.LOWER(); } else { return ConditionOperand.HIGHER_EQUAL(); } }
Convert the given comparison with a boolean (int) value into a condition suitable for the carry flag
public void not(){ mv.visitInsn(Opcodes.ICONST_1); mv.visitInsn(Opcodes.IXOR); }
Generates the instructions to compute the bitwise negation of the top stack value.
public static ReferenceRanges<String> createBedReferenceRanges(SAMFileHeader header,File bedFile) throws IOException { final BedRangeLoader<String> brl=new ResolvedBedRangeLoader(header); brl.loadRanges(bedFile); final ReferenceRanges<String> ranges=brl.getReferenceRanges(); ranges.setIdMap(SamUtils.getSequenceIdLookup(header.getSequenceDictionary())); return ranges; }
Make a reference range list from all regions contained in a BED file
public File encryptToFile(InputStream fileInput,String fileNameOutput) throws NoSuchPaddingException, InvalidKeyException, NoSuchAlgorithmException, IOException, BadPaddingException, IllegalBlockSizeException, InvalidAlgorithmParameterException, InvalidKeySpecException { if ((fileNameOutput == null) || (fileNameOutput.isEmpty())) { return null; } File fileOutput=new File(fileNameOutput); FileOutputStream out=new FileOutputStream(fileOutput); byte[] encrypted=encrypt(fileInput); out.write(encrypted); out.flush(); out.close(); return fileOutput; }
Encryption Method Wrapper
public RemoteError(String message,int code){ this.message=message; this.code=code; }
Instantiates a new remote error.
public ColorAnimator(String group,String[] fields){ super(group); setColorFields(fields); }
Create a new ColorAnimator that processes the specified group and color fields.
public ScaleAndIndex index(int index){ return new ScaleAndIndex(scale,index); }
Specifies a single quantile index to be calculated, i.e. the k in the kth q-quantile.
public static Bitmap create(float width,float height,String character,int textSize,Align textAlign,int textColor,int backgroundColor,Context context){ Bitmap bitmap=Bitmap.createBitmap((int)width,(int)height,Bitmap.Config.ARGB_8888); Canvas canvas=new Canvas(bitmap); Paint paint=new Paint(); paint.setTextSize(textSize); paint.setTextAlign(textAlign); paint.setFakeBoldText(true); paint.setColor(textColor); canvas.drawColor(backgroundColor); canvas.drawText(character,width / 2,height / 1.6f,paint); return bitmap; }
Creates a Bitmap with texts.
private void nextTree(int layer){ if (layer > 0) { index[layer - 1]++; boolean lastTree=true; int z=layer; do { z--; if (index[z] < numLeafs[z]) { lastTree=false; } } while (lastTree && (z > 0)); if (!lastTree) { gmssRandom.nextSeed(currentSeeds[layer]); nextRootSig[layer - 1].updateSign(); if (layer > 1) { nextNextLeaf[layer - 1 - 1]=nextNextLeaf[layer - 1 - 1].nextLeaf(); } upperLeaf[layer - 1]=upperLeaf[layer - 1].nextLeaf(); if (minTreehash[layer - 1] >= 0) { upperTreehashLeaf[layer - 1]=upperTreehashLeaf[layer - 1].nextLeaf(); byte[] leaf=this.upperTreehashLeaf[layer - 1].getLeaf(); try { currentTreehash[layer - 1][minTreehash[layer - 1]].update(this.gmssRandom,leaf); if (currentTreehash[layer - 1][minTreehash[layer - 1]].wasFinished()) { } } catch ( Exception e) { System.out.println(e); } } this.updateNextNextAuthRoot(layer); this.currentRootSig[layer - 1]=nextRootSig[layer - 1].getSig(); for (int i=0; i < heightOfTrees[layer] - K[layer]; i++) { this.currentTreehash[layer][i]=this.nextTreehash[layer - 1][i]; this.nextTreehash[layer - 1][i]=this.nextNextRoot[layer - 1].getTreehash()[i]; } for (int i=0; i < heightOfTrees[layer]; i++) { System.arraycopy(nextAuthPaths[layer - 1][i],0,currentAuthPaths[layer][i],0,mdLength); System.arraycopy(nextNextRoot[layer - 1].getAuthPath()[i],0,nextAuthPaths[layer - 1][i],0,mdLength); } for (int i=0; i < K[layer] - 1; i++) { this.currentRetain[layer][i]=this.nextRetain[layer - 1][i]; this.nextRetain[layer - 1][i]=this.nextNextRoot[layer - 1].getRetain()[i]; } this.currentStack[layer]=this.nextStack[layer - 1]; this.nextStack[layer - 1]=this.nextNextRoot[layer - 1].getStack(); this.nextRoot[layer - 1]=this.nextNextRoot[layer - 1].getRoot(); byte[] OTSseed=new byte[mdLength]; byte[] dummy=new byte[mdLength]; System.arraycopy(currentSeeds[layer - 1],0,dummy,0,mdLength); OTSseed=gmssRandom.nextSeed(dummy); OTSseed=gmssRandom.nextSeed(dummy); OTSseed=gmssRandom.nextSeed(dummy); nextRootSig[layer - 1].initSign(OTSseed,nextRoot[layer - 1]); nextKey(layer - 1); } } }
Switch to next subtree if the current one is depleted
public void onDrawerOpened(View drawerView){ super.onDrawerOpened(drawerView); }
Called when a drawer has settled in a completely open state.
public static Line fromBottom(int margin,int marginUnit){ return new Line(1,Gravity.BOTTOM,margin,marginUnit,DebugColors.next()); }
Create and return new line aligned at bottom edge of screen
public h6 addElement(Element element){ addElementToRegistry(element); return (this); }
Adds an Element to the element.
private void loadStringSetting(SQLiteStatement stmt,String name,int resId){ loadSetting(stmt,name,mContext.getResources().getString(resId)); }
Loads a string resource into a database table. If a conflict occurs, that value is not inserted into the database table.
public Vector3f mul(Matrix3fc mat){ return mul(mat,this); }
Multiply the given matrix with this Vector3f and store the result in <code>this</code>.
public static String stripWord(String word){ if (word != null) { word=stripTitles(word); return StringUtils.replaceChars(word,STRIP_CHARS,""); } return null; }
Returns the word with all characters in STRIP_CHARS removed. If word contains multiple tokens, the last word is returned.
public static boolean isCoreFileSaver(String classname){ boolean result; String[] classnames; classnames=CORE_FILE_SAVERS.split(","); result=(Arrays.binarySearch(classnames,classname) >= 0); return result; }
checks whether the given class is one of the hardcoded core file savers.
@Override public void loadFiltersAndApplyDefault(){ initShortcutActions(); initAdHocFilter(); loadFilterEntities(); FilterEntity defaultFilter=getDefaultFilter(filterEntities); initFilterSelectComponents(); if (defaultFilter == null) { defaultFilter=adHocFilter; } try { setFilterEntity(defaultFilter); } catch ( Exception e) { log.error("Exception on loading default filter '" + defaultFilter.getName() + "'",e); windowManager.showNotification(messages.formatMainMessage("filter.errorLoadingDefaultFilter",defaultFilter.getName()),Frame.NotificationType.ERROR); defaultFilter=adHocFilter; setFilterEntity(adHocFilter); } if (defaultFilter != adHocFilter && (filterMode == FilterMode.GENERIC_MODE)) { Window window=ComponentsHelper.getWindow(filter); if (!WindowParams.DISABLE_AUTO_REFRESH.getBool(window.getContext())) { if (getResultingManualApplyRequired()) { if (BooleanUtils.isTrue(defaultFilter.getApplyDefault())) { apply(true); } } else apply(true); if (filterEntity != null) { window.setDescription(getFilterCaption(filterEntity)); } else window.setDescription(null); } } }
Loads filter entities, finds default filter and applies it if found
int chunkSize(){ return mChunkSize; }
Get the chunk size. Should only be used for testing.
public static byte[][] split(final byte[] a,final byte[] b,final int num){ byte[][] ret=new byte[num + 2][]; int i=0; Iterable<byte[]> iter=iterateOnSplits(a,b,num); if (iter == null) return null; for ( byte[] elem : iter) { ret[i++]=elem; } return ret; }
Split passed range. Expensive operation relatively. Uses BigInteger math. Useful splitting ranges for MapReduce jobs.
public boolean skipField(final int tag) throws IOException { switch (WireFormat.getTagWireType(tag)) { case WireFormat.WIRETYPE_VARINT: readInt32(); return true; case WireFormat.WIRETYPE_FIXED64: readRawLittleEndian64(); return true; case WireFormat.WIRETYPE_LENGTH_DELIMITED: skipRawBytes(readRawVarint32()); return true; case WireFormat.WIRETYPE_START_GROUP: skipMessage(); checkLastTagWas(WireFormat.makeTag(WireFormat.getTagFieldNumber(tag),WireFormat.WIRETYPE_END_GROUP)); return true; case WireFormat.WIRETYPE_END_GROUP: return false; case WireFormat.WIRETYPE_FIXED32: readRawLittleEndian32(); return true; default : throw InvalidProtocolBufferException.invalidWireType(); } }
Reads and discards a single field, given its tag value.
public HoverPredicate(){ super(VisualItem.HOVER); }
Create a new HoverPredicate.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:35:01.573 -0500",hash_original_method="16DE5E515D4E313298C804E12AA820B9",hash_generated_method="B6069869652BA6429DACB728FA845152") public ColorStateList(int[][] states,int[] colors){ mStateSpecs=states; mColors=colors; if (states.length > 0) { mDefaultColor=colors[0]; for (int i=0; i < states.length; i++) { if (states[i].length == 0) { mDefaultColor=colors[i]; } } } }
Creates a ColorStateList that returns the specified mapping from states to colors.
protected void doPrintHeader(){ if (m_Header.classAttribute().isNominal()) if (m_OutputDistribution) append(" inst# actual predicted error distribution"); else append(" inst# actual predicted error prediction"); else append(" inst# actual predicted error"); if (m_Attributes != null) { append(" ("); boolean first=true; for (int i=0; i < m_Header.numAttributes(); i++) { if (i == m_Header.classIndex()) continue; if (m_Attributes.isInRange(i)) { if (!first) append(","); append(m_Header.attribute(i).name()); first=false; } } append(")"); } append("\n"); }
Performs the actual printing of the header.