Code_Function
stringlengths
13
13.9k
Message
stringlengths
10
1.46k
fun join(): Eval<String?>? { return Eval.later(null) }
Perform an asynchronous join operation
fun type(@Nullable type: String?): GetRequest? { var type = type if (type == null) { type = "_all" } this.type = type return this }
Sets the type of the document to fetch .
fun entries(): ImmutableSet<Map.Entry<K, V>>? { val result: ImmutableSet<Map.Entry<K, V>>? = entries return if (result == null) EntrySet<K, V>(this).also { entries = it } else result }
Returns an immutable collection of all key-value pairs in the multimap . Its iterator traverses the values for the first key , the values for the second key , and so on .
private fun luminance(r: Int, g: Int, b: Int): Int { return (0.299 * r + 0.58 * g + 0.11 * b).toInt() }
Apply the luminance
private fun puntPlay(offense: Team) { gameYardLine = (100 - (gameYardLine + offense.getK(0).ratKickPow / 3 + 20 - 10 * Math.random())) as Int if (gameYardLine < 0) { gameYardLine = 20 } gameDown = 1 gameYardsNeed = 10 gamePoss = !gamePoss gameTime -= 20 + 15 * Math.random() }
Punt the ball if it is a 4th down and decided not to go for it . Will turnover possession .
@Throws(IOException::class) private fun readSentence(aReader: BufferedReader): List<Array<String>>? { val words: MutableList<Array<String>> = ArrayList() var line: String? var beginSentence = true while (aReader.readLine().also { line = it } != null) { if (com.sun.tools.javac.util.StringUtils.isBlank(line)) { beginSent...
Read a single sentence .
fun OVERFLOW_FROM_SUB(): ConditionOperand? { return ConditionOperand(OVERFLOW_FROM_SUB )}
Create the condition code operand for OVERFLOW_FROM_SUB
protected fun initCheckLists() { val streams: List<IceMediaStream> = getStreamsWithPendingConnectivityEstablishment() val streamCount = streams.size val maxCheckListSize = Integer.getInteger(StackProperties.MAX_CHECK_LIST_SIZE, DEFAULT_MAX_CHECK_LIST_SIZE) val maxPerStreamSize = if (streamCount == 0) 0 else maxCheckLi...
Creates , initializes and orders the list of candidate pairs that would be used for the connectivity checks for all components in this stream .
private fun checkSearchables(searchablesList: ArrayList<SearchableInfo>) { assertNotNull(searchablesList) val count: Int = searchablesList.size() for (ii in 0 until count) { val si = searchablesList[ii] checkSearchable(si) } }
Generic health checker for an array of searchables . This is designed to pass for any semi-legal searchable , without knowing much about the format of the underlying data . It 's fairly easy for a non-compliant application to provide meta-data that will pass here ( e.g . a non-existent suggestions authority ) .
private fun generateImplementsParcelableInterface(targetPsiClass: PsiClass) { val referenceElement: PsiJavaCodeReferenceElement = factory.createReferenceFromText(PARCELABLE_CLASS_SIMPLE_NAME, null) val implementsList: PsiReferenceList = targetPsiClass.getImplementsList() if (null != implementsList) { implementsList.add...
Implement android.os.Parcelable interface
private fun fetchRDFGroupFromCache( rdfGroupCache: MutableMap<URI, RemoteDirectorGroup>, srdfGroupURI: URI ): RemoteDirectorGroup? { if (rdfGroupCache.containsKey(srdfGroupURI)) { return rdfGroupCache[srdfGroupURI] } val rdfGroup: RemoteDirectorGroup = this.getDbClient().queryObject(RemoteDirectorGroup::class.java, srd...
Return the RemoteDirectorGroup from cache otherwise query from db .
fun minCut(s: String?): Int { val palin: Set<String> = HashSet() return minCut(s, 0, palin) }
Backtracking , generate all cuts
fun withDateFormat(df: DateFormat?): ObjectWriter? { val newConfig: SerializationConfig = _config.withDateFormat(df) return if (newConfig === _config) { this } else ObjectWriter(this, newConfig) }
Fluent factory method that will construct a new writer instance that will use specified date format for serializing dates ; or if null passed , one that will serialize dates as numeric timestamps .
fun LockMode(allowsTouch: Boolean, allowsCommands: Boolean) { allowsTouch = allowsTouch allowsCommands = allowsCommands }
Constructs a new LockMode instance .
fun match(e: Element, pseudoE: String?): Boolean { return if (e is CSSStylableElement) (e as CSSStylableElement).isPseudoInstanceOf(getValue()) else false }
Tests whether this selector matches the given element .
@Throws(IOException::class) fun openInputFileAsZip(fileName: String): RandomAccessFile? { val zipFile: ZipFile try { zipFile = ZipFile(fileName) } catch (fnfe: FileNotFoundException) { System.err.println("Unable to open '" + fileName + "': " + fnfe.getMessage()) throw fnfe } catch (ze: ZipException) { return null } val...
Tries to open an input file as a Zip archive ( jar/apk ) with a `` classes.dex '' inside .
fun generate(proj: Projection?): Boolean { setNeedToRegenerate(true) if (proj == null) { Debug.message("omgraphic", "OMRect: null projection in generate!") return false } when (renderType) { RENDERTYPE_XY -> setShape( createBoxShape( Math.min(x2, x1) as Int, Math.min(y2, y1) as Int, Math.abs(x2 - x1) as Int, Math.abs(y...
Prepare the rectangle for rendering .
@Throws(IOException::class) fun stream(os: OutputStream?) { val globals: sun.net.www.MessageHeader = entries.elementAt(0) if (globals.findValue("Signature-Version") == null) { throw JarException("Signature file requires " + "Signature-Version: 1.0 in 1st header") } val ps = PrintStream(os) globals.print(ps) for (i in 1...
Add a signature file at current position in a stream
fun readDateTimeAsLong(index: Int): Long { return this.readULong(index) shl 32 or this.readULong(index + 4) }
Reads the LONGDATETIME at the given index .
fun BagToSet(b: Value): Value? { val fcn: FcnRcdValue = FcnRcdValue.convert(b) ?: throw EvalException( EC.TLC_MODULE_APPLYING_TO_WRONG_VALUE, arrayOf("BagToSet", "a function with a finite domain", Value.ppr(b.toString())) ) return fcn.getDomain() }
// For now , we do not override SubBag . So , We are using the TLA+ definition . public static Value SubBag ( Value b ) { FcnRcdValue fcn = FcnRcdValue.convert ( b ) ; if ( fcn == null ) { String msg = `` Applying SubBag to the following value , which is\n '' + `` not a function with a finite domain : \n '' + Value.ppr...
fun createProjectClosingEvent(project: ProjectDescriptor?): ProjectActionEvent? { return ProjectActionEvent(project, ProjectAction.CLOSING, false) }
Creates a Project Closing Event .
fun fullyConnectSync(srcContext: Context?, srcHandler: Handler?, dstHandler: Handler?): Int { var status: Int = connectSync(srcContext, srcHandler, dstHandler) if (status == STATUS_SUCCESSFUL) { val response: Message = sendMessageSynchronously(CMD_CHANNEL_FULL_CONNECTION) status = response.arg1 } return status }
Fully connect two local Handlers synchronously .
fun hasInterface(intf: String?, cls: String?): Boolean { return try { hasInterface(Class.forName(intf), Class.forName(cls)) } catch (e: Exception) { false } }
Checks whether the given class implements the given interface .
fun removePropertyChangeListener(propertyName: String?, in_pcl: PropertyChangeListener?) { beanContextChildSupport.removePropertyChangeListener(propertyName, in_pcl) }
Method for BeanContextChild interface . Uses the BeanContextChildSupport to remove a listener to this object 's property . You do n't need this function for objects that extend java.awt.Component .
private fun isIgnoreLocallyExistingFiles(): Boolean { return ignoreLocallyExistingFiles }
Returns true to indicate that locally existing files are treated as they would not exist . This is a extension to the standard cvs-behaviour !
private fun isViewDescendantOf(child: View, parent: View): Boolean { if (child === parent) { return true } val theParent = child.parent return theParent is ViewGroup && isViewDescendantOf(theParent as View, parent) }
Return true if child is an descendant of parent , ( or equal to the parent ) .
fun add(value: Double) { if (count === 0) { count = 1 mean = value min = value max = value if (!isFinite(value)) { sumOfSquaresOfDeltas = NaN } } else { count++ if (isFinite(value) && isFinite(mean)) { val delta: Double = value - mean mean += delta / count sumOfSquaresOfDeltas += delta * (value - mean) } else { mean = ...
Adds the given value to the dataset .
private fun init(context: Context, theme: RuqusTheme, currClassName: String) { currClassName = currClassName inflate(context, R.layout.sort_field_view, this) setOrientation(VERTICAL) label = findViewById(R.id.sort_field_label) as TextView? sortFieldChooser = findViewById(R.id.sort_field) as Spinner removeButton = findV...
Initialize our view .
protected fun closeNoThrow(): Future<Void?>? { var closeFuture: Promise<Void?>? synchronized(this) { if (null != closePromise) { return closePromise } closePromise = Promise<Void>() closeFuture = closePromise } cancelTruncation() Utils.closeSequence( bkDistributedLogManager.getScheduler(), true, getCachedLogWriter(), g...
Close the writer and release all the underlying resources
fun isValidating(): Boolean? { return validating }
Gets the value of the validating property .
private fun scanPlainSpaces(): String? { var length = 0 while (reader.peek(length) === ' ' || reader.peek(length) === '\t') { length++ } val whitespaces: String = reader.prefixForward(length) val lineBreak: String = scanLineBreak() if (lineBreak.length != 0) { this.allowSimpleKey = true var prefix: String = reader.pref...
See the specification for details . SnakeYAML and libyaml allow tabs inside plain scalar
fun w(tag: String?, s: String?, e: Throwable?) { if (LOG.WARN >= LOGLEVEL) Log.w(tag, s, e) }
Warning log message .
fun mean(vector: DoubleArray): Double { var sum = 0.0 if (vector.size == 0) { return 0 } for (i in vector.indices) { sum += vector[i] } return sum / vector.size.toDouble() }
Computes the mean for an array of doubles .
@Throws(Exception::class) protected fun toJsonBytes(`object`: Any?): ByteArray? { val mapper = ObjectMapper() mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL) return mapper.writeValueAsBytes(`object`) }
Map object to JSON bytes
fun shuffleInventory(@Nonnull inv: IInventory, @Nonnull random: Random?) { val list: List<ItemStack?> = getInventoryList(inv) Collections.shuffle(list, random) for (i in 0 until inv.getSizeInventory()) { inv.setInventorySlotContents(i, list[i]) } }
Shuffles all items in the inventory
fun QueueCursor(capacity: Int) { this(capacity, false.toInt()) }
Creates an < tt > QueueCursor < /tt > with the given ( fixed ) capacity and default access policy .
fun destroy(r: DistributedRegion?) {}
Blows away all the data in this object .
@Throws(IOException::class) fun executeAsync(command: CommandLine?, handler: ExecuteResultHandler?): Process? { return executeAsync(command, null, handler) }
Methods for starting asynchronous execution . The child process inherits all environment variables of the parent process . Result provided to callback handler .
fun destroy() { try { val region1: Region = cache.getRegion(Region.SEPARATOR + REGION_NAME) region1.localDestroy("key-1") } catch (e: Exception) { e.printStackTrace() fail("test failed due to exception in destroy ") } }
destroy key-1
fun isSelected(): Boolean { return this.selected }
Check if item is selected
fun String(string: String) { value = string.value offset = string.offset count = string.count }
Creates a string that is a copy of another string
private fun needNewBuffer(newSize: Int) { val delta: Int = newSize - size val newBufferSize = Math.max(minChunkLen, delta) currentBufferIndex++ currentBuffer = IntArray(newBufferSize) offset = 0 if (currentBufferIndex >= buffers.length) { val newLen: Int = buffers.length shl 1 val newBuffers = arrayOfNulls<IntArray>(ne...
Prepares next chunk to match new size . The minimal length of new chunk is < code > minChunkLen < /code > .
fun patch_splitMax(patches: LinkedList<javax.sound.midi.Patch?>) { val patch_size: Short = Match_MaxBits var precontext: String var postcontext: String var patch: javax.sound.midi.Patch var start1: Int var start2: Int var empty: Boolean var diff_type: Operation var diff_text: String val pointer: MutableListIterator<jav...
Look through the patches and break up any which are longer than the maximum limit of the match algorithm . Intended to be called only from within patch_apply .
fun execJavac(toCompile: String?, dir: File, jflexTestVersion: String): TestResult? { val p = Project()val javac = Javac() val path = Path(p, dir.toString())javac.setProject(p) javac.setSrcdir(path) javac.setDestdir(dir) javac.setTarget(javaVersion) javac.setSource(javaVersion) javac.setSourcepath(Path(p, "")) javac.se...
Call javac on toCompile in input dir . If toCompile is null , all *.java files below dir will be compiled .
private fun cloneProperties( certificate: BurpCertificate, burpCertificateBuilder: BurpCertificateBuilder { burpCertificateBuilder.setVersion(certificate.getVersionNumber()) burpCertificateBuilder.setSerial(certificate.getSerialNumberBigInteger()) if (certificate.getPublicKeyAlgorithm().equals("RSA")) { burpCertificate...
Copy all X.509v3 general information and all extensions 1:1 from one source certificat to one destination certificate .
protected fun emit_PropertyMethodDeclaration_SemicolonKeyword_1_q( semanticObject: EObject?, transition: ISynNavigable?, nodes: List<INode?>? ) { acceptNodes(transition, nodes) }
Ambiguous syntax : ' ; ' ? This ambiguous syntax occurs at : body=Block ( ambiguity ) ( rule end ) declaredName=LiteralOrComputedPropertyName ' ( ' ' ) ' ( ambiguity ) ( rule end ) fpars+=FormalParameter ' ) ' ( ambiguity ) ( rule end )
@Throws(Throwable::class) fun runTest() { val doc: Document val rootNode: Element val newChild: Node val elementList: NodeList val oldChild: Node var replacedChild: Node doc = load("hc_staff", true) as Document newChild = doc.createAttribute("lang")elementList = doc.getElementsByTagName("p") oldChild = elementList.item...
Runs the test case .
fun preComputeBestReplicaMapping() { val collectionToShardToCoreMapping: Map<String, Map<String, Map<String, String>>> = getZkClusterData().getCollectionToShardToCoreMapping() for (collection in collectionNames) { val shardToCoreMapping = collectionToShardToCoreMapping[collection]!! for (shard in shardToCoreMapping.key...
For all the collections in zookeeper , compute the best replica for every shard for every collection . Doing this computation at bootup significantly reduces the computation done during streaming .
private fun statInit() {= lDocumentNo.setLabelFor(fDocumentNo) fDocumentNo.setBackground(AdempierePLAF.getInfoBackground()) fDocumentNo.addActionListener(this) lDescription.setLabelFor(fDescription) fDescription.setBackground(AdempierePLAF.getInfoBackground()) fDescription.addActionListener(this) lPOReference.setLabelF...
Static Setup - add fields to parameterPanel
fun check(certificateToken: CertificateToken): Boolean { val keyUsage: Boolean = certificateToken.checkKeyUsage(bit) return keyUsage == value }
Checks the condition for the given certificate .
public static boolean isValidFolderPath ( Path path ) { if ( path == null ) { return false ; } File f = path . toFile ( ) ; return path . toString ( ) . isEmpty ( ) || ( f . isDirectory ( ) && f . canWrite ( ) ) ; }
Checks is the parameter path a valid for saving fixed file
fun extract( maxFeatureValue: Int, distanceSet: IntArray, img: Array<IntArray> ): Array<FloatArray>? { val histogram = IntArray(maxFeatureValue) val W = img.size val H: Int = img[0].length for (x in 0 until W) { for (y in 0 until H) { histogram[img[x][y]]++ } } val correlogram = Array(maxFeatureValue) { FloatArray( dis...
extract extracts an auto-correlogram from an Image . This method create a cummulated auto-correlogram over different distances instead of standard method . Also , uses a different normalization method
public static CC parseComponentConstraint ( String s ) { CC cc = new CC ( ) ; if ( s . length ( ) == 0 ) { return cc ; } String [ ] parts = toTrimmedTokens ( s , ',' ) ; for ( String part : parts ) { try { if ( part . length ( ) == 0 ) { continue ; } int ix = - 1 ; char c = part . charAt ( 0 ) ; if ( c == 'n' ) { if ( ...
Parses one component constraint and returns the parsed value .
fun computeRightChild(node: SegmentTreeNode<*>): SegmentTreeNode<*>? { return if (node.right - node.left > 1) { constructor.construct((node.left + node.right) / 2, node.right) } else null }
Compute the right child node , if it exists
fun isValidIPAddress(address: String?): Boolean { var address = address if (address == null || address.length == 0) { return false } var ipv6Expected = false if (address[0] == '[') { if (address.length > 2 && address[address.length - 1] == ']') { address = address.substring(1, address.length - 1) ipv6Expected = true } ...
Checks whether < tt > address < /tt > is a valid IP address string .
private fun loadVerticesAndRelatives() { val elementList: MutableList<CnATreeElement> = LinkedList<CnATreeElement>() for (loader in getLoaderList()) { loader.setCnaTreeElementDao(getCnaTreeElementDao()) elementList.addAll(loader.loadElements()) } for (element in elementList) { graph.addVertex(element) if (LOG.isDebugEn...
Loads all vertices and adds them to the graph . An edge for each children is added if the child is part of the graph .
private fun initializeLiveAttributes() { transform = createLiveAnimatedTransformList(null, SVG_TRANSFORM_ATTRIBUTE, "")externalResourcesRequired = createLiveAnimatedBoolean(null, SVG_EXTERNAL_RESOURCES_REQUIRED_ATTRIBUTE, false) }
Initializes the live attribute values of this element .
fun putParcelable(key: String?, value: Parcelable?) { unparcel() mMap.put(key, value) mFdsKnown = false }
Inserts a Parcelable value into the mapping of this Bundle , replacing any existing value for the given key . Either key or value may be null .
fun <T> flatten(self: Iterable<T>?, flattenUsing: Closure<out T>?): Collection<T>? { return flatten(self, createSimilarCollection(self), flattenUsing) }
Flatten an Iterable . This Iterable and any nested arrays or collections have their contents ( recursively ) added to the new collection . For any non-Array , non-Collection object which represents some sort of collective type , the supplied closure should yield the contained items ; otherwise , the closure should just...
fun semiDeviation(): Double { return Math.sqrt(semiVariance()) }
returns the semi deviation , defined as the square root of the semi variance .
public Object runSafely ( Catbert . FastStack stack ) throws Exception { String val = getString ( stack ) ; Sage . put ( getString ( stack ) , val ) ; return null ; }
Sets the property with the specified name to the specified value . If this is called from a client instance then it will use the properties on the server system for this call and the change will be made on the server system .
protected fun createUserDictionaryPreference( locale: String?, activity: Activity? ): Preference? { val newPref = Preference(getActivity()) val intent = Intent(USER_DICTIONARY_SETTINGS_INTENT_ACTION) if (null == locale) { newPref.title = Locale.getDefault().displayName } else { if ("" == locale) newPref.title = getStr...
Create a single User Dictionary Preference object , with its parameters set .
public static < T > T withPrintWriter ( Path self , @ ClosureParams ( value = SimpleType . class , options = "java.io.PrintWriter" ) Closure < T > closure ) throws IOException { return IOGroovyMethods . withWriter ( newPrintWriter ( self ) , closure ) ; }
Create a new PrintWriter for this file which is then passed it into the given closure . This method ensures its the writer is closed after the closure returns .
@Throws(Exception::class) fun testBug77649() { var props: Properties = getPropertiesFromTestsuiteUrl() val host = props.getProperty(NonRegisteringDriver.HOST_PROPERTY_KEY) val port = props.getProperty(NonRegisteringDriver.PORT_PROPERTY_KEY) val hosts = arrayOf(host, "address", "address.somewhere", "addressing", "addres...
Tests fix for Bug # 77649 - URL start with word `` address '' , JDBC ca n't parse the `` host : port '' Correctly .
fun pathsIterator(): Iterator<PluginPatternMatcher>? { return if (mDataPaths != null) mDataPaths.iterator() else null }
Return an iterator over the filter 's data paths .
private fun checkInMoving(x: Float, y: Float) { val xDiff = Math.abs(x - lastMotionX) as Int val yDiff = Math.abs(y - lastMotionY) as Int val touchSlop: Int = this.touchSlop val xMoved = xDiff > touchSlop val yMoved = yDiff > touchSlop if (xMoved) { touchState = TOUCH_STATE_SCROLLING_X lastMotionX = x lastMotionY = y }...
Check if the user is moving the cell
fun checkInstance(instance: Instance): Boolean { if (instance.numAttributes() !== numAttributes()) { return false } for (i in 0 until numAttributes()) { if (instance.isMissing(i)) { continue } else if (attribute(i).isNominal() || attribute(i).isString()) { if (!Utils.eq(instance.value(i), instance.value(i) as Int.toDou...
Checks if the given instance is compatible with this dataset . Only looks at the size of the instance and the ranges of the values for nominal and string attributes .
private fun concatBytes(array1: ByteArray, array2: ByteArray): ByteArray? { val cBytes = ByteArray(array1.size + array2.size) try { System.arraycopy(array1, 0, cBytes, 0, array1.size) System.arraycopy(array2, 0, cBytes, array1.size, array2.size) } catch (e: Exception) { throw FacesException(e)}return cBytes }
This method concatenates two byte arrays
fun layout(delta: Int, animate: Boolean) { if (mDataChanged) { handleDataChanged() } if (getCount() === 0) { resetList() return } if (mNextSelectedPosition >= 0) { setSelectedPositionInt(mNextSelectedPosition) } recycleAllViews() detachAllViewsFromParent() val count: Int = sun.util.locale.provider.LocaleProviderAdapter...
Setting up images .
private void updateMenuItems ( boolean isGpsStarted , boolean isRecording ) { boolean hasTrack = listView != null && listView . getCount ( ) != 0 ; if ( startGpsMenuItem != null ) { startGpsMenuItem . setVisible ( ! isRecording ) ; if ( ! isRecording ) { startGpsMenuItem . setTitle ( isGpsStarted ? R . string . menu_st...
Updates the menu items .
public boolean isDuplicateSupported ( ) { return duplicateSupported ; }
Indicates whether this connection request supports duplicate entries in the request queue
public void onStart ( ) { }
Called when the animation starts .
public static int [ ] [ ] loadPNMFile ( InputStream str ) throws IOException { BufferedInputStream stream = new BufferedInputStream ( str ) ; String type = tokenizeString ( stream ) ; if ( type . equals ( "P1" ) ) return loadPlainPBM ( stream ) ; else if ( type . equals ( "P2" ) ) return loadPlainPGM ( stream ) ; else ...
Loads plain or raw PGM files or plain or raw PBM files and return the result as an int [ ] [ ] . The Y dimension is not flipped .
public BiCorpus alignedFromFiles ( String f ) throws IOException { return new BiCorpus ( fpath + f + extf , epath + f + exte , apath + f + exta ) ; }
Generate aligned BiCorpus .
public LognormalDistr ( double shape , double scale ) { numGen = new LogNormalDistribution ( scale , shape ) ; }
Instantiates a new Log-normal pseudo random number generator .
private static String contentLengthHeader ( final long length ) { return String . format ( "Content-Length: %d" , length ) ; }
Format Content-Length header .
@ Bean @ ConditionalOnMissingBean public AmqpSenderService amqpSenderServiceBean ( ) { return new DefaultAmqpSenderService ( rabbitTemplate ( ) ) ; }
Create default amqp sender service bean .
@ Override protected void initialize ( ) { super . initialize ( ) ; m_Processor = new MarkdownProcessor ( ) ; m_Markdown = "" ; }
Initializes the members .
public void upperBound ( byte [ ] key ) throws IOException { upperBound ( key , 0 , key . length ) ; }
Move the cursor to the first entry whose key is strictly greater than the input key . Synonymous to upperBound ( key , 0 , key.length ) . The entry returned by the previous entry ( ) call will be invalid .
public static String replaceLast ( String s , char sub , char with ) { int index = s . lastIndexOf ( sub ) ; if ( index == - 1 ) { return s ; } char [ ] str = s . toCharArray ( ) ; str [ index ] = with ; return new String ( str ) ; }
Replaces the very last occurrence of a character in a string .
public static void main ( String [ ] args ) { Thrust simulation = new Thrust ( ) ; simulation . run ( ) ; }
Entry point for the example application .
public static < T > T checkNotNull ( T reference , @ Nullable String errorMessageTemplate , @ Nullable Object ... errorMessageArgs ) { if ( reference == null ) { throw new NullPointerException ( format ( errorMessageTemplate , errorMessageArgs ) ) ; } return reference ; }
Ensures that an object reference passed as a parameter to the calling method is not null .
public boolean insert ( String name , RegExp definition ) { if ( Options . DEBUG ) Out . debug ( "inserting macro " + name + " with definition :" + Out . NL + definition ) ; used . put ( name , Boolean . FALSE ) ; return macros . put ( name , definition ) == null ; }
Stores a new macro and its definition .
public boolean add ( Object o ) { ensureCapacity ( size + 1 ) ; elementData [ size ++ ] = o ; return true ; }
Appends the specified element to the end of this list .
public InvocationTargetException ( Throwable target , String s ) { super ( s , null ) ; this . target = target ; }
Constructs a InvocationTargetException with a target exception and a detail message .
public boolean isExternalSkin ( ) { return ! isDefaultSkin && mResources != null ; }
whether the skin being used is from external .skin file
private void updateActions ( ) { actions . removeAll ( ) ; final ActionGroup mainActionGroup = ( ActionGroup ) actionManager . getAction ( getGroupMenu ( ) ) ; if ( mainActionGroup == null ) { return ; } final Action [ ] children = mainActionGroup . getChildren ( null ) ; for ( final Action action : children ) { final ...
Updates the list of visible actions .
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 .
TechCategory fallthrough ( ) { switch ( this ) { case OMNI_AERO : return OMNI ; case CLAN_AERO : case CLAN_VEE : return CLAN ; case IS_ADVANCED_AERO : case IS_ADVANCED_VEE : return IS_ADVANCED ; default : return null ; } }
If no value is provided for ASFs or Vees , use the base value .
static void svd_dscal ( int n , double da , double [ ] dx , int incx ) { if ( n <= 0 || incx == 0 ) return ; int ix = ( incx < 0 ) ? n - 1 : 0 ; for ( int i = 0 ; i < n ; i ++ ) { dx [ ix ] *= da ; ix += incx ; } return ; }
Function scales a vector by a constant . * Based on Fortran-77 routine from Linpack by J. Dongarra
public CampoFechaVO insertValue ( final CampoFechaVO value ) { try { DbConnection conn = getConnection ( ) ; DbInsertFns . insert ( conn , TABLE_NAME , DbUtil . getColumnNames ( COL_DEFS ) , new SigiaDbInputRecord ( COL_DEFS , value ) ) ; return value ; } catch ( Exception e ) { logger . error ( "Error insertando campo...
Inserta un valor de tipo fecha .
private synchronized void closeActiveFile ( ) { StringWriterFile activeFile = this . activeFile ; try { this . activeFile = null ; if ( activeFile != null ) { activeFile . close ( ) ; getPolicy ( ) . closeActiveFile ( activeFile . path ( ) ) ; activeFile = null ; } } catch ( IOException e ) { trace . error ( "error clo...
close , finalize , and apply retention policy
public void testWARTypeEquality ( ) { WAR war1 = new WAR ( "/some/path/to/file.war" ) ; WAR war2 = new WAR ( "/otherfile.war" ) ; assertEquals ( war1 . getType ( ) , war2 . getType ( ) ) ; }
Test equality between WAR deployables .
public static Vector readSignatureAlgorithmsExtension ( byte [ ] extensionData ) throws IOException { if ( extensionData == null ) { throw new IllegalArgumentException ( "'extensionData' cannot be null" ) ; } ByteArrayInputStream buf = new ByteArrayInputStream ( extensionData ) ; Vector supported_signature_algorithms =...
Read 'signature_algorithms ' extension data .
public void updateNCharacterStream ( int columnIndex , java . io . Reader x , long length ) throws SQLException { throw new SQLFeatureNotSupportedException ( resBundle . handleGetObject ( "jdbcrowsetimpl.featnotsupp" ) . toString ( ) ) ; }
Updates the designated column with a character stream value , which will have the specified number of bytes . The driver does the necessary conversion from Java character format to the national character set in the database . It is intended for use when updating NCHAR , NVARCHAR and LONGNVARCHAR columns . The updater m...
public boolean isModified ( ) { return isCustom ( ) && ! isUserAdded ( ) ; }
Returns whether the receiver represents a modified template , i.e . a contributed template that has been changed .
public String toString ( ) { return this . getClass ( ) . getName ( ) + "(" + my_k + ")" ; }
Returns a String representation of the receiver .
private static PostingsEnum termDocs ( IndexReader reader , Term term ) throws IOException { return MultiFields . getTermDocsEnum ( reader , MultiFields . getLiveDocs ( reader ) , term . field ( ) , term . bytes ( ) ) ; }
NB : this is a convenient but very slow way of getting termDocs . It is sufficient for testing purposes .
public boolean isSubregion ( ) { return subregion ; }
Returns true if the Region is a subregion of a Component , otherwise false . For example , < code > Region.BUTTON < /code > corresponds do a < code > Component < /code > so that < code > Region.BUTTON.isSubregion ( ) < /code > returns false .
public static void encodeToFile ( byte [ ] dataToEncode , String filename ) throws java . io . IOException { if ( dataToEncode == null ) { throw new NullPointerException ( "Data to encode was null." ) ; } Base64 . OutputStream bos = null ; try { bos = new Base64 . OutputStream ( new java . io . FileOutputStream ( filen...
Convenience method for encoding data to a file . < p > As of v 2.3 , if there is a error , the method will throw an java.io.IOException . < b > This is new to v2.3 ! < /b > In earlier versions , it just returned false , but in retrospect that 's a pretty poor way to handle it. < /p >