code
stringlengths
10
174k
nl
stringlengths
3
129k
public synchronized static void addGlobalUnitConverter(UnitConverter conv){ if (conv == null) throw new NullPointerException(); CONVERTERS.add(conv); }
Adds a global unit converter that can convert from some <code>unit</code> to pixels. <p> This converter will be asked before the platform converter so the values for it (e.g. "related" and "unrelated") can be overridden. It is however not possible to override the built in ones (e.g. "mm", "pixel" or "lp").
protected void validateVariables(TemplateVariable[] variables) throws TemplateException { }
Validates the variables in this context type. If a variable is not valid, e.g. if its type is not known in this context type, a <code>TemplateException</code> is thrown. <p> The default implementation does nothing. </p>
public static String fromUUID(UUID value,boolean withDashes){ return withDashes ? value.toString() : DASH_PAT.matcher(value.toString()).replaceAll(""); }
Returns String UUID representation.
public Sequence(){ this(Object.class); }
Constructs a new node for executing two expressions in sequence.
public HashCodeBuilder append(float value){ iTotal=iTotal * iConstant + Float.floatToIntBits(value); return this; }
<p> Append a <code>hashCode</code> for a <code>float</code>. </p>
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { doGet(request,response); }
Process the HTTP Post request
public void mouseReleased(MouseEvent e){ if (AWTEventMonitor.mouseListener_private != null) { AWTEventMonitor.mouseListener_private.mouseReleased(e); } }
Called when the mouse is released.
@Override public void configureZone(final StendhalRPZone zone,final Map<String,String> attributes){ buildThirdFloor(zone); }
Configure a zone.
public String insert(Boolean m_Client,Boolean m_User,Boolean m_Window,Boolean m_Org){ log.info(""); String m_UpdateResult; int no=0; m_UpdateResult=delete(m_Client,m_User,m_Window,m_Org); if (m_Value == null || m_Value.length() == 0) { if (DisplayType.isLookup(m_DisplayType)) m_Value="-1"; else if (DisplayType.isDate(m_DisplayType)) m_Value=" "; else { m_UpdateResult=m_UpdateResult + " Can not update record"; return m_UpdateResult; } } int Client_ID=m_Client ? m_AD_Client_ID : 0; int Org_ID=m_Org ? m_AD_Org_ID : 0; int AD_Preference_ID=DB.getNextID(m_ctx,"AD_Preference",null); StringBuffer sql=new StringBuffer("INSERT INTO AD_Preference (" + "AD_Preference_ID, AD_Client_ID, AD_Org_ID, IsActive, Created,CreatedBy,Updated,UpdatedBy," + "AD_Window_ID, AD_User_ID, Attribute, Value) VALUES ("); sql.append(AD_Preference_ID).append(",").append(Client_ID).append(",").append(Org_ID).append(", 'Y',SysDate,").append(m_AD_User_ID).append(",SysDate,").append(m_AD_User_ID).append(", "); if (m_Window) sql.append(m_AD_Window_ID).append(","); else sql.append("NULL,"); if (m_User) sql.append(m_AD_User_ID).append(","); else sql.append("NULL,"); sql.append(DB.TO_STRING(m_Attribute)).append(",").append(DB.TO_STRING(m_Value)).append(")"); log.fine(sql.toString()); no=DB.executeUpdate(sql.toString(),null); if (no > 0) m_UpdateResult=no + " Record Inserted"; else m_UpdateResult="Record not Inserted"; return m_UpdateResult; }
Save to Disk
public boolean checkPathSet(){ if (_beans.size() == 0) { return true; } for (int i=0; i < _beans.size(); i++) { if (!(_beans.get(i)).check()) { return false; } } return true; }
Check that the Path can be traversed. This means that any path elements are set to the proper state, e.g. that the Turnouts on this path are set to the proper CLOSED or OPEN status.
public boolean contains(Key key){ if (key == null) throw new NullPointerException("argument to contains() is null"); return get(key) != null; }
Does this symbol table contain the given key?
public static int divide(int dividend,int divisor){ return (int)(toLong(dividend) / toLong(divisor)); }
Returns dividend / divisor, where the dividend and divisor are treated as unsigned 32-bit quantities.
public void remove(String string){ checkWidget(); if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); int index=-1; for (int i=0, n=table.getItemCount(); i < n; i++) { if (table.getItem(i).getText().equals(string)) { index=i; break; } } remove(index); }
Searches the receiver's list starting at the first item until an item is found that is equal to the argument, and removes that item from the list.
public boolean isApproved(){ Object oo=get_Value(COLUMNNAME_IsApproved); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; }
Get Approved.
@HLEFunction(nid=0x1C90BECB,version=150) public int sctrlHENSetStartModuleHandler(TPointer startModuleHandler){ int previousStartModuleHandler=this.startModuleHandler; this.startModuleHandler=startModuleHandler.getAddress(); return previousStartModuleHandler; }
Sets a function to be called just before module_start of a module is gonna be called (useful for patching purposes)
public static DocSet toParents(DocSet childInput,BitDocSet parentList,QueryContext qcontext) throws IOException { FixedBitSet parentBits=parentList.getBits(); DocSetCollector collector=new DocSetCollector(qcontext.searcher().maxDoc()); DocIterator iter=childInput.iterator(); int currentParent=-1; while (iter.hasNext()) { int childDoc=iter.nextDoc(); if (childDoc <= currentParent) { continue; } currentParent=parentBits.nextSetBit(childDoc); if (currentParent != DocIdSetIterator.NO_MORE_DOCS) { collector.collect(currentParent); } } return collector.getDocSet(); }
childInput may also contain parents (i.e. a parent or below will all roll up to that parent)
public static void mySetSystemScope(IdentityScope scope){ IdentityScope.setSystemScope(scope); }
Sets the system's identity scope
@Override public void translate(final ITranslationEnvironment environment,final IInstruction instruction,final List<ReilInstruction> instructions) throws InternalTranslationException { Preconditions.checkNotNull(environment,"Error: Argument environment can't be null"); Preconditions.checkNotNull(instruction,"Error: Argument instruction can't be null"); Preconditions.checkNotNull(instructions,"Error: Argument instructions can't be null"); Preconditions.checkArgument(instruction.getOperands().size() == 2,"Error: Argument instruction is not a conditional move instruction (invalid number of operands)"); final long baseOffset=instruction.getAddress().toLong() * 0x100; long offset=baseOffset; final Pair<OperandSize,String> conditionResult=conditionGenerator.generate(environment,offset,instructions); final OperandSize conditionRegisterSize=conditionResult.first(); final String conditionRegister=conditionResult.second(); offset=baseOffset + instructions.size(); final String flippedCondition=environment.getNextVariableString(); instructions.add(ReilHelpers.createBisz(offset,conditionRegisterSize,conditionRegister,OperandSize.BYTE,flippedCondition)); final ArrayList<ReilInstruction> movCode=new ArrayList<ReilInstruction>(); Helpers.generateMov(environment,offset + 2,instruction,movCode); final long lastOffset=instructions.size() + movCode.size() + 1; final String jmpGoal=String.format("%d.%d",instruction.getAddress().toLong(),lastOffset); instructions.add(ReilHelpers.createJcc(offset + 1,OperandSize.BYTE,flippedCondition,OperandSize.ADDRESS,jmpGoal)); instructions.addAll(movCode); offset=baseOffset + instructions.size(); instructions.add(ReilHelpers.createNop(offset)); }
Translates a Cmovcc instruction to REIL code.
@Override public final void preTearDown() throws Exception { this.expectedEx=IgnoredException.addIgnoredException(ServerConnectivityException.class.getName()); vm0.invoke(null); vm1.invoke(null); }
Closes the cache on server and client
@SuppressWarnings("unchecked") @Override public void initGui(){ autoMaximize=WurstClient.INSTANCE.files.loadAutoMaximize(); buttonList.clear(); buttonList.add(new GuiButton(0,width / 2 - 100,height / 4 + 144 - 16,200,20,"Back")); buttonList.add(new GuiButton(1,width / 2 - 154,height / 4 + 24 - 16,100,20,"Click Friends: " + (WurstClient.INSTANCE.options.middleClickFriends ? "ON" : "OFF"))); buttonList.add(new GuiButton(2,width / 2 - 154,height / 4 + 48 - 16,100,20,"Mod List: " + modListModes[WurstClient.INSTANCE.options.modListMode])); buttonList.add(new GuiButton(3,width / 2 - 154,height / 4 + 72 - 16,100,20,"AutoMaximize: " + (autoMaximize ? "ON" : "OFF"))); buttonList.add(new GuiButton(4,width / 2 - 154,height / 4 + 96 - 16,100,20,"Wurst News: " + (WurstClient.INSTANCE.options.wurstNews ? "ON" : "OFF"))); buttonList.add(new GuiButton(5,width / 2 - 154,height / 4 + 120 - 16,100,20,"Analytics: " + (WurstClient.INSTANCE.options.google_analytics.enabled ? "ON" : "OFF"))); buttonList.add(new GuiButton(6,width / 2 - 50,height / 4 + 24 - 16,100,20,"Keybinds")); buttonList.add(new GuiButton(7,width / 2 - 50,height / 4 + 48 - 16,100,20,"X-Ray Blocks")); buttonList.add(new GuiButton(8,width / 2 - 50,height / 4 + 72 - 16,100,20,"Zoom")); buttonList.add(new GuiButton(11,width / 2 + 54,height / 4 + 24 - 16,100,20,"Official Website")); buttonList.add(new GuiButton(12,width / 2 + 54,height / 4 + 48 - 16,100,20,"YouTube Channel")); buttonList.add(new GuiButton(13,width / 2 + 54,height / 4 + 72 - 16,100,20,"Twitter Page")); buttonList.add(new GuiButton(14,width / 2 + 54,height / 4 + 96 - 16,100,20,"FAQ")); buttonList.add(new GuiButton(15,width / 2 + 54,height / 4 + 120 - 16,100,20,"Bug Tracker")); ((GuiButton)buttonList.get(3)).enabled=!Minecraft.isRunningOnMac; }
Adds the buttons (and other controls) to the screen in question.
public EqualsResult append(final byte lhs,final byte rhs){ if (!isEqual) { return this; } isEqual=lhs == rhs; return this; }
<p>Test if two <code>byte</code>s are equal.</p>
protected void updateMarkSeenPermanent(){ setMarkSeenPermanent(computeMarkSeenPermanent()); }
Updates the markSeenPermanent.
public GridCacheDhtPreloadMultiThreadedSelfTest(){ super(false); }
Creates new test.
public boolean applyOptions() throws IOException { URLHandlerSettings.VIDEO_PLAYER.setValue(_playerField.getText()); return false; }
Applies the options currently set in this <tt>PaneItem</tt>.
public boolean copyFile(File destinationFolder,File fromFile){ boolean result=false; String toFileName=destinationFolder.getAbsolutePath() + "/" + fromFile.getName(); File toFile=new File(toFileName); FileInputStream from=null; FileOutputStream to=null; try { from=new FileInputStream(fromFile); to=new FileOutputStream(toFile); byte[] buffer=new byte[4096]; int bytesRead; while ((bytesRead=from.read(buffer)) != -1) to.write(buffer,0,bytesRead); } catch ( FileNotFoundException e) { e.printStackTrace(); } catch ( IOException e) { e.printStackTrace(); } finally { if (from != null) { try { from.close(); } catch ( IOException e2) { e2.printStackTrace(); } if (to != null) { try { to.close(); result=true; } catch ( IOException e3) { e3.printStackTrace(); } } } } return result; }
The method copies a given file to a given folder, instead of just relocating the file to the destination as is done with the <code>File.renameTo()</code> method.
public InputStream recieveFile() throws XMPPException { if (inputStream != null) { throw new IllegalStateException("Transfer already negotiated!"); } try { inputStream=negotiateStream(); } catch ( XMPPException e) { setException(e); throw e; } return inputStream; }
Negotiates the stream method to transfer the file over and then returns the negotiated stream.
public Config loadConfig(final String configfile){ Config config; if (configfile != null) { config=ConfigUtils.loadConfig(configfile); MatsimRandom.reset(config.global().getRandomSeed()); } else { config=new Config(); config.addCoreModules(); } createOutputDirectory(); config.controler().setOutputDirectory(this.outputDirectory); return config; }
Loads a configuration from file (or the default config if <code>configfile</code> is <code>null</code>).
void refCountChanged(Long address,boolean decRefCount,int rc){ if (!trackReferenceCounts()) return; final Object owner=refCountOwner.get(); if (owner == SKIP_REF_COUNT_TRACKING) { return; } List<RefCountChangeInfo> list=stacktraces.get(address); if (list == null) { List<RefCountChangeInfo> newList=new ArrayList<RefCountChangeInfo>(); refCountChangedTestHook(address,decRefCount,rc); List<RefCountChangeInfo> old=stacktraces.putIfAbsent(address,newList); if (old == null) { list=newList; } else { list=old; } } if (decRefCount) { if (owner != null) { synchronized (list) { for (int i=0; i < list.size(); i++) { RefCountChangeInfo info=list.get(i); if (owner instanceof RegionEntry) { if (owner == info.getOwner()) { if (info.getUseCount() > 0) { info.decUseCount(); } else { list.remove(i); } return; } } else if (owner.equals(info.getOwner())) { if (info.getUseCount() > 0) { info.decUseCount(); } else { list.remove(i); } return; } } } } } if (list == LOCKED) { MemoryAllocatorImpl.debugLog("refCount " + (decRefCount ? "deced" : "inced") + " after orphan detected for @"+ Long.toHexString(address),true); return; } RefCountChangeInfo info=new RefCountChangeInfo(decRefCount,rc,owner); synchronized (list) { for ( RefCountChangeInfo e : list) { if (e.isSameCaller(info)) { e.incUseCount(); return; } } list.add(info); } }
Used internally to report that a reference count has changed.
@Override public void onAction(){ onAction(ActionType.ATTACK); }
Perform the default action.
public void paintInternalFrameBackground(SynthContext context,Graphics g,int x,int y,int w,int h){ paintBackground(context,g,x,y,w,h,null); }
Paints the background of an internal frame.
@RpcMethod public void deleteDirectory(String directoryPath,String dataStore,AsyncMethodCallback<Host.AsyncClient.delete_directory_call> handler) throws RpcException { ensureClient(); DeleteDirectoryRequest deleteDirectoryRequest=new DeleteDirectoryRequest(dataStore,directoryPath); clientProxy.setTimeout(DELETE_DIRECTORY_TIMEOUT_MS); logger.info("delete_directory target {}, request {]",getHostIp(),deleteDirectoryRequest); try { clientProxy.delete_directory(deleteDirectoryRequest,handler); } catch ( TException e) { throw new RpcException(e); } }
This method performs a asynchronous Thrift call to delete a directory. On completion, the specified handler is invoked.
protected POInfo initPO(Properties ctx){ POInfo poi=POInfo.getPOInfo(ctx,Table_ID,get_TrxName()); return poi; }
Load Meta Data
@Override public boolean eIsSet(int featureID){ switch (featureID) { case UmplePackage.RECORD_ENTITY___ANONYMOUS_RECORD_ENTITY_11: return anonymous_recordEntity_1_1 != null && !anonymous_recordEntity_1_1.isEmpty(); case UmplePackage.RECORD_ENTITY___TRACE_RECORD_1: return TRACE_RECORD_1_EDEFAULT == null ? trace_record_1 != null : !TRACE_RECORD_1_EDEFAULT.equals(trace_record_1); case UmplePackage.RECORD_ENTITY___ANONYMOUS_RECORD_ENTITY_21: return anonymous_recordEntity_2_1 != null && !anonymous_recordEntity_2_1.isEmpty(); } return super.eIsSet(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
public Builder zkProxyDir(String zkProxyDir){ this.zkProxyDir=zkProxyDir; return this; }
Set codis proxy path on zk.
public void loadSettingsFromJson(){ synchronized (LOCK) { loadSettingsFromJson(defaultFile); for ( String fileName : files) { loadSettingsFromJson(fileName); } } }
Loads the settings from a JSON file.
public void updateWithParameters(MapBean mapBean){ Proj projection=(Proj)mapBean.getProjection(); Object suggested=getSuggested(PROJECTION_TYPE); if (suggested instanceof Class && suggested != projection.getClass()) { projection=(Proj)mapBean.getProjectionFactory().makeProjection((Class<? extends Projection>)suggested,projection.getCenter(),projection.getScale(),projection.getWidth(),projection.getHeight()); } suggested=getSuggested(CENTER); if (suggested instanceof Point2D) { projection.setCenter((Point2D)suggested); } suggested=getSuggested(SCALE); if (suggested instanceof Number) { projection.setScale(((Number)suggested).floatValue()); } mapBean.setProjection(projection); }
A helper function for the MapBean. The Exception object can update the projection for a MapBean, and then call MapBean.setProjection() with the new settings. This method was intended to be called from the MapBean.fireProjectionChange() method after this Exception has been caught, and can be overridden for new/updated Projection types and for different suggestion parameters that may be contained in the Exception properties.
public synchronized void writeTo(OutputStream out) throws IOException { int remaining=count; for ( byte[] buf : buffers) { int c=Math.min(buf.length,remaining); out.write(buf,0,c); remaining-=c; if (remaining == 0) { break; } } }
Writes the entire contents of this byte stream to the specified output stream.
public UnweightedGraph(List<Edge> edges,int numberOfVertices){ super(edges,numberOfVertices); }
Construct a graph from integer vertices 0, 1, 2 and edge list
@Override public ScoringFunction createNewScoringFunction(Person person){ final CharyparNagelScoringParameters parameters=this.params.getScoringParameters(person); SumScoringFunction sumScoringFunction=new SumScoringFunction(); sumScoringFunction.addScoringFunction(new CharyparNagelActivityScoring(parameters)); sumScoringFunction.addScoringFunction(new CharyparNagelLegScoring(parameters,this.network)); sumScoringFunction.addScoringFunction(new CharyparNagelMoneyScoring(parameters)); sumScoringFunction.addScoringFunction(new CharyparNagelAgentStuckScoring(parameters)); return sumScoringFunction; }
In every iteration, the framework creates a new ScoringFunction for each Person. A ScoringFunction is much like an EventHandler: It reacts to scoring-relevant events by accumulating them. After the iteration, it is asked for a score value. Since the factory method gets the Person, it can create a ScoringFunction which depends on Person attributes. This implementation does not. <li>The fact that you have a person-specific scoring function does not mean that the "creative" modules (such as route choice) are person-specific. This is not a bug but a deliberate design concept in order to reduce the consistency burden. Instead, the creative modules should generate a diversity of possible solutions. In order to do a better job, they may (or may not) use person-specific info. kai, apr'11 </ul>
public void clear(){ oredCriteria.clear(); orderByClause=null; distinct=false; }
This method was generated by MyBatis Generator. This method corresponds to the database table PUBLIC.SAMPLETABLE2
public String planned(Properties ctx,int WindowNo,GridTab mTab,GridField mField,Object value){ if (isCalloutActive() || value == null) return ""; BigDecimal PlannedQty, PlannedPrice; int StdPrecision=Env.getContextAsInt(ctx,WindowNo,"StdPrecision"); PlannedQty=(BigDecimal)mTab.getValue("PlannedQty"); if (PlannedQty == null) PlannedQty=Env.ONE; PlannedPrice=((BigDecimal)mTab.getValue("PlannedPrice")); if (PlannedPrice == null) PlannedPrice=Env.ZERO; BigDecimal PlannedAmt=PlannedQty.multiply(PlannedPrice); if (PlannedAmt.scale() > StdPrecision) PlannedAmt=PlannedAmt.setScale(StdPrecision,BigDecimal.ROUND_HALF_UP); log.fine("PlannedQty=" + PlannedQty + " * PlannedPrice="+ PlannedPrice+ " -> PlannedAmt="+ PlannedAmt+ " (Precision="+ StdPrecision+ ")"); mTab.setValue("PlannedAmt",PlannedAmt); return ""; }
Project Planned - Price + Qty. - called from PlannedPrice, PlannedQty - calculates PlannedAmt (same as Trigger)
public String sizeTipText(){ return "Size of the compressed matrix. Should be \n" + "less than the number of labels and more than 1."; }
The tooltip for the size.
@Override protected void initialize(){ super.initialize(); m_Processor=new MarkdownProcessor(); }
Initializes the members.
private void temporarilyDisableUnsupportedSettings(Preferences preferences){ NotificationsPrefs notification=preferences.getNotification(); notification.setFriendOnlineSoundEnabled(false); notification.setFriendOfflineSoundEnabled(false); notification.setFriendOfflineSoundEnabled(false); notification.setFriendPlaysGameSoundEnabled(false); notification.setFriendPlaysGameToastEnabled(false); }
Disables preferences that should not be enabled since they are not supported yet.
@Override public boolean eIsSet(int featureID){ switch (featureID) { case StextPackage.IMPORT_SCOPE__IMPORTS: return imports != null && !imports.isEmpty(); } return super.eIsSet(featureID); }
<!-- begin-user-doc --> <!-- end-user-doc -->
@Field(42) public Pointer<Long> pullVal(){ return this.io.getPointerField(this,42); }
VT_BYREF|VT_UI8<br> C type : ULONGLONG
public void resetRecipes(){ clearRecipes(); loadRecipes(); dynamicRecipes.add(new DynamicRecipe(new GlowBannerMatcher())); dynamicRecipes.add(new DynamicRecipe(new GlowBannerCopyMatcher())); dynamicRecipes.add(new DynamicRecipe(new GlowRepairMatcher())); dynamicRecipes.add(new DynamicRecipe(new GlowArmorDyeMatcher())); dynamicRecipes.add(new DynamicRecipe(new GlowChargeMatcher())); dynamicRecipes.add(new DynamicRecipe(new GlowChargeFadeMatcher())); dynamicRecipes.add(new DynamicRecipe(new GlowFireworkMatcher())); dynamicRecipes.add(new DynamicRecipe(new GlowBookCopyMatcher())); dynamicRecipes.add(new DynamicRecipe(new GlowMapCopyMatcher())); dynamicRecipes.add(new DynamicRecipe(new GlowMapZoomMatcher())); furnaceFuels.put(Material.COAL,1600); furnaceFuels.put(Material.WOOD,300); furnaceFuels.put(Material.SAPLING,100); furnaceFuels.put(Material.STICK,100); furnaceFuels.put(Material.FENCE,300); furnaceFuels.put(Material.WOOD_STAIRS,300); furnaceFuels.put(Material.TRAP_DOOR,300); furnaceFuels.put(Material.LOG,300); furnaceFuels.put(Material.WORKBENCH,300); furnaceFuels.put(Material.BOOKSHELF,300); furnaceFuels.put(Material.CHEST,300); furnaceFuels.put(Material.JUKEBOX,300); furnaceFuels.put(Material.NOTE_BLOCK,300); furnaceFuels.put(Material.LAVA_BUCKET,20000); furnaceFuels.put(Material.COAL_BLOCK,16000); furnaceFuels.put(Material.BLAZE_ROD,2400); furnaceFuels.put(Material.WOOD_PLATE,300); furnaceFuels.put(Material.FENCE_GATE,300); furnaceFuels.put(Material.TRAPPED_CHEST,300); furnaceFuels.put(Material.DAYLIGHT_DETECTOR,300); furnaceFuels.put(Material.DAYLIGHT_DETECTOR_INVERTED,300); furnaceFuels.put(Material.BANNER,300); furnaceFuels.put(Material.WOOD_AXE,200); furnaceFuels.put(Material.WOOD_HOE,200); furnaceFuels.put(Material.WOOD_PICKAXE,200); furnaceFuels.put(Material.WOOD_SPADE,200); furnaceFuels.put(Material.WOOD_SWORD,200); furnaceFuels.put(Material.WOOD_STEP,150); }
Reset the crafting recipe lists to their default states.
public int next(){ int node=_currentNode; if (node == DTM.NULL) return DTM.NULL; final int nodeType=_nodeType; if (nodeType != DTM.ELEMENT_NODE) { while (node != DTM.NULL && _exptype2(node) != nodeType) { node=_nextsib2(node); } } else { int eType; while (node != DTM.NULL) { eType=_exptype2(node); if (eType >= DTM.NTYPES) break; else node=_nextsib2(node); } } if (node == DTM.NULL) { _currentNode=DTM.NULL; return DTM.NULL; } else { _currentNode=_nextsib2(node); return returnNode(makeNodeHandle(node)); } }
Get the next node in the iteration.
public void pick(String text,int x,int y,int textLineHeight,DrawContext dc,PickSupport pickSupport,Object refObject,Position refPosition){ if (text == null) { String msg=Logging.getMessage("nullValue.StringIsNull"); Logging.logger().severe(msg); throw new IllegalArgumentException(msg); } if (dc == null) { String msg=Logging.getMessage("nullValue.DrawContextIsNull"); Logging.logger().severe(msg); throw new IllegalArgumentException(msg); } if (pickSupport == null) { String msg=Logging.getMessage("nullValue.PickSupportIsNull"); Logging.logger().severe(msg); throw new IllegalArgumentException(msg); } String[] lines=text.split("\n"); for ( String line : lines) { int xAligned=x; if (this.textAlign.equals(AVKey.CENTER)) xAligned=x - (int)(this.textRenderer.getBounds(line).getWidth() / 2); else if (this.textAlign.equals(AVKey.RIGHT)) xAligned=x - (int)(this.textRenderer.getBounds(line).getWidth()); y-=textLineHeight; drawLineWithUniqueColors(line,xAligned,y,dc,pickSupport,refObject,refPosition); y-=this.lineSpacing; } }
Draw text with unique colors word bounding rectangles and add each as a pickable object to the provided PickSupport instance.
public final void testAddAllHelperTextIdsFromCollection(){ CharSequence helperText1=getContext().getText(android.R.string.cancel); CharSequence helperText2=getContext().getText(android.R.string.copy); Collection<Integer> helperTextIds=new LinkedList<>(); helperTextIds.add(android.R.string.cancel); helperTextIds.add(android.R.string.copy); PasswordEditText passwordEditText=new PasswordEditText(getContext()); passwordEditText.addAllHelperTextIds(helperTextIds); passwordEditText.addAllHelperTextIds(helperTextIds); Collection<CharSequence> helperTexts=passwordEditText.getHelperTexts(); assertEquals(helperTextIds.size(),helperTexts.size()); Iterator<CharSequence> iterator=helperTexts.iterator(); assertEquals(helperText1,iterator.next()); assertEquals(helperText2,iterator.next()); }
Tests the functionality of the method, which allows to add all helper texts by the ids, which are contained by a collection.
public boolean matchRegex(String pattern,String input){ return new RegexValidator(pattern).isValid(input); }
Checks if the value matches the regular expression.
public void addRow(int before){ int size=(rows + 1) * cols; float[] x=new float[size]; float[] y=new float[size]; rows++; int i=0; int j=0; for (int row=0; row < rows; row++) { for (int col=0; col < cols; col++) { int k=j + col; int l=i + col; if (row == before) { x[k]=(xGrid[l] + xGrid[k]) / 2; y[k]=(yGrid[l] + yGrid[k]) / 2; } else { x[k]=xGrid[l]; y[k]=yGrid[l]; } } if (row != before - 1) i+=cols; j+=cols; } xGrid=x; yGrid=y; }
Add a new row to the grid. "before" must be in the range 1..rows-1. i.e. you can only add rows inside the grid.
public void testGetSpeed_large(){ testSpeed(99,100); }
Tests when the slow speed and the normal speed are both large number. E.g., 99 and 100.
public static String fromTag(IntArrayTag tag){ StringBuilder builder=new StringBuilder(); builder.append(ARRAY_START); boolean start=true; for ( int value : tag.getValue()) { IntTag i=new IntTag(value); if (start) { start=false; } else { builder.append(ELEMENT_SEPERATOR); } builder.append(fromTag(i)); } builder.append(ARRAY_END); return builder.toString(); }
Creates a Mojangson string from the given IntArray Tag.
public String street(){ return street; }
Returns the address street. This string also may contain the house number.
public CProjectNodeComponent(final JTree projectTree,final IDatabase database,final INaviProject project,final IViewContainer container){ super(new BorderLayout()); Preconditions.checkNotNull(projectTree,"IE01985: Project tree argument can not be null"); m_project=Preconditions.checkNotNull(project,"IE01986: Project argument can't be null"); m_database=Preconditions.checkNotNull(database,"IE01987: Database argument can't be null"); final CDefaultFieldDescription<String> nameInfo=new CDefaultFieldDescription<String>(project.getConfiguration().getName(),new CNameHelp()); final CDefaultFieldDescription<String> descriptionInfo=new CDefaultFieldDescription<String>(project.getConfiguration().getDescription(),new CDescriptionHelp()); final CDefaultFieldDescription<Date> creationInfo=new CDefaultFieldDescription<Date>(project.getConfiguration().getCreationDate(),new CCreationDateHelp()); final CDefaultFieldDescription<Date> modificationInfo=new CDefaultFieldDescription<Date>(project.getConfiguration().getModificationDate(),new CModificationDateHelp()); m_stdEditPanel=new CStandardEditPanel("Project",nameInfo,descriptionInfo,creationInfo,modificationInfo); m_checkedListPanel=new JPanel(new BorderLayout()); m_table=new CAddressSpacesTable(projectTree,database,m_project,container); m_titledBorder=new TitledBorder(getBorderText()); createGui(); m_database.getContent().getDebuggerTemplateManager().addListener(m_debuggerManagerListener); project.addListener(m_projectListener); m_checkedList.addListSelectionListener(m_updateListener); m_stdEditPanel.addInputListener(m_updateListener); updateSaveButton(); }
Creates a new component object.
public static double beta(double z,double w){ return exp(lnBeta(z,w)); }
Computes the Beta function B(z,w)
@Override public boolean isNativeLookAndFeel(){ return false; }
Returns false, SynthLookAndFeel is not a native look and feel.
public synchronized void removeAllElements(){ modCount++; for (int i=0; i < elementCount; i++) { elementData[i]=null; } elementCount=0; }
Removes all components from this vector and sets its size to zero.<p> This method is identical in functionality to the clear method (which is part of the List interface).
public StunFailureEvent(StunStack stunStack,Message message,TransportAddress localAddress,Throwable cause){ super(stunStack,localAddress,message); this.cause=cause; }
Constructs a <tt>StunFailureEvent</tt> according to the specified message.
public static void main(String[] args) throws UnknownHostException { SpringApplication app=new SpringApplication(Application.class); app.setShowBanner(false); SimpleCommandLinePropertySource source=new SimpleCommandLinePropertySource(args); addDefaultProfile(app,source); addLiquibaseScanPackages(); Environment env=app.run(args).getEnvironment(); log.info("Access URLs:\n----------------------------------------------------------\n\t" + "Local: \t\thttp://127.0.0.1:{}\n\t" + "External: \thttp://{}:{}\n----------------------------------------------------------",env.getProperty("server.port"),InetAddress.getLocalHost().getHostAddress(),env.getProperty("server.port")); }
Main method, used to run the application.
private static void createRates(Properties ctx){ s_conversions=new CCache<Point,BigDecimal>("C_UOMConversion",20); String sql=MRole.getDefault(ctx,false).addAccessSQL("SELECT C_UOM_ID, C_UOM_To_ID, MultiplyRate, DivideRate " + "FROM C_UOM_Conversion " + "WHERE IsActive='Y' AND M_Product_ID IS NULL","C_UOM_Conversion",MRole.SQL_NOTQUALIFIED,MRole.SQL_RO); PreparedStatement pstmt=null; ResultSet rs=null; try { pstmt=DB.prepareStatement(sql,null); rs=pstmt.executeQuery(); while (rs.next()) { Point p=new Point(rs.getInt(1),rs.getInt(2)); BigDecimal mr=rs.getBigDecimal(3); BigDecimal dr=rs.getBigDecimal(4); if (mr != null) s_conversions.put(p,mr); if (dr == null && mr != null) dr=Env.ONE.divide(mr,BigDecimal.ROUND_HALF_UP); if (dr != null) s_conversions.put(new Point(p.y,p.x),dr); } } catch ( SQLException e) { s_log.log(Level.SEVERE,sql,e); } finally { DB.close(rs,pstmt); rs=null; pstmt=null; } }
Create Conversion Matrix (Client)
public BuildStep(Vertex vtx,int res){ vertex=vtx; if (vertex != null) { cert=vertex.getCertificate(); throwable=vertex.getThrowable(); } result=res; }
construct a BuildStep
protected void focusedComponentChanged(Component component,@Nullable final AWTEvent cause){ }
Override this method to get notifications about focus. <code>FocusWatcher</code> invokes this method each time one of the populated component gains focus. All "temporary" focus event are ignored.
public boolean isDisabledForEdit(){ return (marketplaceId == null || marketplaceId.equals("0")); }
Returns whether a marketplace id is selected. <p> This function can be used to control the disable state of UI components.
@Override public boolean isAuthorizationStale(String header){ return false; }
Check if the header indicates that the current auth. parameters are stale. If so, then replace the relevant field with the new value and return true. Otherwise return false. returning true means the request can be retried with the same userid/password returning false means we have to go back to the user to ask for a new username password.
public AnnotationVisitor visitAnnotation(String desc,boolean visible){ if (fv != null) { return fv.visitAnnotation(desc,visible); } return null; }
Visits an annotation of the field.
public void addCPUTime(long delta){ cpuTime.addAndGet(delta); }
Adds CPU time.
public static long generateNonce(){ long nonce=RANDOM.nextLong(); sKnownNonces.add(nonce); return nonce; }
Generates a nonce (a random number used once).
private boolean skipToNextSync(ParsableByteArray pesBuffer){ byte[] adtsData=pesBuffer.data; int startOffset=pesBuffer.getPosition(); int endOffset=pesBuffer.limit(); for (int i=startOffset; i < endOffset; i++) { boolean byteIsFF=(adtsData[i] & 0xFF) == 0xFF; boolean found=lastByteWasFF && !byteIsFF && (adtsData[i] & 0xF0) == 0xF0; lastByteWasFF=byteIsFF; if (found) { hasCrc=(adtsData[i] & 0x1) == 0; pesBuffer.setPosition(i + 1); lastByteWasFF=false; return true; } } pesBuffer.setPosition(endOffset); return false; }
Locates the next sync word, advancing the position to the byte that immediately follows it. If a sync word was not located, the position is advanced to the limit.
protected void removeDuplicates(List<Node> list,Map<Node,Object> sortValues){ HashSet<Object> distinctValues=new HashSet<Object>(); for (Iterator<Node> iter=list.iterator(); iter.hasNext(); ) { Node node=iter.next(); Object value=sortValues.get(node); if (distinctValues.contains(value)) { iter.remove(); } else { distinctValues.add(value); } } }
Removes items from the list which have duplicate values
public ViewPropertyAnimator alphaBy(float value){ animatePropertyBy(ALPHA,value); return this; }
This method will cause the View's <code>alpha</code> property to be animated by the specified value. Animations already running on the property will be canceled.
private void showFeedback(String message){ if (myHost != null) { myHost.showFeedback(message); } else { System.out.println(message); } }
Used to communicate feedback pop-up messages between a plugin tool and the main Whitebox user-interface.
private CipherSuite(String name,boolean isExportable,int keyExchange,String authType,String cipherName,String hash,byte[] code){ this.name=name; this.keyExchange=keyExchange; this.authType=authType; this.isExportable=isExportable; if (cipherName == null) { this.cipherName=null; keyMaterial=0; expandedKeyMaterial=0; effectiveKeyBytes=0; ivSize=0; blockSize=0; } else if ("RC4_40".equals(cipherName)) { this.cipherName="RC4"; keyMaterial=5; expandedKeyMaterial=16; effectiveKeyBytes=5; ivSize=0; blockSize=0; } else if ("RC4_128".equals(cipherName)) { this.cipherName="RC4"; keyMaterial=16; expandedKeyMaterial=16; effectiveKeyBytes=16; ivSize=0; blockSize=0; } else if ("DES40_CBC".equals(cipherName)) { this.cipherName="DES/CBC/NoPadding"; keyMaterial=5; expandedKeyMaterial=8; effectiveKeyBytes=5; ivSize=8; blockSize=8; } else if ("DES_CBC".equals(cipherName)) { this.cipherName="DES/CBC/NoPadding"; keyMaterial=8; expandedKeyMaterial=8; effectiveKeyBytes=7; ivSize=8; blockSize=8; } else if ("3DES_EDE_CBC".equals(cipherName)) { this.cipherName="DESede/CBC/NoPadding"; keyMaterial=24; expandedKeyMaterial=24; effectiveKeyBytes=24; ivSize=8; blockSize=8; } else if ("AES_128_CBC".equals(cipherName)) { this.cipherName="AES/CBC/NoPadding"; keyMaterial=16; expandedKeyMaterial=16; effectiveKeyBytes=16; ivSize=16; blockSize=16; } else if ("AES_256_CBC".equals(cipherName)) { this.cipherName="AES/CBC/NoPadding"; keyMaterial=32; expandedKeyMaterial=32; effectiveKeyBytes=32; ivSize=16; blockSize=16; } else { this.cipherName=cipherName; keyMaterial=0; expandedKeyMaterial=0; effectiveKeyBytes=0; ivSize=0; blockSize=0; } if ("MD5".equals(hash)) { this.hmacName="HmacMD5"; this.hashName="MD5"; hashSize=16; } else if ("SHA".equals(hash)) { this.hmacName="HmacSHA1"; this.hashName="SHA-1"; hashSize=20; } else { this.hmacName=null; this.hashName=null; hashSize=0; } cipherSuiteCode=code; if (this.cipherName != null) { try { Cipher.getInstance(this.cipherName); } catch ( GeneralSecurityException e) { supported=false; } } if (this.name.startsWith("TLS_EC")) { supported=false; } }
Creates CipherSuite
public StateMachineEnsembleException(String message,Exception e){ super(message,e); }
Instantiates a new state machine ensemble exception.
public DBIDArrayIter iter(){ return ids.iter(); }
Get an iterator.
public InfocardInvocation(OpenIDTokenType tokenType){ _requiredClaims.add(OpenIDTokenType.OPENID_CLAIM); _tokenType=tokenType; if (DEBUG) _log.debug("Created " + _tokenType + " token type InfocardInvocation"); }
Creates a new InfocardInvocation object, describing Relying Party's requirements.
public static String escapeHTML(String html){ return Encode.forHtml(html); }
Escape HTML elements.
public CipherInputStream(InputStream is,Cipher c){ super(is); input=is; cipher=c; }
Constructs a CipherInputStream from an InputStream and a Cipher. <br>Note: if the specified input stream or cipher is null, a NullPointerException may be thrown later when they are used.
protected void initModules(Collection<IFloodlightModule> moduleSet) throws FloodlightModuleException { for ( IFloodlightModule module : moduleSet) { if (initedSet.contains(module.getClass().getCanonicalName())) continue; Map<Class<? extends IFloodlightService>,IFloodlightService> simpls=module.getServiceImpls(); if (simpls != null) { for ( Entry<Class<? extends IFloodlightService>,IFloodlightService> s : simpls.entrySet()) { if (logger.isDebugEnabled()) { logger.debug("Setting " + s.getValue() + " as provider for "+ s.getKey().getCanonicalName()); } if (floodlightModuleContext.getServiceImpl(s.getKey()) == null) { floodlightModuleContext.addService(s.getKey(),s.getValue()); } else { throw new FloodlightModuleException("Cannot set " + s.getValue() + " as the provider for "+ s.getKey().getCanonicalName()+ " because "+ floodlightModuleContext.getServiceImpl(s.getKey())+ " already provides it"); } } } } for ( IFloodlightModule module : moduleSet) { if (initedSet.contains(module.getClass().getCanonicalName())) continue; initedSet.add(module.getClass().getCanonicalName()); if (logger.isDebugEnabled()) { logger.debug("Initializing " + module.getClass().getCanonicalName()); } module.init(floodlightModuleContext); } }
Allocate service implementations and then init all the modules
@DSComment("Package priviledge") @DSBan(DSCat.DEFAULT_MODIFIER) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:59:51.852 -0500",hash_original_method="35BDC5101A4DE38616FDCE6EF4D8CA10",hash_generated_method="35BDC5101A4DE38616FDCE6EF4D8CA10") Arguments(String args[]) throws IllegalArgumentException { parseArgs(args); }
Constructs instance and parses args
public void call(String method,Class[] argTypes,Object... args) throws InvocationTargetException { MethodIdentifier id=parse(method,argTypes); for ( MethodContainer container : callStacks.get(id)) { ToastModule mod=null; if (section != null && container.obj instanceof ToastModule) { mod=(ToastModule)container.obj; section.section(mod.getModuleName()).start(method); } try { container.method.invoke(container.obj); } catch ( IllegalAccessException e) { } if (mod != null) section.section(mod.getModuleName()).stop(method); } }
Call the specified method on all listening objects.
@Override public final void onAdded(final RPObject object){ }
An object was added.
private void register(EntryImpl prevEntry,String name,IoFilter filter){ EntryImpl newEntry=new EntryImpl(prevEntry,prevEntry.nextEntry,name,filter); try { filter.onPreAdd(this,name,newEntry.getNextFilter()); } catch ( Exception e) { throw new IoFilterLifeCycleException("onPreAdd(): " + name + ':'+ filter+ " in "+ getSession(),e); } prevEntry.nextEntry.prevEntry=newEntry; prevEntry.nextEntry=newEntry; name2entry.put(name,newEntry); try { filter.onPostAdd(this,name,newEntry.getNextFilter()); } catch ( Exception e) { deregister0(newEntry); throw new IoFilterLifeCycleException("onPostAdd(): " + name + ':'+ filter+ " in "+ getSession(),e); } }
Register the newly added filter, inserting it between the previous and the next filter in the filter's chain. We also call the preAdd and postAdd methods.
@DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2014-02-25 10:38:09.274 -0500",hash_original_method="8091A4366A2C1A9998C238D888E06938",hash_generated_method="4BC82F2C31D9CDDD779B641B9867A61F") public int xhdr(String header,String selectedArticles) throws IOException { StringBuffer command=new StringBuffer(header); command.append(" "); command.append(selectedArticles); return sendCommand(NNTPCommand.XHDR,command.toString()); }
A convenience method to send the NNTP XHDR command to the server, receive the reply, and return the reply code. <p>
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.
@Override protected void configureList(){ list.setFont(comboBox.getFont()); list.setCellRenderer(comboBox.getRenderer()); list.setFocusable(false); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); int selectedIndex=comboBox.getSelectedIndex(); if (selectedIndex == -1) { list.clearSelection(); } else { list.setSelectedIndex(selectedIndex); list.ensureIndexIsVisible(selectedIndex); } installListListeners(); }
Configures the list which is used to hold the combo box items in the popup. This method is called when the UI class is created.
public ThreadClosedReply(final int packetId,final int errorCode,final long tid){ super(packetId,errorCode); threadId=tid; }
Creates a new Thread Closed reply.
public void writeText(char text) throws IOException { closeStartIfNecessary(); if (dontEscape) { writer.write(text); } else { charHolder[0]=text; HtmlUtils.writeText(writer,true,true,buffer,charHolder); } }
<p>Write a properly escaped single character, If there is an open element that has been created by a call to <code>startElement()</code>, that element will be closed first.</p> <p/> <p>All angle bracket occurrences in the argument must be escaped using the &amp;gt; &amp;lt; syntax.</p>
public boolean isTextList(){ return true; }
This is used to determine if an annotated list is a text list. A text list is a list of elements that also accepts free text. Typically this will be an element list union that will allow unstructured XML such as XHTML to be parsed.
@Override public void close(){ _inputStream=null; }
Close/free the connection
public TraceList createTrace(final String name,final String description) throws CouldntSaveDataException { Preconditions.checkNotNull(name,"IE00157: Name argument can not be null"); Preconditions.checkNotNull(description,"IE00158: Description argument can not be null"); final TraceList trace=m_provider.createTrace(m_module,name,description); m_traces.add(trace); for ( final ITraceContainerListener listener : m_listeners) { try { listener.addedTrace(this,trace); } catch ( final Exception exception) { CUtilityFunctions.logException(exception); } } m_module.getConfiguration().updateModificationDate(); return trace; }
Creates a new debug trace for the module.
public Intent offerBusyBox(Activity activity,int requestCode){ RootTools.log("Launching Market for BusyBox"); Intent i=new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=stericson.busybox")); activity.startActivityForResult(i,requestCode); return i; }
This will launch the Android market looking for BusyBox, but will return the intent fired and starts the activity with startActivityForResult
@Override public String toString(){ return super.toString(); }
Returns a String representation of this object.
public final void testGetModulus(){ RSAPublicKeySpec rpks=new RSAPublicKeySpec(BigInteger.valueOf(1234567890L),BigInteger.valueOf(3L)); assertTrue(BigInteger.valueOf(1234567890L).equals(rpks.getModulus())); }
Test for <code>getModulus()</code> method<br> Assertion: returns modulus
public static char[] genOffsetBitmap(int[] offsets){ int lastOffset=offsets[offsets.length - 1]; int numBlocks=(lastOffset / BITMAP_BLOCK_SZ) + 1; int[] blockLengths=new int[numBlocks]; Arrays.fill(blockLengths,0); for (int ix=0; ix < offsets.length; ix++) { int val=offsets[ix]; int blockForVal=val / BITMAP_BLOCK_SZ; blockLengths[blockForVal]++; } int totalSize=numBlocks; for (int block=0; block < numBlocks; block++) { totalSize+=blockLengths[block]; } char[] encodedBlocks=new char[totalSize]; int inputIx=0; int blockStartIx=0; for (int block=0; block < numBlocks; block++) { int blockSz=blockLengths[block]; encodedBlocks[blockStartIx]=(char)blockSz; for (int i=0; i < blockSz; i++) { encodedBlocks[blockStartIx + i + 1]=(char)(offsets[inputIx + i] % BITMAP_BLOCK_SZ); } inputIx+=blockSz; blockStartIx+=blockSz + 1; } return encodedBlocks; }
Encodes the bitmap in blocks of offsets. Within each block, the bits are stored as absolute offsets from the start of the block.
private void parseRCSe(Node node){ if (node == null) { return; } Node childnode=node.getFirstChild(); if (childnode != null) { do { if (childnode.getNodeName().equals("characteristic")) { NamedNodeMap attributes=childnode.getAttributes(); if (attributes.getLength() > 0) { Node typenode=attributes.getNamedItem("type"); if (typenode != null) { String nodeValue=typenode.getNodeValue(); if (nodeValue.equalsIgnoreCase("IMS")) { parseIMS(childnode); } else if (nodeValue.equalsIgnoreCase("PRESENCE")) { parsePresence(childnode); } else if (nodeValue.equalsIgnoreCase("XDMS")) { parseXDMS(childnode); } else if (nodeValue.equalsIgnoreCase("IM")) { parseIM(childnode); } else if (nodeValue.equalsIgnoreCase("CAPDISCOVERY")) { parseCapabilityDiscovery(childnode); } else if (nodeValue.equalsIgnoreCase("APN")) { parseAPN(childnode); } else if (nodeValue.equalsIgnoreCase("OTHER")) { parseOther(childnode); } else if (nodeValue.equalsIgnoreCase("SERVICES")) { parseServices(childnode); } else if (nodeValue.equalsIgnoreCase("SUPL")) { parseSupl(childnode); } else if (nodeValue.equalsIgnoreCase("SERVICEPROVIDEREXT")) { parseServiceProviderExt(childnode); } } } } } while ((childnode=childnode.getNextSibling()) != null); } }
Parse RCSe settings
@DSComment("Private Method") @DSBan(DSCat.PRIVATE_METHOD) @DSGenerator(tool_name="Doppelganger",tool_version="2.0",generated_on="2013-12-30 12:58:24.584 -0500",hash_original_method="FAE53DB9273E730E3BB3527C1EA0C82D",hash_generated_method="8434F909E03B4589EDAD548442697F2B") private void createAllApnList(){ mAllApns=new ArrayList<ApnSetting>(); String operator=mPhone.mIccRecords.getOperatorNumeric(); if (operator != null) { String selection="numeric = '" + operator + "'"; selection+=" and carrier_enabled = 1"; if (DBG) log("createAllApnList: selection=" + selection); Cursor cursor=mPhone.getContext().getContentResolver().query(Telephony.Carriers.CONTENT_URI,null,selection,null,null); if (cursor != null) { if (cursor.getCount() > 0) { mAllApns=createApnList(cursor); } cursor.close(); } } if (mAllApns.isEmpty()) { if (DBG) log("createAllApnList: No APN found for carrier: " + operator); mPreferredApn=null; } else { mPreferredApn=getPreferredApn(); if (mPreferredApn != null && !mPreferredApn.numeric.equals(operator)) { mPreferredApn=null; setPreferredApn(-1); } if (DBG) log("createAllApnList: mPreferredApn=" + mPreferredApn); } if (DBG) log("createAllApnList: X mAllApns=" + mAllApns); }
Based on the sim operator numeric, create a list for all possible Data Connections and setup the preferredApn.
public int indexOf(String name,int start){ int sz=size(); for (int i=start; i < sz; i++) { String n=getName(i); if (name == null) { if (n == null) return i; } else if (name.equals(n)) { return i; } } return -1; }
Scans the list sequentially beginning at the specified index and returns the index of the first pair with the specified name.
private void reduceTrinomialBitwise(int tc){ int i; int k=mDegree - tc; for (i=polynomial.getLength() - 1; i >= mDegree; i--) { if (polynomial.testBit(i)) { polynomial.xorBit(i); polynomial.xorBit(i - k); polynomial.xorBit(i - mDegree); } } polynomial.reduceN(); polynomial.expandN(mDegree); }
Reduce this GF2nPolynomialElement using the trinomial x^n + x^tc + 1 as fieldpolynomial. The coefficients are reduced bit by bit.