Code_Function
stringlengths
13
13.9k
Message
stringlengths
10
1.46k
fun LDC(x: Int) { env.topFrame().operandStack.pushBv32(ExpressionFactory.buildNewIntegerConstant(x)) }
Bytecode instruction stream : ... ,0x12 , index , ... < p > Push corresponding symbolic constant from constant pool ( at index ) onto the operand stack . http : //java.sun.com/docs/books/jvms/second_edition/html/Instructions2 . doc8.html # ldc
private fun filter_regexp(unfilteredTrie: Trie?): SentenceFilteredTrie? { var trie: SentenceFilteredTrie? = nullif (unfilteredTrie.hasRules()) if (matchesSentence(unfilteredTrie))trie =SentenceFilteredTrie(unfilteredTrie) else return nullif (unfilteredTrie.hasExtensions()) for ((key, unfilteredChildTrie): Map.Entry<Int...
Alternate filter that uses regular expressions , walking the grammar trie and matching the source side of each rule collection against the input sentence . Failed matches are discarded , and trie nodes extending from that position need not be explored .
protected fun engineUpdate(input: Byte) { if (first === true) {md.update(k_ipad) first = false }md.update(input)}
Processes the given byte .
fun configureZone(zone: StendhalRPZone?, attributes: Map<String?, String?>?) { buildAdosGreetingSoldier(zone) }
Configure a zone .
@Throws(sun.security.krb5.Asn1Exception::class, IOException::class) fun parse(data: sun.security.util.DerInputStream,explicitTag: Byte,optional: Boolean): sun.security.krb5.internal.KerberosTime? {if (optional && data.peekByte().toByte() and 0x1F.toByte() !=explicitTag.toInt()) return null val der: sun.security.util.De...
Parse ( unmarshal ) a kerberostime from a DER input stream . This form parsing might be used when expanding a value which is part of a constructed sequence and uses explicitly tagged type .
@DSGenerator( tool_name = "Doppelganger",tool_version = "2.0",generated_on = "2013-12-30 13:02:38.770-0500",hash_original_method = "C464D16A28A9DCABA3B0B8FD02F52155",hash_generated_method ="0A183B7841054C14E915336FD1A0DC9E") fun hasExtension(extension: String?): Boolean {return if (extension == null ||extension.isEmpty...
Returns true if the given extension has a registered MIME type .
@Throws(Exception::class) fun testExhaustContentSource() {val algLines = arrayOf("# ----- properties","content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource","content.source.log.step=1","doc.term.vector=false","content.source.forever=false","directory=RAMDirectory","doc.stored=false","doc.tokenized=fa...
Test Exhasting Doc Maker logic
@DSSource([DSSourceKind.NETWORK]) @DSSafe(DSCat.SAFE_LIST) @DSGenerator(tool_name = "Doppelganger",tool_version = "2.0",generated_on = "2014-02-25 10:38:10.723 -0500",hash_original_method = "8EB7107FA2367D701AF7CBC234A81F19",hash_generated_method = "B23ED7B4CA5FBA5E6343C71EA6EDB1E4") override fun toString(): String? {v...
Converts the SimpleNNTPHeader to a properly formatted header in the form of a String , including the blank line used to separate the header from the article body . < p >
private fun sincronizarBase() { listaOrganizacao = ControleDAO.getBanco().getOrganizacaoDAO().listar() }
Sincronizar dados com banco de dados
protected fun newlines(text: CharArray): Int { var result = 0 for (i in text.indices) { if (text[i] == 10) { result++ } } return result }
Returns the number of newlines in the given char array .
protected fun toBitmap(source: LuminanceSource?): BinaryBitmap? { return BinaryBitmap(HybridBinarizer(source)) }
Given an image source , convert to a binary bitmap . Override this to use a custom binarizer .
protected fun handleMergeException(dir: Directory?, exc: Throwable?) { throw MergeException(exc, dir) }
Called when an exception is hit in a background merge thread
fun merge(factory: FactoryDto, computedProjectConfig: ProjectConfigDto): FactoryDto? { val projects: List<ProjectConfigDto> = factory.getWorkspace().getProjects() if (projects == null || projects.isEmpty()) { factory.getWorkspace().setProjects(listOf(computedProjectConfig)) return factory } if (projects.size == 1) { va...
Apply the merging of project config dto including source storage dto into the existing factory < p > here are the following rules < ul > < li > no projects -- > add whole project < /li > < li > if projects < ul > < li > : if there is only one project : add source if missing < /li > < li > if many projects : do nothing ...
@Throws(ParseException::class) fun parseSIPStatusLine(statusLine: String?): StatusLine? { var statusLine = statusLine statusLine += "\n" return StatusLineParser(statusLine).parse() }
Parse the SIP Response message status line
fun initQuitAction(quitAction: QuitAction?) { requireNotNull(quitAction) { "quitAction is null" } require(quitAction == null) { "The method is once-call." } quitAction = quitAction }
Set the action to call from quit ( ) .
fun isFileStoragePool(storagePool: StoragePool, dbClient: DbClient): Boolean { val storageSystemUri: URI = storagePool.getStorageDevice() val storageSystem: StorageSystem = dbClient.queryObject(StorageSystem::class.java, storageSystemUri) ArgValidator.checkEntity(storageSystem, storageSystemUri, false) val storageSyste...
Finds if a pool is file storage pool
fun invokeStatic( clazz: String?, methodName: String?, types: Array<Class<*>?>?, values: Array<Any?>?, defaultValue: Any? ): Any? { return try { invokeStatic(Class.forName(clazz), methodName, types, values) } catch (e: ClassNotFoundException) { defaultValue } catch (e: NoSuchMethodException) { defaultValue } }
Invokes the specified parameterless method if it exists .
@Throws(IllegalArgumentException::class) fun internalsprintf(s: Double): String? { var s2: String? = "" when (conversionCharacter) { 'f' -> s2 = printFFormat(s) 'E', 'e' -> s2 = printEFormat(s) 'G', 'g' -> s2 = printGFormat(s) else -> throw IllegalArgumentException("Cannot format a double with a format using a $convers...
Format a double argument using this conversion specification .
fun eInverseRemove( otherEnd: InternalEObject?, featureID: Int, msgs: NotificationChain? ): NotificationChain? { when (featureID) { N4mfPackage.MODULE_FILTER__MODULE_SPECIFIERS -> return (getModuleSpecifiers() as InternalEList<*>).basicRemove( otherEnd, msgs ) } return super.eInverseRemove(otherEnd, featureID, msgs) }
< ! -- begin-user-doc -- > < ! -- end-user-doc -- >
fun hasUiObjectExpression(): Boolean { return !com.sun.tools.javac.util.StringUtils.isEmpty(getUiObjectExpression) }
If this databinding reference an ui element that is not the widget bound to this binding , then an expression is used to retrieve the target ui element
fun restore() { try { if (inCurrentStorage) currentStorage.insertElementSafe(element) else currentStorage.removeElement( element ) if (inApiStorage) apiStorage.insertElementSafe(element) else apiStorage.removeElement( element ) } catch (e: StorageException) { e.printStackTrace() } element.osmId = osmId element.osmVersi...
Restores the saved state of the element
@DSGenerator( tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2013-12-30 12:36:00.382 -0500", hash_original_method = "A7CC818E7F384DAEC54D76069E9C5019", hash_generated_method "E8FCEBA0D995DB6EE22CA1B5390C8697" ) @Throws( IOException::class ) protected fun available(): Int { return getInputStream().ava...
Returns the number of bytes available for reading without blocking .
fun isOverwriteMode(): Boolean { return hexEditControl == null || hexEditControl.isOverwriteMode() }
Tells whether the input is in overwrite or insert mode
fun loadStrings(filename: String): Array<String?>? { val `is`: InputStream = createInput(filename) if (`is` != null) return loadStrings(`is`) System.err.println("The file \"$filename\" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.") return null }
Load data from a file and shove it into a String array . < p/ > Exceptions are handled internally , when an error , occurs , an exception is printed to the console and 'null ' is returned , but the program continues running . This is a tradeoff between 1 ) showing the user that there was a problem but 2 ) not requiring...
private fun fieldsWithAnnotation(cls: Class<*>): Iterable<Field?>? { synchronized(mux) { var fields: MutableList<Field?>? = fieldCache.get(cls) if (fields == null) { fields = ArrayList() for (field in cls.declaredFields) { val ann: Annotation = field.getAnnotation(annCls) if (ann != null || needsRecursion(field)) field...
Gets all entries from the specified class or its super-classes that have been annotated with annotation provided .
@Throws(Exception::class) fun mapRelations( `object`: jdk.internal.loader.Resource, jsonObject: JSONObject, included: List<jdk.internal.loader.Resource?>? ): jdk.internal.loader.Resource? { val relationshipNames: HashMap<String, String> = getRelationshipNames(`object`.javaClass) for (relationship in relationshipNames.k...
Loops through relation JSON array and maps annotated objects .
override fun onDestroyView() { mIsWebViewAvailable = false super.onDestroyView() }
Called when the WebView has been detached from the fragment . The WebView is no longer available after this time .
fun clearMovementData() {pathSprites = ArrayList<StepSprite>() movementTarget = null checkFoVHexImageCacheClear() repaint() refreshMoveVectors() }
Clears current movement data from the screen
@Throws(Exception::class) fun execute( mapping: ActionMapping, form: ActionForm, request: HttpServletRequest, response: HttpServletResponse): ActionForward? { val editRoomDeptForm: EditRoomDeptForm = form as EditRoomDeptForm val rsc: MessageResources = getResources(request) val doit: String = editRoomDeptForm.getDoit()...
Method execute
fun execute(timeSeries: MetricTimeSeries, functionValueMap: FunctionValueMap) { if (timeSeries.isEmpty()) { functionValueMap.add(this, false, null) return } val points: DoubleList = timeSeries.getValues() val q1: Double = Percentile.evaluate(points, .25) val q3: Double = Percentile.evaluate(points, .75) val threshold =...
Detects outliers using the default box plot implementation . An outlier every value that is above ( q3-q1 ) *1.5*q3 where qN is the nth percentile
fun DuplicatePrimaryPartitionException(message: String?) { super(message) }
Creates a new < code > DuplicatePrimaryPartitionException < /code > with the given detail message .
fun buildFieldTypes(tableDef: TableDefinition) { (tableDef as JPAMTableDefinition).buildFieldTypes(getSession()) }
INTERNAL : builds the field names based on the type read in from the builder
fun clearCache() { softCache = SoftReference<Array<String>>(null) }
Clear the cache . This method is used for testing .
fun clear() { oredCriteria.clear() orderByClause = null distinct = false }
This method was generated by MyBatis Generator . This method corresponds to the database table activity
protected fun remove(id: Int) { nodes.remove(id) }
Removes the node with the specified identifier from this problem instance .
fun addHaptic(id: Int) { mHapticFeedback.add(id) }
Adds haptic feedback to this utterance .
private fun init() { val grid = Grid() appendChild(grid) grid.setWidth("100%") grid.setStyle("margin:0; padding:0; position: absolute;") grid.makeNoStrip() grid.setOddRowSclass("even") val rows: jdk.internal.joptsimple.internal.Rows = jdk.internal.joptsimple.internal.Rows() grid.appendChild(rows) for (i in 0 until m_go...
Static/Dynamic Init
fun deleteBack(): Int { val oldBack: Int = getBack() size = size - 1 return oldBack }
Deletes item from back of the list and returns deleted item .
fun isLicensed(): Boolean { return resourceExists(thresholdFileResource) && resourceExists(overlappingFileResource) }
This method returns true if the threshold and overlap files are present .
protected fun SimplePhase(name: String?) { super(name) }
Construct a phase given just a name and a global/local ordering scheme .
private fun URIUtil() {}
Prevent instance creation .
@Synchronized fun processResponse( transactionResponse: SIPResponse, sourceChannel: MessageChannel?, dialog: SIPDialog ) { if (getState() == null) return if ((TransactionState.COMPLETED === this.getState() || TransactionState.TERMINATED === this.getState()) && transactionResponse.getStatusCode() / 100 === 1) { return }...
Process a new response message through this transaction . If necessary , this message will also be passed onto the TU .
fun disable(adapter: BluetoothAdapter) { var mask: Int = BluetoothReceiver.STATE_TURNING_OFF_FLAG or BluetoothReceiver.STATE_OFF_FLAG or BluetoothReceiver.SCAN_MODE_NONE_FLAG var start: Long = -1 val receiver: BluetoothReceiver = getBluetoothReceiver(mask) var state = adapter.state when (state) { BluetoothAdapter.STATE...
Disables Bluetooth and checks to make sure that Bluetooth was turned off and that the correct actions were broadcast .
fun isLocal(): Boolean { return local }
Indicates if the ejb referenced is a local ejb .
fun PowerDecay() { this(10, 0.5) }
Creates a new Power Decay rate
fun isStorageIORMSupported(): Boolean? { return storageIORMSupported }
Gets the value of the storageIORMSupported property .
fun array(): ByteArray { return array }
Returns the underlying byte array .
@Throws(Exception::class) fun buildClassifier(D: Instances) { val r = Random(m_seed) if (fastaram) { networks = arrayOfNulls<ARAMNetworkfast>(numberofnetworks) } else if (sparsearam) { networks = arrayOfNulls<ARAMNetworkSparse>(numberofnetworks) } else if (sparsearamH) { networks = arrayOfNulls<ARAMNetworkSparseV>(numb...
Generates the classifier .
private fun startCameraSource() { val code: Int = GoogleApiAvailability.getInstance() .isGooglePlayServicesAvailable(ApplicationProvider.getApplicationContext()) if (code != ConnectionResult.SUCCESS) { val dlg: Dialog = GoogleApiAvailability.getInstance().getErrorDialog(this, code, RC_HANDLE_GMS) dlg.show() } if (mCame...
Starts or restarts the camera source , if it exists . If the camera source does n't exist yet ( e.g. , because onResume was called before the camera source was created ) , this will be called again when the camera source is created .
fun Timezone(text: String?) { this(null, text) }
Creates a timezone property .
fun <K, V> putAt(self: MutableMap<K, V>, key: K, value: V): V { self[key] = value return value }
A helper method to allow maps to work with subscript operators
override fun toString(): String? { return toString(",") }
Form a string listing all elements with comma as the separator character .
@DSSafe(DSCat.SAFE_LIST) @DSGenerator( tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-09-03 14:59:51.857 -0400", hash_original_method = "8DBE36D3CC23C0C9E5FAAD9804EB9F8E", hash_generated_method = "B8E268DF01A1D59287B8F2ED5303EAE7" ) @Throws( IOException::class ) private fun processInput(endOfInp...
Decode the contents of the input ByteBuffer into a CharBuffer .
fun byte52ToFloat(b: Byte): Float { if (b.toInt() == 0) return 0.0f var bits: Int = b and 0xff shl 24 - 5 bits += 63 - 2 shl 24 return java.lang.Float.intBitsToFloat(bits) }
byteToFloat ( b , mantissaBits=5 , zeroExponent=2 )
private fun createAndRegisterObserverProxyLocked(observer: IContentObserver) { check(mObserver == null) { "an observer is already registered" } mObserver = ContentObserverProxy(observer, this) mCursor.registerContentObserver(mObserver) }
Create a ContentObserver from the observer and register it as an observer on the underlying cursor .
fun compressEstim(src: ByteArray?, srcOff: Int, srcLen: Int): Int { var srcOff = srcOff if (srcLen < 10) return srcLen var stride: Int = LZ4_64K_LIMIT - 1 val segments = (srcLen + stride - 1) / stride stride = srcLen / segments if (stride >= LZ4_64K_LIMIT - 1 || stride * segments > srcLen || segments < 1 || stride < 1)...
Estimates the length of the compressed bytes , as compressed by Lz4 WARNING : if larger than LZ4_64K_LIMIT it cuts it in fragments WARNING : if some part of the input is discarded , this should return the proportional ( so that returnValue/srcLen=compressionRatio )
fun eIsSet(featureID: Int): Boolean { when (featureID) { N4JSPackage.ARRAY_LITERAL__ELEMENTS -> return elements != null && !elements.isEmpty() N4JSPackage.ARRAY_LITERAL__TRAILING_COMMA -> return trailingComma !== TRAILING_COMMA_EDEFAULT } return super.eIsSet(featureID) }
< ! -- begin-user-doc -- > < ! -- end-user-doc -- >
fun FilterStreamSpecRaw() {}
Default ctor .
fun onMenuVisibilityChanged(isVisible: Boolean) { for (i in 0 until mObservers.size()) { mObservers.get(i).onMenuVisibilityChanged(isVisible) } }
Called by AppMenu to report that the App Menu visibility has changed .
fun updateDownload() { val ongoingDownloads: ArrayList<DownloadInfoRunnable> = getOngoingDownloads() if (!ongoingDownloads.isEmpty()) { updateProgress() } else { timer.cancel() timer.purge() stopSelf() mBuilder = null stopForeground(true) isStopped = true } }
Updates the download list and stops the service if it 's empty . If not , updates the progress in the Notification bar
private fun remoteAddPois(pois: List<Poi>, changeSetId: String): Int { var count = 0 for (poi in pois) { if (remoteAddPoi(poi, changeSetId)) { count++ } } return count }
Add a List of POIs to the backend .
fun CopyOnWriteArraySet(c: Collection<E?>?) { al = CopyOnWriteArrayList<E>() al.addAllAbsent(c) }
Creates a set containing all of the elements of the specified collection .
@Throws(SQLException::class) fun close() { try { super.close() } finally { this.outputLogger.close() } }
This method will close the connection to the output .
@DSGenerator( tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2013-12-30 12:55:41.688 -0500", hash_original_method = "1623111994CBCA0890DA0FF2A1E140E0", hash_generated_method = "478ACA79A313929F4EF55B9242DEEF4D" ) fun isBackToBackUserAgent(): Boolean { return super.isBackToBackUserAgent }
Get the `` back to back User Agent '' flag . return the value of the flag
fun EnglishMinimalStemFilterFactory(args: Map<String?, String?>) { super(args) require(args.isEmpty()) { "Unknown parameters: $args" } }
Creates a new EnglishMinimalStemFilterFactory
fun AABB(pos: ReadonlyVec3D?, extent: Float) { super(pos) setExtent(Vec3D(extent, extent, extent)) }
Creates a new instance from centre point and uniform extent in all directions .
fun <T> subscriber(): JavaslangSubscriber<T>? { return JavaslangSubscriber<T>() }
A reactive-streams subscriber than can generate Javaslang traversable types
fun SQLNonTransientException(reason: String?, cause: Throwable?) { super(reason, cause) }
Creates an SQLNonTransientException object . The Reason string is set to the given and the cause Throwable object is set to the given cause Throwable object .
fun localTransactionCommitted(event: ConnectionEvent?) {}
Ignored event callback
protected fun runAndReset(): Boolean { if (state !== NEW || !UNSAFE.compareAndSwapObject( this, runnerOffset, null,Thread.currentThread() ) ) return false var ran = false var s: Int = state try { val c: Callable<V> = callable if (c != null && s == NEW) { try { c.call() ran = true } catch (ex: Throwable) { setException...
Executes the computation without setting its result , and then resets this future to initial state , failing to do so if the computation encounters an exception or is cancelled . This is designed for use with tasks that intrinsically execute more than once .
fun addCookie(cookie: GoogleCookie?) { if (cookieManager != null) { cookieManager.addCookie(cookie) } }
Adds a new GoogleCookie instance to the cache .
fun debug(trace: String?) { printTrace(trace, DEBUG_LEVEL) }
Debug trace
fun isAutoIndentEnabled(): Boolean { return autoIndentEnabled }
Returns whether or not auto-indent is enabled .
fun disableHardwareLayersForContent() { val widget: View = org.jcp.xml.dsig.internal.dom.DOMKeyInfo.getContent() if (widget != null) { widget.setLayerType(LAYER_TYPE_NONE, null) } }
Because this view has fading outlines , it is essential that we enable hardware layers on the content ( child ) so that updating the alpha of the outlines does n't result in the content layer being recreated .
@Throws(ParseException::class) fun parseDateLong(dateString: String?, pattern: String?): Date? { return getSimplDateFormat(pattern).parse(dateString) }
Construct payment gateway descriptor .
@Throws(ParseException::class) fun parseDateLong(dateString: String?, pattern: String?): Date? { return getSimplDateFormat(pattern).parse(dateString) }
Returns date parsed from string by given pattern
fun add(i: Int, coord: Coordinate?, allowRepeated: Boolean) { if (!allowRepeated) { val size: Int = size() if (size > 0) { if (i > 0) { val prev: Coordinate = get(i - 1) as Coordinate if (prev.equals2D(coord)) return } if (i < size) { val next: Coordinate = get(i) as Coordinate if (next.equals2D(coord)) return } } } su...
Inserts the specified coordinate at the specified position in this list .
private fun loadAppThemeDefaults() { val typedValue = TypedValue() val a = context!!.obtainStyledAttributes( typedValue.data, intArrayOf(attr.colorAccent, attr.textColorPrimary, attr.colorControlNormal) ) dialColor = a.getColor(0, dialColor) textColor = a.getColor(1, textColor) clockColor = a.getColor(2, clockColor) a....
Sets default theme attributes for picker These will be used if picker 's attributes are'nt set
fun increaseRefcount() { refcount++ }
Increase number of data points by one .
fun computePolygonAreaFromVertices(points: Iterable<Vec4?>?): Double { if (points == null) { val message: String = Logging.getMessage("nullValue.IterableIsNull") Logging.logger().severe(message) throw IllegalArgumentException(message) } val iter: Iterator<Vec4?> = points.iterator() if (!iter.hasNext()) { return 0 } var...
Returns the area enclosed by the specified ( x , y ) points ( the z and w coordinates are ignored ) . If the specified points do not define a closed loop , then the loop is automatically closed by simulating appending the first point to the last point .
fun init(param: KeyGenerationParameters) { this.params = param as NTRUEncryptionKeyGenerationParameters }
Constructs a new instance with a set of encryption parameters .
fun createDemoPanel(): javax.swing.JPanel? { val chart: JFreeChart = createChart(createDataset()) val panel = ChartPanel(chart, false) panel.setFillZoomRectangle(true) panel.setMouseWheelEnabled(true) return panel }
Creates a panel for the demo ( used by SuperDemo.java ) .
@Throws(Throwable::class) fun deleteVMsOnThisEndpoint( host: VerificationHost?, isMock: Boolean, parentComputeLink: String?, instanceIdsToDelete: List<String?>? ) { deleteVMsOnThisEndpoint(host, null, isMock, parentComputeLink, instanceIdsToDelete, null) }
A utility method that deletes the VMs on the specified endpoint filtered by the instanceIds that are passed in .
fun isIn(i: Byte): Boolean { return i >= this.min && i <= this.max }
Check if given number is in range .
fun completeAll() { val currentCompleted: Long = completedCount val size = Math.max(1, actionList.size()) while (completedCount - currentCompleted < size) { if (getState() !== Thread.State.BLOCKED && getState() !== Thread.State.RUNNABLE) break try { Thread.sleep(50) } catch (ex: InterruptedException) { break } } }
< p > Complete all scheduled actions at the time of this call . Since other threads may keep adding actions , this method makes sure that only the actions in the queue at the time of the call are waited upon . < /p >
override fun toString(): String? { return image }
Returns the image .
fun KtVisualPanel1() { initComponents() }
Creates new form KtVisualPanel1
@Throws(MalformedURIException::class) fun URI(p_scheme: String?, p_schemeSpecificPart: String?) { if (p_scheme == null || p_scheme.trim { it <= ' ' }.length == 0) { throw MalformedURIException("Cannot construct URI with null/empty scheme!") } if (p_schemeSpecificPart == null || p_schemeSpecificPart.trim { it <= ' ' }.l...
Construct a new URI that does not follow the generic URI syntax . Only the scheme and scheme-specific part ( stored as the path ) are initialized .
fun isDoingRangedAttack(): Boolean { return isDoingRangedAttack }
Check if the currently performed attack is ranged .
@Throws(IOException::class) fun SdfReaderWrapper(sdfDir: File?, useMem: Boolean, checkConsistency: Boolean) { mIsPaired = jdk.internal.org.jline.reader.impl.ReaderUtils.isPairedEndDirectory(sdfDir) if (mIsPaired) { mSingle = null mLeft = createSequencesReader( jdk.internal.org.jline.reader.impl.ReaderUtils.getLeftEnd(s...
Wrapper for the readers .
fun DefaultRenderStack() { stack = ArrayDeque() }
Constructs the stack .
fun onLocationChanged(location: Location?) { if (location == null) { return } val distance: Float = getDistanceFromNetwork(location) mTrackerData.writeEntry(location, distance) }
Writes details of location update to tracking file , including recording the distance between this location update and the last network location update
fun secondaryIndexFileName(data: File): File? { val extensionIndex: Int = data.getName().lastIndexOf('.') return if (extensionIndex != -1) { File( data.getParentFile(), data.getName().substring(0, extensionIndex) + BamIndexer.BAM_INDEX_EXTENSION ) } else indexFileName(data) }
Get the secondary possible name for an index to have for a given data file ( Will return same as indexFileName if there is no file extension )
@Throws(IOException::class) private fun cancelOrder(contract: Contract, order: TradeOrder) { val orderState = OrderState() orderState.m_status = OrderStatus.CANCELLED this.brokerModel.openOrder(order.getOrderKey(), contract, order, orderState) order.setStatus(OrderStatus.CANCELLED) }
Method cancelOrder .
private fun TempTripleStore(store: TemporaryStore, properties: Properties) { this(store, UUID.randomUUID().toString() + "kb", ITx.UNISOLATED, properties) }
Note : This is here just to make it easy to have the reference to the [ store ] and its [ uuid ] when we create one in the calling ctor .
fun <T> newSameSize(list: List<*>?, cpType: Class<T>?): Array<T>? { return if (list == null) create(cpType, 0) else create(cpType, list.size) }
Creates an array with the same size as the given list . If the list is null , a zero-length array is created .
fun addPaintListener(pl: PaintListener?) { if (m_painters == null) { m_painters = CopyOnWriteArrayList() } m_painters.add(pl) }
Add a PaintListener to this Display to receive notifications about paint events .
fun isNamed(): Boolean { return flags and NO_NAME === 0 }
Returns true if this method is anonymous .
fun CopyOnWriteMap() { internalMap = HashMap<K, V>() }
Creates a new instance of CopyOnWriteMap .
fun runTrialParallel( size: Int,set: TrialSuite,pts: Array<IPoint>,selector: IPivotIndex?,numThreads: Int,ratio: Int) {val ar = arrayOfNulls<Int>(size) run { var i = 0 var idx = 0 while (i < pts.size) { ar[idx++] = (pts[i].getX() * BASE) as Int ar[idx++] = (pts[i].getY() * BASE) as Int i++ } } val qs: MultiThreadQuickS...
Change the number of helper threads inside to try different configurations . < p > Set to NUM_THREADS by default .