code
stringlengths
10
174k
nl
stringlengths
3
129k
public double minY(){ return Math.min(p0.y,p1.y); }
Gets the minimum Y ordinate.
public String toString(){ StringBuilder stringBuilder=new StringBuilder(); for ( ValidationErrorObject error : errors) { stringBuilder.append(error.toString()); } return stringBuilder.toString(); }
A method that returns a string representation of a ValidationEventHandlerImpl object
protected boolean updateAttachmentPoint(DatapathId sw,OFPort port,Date lastSeen){ ITopologyService topology=deviceManager.topology; List<AttachmentPoint> oldAPList; List<AttachmentPoint> apList; boolean oldAPFlag=false; if (!deviceManager.isValidAttachmentPoint(sw,port)) return false; AttachmentPoint newAP=new AttachmentPoint(sw,port,lastSeen); apList=new ArrayList<AttachmentPoint>(); if (attachmentPoints != null) apList.addAll(attachmentPoints); oldAPList=new ArrayList<AttachmentPoint>(); if (oldAPs != null) oldAPList.addAll(oldAPs); if (oldAPList.contains(newAP)) { int index=oldAPList.indexOf(newAP); newAP=oldAPList.remove(index); newAP.setLastSeen(lastSeen); this.oldAPs=oldAPList; oldAPFlag=true; } Map<DatapathId,AttachmentPoint> apMap=getAPMap(apList); if (apMap == null || apMap.isEmpty()) { apList.add(newAP); attachmentPoints=apList; return true; } DatapathId id=topology.getL2DomainId(sw); AttachmentPoint oldAP=apMap.get(id); if (oldAP == null) { apList=new ArrayList<AttachmentPoint>(); apList.addAll(apMap.values()); apList.add(newAP); this.attachmentPoints=apList; return true; } if (oldAP.equals(newAP)) { if (newAP.lastSeen.after(oldAP.lastSeen)) { oldAP.setLastSeen(newAP.lastSeen); } this.attachmentPoints=new ArrayList<AttachmentPoint>(apMap.values()); return false; } int x=deviceManager.apComparator.compare(oldAP,newAP); if (x < 0) { apMap.put(id,newAP); this.attachmentPoints=new ArrayList<AttachmentPoint>(apMap.values()); oldAPList=new ArrayList<AttachmentPoint>(); if (oldAPs != null) oldAPList.addAll(oldAPs); oldAPList.add(oldAP); this.oldAPs=oldAPList; if (!topology.isInSameBroadcastDomain(oldAP.getSw(),oldAP.getPort(),newAP.getSw(),newAP.getPort())) return true; } else if (oldAPFlag) { oldAPList=new ArrayList<AttachmentPoint>(); if (oldAPs != null) oldAPList.addAll(oldAPs); oldAPList.add(newAP); this.oldAPs=oldAPList; } return false; }
Update the list of attachment points given that a new packet-in was seen from (sw, port) at time (lastSeen). The return value is true if there was any change to the list of attachment points for the device -- which indicates a device move.
protected void checkRowPos() throws SQLException { checkClosed(); if (!this.onValidRow) { throw SQLError.createSQLException(this.invalidRowReason,SQLError.SQL_STATE_GENERAL_ERROR,getExceptionInterceptor()); } }
Ensures that the cursor is positioned on a valid row and that the result set is not closed
public final float paint(Graphics2D g,float x,float y,RSyntaxTextArea host,TabExpander e,float clipStart){ int origX=(int)x; int end=textOffset + textCount; float nextX=x; int flushLen=0; int flushIndex=textOffset; Color fg=host.getForegroundForToken(this); Color bg=host.getBackgroundForTokenType(type); g.setFont(host.getFontForTokenType(type)); FontMetrics fm=host.getFontMetricsForTokenType(type); int ascent=fm.getAscent(); int height=fm.getHeight(); for (int i=textOffset; i < end; i++) { switch (text[i]) { case '\t': nextX=x + fm.charsWidth(text,flushIndex,flushLen); float nextNextX=e.nextTabStop(nextX,0); if (bg != null) { paintBackground(x,y,nextNextX - x,height,g,ascent,host,bg); } g.setColor(fg); if (flushLen > 0) { g.drawChars(text,flushIndex,flushLen,(int)x,(int)y); flushLen=0; } flushIndex=i + 1; int halfHeight=height / 2; int quarterHeight=halfHeight / 2; int ymid=(int)y - ascent + halfHeight; g.drawLine((int)nextX,ymid,(int)nextNextX,ymid); g.drawLine((int)nextNextX,ymid,(int)nextNextX - 4,ymid - quarterHeight); g.drawLine((int)nextNextX,ymid,(int)nextNextX - 4,ymid + quarterHeight); x=nextNextX; break; case ' ': nextX=x + fm.charsWidth(text,flushIndex,flushLen + 1); int width=fm.charWidth(' '); if (bg != null) { paintBackground(x,y,nextX - x,height,g,ascent,host,bg); } g.setColor(fg); if (flushLen > 0) { g.drawChars(text,flushIndex,flushLen,(int)x,(int)y); flushLen=0; } dotRect.x=nextX - width / 2.0f; dotRect.y=y - ascent + height / 2.0f; g.fill(dotRect); flushIndex=i + 1; x=nextX; break; case '\f': default : flushLen+=1; break; } } nextX=x + fm.charsWidth(text,flushIndex,flushLen); if (flushLen > 0 && nextX >= clipStart) { if (bg != null) { paintBackground(x,y,nextX - x,height,g,ascent,host,bg); } g.setColor(fg); g.drawChars(text,flushIndex,flushLen,(int)x,(int)y); } if (host.getUnderlineForToken(this)) { g.setColor(fg); int y2=(int)(y + 1); g.drawLine(origX,y2,(int)nextX,y2); } return nextX; }
Paints this token, using special symbols for whitespace characters.
public NodeId(int namespaceIndex,UnsignedInteger value){ if (value == null) throw new IllegalArgumentException("Numeric NodeId cannot be null"); if (namespaceIndex < 0 || namespaceIndex > 65535) throw new IllegalArgumentException("namespaceIndex out of bounds"); this.value=value; this.namespaceIndex=namespaceIndex; type=IdType.Numeric; }
Create new NodeId
public static boolean taskScopedTaskExecutionActionsVisibleFor(NodeSelection nodeSelection){ if (nodeSelection.isEmpty()) { return false; } return nodeSelection.hasAllNodesOfType(TaskNode.class); }
Determines whether actions related to task execution should be visible or hidden.
public boolean hasBirthday(){ return hasExtension(Birthday.class); }
Returns whether it has the birthday.
public void runTest() throws Throwable { Document doc; NodeList elementList; Node nameNode; Node nodeV; String value; doc=(Document)load("staff",false); elementList=doc.getElementsByTagName("name"); nameNode=elementList.item(2); nodeV=nameNode.getFirstChild(); value=nodeV.getNodeValue(); assertEquals("textNodeValue","Roger\n Jones",value); }
Runs the test case.
public boolean isValid(){ return (_fromBlock != null && _toBlock != null); }
Check portal has both blocks
protected void after(Description description) throws Throwable { if (gfsh != null) { gfsh.clearEvents(); gfsh.executeCommand("disconnect"); gfsh.executeCommand("exit"); gfsh.terminate(); gfsh.setThreadLocalInstance(); gfsh=null; } CliUtil.isGfshVM=false; }
Override to tear down your specific external resource.
public String toString(){ return print(""); }
Returns a String-representation of this regular expression
private void testGetProviders(Locale locale){ Locale defaultLocale=Locale.getDefault(); Locale.setDefault(locale); Provider p=new MyProvider(); try { Security.addProvider(p); String filter="MyService.MyAlgorithm"; assertTrue(filter,Arrays.equals(new Provider[]{p},Security.getProviders(filter))); filter="MyService.MyAlgorithm KeySize:512"; assertTrue(filter,Arrays.equals(new Provider[]{p},Security.getProviders(filter))); filter="MyService.MyAlgorithm KeySize:1025"; assertNull(filter,Security.getProviders(filter)); filter="MyService.MyAlgorithm imPLementedIn:softWARE"; assertTrue(filter,Arrays.equals(new Provider[]{p},Security.getProviders(filter))); filter="MyService.MyAlgorithm ATTribute:attributeVALUE"; assertTrue(filter,Arrays.equals(new Provider[]{p},Security.getProviders(filter))); filter="MyService.MyAlgorithm \u0130mPLemented\u0131n:softWARE"; assertTrue(filter,Arrays.equals(new Provider[]{p},Security.getProviders(filter))); filter="MyService.NoKeySize KeySize:512"; assertNull(filter,Security.getProviders(filter)); filter="MyService.NoImplementedIn ImplementedIn:Software"; assertNull(filter,Security.getProviders(filter)); filter="ABCService.NoAttribute Attribute:ABC"; assertNull(filter,Security.getProviders(filter)); } finally { Security.removeProvider(p.getName()); Locale.setDefault(defaultLocale); } }
Test that Security.getProviders does case sensitive operations independent of its locale.
public Builder addPart(Part part){ if (part == null) throw new NullPointerException("part == null"); parts.add(part); return this; }
Add a part to the body.
public void testLocale() throws IOException { assertEquals(new Locale("en"),mapper.readValue(quote("en"),Locale.class)); assertEquals(new Locale("es","ES"),mapper.readValue(quote("es_ES"),Locale.class)); assertEquals(new Locale("FI","fi","savo"),mapper.readValue(quote("fi_FI_savo"),Locale.class)); }
Test for [JACKSON-419]
public String toString(){ StringBuffer sb=new StringBuffer("PrintData["); sb.append(m_name).append(",Rows=").append(m_rows.size()); if (m_TableName != null) sb.append(",TableName=").append(m_TableName); sb.append("]"); return sb.toString(); }
String representation
@SuppressWarnings("unchecked") com.redhat.ceylon.model.typechecker.model.Class loadClass(String name,Map<String,Object> m,Scope parent,final List<TypeParameter> existing){ com.redhat.ceylon.model.typechecker.model.Class cls; m.remove(KEY_NAME); if (m.get(KEY_METATYPE) instanceof com.redhat.ceylon.model.typechecker.model.Class) { cls=(com.redhat.ceylon.model.typechecker.model.Class)m.get(KEY_METATYPE); if (m.size() <= 3) { return cls; } } else { if (m.containsKey("$alias")) { cls=new com.redhat.ceylon.model.typechecker.model.ClassAlias(); } else { cls=new com.redhat.ceylon.model.typechecker.model.Class(); } cls.setAbstract(m.remove("abstract") != null); cls.setAnonymous(m.remove("$anon") != null); cls.setDynamic(m.remove(KEY_DYNAMIC) != null); cls.setContainer(parent); cls.setScope(parent); cls.setName(name); cls.setUnit(u2); if (parent == this) { u2.addDeclaration(cls); } parent.addMember(cls); m.put(KEY_METATYPE,cls); setAnnotations(cls,(Integer)m.remove(KEY_PACKED_ANNS),(Map<String,Object>)m.remove(KEY_ANNOTATIONS)); } final List<TypeParameter> tparms=parseTypeParameters((List<Map<String,Object>>)m.remove(KEY_TYPE_PARAMS),cls,existing); final List<TypeParameter> allparms=JsonPackage.merge(tparms,existing); if (m.containsKey(KEY_SELF_TYPE)) { for ( TypeParameter t : tparms) { if (t.getName().equals(m.get(KEY_SELF_TYPE))) { cls.setSelfType(t.getType()); } } } if (!(isLanguagePackage() && ("Nothing".equals(name) || "Anything".equals(name)))) { if (cls.getExtendedType() == null) { if (m.containsKey("super")) { Type father=getTypeFromJson((Map<String,Object>)m.get("super"),parent instanceof Declaration ? (Declaration)parent : null,allparms); if (father != null) { m.remove("super"); cls.setExtendedType(father); } } else { cls.setExtendedType(getTypeFromJson(idobj,parent instanceof Declaration ? (Declaration)parent : null,allparms)); } } } if (cls instanceof ClassAlias) { ClassAlias ca=(ClassAlias)cls; if (m.containsKey(KEY_CONSTRUCTOR)) { String constructorName=(String)m.get(KEY_CONSTRUCTOR); Function ctorFn=(Function)ca.getExtendedType().getDeclaration().getDirectMember(constructorName,null,false); ca.setConstructor(ctorFn.getType().getDeclaration()); } else { ca.setConstructor(ca.getExtendedType().getDeclaration()); } } if (m.containsKey(KEY_CONSTRUCTORS)) { final Map<String,Map<String,Object>> constructors=(Map<String,Map<String,Object>>)m.remove(KEY_CONSTRUCTORS); for ( Map.Entry<String,Map<String,Object>> cons : constructors.entrySet()) { Constructor cnst=new Constructor(); cnst.setName("$def".equals(cons.getKey()) ? null : cons.getKey()); cnst.setContainer(cls); cnst.setScope(cls); cnst.setUnit(cls.getUnit()); cnst.setExtendedType(cls.getType()); cnst.setDynamic(cons.getValue().remove(KEY_DYNAMIC) != null); setAnnotations(cnst,(Integer)cons.getValue().remove(KEY_PACKED_ANNS),(Map<String,Object>)cons.getValue().remove(KEY_ANNOTATIONS)); final List<Map<String,Object>> modelPlist=(List<Map<String,Object>>)cons.getValue().remove(KEY_PARAMS); cls.addMember(cnst); if (modelPlist == null) { cls.setEnumerated(true); Value cv=new Value(); cv.setName(cnst.getName()); cv.setType(cnst.getType()); cv.setContainer(cls); cv.setScope(cls); cv.setUnit(cls.getUnit()); cv.setVisibleScope(cls.getVisibleScope()); cv.setShared(cls.isShared()); cv.setDeprecated(cls.isDeprecated()); cls.addMember(cv); } else { cls.setConstructors(true); final ParameterList plist=parseParameters(modelPlist,cnst,allparms); cnst.addParameterList(plist); plist.setNamedParametersSupported(true); Function cf=new Function(); cf.setName(cnst.getName()); final Type ft=cnst.appliedType(cnst.getExtendedType(),Collections.<Type>emptyList()); cf.setType(ft); cf.addParameterList(plist); cf.setContainer(cls); cf.setScope(cls); cf.setUnit(cls.getUnit()); cf.setVisibleScope(cnst.getVisibleScope()); cf.setShared(cnst.isShared()); cf.setDeprecated(cnst.isDeprecated()); cf.setDynamic(cnst.isDynamic()); cls.addMember(cf); } if (cons.getValue().containsKey(KEY_JS_TSENUM)) { cnst.setTypescriptEnum((String)cons.getValue().get(KEY_JS_TSENUM)); } } } else { ParameterList plist=parseParameters((List<Map<String,Object>>)m.remove(KEY_PARAMS),cls,allparms); plist.setNamedParametersSupported(true); cls.setParameterList(plist); } if (m.containsKey("of") && cls.getCaseTypes() == null) { cls.setCaseTypes(parseTypeList((List<Map<String,Object>>)m.get("of"),allparms)); m.remove("of"); } if (m.containsKey(KEY_SATISFIES)) { List<Map<String,Object>> stypes=(List<Map<String,Object>>)m.remove(KEY_SATISFIES); cls.setSatisfiedTypes(parseTypeList(stypes,allparms)); } if (m.containsKey(KEY_OBJECTS)) { for ( Map.Entry<String,Map<String,Object>> inner : ((Map<String,Map<String,Object>>)m.get(KEY_OBJECTS)).entrySet()) { loadObject(inner.getKey(),inner.getValue(),cls,allparms); } m.remove(KEY_OBJECTS); } addAttributesAndMethods(m,cls,allparms); if (m.containsKey(KEY_INTERFACES)) { Map<String,Map<String,Object>> cdefs=(Map<String,Map<String,Object>>)m.get(KEY_INTERFACES); for ( Map.Entry<String,Map<String,Object>> cdef : cdefs.entrySet()) { loadInterface(cdef.getKey(),cdef.getValue(),cls,allparms); } m.remove(KEY_INTERFACES); } if (m.containsKey(KEY_CLASSES)) { Map<String,Map<String,Object>> cdefs=(Map<String,Map<String,Object>>)m.get(KEY_CLASSES); for ( Map.Entry<String,Map<String,Object>> cdef : cdefs.entrySet()) { loadClass(cdef.getKey(),cdef.getValue(),cls,allparms); } m.remove(KEY_CLASSES); } if (cls.isDynamic() && (getModule().getJsMajor() < 9 || (getModule().getJsMajor() == 9 && getModule().getJsMinor() < 1))) { cls.makeMembersDynamic(); } return cls; }
Loads a class from the specified map. To avoid circularities, when the class is being created it is added to the map, and once it's been fully loaded, all other keys are removed.
public void testBasicsMultiDims() throws Exception { Directory dir=newDirectory(); RandomIndexWriter writer=new RandomIndexWriter(random(),dir); Document document=new Document(); document.add(new HalfFloatPoint("field",1.25f,-2f)); writer.addDocument(document); IndexReader reader=writer.getReader(); IndexSearcher searcher=newSearcher(reader); assertEquals(1,searcher.count(HalfFloatPoint.newRangeQuery("field",new float[]{0,-5},new float[]{1.25f,-1}))); assertEquals(0,searcher.count(HalfFloatPoint.newRangeQuery("field",new float[]{0,0},new float[]{2,2}))); assertEquals(0,searcher.count(HalfFloatPoint.newRangeQuery("field",new float[]{-10,-10},new float[]{1,2}))); reader.close(); writer.close(); dir.close(); }
Add a single multi-dimensional value and search for it
private synchronized void trim(){ while (mCurrentSize > mSizeLimit) { byte[] buf=mBuffersByLastUse.remove(0); mBuffersBySize.remove(buf); mCurrentSize-=buf.length; } }
Removes buffers from the pool until it is under its size limit.
public JLBHOptions throughput(int throughput){ return throughput(throughput,TimeUnit.SECONDS); }
Number of iterations per second to be pushed through the benchmark
@Deprecated public LogisticRegressionOptimization(ExampleSet exampleSet,boolean addIntercept,int initType,int maxIterations,int generationsWithoutImprovement,int popSize,int selectionType,double tournamentFraction,boolean keepBest,int mutationType,double crossoverProb,boolean showConvergencePlot,RandomGenerator random,LoggingHandler logging){ this(exampleSet,addIntercept,initType,maxIterations,generationsWithoutImprovement,popSize,selectionType,tournamentFraction,keepBest,mutationType,crossoverProb,showConvergencePlot,random,logging,null); }
Creates a new evolutionary optimization.
protected DeprecatableElementImpl(){ super(); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public CameraSelectionCriteria build(){ return (criteria); }
Returns the fabricated criteria
public PercentFormatter(DecimalFormat format){ this.mFormat=format; }
Allow a custom decimalformat
public String type(){ return type; }
Returns grantee type.
private String sendStatusRequestWithRetry(ModifiableSolrParams params,int maxCounter) throws SolrServerException, IOException { NamedList status=null; String state=null; String message=null; NamedList r; while (maxCounter-- > 0) { r=sendRequest(params); status=(NamedList)r.get("status"); state=(String)status.get("state"); message=(String)status.get("msg"); if (state.equals("completed") || state.equals("failed")) return (String)status.get("msg"); try { Thread.sleep(1000); } catch ( InterruptedException e) { } } return message; }
Helper method to send a status request with specific retry limit and return the message/null from the success response.
private static byte[] max(byte[] ip1,byte[] ip2){ for (int i=0; i < ip1.length; i++) { if ((ip1[i] & 0xFFFF) > (ip2[i] & 0xFFFF)) { return ip1; } } return ip2; }
Returns the maximum IP address.
public boolean isSetCursorId(){ return EncodingUtils.testBit(__isset_bitfield,__CURSORID_ISSET_ID); }
Returns true if field cursorId is set (has been assigned a value) and false otherwise
public boolean overlaps(Mention mention){ final Base a=getAnnotation(); final Base b=mention.getAnnotation(); return !(a.getEnd() < b.getBegin() || b.getEnd() < a.getBegin()); }
Returns true if the provided mention overlaps with this mention
public boolean isDominatorOf(DominatorNode dom,DominatorNode node){ return dominators.isDominatedBy(node.getGode(),dom.getGode()); }
Returns true if dom dominates node.
public long seek(long position){ if (mPlayer != null && mPlayer.isInitialized()) { if (position < 0) { position=0; } else if (position > mPlayer.duration()) { position=mPlayer.duration(); } long result=mPlayer.seek(position); notifyChange(POSITION_CHANGED); return result; } return -1; }
Seeks the current track to a specific time
public XYAreaRenderer2(XYToolTipGenerator labelGenerator,XYURLGenerator urlGenerator){ super(); this.showOutline=false; setBaseToolTipGenerator(labelGenerator); setURLGenerator(urlGenerator); GeneralPath area=new GeneralPath(); area.moveTo(0.0f,-4.0f); area.lineTo(3.0f,-2.0f); area.lineTo(4.0f,4.0f); area.lineTo(-4.0f,4.0f); area.lineTo(-3.0f,-2.0f); area.closePath(); this.legendArea=area; }
Constructs a new renderer.
public void initialise(int k,double epsilon) throws Exception { super.initialise(k); this.epsilon=epsilon; miKernel.initialise(k,1,epsilon); destPastVectors=null; destNextVectors=null; }
Initialises the calculator
private static String normalizeLineEndings(String input){ return NON_UNIX_LINE_ENDING.matcher(input).replaceAll("\n"); }
The lexer crashes on windows line endings, so for now just normalize to `\n`.
public void testUnsupportedCallbackException01(){ Callback c=null; UnsupportedCallbackException ucE=new UnsupportedCallbackException(c); assertNull("getMessage() must return null.",ucE.getMessage()); assertNull("getCallback() must return null",ucE.getCallback()); }
javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback) javax.security.auth.callback.UnsupportedCallbackExceptionTest#getCallback() Assertion: constructs with null parameter.
private void returnData(Object ret){ if (myHost != null) { myHost.returnData(ret); } }
Used to communicate a return object from a plugin tool to the main Whitebox user-interface.
public VmStatusChangeEvent(MonitoredHost host,Set active,Set started,Set terminated){ super(host); this.active=active; this.started=started; this.terminated=terminated; }
Construct a new VmStatusChangeEvent instance.
public void connect(Context context,BeanListener listener){ lastKnownContext=context; beanListener=listener; gattClient.connect(context,device); }
Attempt to connect to this Bean.
private void sendLogManagerSavedTimestamp(TimestampSucceeded message){ SaveTimestampedDataMessage data=new SaveTimestampedDataMessage(message); getContext().parent().tell(data,getSelf()); }
Sends successfully time stamped data to logManager for storing (previously logManager.saveTimestampRecord(message);)
protected boolean afterDelete(boolean success){ String sql="DELETE FROM AD_Package_Exp_Detail WHERE AD_Package_Exp_ID = " + getAD_Package_Exp_ID(); int deleteSuccess=DB.executeUpdate(sql,get_TrxName()); if (deleteSuccess == -1) return false; return true; }
Before Delete
public Object jjtAccept(SyntaxTreeBuilderVisitor visitor,Object data) throws VisitorException { return visitor.visit(this,data); }
Accept the visitor.
public static Set<Entity> replaceWithCoreferent(Collection<Entity> entities,Map<ReferenceTarget,Entity> referentMap){ final Set<Entity> set=new HashSet<>(entities.size()); for ( final Entity t : entities) { if (t.getReferent() == null) { set.add(t); } else { final Entity entity=referentMap.get(t.getReferent()); if (entity != null) { set.add(entity); } else { set.add(t); } } } return set; }
Replace the mentins with the principal coreferent entity (if there is one).
public AxesWalker(LocPathIterator locPathIterator,int axis){ super(locPathIterator); m_axis=axis; }
Construct an AxesWalker using a LocPathIterator.
private void loadServerDetailsActivity(){ Preference.putString(context,resources.getString(R.string.shared_pref_ip),resources.getString(R.string.shared_pref_default_string)); Intent intent=new Intent(AlreadyRegisteredActivity.this,ServerDetails.class); intent.putExtra(getResources().getString(R.string.intent_extra_regid),regId); intent.putExtra(getResources().getString(R.string.intent_extra_from_activity),AlreadyRegisteredActivity.class.getSimpleName()); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); finish(); }
Load server details activity.
public boolean isBefore(ReadableInstant instant){ long instantMillis=DateTimeUtils.getInstantMillis(instant); return isBefore(instantMillis); }
Is this instant before the instant passed in comparing solely by millisecond.
public InflaterInputStream(InputStream in,Inflater inf){ this(in,inf,512); }
Creates a new input stream with the specified decompressor and a default buffer size.
public OpenDoubleIntHashMap(int initialCapacity){ this(initialCapacity,defaultMinLoadFactor,defaultMaxLoadFactor); }
Constructs an empty map with the specified initial capacity and default load factors.
static void computeCallerMap(JsonElement jsonElt,boolean topLevel,Map<String,Map<String,Set<JsonElement>>> callerMap){ JsonArray childrenArray=Utils.getChildrenArray(jsonElt); String sig=Utils.getFieldValueAsString(jsonElt,"signature"); if (childrenArray != null) { for (int i=0; i < childrenArray.size(); i++) { JsonElement child=childrenArray.get(i); if (child.isJsonObject() && !Utils.isEmptyJsonObject(child)) { JsonObject childObj=child.getAsJsonObject(); String childSig=Utils.getFieldValueAsString(childObj,"signature"); if (!topLevel) { Map<String,Set<JsonElement>> callers=callerMap.get(childSig); if (callers == null) { callers=new HashMap<String,Set<JsonElement>>(); callerMap.put(childSig,callers); } Set<JsonElement> calls=callers.get(sig); if (calls == null) { calls=new HashSet<JsonElement>(); callers.put(sig,calls); } calls.add(jsonElt); } computeCallerMap(childObj,false,callerMap); } } } }
Processes a Json element (representing a caller in a source call graph) and its children elements (representing the callees), adds the corresponding calls to the caller map and do this recursively till the entire tree rooted at the Json element is processed.
protected boolean isInitialized(){ return initialized; }
Get the initialized flag.
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:27:51.392 -0500",hash_original_method="5412F78A6FFD23BF6E67569C9C7086D9",hash_generated_method="A1A47654BACAD454A83B86CF81070850") private static int addPlusChar(String number){ int pos=-1; if (number.startsWith(CLIR_OFF)) { pos=CLIR_OFF.length() - 1; } if (number.startsWith(CLIR_ON)) { pos=CLIR_ON.length() - 1; } return pos; }
GSM codes Finds if a GSM code includes the international prefix (+).
public void onSaveInstanceState(Bundle outState){ outState.putBoolean("SlidingActivityHelper.open",mSlidingMenu.isMenuShowing()); outState.putBoolean("SlidingActivityHelper.secondary",mSlidingMenu.isSecondaryMenuShowing()); }
Called to retrieve per-instance state from an activity before being killed so that the state can be restored in onCreate(Bundle) or onRestoreInstanceState(Bundle) (the Bundle populated by this method will be passed to both).
public static void writeStringToFile(File file,String data) throws IOException { writeStringToFile(file,data,null,false); }
Writes a String to a file creating the file if it does not exist using the default encoding for the VM.
public static DiscCacheAware createReserveDiscCache(File cacheDir){ File individualDir=new File(cacheDir,"uil-images"); if (individualDir.exists() || individualDir.mkdir()) { cacheDir=individualDir; } return new TotalSizeLimitedDiscCache(cacheDir,2 * 1024 * 1024); }
Creates reserve disc cache which will be used if primary disc cache becomes unavailable
public boolean isDeleted(){ return deleted; }
Once a file/folder is deleted, it shouldn't be accessible any more from the VFS. But in case some thread holds a reference to this instance, we need to mark that it is supposed to be deleted
public static String indent(String iString,int iIndentDepth){ StringBuilder spacer=new StringBuilder(); spacer.append("\n"); for (int i=0; i < iIndentDepth; i++) { spacer.append(" "); } return replace(iString,"\n",spacer.toString()); }
Indents the given String per line.
public void append(final char data){ provideCapacity(length + 1); c[length]=data; length++; }
Appends a single character to the end of this CharBuffer. This method involves copying the new data once!
private void processWriteInstruction(ExecutionContext ec) throws DMLRuntimeException { String fname=ec.getScalarInput(input2.getName(),ValueType.STRING,input2.isLiteral()).getStringValue(); if (input1.getDataType() == DataType.SCALAR) { writeScalarToHDFS(ec,fname); } else if (input1.getDataType() == DataType.MATRIX) { String outFmt=input3.getName(); if (outFmt.equalsIgnoreCase("matrixmarket")) writeMMFile(ec,fname); else if (outFmt.equalsIgnoreCase("csv")) writeCSVFile(ec,fname); else { MatrixObject mo=ec.getMatrixObject(input1.getName()); mo.exportData(fname,outFmt); } } else if (input1.getDataType() == DataType.FRAME) { String outFmt=input3.getName(); FrameObject mo=ec.getFrameObject(input1.getName()); mo.exportData(fname,outFmt,_formatProperties); } }
Handler for write instructions. Non-native formats like MM and CSV are handled through specialized helper functions. The default behavior is to write out the specified matrix from the instruction, in the format given by the corresponding symbol table entry.
private void fetchWallMessages(int pageNumber){ final Map<String,String> params=new HashMap<String,String>(5); if (!SharedPreferenceHelper.getString(R.string.pref_latitude).equals("")) { params.put(HttpConstants.LATITUDE,SharedPreferenceHelper.getString(R.string.pref_latitude)); params.put(HttpConstants.LONGITUDE,SharedPreferenceHelper.getString(R.string.pref_longitude)); params.put(HttpConstants.TYPE,HttpConstants.SearchType.WALL); params.put(HttpConstants.PER,"10"); params.put(HttpConstants.RADIUS,"50"); RetroCallback retroCallback; retroCallback=new RetroCallback(this); retroCallback.setRequestId(HttpConstants.ApiResponseCodes.GET_ALL_WALLS); retroCallbackList.add(retroCallback); params.put(HttpConstants.PAGE,pageNumber + ""); if (!mFetchingWalls) { mYeloApi.getWallMessages(params,retroCallback); mFetchingWalls=true; } if (pageNumber != 1) { mCurrentpage=pageNumber; } mIsLoading=true; mSwipeRefreshLayout.setRefreshing(true); } else { Utils.setDefaultLocation(getActivity()); } }
This api call fetches the feed wall
Node cloneOrImportNode(short operation,Node node,boolean deep){ NodeImpl copy=shallowCopy(operation,node); if (deep) { NodeList list=node.getChildNodes(); for (int i=0; i < list.getLength(); i++) { copy.appendChild(cloneOrImportNode(operation,list.item(i),deep)); } } notifyUserDataHandlers(operation,node,copy); return copy; }
Returns a copy of the given node or subtree with this document as its owner.
@Nullable public GridCacheMvccCandidate releaseLocal(){ return releaseLocal(Thread.currentThread().getId()); }
Local local release.
public void erasePurchase(String sku){ if (mPurchaseMap.containsKey(sku)) mPurchaseMap.remove(sku); }
Erase a purchase (locally) from the inventory, given its product ID. This just modifies the Inventory object locally and has no effect on the server! This is useful when you have an existing Inventory object which you know to be up to date, and you have just consumed an item successfully, which means that erasing its purchase data from the Inventory you already have is quicker than querying for a new Inventory.
public void query(WebSocket session,HeadersAmp headers,String from,long qid,String to,String methodName,PodRef podCaller,Object... args) throws IOException { }
Sends a message to a given address
public double cond(){ return s.$[s.addr.op(0)] / s.$[Math.min(m,n) - 1]; }
Two norm condition number
private String lookaheadWord() throws IOException, ParseException { String nextWord=getNextWord(); tokenizer.pushBack(); return nextWord; }
Returns the next word in the stream.
public void runTest() throws Throwable { Document doc; NodeList testList; Node commentNode; String commentNodeName; int nodeType; doc=(Document)load("staff",false); testList=doc.getChildNodes(); for (int indexN10040=0; indexN10040 < testList.getLength(); indexN10040++) { commentNode=(Node)testList.item(indexN10040); commentNodeName=commentNode.getNodeName(); if (equals("#comment",commentNodeName)) { nodeType=(int)commentNode.getNodeType(); assertEquals("nodeCommentNodeTypeAssert1",8,nodeType); } } }
Runs the test case.
public void resetOriginals(){ mStartingStartTrim=0; mStartingEndTrim=0; mStartingRotation=0; setStartTrim(0); setEndTrim(0); setRotation(0); }
Reset the progress spinner to default rotation, start and end angles.
public boolean verify(SignerInformationVerifier verifier) throws CMSException { Time signingTime=getSigningTime(); if (verifier.hasAssociatedCertificate()) { if (signingTime != null) { X509CertificateHolder dcv=verifier.getAssociatedCertificate(); if (!dcv.isValidOn(signingTime.getDate())) { throw new CMSVerifierCertificateNotValidException("verifier not valid at signingTime"); } } } return doVerify(verifier); }
Verify that the given verifier can successfully verify the signature on this SignerInformation object.
public static void dropTable(SQLiteDatabase db,boolean ifExists){ String sql="DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "'THREAD'"; db.execSQL(sql); }
Drops the underlying database table.
private boolean canModifyApplicationUsers(Subscription subscription){ return !(subscription.getStatus() == SubscriptionStatus.PENDING || subscription.getStatus() == SubscriptionStatus.INVALID); }
Checks if the users of the subscription can be modified. this is not possible if the subscription is in pending or invalid state because no product instance is there in this case.
private void resizeHorizontal(Event e,FormData sashData){ Rectangle sashRect=sash.getBounds(); Rectangle shellRect=Sasher.this.getBounds(); int bottom=shellRect.height - sashRect.height - limit; e.y=Math.max(Math.min(e.y,bottom),limit); if (e.y != sashRect.y) { sashData.top=new FormAttachment(0,e.y); Sasher.this.layout(); } }
Handle an horizontal resize event.
public void testNoUnigrams() throws Exception { Reader reader=new StringReader("this is a test"); TokenStream stream=whitespaceMockTokenizer(reader); stream=tokenFilterFactory("Shingle","outputUnigrams","false").create(stream); assertTokenStreamContents(stream,new String[]{"this is","is a","a test"}); }
Test with unigrams disabled
public static int[][] computeTable(){ int[][] ret=new int[10][10]; for (int m=0; m < 10; m++) { for (int n=0; n < 10; n++) { ret[m][n]=m * n; } } return ret; }
Compute full multiplication table for digits 0 through 9.
public static void warn(int windowNo,String adMessage){ warn(windowNo,null,adMessage,null,null); }
Display warning with warning icon
@Override public void createExportMask(StorageSystem storage,URI exportMaskURI,VolumeURIHLU[] volumeURIHLUs,List<URI> targetURIList,List<Initiator> initiatorList,TaskCompleter taskCompleter) throws DeviceControllerException { _log.info("{} createExportMask START...",storage.getSerialNumber()); Map<StorageGroupPolicyLimitsParam,CIMObjectPath> newlyCreatedChildVolumeGroups=new HashMap<StorageGroupPolicyLimitsParam,CIMObjectPath>(); ExportOperationContext context=new VmaxExportOperationContext(); taskCompleter.updateWorkflowStepContext(context); try { _log.info("Export mask id: {}",exportMaskURI); _log.info("createExportMask: volume-HLU pairs: {}",Joiner.on(',').join(volumeURIHLUs)); _log.info("createExportMask: initiators: {}",Joiner.on(',').join(initiatorList)); _log.info("createExportMask: assignments: {}",Joiner.on(',').join(targetURIList)); ExportMask mask=_dbClient.queryObject(ExportMask.class,exportMaskURI); String maskingViewName=generateMaskViewName(storage,mask); String cascadedIGCustomTemplateName=CustomConfigConstants.VMAX_HOST_CASCADED_IG_MASK_NAME; String initiatorGroupCustomTemplateName=CustomConfigConstants.VMAX_HOST_INITIATOR_GROUP_MASK_NAME; String cascadedSGCustomTemplateName=CustomConfigConstants.VMAX_HOST_CASCADED_SG_MASK_NAME; String portGroupCustomTemplateName=CustomConfigConstants.VMAX_HOST_PORT_GROUP_MASK_NAME; String exportType=ExportMaskUtils.getExportType(_dbClient,mask); if (ExportGroupType.Cluster.name().equals(exportType)) { cascadedIGCustomTemplateName=CustomConfigConstants.VMAX_CLUSTER_CASCADED_IG_MASK_NAME; initiatorGroupCustomTemplateName=CustomConfigConstants.VMAX_CLUSTER_INITIATOR_GROUP_MASK_NAME; cascadedSGCustomTemplateName=CustomConfigConstants.VMAX_CLUSTER_CASCADED_SG_MASK_NAME; portGroupCustomTemplateName=CustomConfigConstants.VMAX_CLUSTER_PORT_GROUP_MASK_NAME; } DataSource cascadedIGDataSource=ExportMaskUtils.getExportDatasource(storage,initiatorList,dataSourceFactory,cascadedIGCustomTemplateName); String cigName=customConfigHandler.getComputedCustomConfigValue(cascadedIGCustomTemplateName,storage.getSystemType(),cascadedIGDataSource); cigName=_helper.generateGroupName(_helper.getExistingInitiatorGroupsFromArray(storage),cigName); CIMObjectPath cascadedIG=createOrUpdateInitiatorGroups(storage,exportMaskURI,cigName,initiatorGroupCustomTemplateName,initiatorList,taskCompleter); if (cascadedIG == null) { return; } DataSource cascadedSGDataSource=ExportMaskUtils.getExportDatasource(storage,initiatorList,dataSourceFactory,cascadedSGCustomTemplateName); String csgName=customConfigHandler.getComputedCustomConfigValue(cascadedSGCustomTemplateName,storage.getSystemType(),cascadedSGDataSource); DataSource portGroupDataSource=ExportMaskUtils.getExportDatasource(storage,initiatorList,dataSourceFactory,portGroupCustomTemplateName); String pgGroupName=customConfigHandler.getComputedCustomConfigValue(portGroupCustomTemplateName,storage.getSystemType(),portGroupDataSource); pgGroupName=_helper.generateGroupName(_helper.getExistingPortGroupsFromArray(storage),pgGroupName); CIMObjectPath targetPortGroupPath=createTargetPortGroup(storage,pgGroupName,targetURIList,taskCompleter); CIMObjectPath volumeParentGroupPath=storage.checkIfVmax3() ? createOrSelectSLOBasedStorageGroup(storage,exportMaskURI,initiatorList,volumeURIHLUs,csgName,newlyCreatedChildVolumeGroups,taskCompleter) : createOrSelectStorageGroup(storage,exportMaskURI,initiatorList,volumeURIHLUs,csgName,newlyCreatedChildVolumeGroups,taskCompleter); createMaskingView(storage,exportMaskURI,maskingViewName,volumeParentGroupPath,volumeURIHLUs,targetPortGroupPath,cascadedIG,taskCompleter); } catch ( Exception e) { _log.error(String.format("createExportMask failed - maskName: %s",exportMaskURI.toString()),e); ServiceError serviceError=DeviceControllerException.errors.jobFailed(e); taskCompleter.error(_dbClient,serviceError); } _log.info("{} createExportMask END...",storage.getSerialNumber()); }
This implementation will attempt to create a MaskingView on the VMAX with the associated elements. The goal of this is to create a MaskingView per compute resource. A compute resource is either a host or a cluster. A host is a single entity with multiple initiators. A cluster is an entity consisting of multiple hosts. The idea is to maintain 1 MaskingView to 1 compute resource, regardless of the number of ViPR Export*Groups* that are created. An Export*Mask* will map to a MaskingView.
public void installLinearModels() throws Exception { Evaluation nodeModelEval; if (m_isLeaf) { buildLinearModel(m_indices); } else { if (m_left != null) { m_left.installLinearModels(); } if (m_right != null) { m_right.installLinearModels(); } buildLinearModel(m_indices); } nodeModelEval=new Evaluation(m_instances); nodeModelEval.evaluateModel(m_nodeModel,m_instances); m_rootMeanSquaredError=nodeModelEval.rootMeanSquaredError(); if (!m_saveInstances) { m_instances=new Instances(m_instances,0); } }
Traverses the tree and installs linear models at each node. This method must be called if pruning is not to be performed.
public InventoryView(Inventory parent,int[] slots){ this.parent=parent; this.slots=slots; }
Creates new inventory view
default <K,A,D>Traversable<Tuple2<K,D>> grouped(final Function<? super T,? extends K> classifier,final Collector<? super T,A,D> downstream){ return traversable().grouped(classifier,downstream); }
Group this Traversable by the provided classifying function and collected by the provided Collector
private VarSymbol enterConstant(String name,Type type){ VarSymbol c=new VarSymbol(PUBLIC | STATIC | FINAL,names.fromString(name),type,predefClass); c.setData(type.constValue()); predefClass.members().enter(c); return c; }
Enter a constant into symbol table.
public static int removeTransitRoutesWithoutLinkSequences(TransitSchedule schedule){ log.info("... Removing transit routes without link sequences"); int removed=0; for ( TransitLine transitLine : schedule.getTransitLines().values()) { for ( TransitRoute transitRoute : new HashSet<>(transitLine.getRoutes().values())) { boolean removeRoute=false; NetworkRoute networkRoute=transitRoute.getRoute(); if (networkRoute == null) { removeRoute=true; } List<Id<Link>> linkIds=ScheduleTools.getTransitRouteLinkIds(transitRoute); if (linkIds.size() == 0) { removeRoute=true; } else { for ( Id<Link> linkId : linkIds) { if (linkId == null) { removeRoute=true; } } } if (removeRoute) { transitLine.removeRoute(transitRoute); removed++; } } } log.info("... " + removed + " transit routes removed"); return removed; }
Removes routes without link sequences
@Override public void addPropertyChangeListener(PropertyChangeListener listener){ m_propSupport.addPropertyChangeListener(listener); }
Adds an object to the list of those that wish to be informed when the cost matrix changes.
public InputStreamImpl(){ }
Initializes a new <tt>TCPInputStream</tt>.
public TObjectFloatHashMap(int initialCapacity,float loadFactor){ super(initialCapacity,loadFactor); }
Creates a new <code>TObjectFloatHashMap</code> instance with a prime capacity equal to or greater than <tt>initialCapacity</tt> and with the specified load factor.
public void write(byte[] buffer,int offset,int length,boolean isEnd) throws IOException { _crc=Crc64.generate(_crc,buffer,offset,length); _next.write(buffer,offset,length,isEnd); }
Writes a buffer to the underlying stream.
public static InlineMethodRefactoring create(ITypeRoot unit,CompilationUnit node,int selectionStart,int selectionLength){ ASTNode target=RefactoringAvailabilityTester.getInlineableMethodNode(unit,node,selectionStart,selectionLength); if (target == null) return null; if (target.getNodeType() == ASTNode.METHOD_DECLARATION) { return new InlineMethodRefactoring(unit,(MethodDeclaration)target,selectionStart,selectionLength); } else { ICompilationUnit cu=(ICompilationUnit)unit; if (target.getNodeType() == ASTNode.METHOD_INVOCATION) { return new InlineMethodRefactoring(cu,(MethodInvocation)target,selectionStart,selectionLength); } else if (target.getNodeType() == ASTNode.SUPER_METHOD_INVOCATION) { return new InlineMethodRefactoring(cu,(SuperMethodInvocation)target,selectionStart,selectionLength); } else if (target.getNodeType() == ASTNode.CONSTRUCTOR_INVOCATION) { return new InlineMethodRefactoring(cu,(ConstructorInvocation)target,selectionStart,selectionLength); } } return null; }
Creates a new inline method refactoring
private void readResponseHeaders(State state,InnerState innerState,HttpResponse response) throws StopRequest { Header header=response.getFirstHeader("Content-Disposition"); if (header != null) { innerState.mHeaderContentDisposition=header.getValue(); } header=response.getFirstHeader("Content-Location"); if (header != null) { innerState.mHeaderContentLocation=header.getValue(); } header=response.getFirstHeader("ETag"); if (header != null) { innerState.mHeaderETag=header.getValue(); } String headerTransferEncoding=null; header=response.getFirstHeader("Transfer-Encoding"); if (header != null) { headerTransferEncoding=header.getValue(); } String headerContentType=null; header=response.getFirstHeader("Content-Type"); if (header != null) { headerContentType=header.getValue(); if (!headerContentType.equals("application/vnd.android.obb")) { throw new StopRequest(DownloaderService.STATUS_FILE_DELIVERED_INCORRECTLY,"file delivered with incorrect Mime type"); } } if (headerTransferEncoding == null) { header=response.getFirstHeader("Content-Length"); if (header != null) { innerState.mHeaderContentLength=header.getValue(); long contentLength=Long.parseLong(innerState.mHeaderContentLength); if (contentLength != -1 && contentLength != mInfo.mTotalBytes) { Log.e(Constants.TAG,"Incorrect file size delivered."); } } } else { if (Constants.LOGVV) { Log.v(Constants.TAG,"ignoring content-length because of xfer-encoding"); } } if (Constants.LOGVV) { Log.v(Constants.TAG,"Content-Disposition: " + innerState.mHeaderContentDisposition); Log.v(Constants.TAG,"Content-Length: " + innerState.mHeaderContentLength); Log.v(Constants.TAG,"Content-Location: " + innerState.mHeaderContentLocation); Log.v(Constants.TAG,"ETag: " + innerState.mHeaderETag); Log.v(Constants.TAG,"Transfer-Encoding: " + headerTransferEncoding); } boolean noSizeInfo=innerState.mHeaderContentLength == null && (headerTransferEncoding == null || !headerTransferEncoding.equalsIgnoreCase("chunked")); if (noSizeInfo) { throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR,"can't know size of download, giving up"); } }
Read headers from the HTTP response and store them into local state.
@DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-09-03 14:59:52.813 -0400",hash_original_method="0829B6DA23F89F75CF76B7CF84C00C9F",hash_generated_method="E8E4BDB926E9E2747B073CF25256C0EE") @Override public boolean markSupported(){ return markSupported; }
Indicates whether <i>mark</i> is supported.
void print() throws Exception { Language language=Language.getLoginLanguage(); MPrintFormat pf=null; int pfid=0; RowSet pfrs=MPrintFormat.getAccessiblePrintFormats(MTable.getTable_ID(X_RV_PP_Product_BOMLine_Storage_TableName),-1,null); pfrs.next(); pfid=pfrs.getInt("AD_PrintFormat_ID"); if (pfrs.getInt("AD_Client_ID") != 0) pf=MPrintFormat.get(getCtx(),pfid,false); else pf=MPrintFormat.copyToClient(getCtx(),pfid,getAD_Client_ID()); pfrs.close(); if (pf == null) raiseError("Error: ","No Print Format"); pf.setLanguage(language); pf.setTranslationLanguage(language); MQuery query=new MQuery(X_RV_PP_Product_BOMLine_Storage_TableName); query.addRestriction(X_T_BOMLine.COLUMNNAME_AD_PInstance_ID,MQuery.EQUAL,AD_PInstance_ID,getParamenterName(X_T_BOMLine.COLUMNNAME_AD_PInstance_ID),getParamenterInfo(X_T_BOMLine.COLUMNNAME_AD_PInstance_ID)); query.addRestriction(X_T_BOMLine.COLUMNNAME_M_Warehouse_ID,MQuery.EQUAL,p_M_Warehouse_ID,getParamenterName(X_T_BOMLine.COLUMNNAME_M_Warehouse_ID),getParamenterInfo(X_T_BOMLine.COLUMNNAME_M_Warehouse_ID)); query.addRestriction(X_T_BOMLine.COLUMNNAME_M_Warehouse_ID,MQuery.EQUAL,p_M_Warehouse_ID,getParamenterName("DateTrx"),getParamenterInfo("DateTrx")); PrintInfo info=new PrintInfo(X_RV_PP_Product_BOMLine_Storage_TableName,MTable.getTable_ID(X_RV_PP_Product_BOMLine_Storage_TableName),getRecord_ID()); ReportEngine re=new ReportEngine(getCtx(),pf,query,info); ReportCtl.preview(re); while (re.getView().isDisplayable()) { Env.sleep(1); } }
Print result generate for this report
public static String toString(Object[] self){ return toArrayString(self); }
Returns the string representation of this array's contents.
private static boolean isDebugging(List<String> arguments){ for ( final String argument : arguments) { if ("-Xdebug".equals(argument)) { return true; } else if (argument.startsWith("-agentlib:jdwp")) { return true; } } return false; }
Parses arguments passed to the runtime environment for debug flags <p> Options specified in: <ul> <li> <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/jpda/conninv.html#Invocation" >javase-6</a></li> <li><a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jpda/conninv.html#Invocation" >javase-7</a></li> <li><a href="http://docs.oracle.com/javase/8/docs/technotes/guides/jpda/conninv.html#Invocation" >javase-8</a></li>
void checkIntersection(Coordinate[] pt,int expectedIntersectionNum,Coordinate[] expectedIntPt,double distanceTolerance){ LineIntersector li=new RobustLineIntersector(); li.computeIntersection(pt[0],pt[1],pt[2],pt[3]); int intNum=li.getIntersectionNum(); assertEquals("Number of intersections not as expected",expectedIntersectionNum,intNum); if (expectedIntPt != null) { assertEquals("Wrong number of expected int pts provided",intNum,expectedIntPt.length); boolean isIntPointsCorrect=true; if (intNum == 1) { checkIntPoints(expectedIntPt[0],li.getIntersection(0),distanceTolerance); } else if (intNum == 2) { checkIntPoints(expectedIntPt[1],li.getIntersection(0),distanceTolerance); checkIntPoints(expectedIntPt[1],li.getIntersection(0),distanceTolerance); if (!(equals(expectedIntPt[0],li.getIntersection(0),distanceTolerance) || equals(expectedIntPt[0],li.getIntersection(1),distanceTolerance))) { checkIntPoints(expectedIntPt[0],li.getIntersection(0),distanceTolerance); checkIntPoints(expectedIntPt[0],li.getIntersection(1),distanceTolerance); } else if (!(equals(expectedIntPt[1],li.getIntersection(0),distanceTolerance) || equals(expectedIntPt[1],li.getIntersection(1),distanceTolerance))) { checkIntPoints(expectedIntPt[1],li.getIntersection(0),distanceTolerance); checkIntPoints(expectedIntPt[1],li.getIntersection(1),distanceTolerance); } } } }
Check that intersection of segment defined by points in pt array is equal to the expectedIntPt value (up to the given distanceTolerance).
private boolean isSerializable(ClassSymbol c){ try { syms.serializableType.complete(); } catch ( CompletionFailure e) { return false; } return types.isSubtype(c.type,syms.serializableType); }
check if a class is a subtype of Serializable, if that is available.
private void buildViewForMeasuring(){ if (itemsLayout != null) { recycle.recycleItems(itemsLayout,firstItem,new ItemsRange()); } else { createItemsLayout(); } int addItems=visibleItems / 2; for (int i=currentItem + addItems; i >= currentItem - addItems; i--) { if (addViewItem(i,true)) { firstItem=i; } } }
Builds view for measuring
public void encode(OutputStream out) throws IOException { super.encode(out,PKIXExtensions.FreshestCRL_Id,false); }
Writes the extension to the DerOutputStream.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-02-26 10:48:13.818 -0500",hash_original_method="40648F605301A4EB71E07CB04AC75C75",hash_generated_method="AA3F70A8E211E79ACDAEAE4333F4F589") @DSVerified @DSSafe(DSCat.SAFE_OTHERS) public Builder(int pageWidth,int pageHeight,int pageNumber){ if (pageWidth <= 0) { throw new IllegalArgumentException("page width must be positive"); } if (pageHeight <= 0) { throw new IllegalArgumentException("page width must be positive"); } if (pageNumber < 0) { throw new IllegalArgumentException("pageNumber must be non negative"); } mPageInfo.mPageWidth=pageWidth; mPageInfo.mPageHeight=pageHeight; mPageInfo.mPageNumber=pageNumber; }
Creates a new builder with the mandatory page info attributes.
public static double PPVNPVrawFitness(boolean useTrainingData,GEPIndividual ind,int chromosomeNum){ int confusionMatrix[]=getConfusionMatrixValues(useTrainingData,ind,chromosomeNum); int truePositives=confusionMatrix[0]; int falseNegatives=confusionMatrix[1]; int falsePositives=confusionMatrix[2]; int trueNegatives=confusionMatrix[3]; int TPplusFP=truePositives + falsePositives; int TNplusFN=trueNegatives + falseNegatives; if (TPplusFP == 0 || TNplusFN == 0) return 0.0; double PPV=(double)truePositives / (double)TPplusFP; double NPV=(double)trueNegatives / (double)TNplusFN; return (PPV * NPV); }
Calculates the 'raw' fitness for the PPVNPV (Positive Predictive Value / Negative Predictive Value ) type fitness (before the normalization from 0 to max value is done).
public OperationNotPermittedException(String message,ApplicationExceptionBean bean){ super(message,bean); }
Constructs a new exception with the specified detail message and bean for JAX-WS exception serialization.
private void configureApiBinding(){ bind(KeyBindingAgent.class).to(KeyBindingManager.class).in(Singleton.class); bind(SelectionAgent.class).to(SelectionAgentImpl.class).asEagerSingleton(); bind(WorkspaceAgent.class).to(WorkspacePresenter.class).in(Singleton.class); bind(IconRegistry.class).to(IconRegistryImpl.class).in(Singleton.class); bind(EditorMultiPartStack.class).to(EditorMultiPartStackPresenter.class).in(Singleton.class); bind(ActionManager.class).to(ActionManagerImpl.class).in(Singleton.class); GinMultibinder<NodeInterceptor> nodeInterceptors=GinMultibinder.newSetBinder(binder(),NodeInterceptor.class); nodeInterceptors.addBinding().to(DefaultNodeInterceptor.class); bind(CommandTypeRegistry.class).to(CommandTypeRegistryImpl.class).in(Singleton.class); bind(MacroRegistry.class).to(MacroRegistryImpl.class).in(Singleton.class); bind(MacroProcessor.class).to(MacroProcessorImpl.class).in(Singleton.class); GinMultibinder<Macro> macrosBinder=GinMultibinder.newSetBinder(binder(),Macro.class); macrosBinder.addBinding().to(EditorCurrentFileNameMacro.class); macrosBinder.addBinding().to(EditorCurrentFilePathMacro.class); macrosBinder.addBinding().to(EditorCurrentFileRelativePathMacro.class); macrosBinder.addBinding().to(EditorCurrentProjectNameMacro.class); macrosBinder.addBinding().to(EditorCurrentProjectTypeMacro.class); macrosBinder.addBinding().to(ExplorerCurrentFileNameMacro.class); macrosBinder.addBinding().to(ExplorerCurrentFilePathMacro.class); macrosBinder.addBinding().to(ExplorerCurrentFileParentPathMacro.class); macrosBinder.addBinding().to(ExplorerCurrentFileRelativePathMacro.class); macrosBinder.addBinding().to(ExplorerCurrentProjectNameMacro.class); macrosBinder.addBinding().to(ExplorerCurrentProjectTypeMacro.class); macrosBinder.addBinding().to(WorkspaceNameMacro.class); }
API Bindings, binds API interfaces to the implementations
public UnsignedByte add(int increment){ return valueOf(getValue() + increment); }
Add a value. Note that this object is not changed, but a new one is created.
public void putNextEntry(ZipEntry e) throws IOException { ensureOpen(); if (current != null) { closeEntry(); } if (e.xdostime == -1) { e.setTime(System.currentTimeMillis()); } if (e.method == -1) { e.method=method; } e.flag=0; switch (e.method) { case DEFLATED: if (e.size == -1 || e.csize == -1 || e.crc == -1) e.flag=8; break; case STORED: if (e.size == -1) { e.size=e.csize; } else if (e.csize == -1) { e.csize=e.size; } else if (e.size != e.csize) { throw new ZipException("STORED entry where compressed != uncompressed size"); } if (e.size == -1 || e.crc == -1) { throw new ZipException("STORED entry missing size, compressed size, or crc-32"); } break; default : throw new ZipException("unsupported compression method"); } if (!names.add(e.name)) { throw new ZipException("duplicate entry: " + e.name); } if (zc.isUTF8()) e.flag|=EFS; current=new XEntry(e,written); xentries.add(current); writeLOC(current); }
Begins writing a new ZIP file entry and positions the stream to the start of the entry data. Closes the current entry if still active. The default compression method will be used if no compression method was specified for the entry, and the current time will be used if the entry has no set modification time.
public synchronized FileSetting createFileSetting(String key,File defaultValue){ String parentString=defaultValue.getParent(); if (parentString != null) { File parent=new File(parentString); if (!parent.isDirectory()) { parent.mkdirs(); } } FileSetting result=new FileSetting(DEFAULT_PROPS,PROPS,key,defaultValue); handleSettingInternal(result,null); return result; }
Creates a new <tt>FileSetting</tt> instance with the specified key and default value.