idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
15,700
public String getRemoteClassName ( ) { String strClassName = Appointment . class . getName ( ) . toString ( ) ; int iThinPos = strClassName . indexOf ( "thin." ) ; return strClassName . substring ( 0 , iThinPos ) + strClassName . substring ( iThinPos + 5 ) ; }
Get the name of the remote class .
15,701
public Date setEndDate ( Date time ) { try { this . getTable ( ) . edit ( ) ; this . getField ( "EndDateTime" ) . setData ( time ) ; this . getTable ( ) . set ( this ) ; this . getTable ( ) . seek ( null ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } return this . getEndDate ( ) ; }
Change the ending time of this service .
15,702
public List < String > getSourceUrls ( boolean useInherited ) { List < String > temp = new ArrayList < String > ( ) ; if ( useInherited && parent != null ) { if ( parent instanceof ContentSpec ) { temp = ( ( ContentSpec ) parent ) . getBaseLevel ( ) . getSourceUrls ( true ) ; } else if ( parent instanceof KeyValueNode ...
Get the Source Urls for a node and also checks to make sure the url hasn t already been inherited
15,703
public static < R extends Resource , X > ResourcePredicate < R > distinctFilter ( FunctionWithThrowable < R , X , IOException > function ) { final Map < X , Boolean > seen = Maps . newConcurrentMap ( ) ; return resource -> seen . putIfAbsent ( function . apply ( resource ) , Boolean . TRUE ) == null ; }
A predicate to filter out already seen resources by function .
15,704
public RemoteLockSession getRemoteLockSession ( SessionInfo sessionInfo ) { if ( m_lockServer == null ) { Application app = ( Application ) ( ( Environment ) m_owner ) . getDefaultApplication ( ) ; if ( m_gbRemoteTaskServer ) { String strServer = app . getAppServerName ( ) ; String strRemoteApp = DBParams . DEFAULT_REM...
Get the remote lock server .
15,705
public void setInputEncoding ( String inputEncoding ) { this . log ( "Setting input encoding to " + inputEncoding , LogLevel . DEBUG . getLevel ( ) ) ; this . inputEncoding = inputEncoding ; }
Optional . Sets the file encoding to be used when reading the input files . Defaults to the system file encoding .
15,706
public void setOutputEncoding ( String outputEncoding ) { this . log ( "Setting output encoding to " + outputEncoding , LogLevel . DEBUG . getLevel ( ) ) ; this . outputEncoding = outputEncoding ; }
Optional . Set the file encoding of the generated files . Defaults to the system file encoding .
15,707
public void setStylesheet ( FileResource stylesheet ) { this . log ( "Setting custom stylesheet " + stylesheet . toString ( ) , LogLevel . DEBUG . getLevel ( ) ) ; this . stylesheet = stylesheet ; }
Optional . Set a custom stylesheet to be used
15,708
public float addValue ( final float value ) { long now = System . currentTimeMillis ( ) ; if ( now - this . last_time > this . ageGap ) { this . reset ( ) ; } this . last_time = now ; if ( this . sizeHistory < this . maxHistory ) { this . sum += value ; this . sum_squares += Math . pow ( value , 2 ) ; ++ this . sizeHis...
Adds a value to this variance . If the time between the previous addition and this addition exceeds the age gap for this object then the variance will be reset to 0 before this value is added .
15,709
public void dumpTo ( AreaTree tree , PrintWriter out ) { if ( produceHeader ) out . println ( "<?xml version=\"1.0\"?>" ) ; out . println ( "<areaTree base=\"" + HTMLEntities ( tree . getRoot ( ) . getPage ( ) . getSourceURL ( ) . toString ( ) ) + "\">" ) ; recursiveDump ( tree . getRoot ( ) , 1 , out ) ; out . println...
Formats the complete tag tree to an output stream
15,710
public static String buildReportTable ( final List < TopicErrorData > topicErrorDatas , final String tableTitle , final boolean showEditorLink , final ZanataDetails zanataDetails ) { final List < String > tableHeaders = CollectionUtilities . toArrayList ( new String [ ] { "Topic Link" , "Topic Title" , "Topic Tags" } )...
Builds a Table to be used within a report . The table contains a link to the topic in Skynet the topic Title and the list of tags for the topic .
15,711
public static String isbn ( ) { StringBuffer stringBuffer = new StringBuffer ( "09" ) ; stringBuffer . append ( String . format ( "%06d" , JDefaultNumber . randomIntBetweenTwoNumbers ( 0 , 49999 ) ) ) ; stringBuffer . append ( String . format ( "%02d" , JDefaultNumber . randomIntBetweenTwoNumbers ( 0 , 99 ) ) ) ; Strin...
Generates an English Language Publisher Code in the range of 0 - 900000 - xx - x to 0 - 949999 - xx - x
15,712
protected void checkAndAddListInjections ( final BuildData buildData , final Document doc , final ITopicNode topicNode , final Map < String , TranslationDetails > translations ) { final DocBookXMLPreProcessor preProcessor = buildData . getXMLPreProcessor ( ) ; final List < Integer > types = Arrays . asList ( DocBookXML...
Checks to see if any list injections have been used and if so adds the translation xrefs .
15,713
protected String formatTranslationString ( POBuildData buildData , final String translationString ) { try { final Document doc = TopicUtilities . convertXMLStringToDocument ( "<temp>" + translationString + "</temp>" , buildData . getDocBookVersion ( ) . getId ( ) ) ; return XMLUtilities . convertNodeToString ( doc . ge...
Formats a string so that it will be compatible with publicans expectations .
15,714
protected void processPOTopicInjections ( final POBuildData buildData , final SpecTopic specTopic , final Map < String , TranslationDetails > translations ) { addStringsFromTopicRelationships ( buildData , specTopic . getPrerequisiteRelationships ( ) , DocBookXMLPreProcessor . PREREQUISITE_PROPERTY , DocBookXMLPreProce...
Process a spec topic and add any translation strings for it .
15,715
protected void addStringsFromTopicRelationships ( final POBuildData buildData , final List < Relationship > relationships , final String key , final String roleName , final Map < String , TranslationDetails > translations ) { if ( ! relationships . isEmpty ( ) ) { if ( key != null ) { addStringsForConstant ( buildData ...
Add the translation strings from a list of relationships for a specific topic .
15,716
protected void addStringsFromProcessRelationships ( final POBuildData buildData , final SpecTopic specTopic , final List < Relationship > relationships , final String key , final String roleName , final String titleRoleName , final Map < String , TranslationDetails > translations ) { if ( ! relationships . isEmpty ( ) ...
Add the translation strings from a list of relationships for a specific topic in a process .
15,717
protected void addStringsFromRelationships ( final BuildData buildData , final List < Relationship > relationships , final String roleName , final Map < String , TranslationDetails > translations ) { final boolean useFixedUrls = buildData . isUseFixedUrls ( ) ; for ( final Relationship relationship : relationships ) { ...
Add the translation strings from a list of relationships .
15,718
protected void processPOTopicBugLink ( final POBuildData buildData , final SpecTopic specTopic , final Map < String , TranslationDetails > translations ) throws BuildProcessingException { try { final DocBookXMLPreProcessor preProcessor = buildData . getXMLPreProcessor ( ) ; final String bugLinkUrl = preProcessor . getB...
Add any bug link strings for a specific topic .
15,719
protected void processPOInitialContentBugLink ( final POBuildData buildData , final InitialContent initialContent , final Map < String , TranslationDetails > translations ) throws BuildProcessingException { try { final DocBookXMLPreProcessor preProcessor = buildData . getXMLPreProcessor ( ) ; final String bugLinkUrl = ...
Add any bug link strings for a specific initial content container .
15,720
protected void processPOBugLinks ( final POBuildData buildData , final DocBookXMLPreProcessor preProcessor , final String bugLinkUrl , final Map < String , TranslationDetails > translations ) { final String originalString = buildData . getConstants ( ) . getString ( "REPORT_A_BUG" ) ; final String translationString = b...
Creates the strings for a specific bug link url .
15,721
protected StringBuilder createBasePOFile ( final BuildData buildData ) { final String formattedDate = POT_DATE_FORMAT . format ( buildData . getBuildDate ( ) ) ; return new StringBuilder ( "# \n" ) . append ( "# AUTHOR <EMAIL@ADDRESS>, YEAR.\n" ) . append ( "#\n" ) . append ( "msgid \"\"\n" ) . append ( "msgstr \"\"\n"...
Create the base initial content required for all PO and POT files .
15,722
protected void addPOTEntry ( final String tag , final String source , final StringBuilder potFile ) { addPOEntry ( tag , source , "" , false , potFile ) ; }
Add an entry to a POT file .
15,723
protected void addPOEntry ( final String tag , final String source , final String translation , final boolean fuzzy , final StringBuilder poFile ) { if ( source == null || source . length ( ) == 0 ) return ; poFile . append ( "\n" ) ; if ( ! isNullOrEmpty ( tag ) ) { poFile . append ( "#. Tag: " ) . append ( tag ) . ap...
Add an entry to a PO file .
15,724
@ SuppressWarnings ( "PMD.UnnecessaryLocalBeforeReturn" ) < T > T putIfAbsent ( final Key < T > key , final Provider < T > valueComputer ) throws InterruptedException , ExecutionException { Preconditions . checkArgument ( key != null , "Key must not be null!" ) ; Future < ? > oldValue = contents . get ( key ) ; if ( ol...
Compute and enter a value into the context unless the value has already been computed .
15,725
public boolean includeThis ( ClassProjectModel . CodeType codeType , boolean hasAnInterface ) { int scope = ( int ) ( this . getValue ( ) + 0.5 ) ; int target = 0 ; if ( codeType == ClassProjectModel . CodeType . THICK ) target = LogicFile . INCLUDE_THICK ; if ( codeType == ClassProjectModel . CodeType . THIN ) target ...
IncludeThis Method .
15,726
public < T > EntityResponse < List < T > > getWithListResult ( Class < T > entityClass , String path , Map < String , String > params , Map < String , String > headers ) throws IOException , RESTException { HttpGet httpGet = buildHttpGet ( path , params ) ; return parseListEntityResponse ( entityClass , getHttpResponse...
Performs GET request while expected response entity is a list of specified type .
15,727
public < T > EntityResponse < List < T > > postWithListResult ( Class < T > entityClass , String path , Object payload , Map < String , String > headers ) throws IOException , RESTException { return postWithListResultInternal ( entityClass , payload , new HttpPost ( baseUrl + path ) , headers ) ; }
Performs POST request while expected response entity is a list of specified type .
15,728
public < T > EntityResponse < List < T > > deleteWithListResult ( Class < T > entityClass , String path , Map < String , String > headers ) throws IOException , RESTException { return parseListEntityResponse ( entityClass , getHttpResponse ( new HttpDelete ( baseUrl + path ) , headers ) ) ; }
Performs DELETE request while expected response entity is a list of specified type .
15,729
public void setId ( final String id ) { if ( id . matches ( CSConstants . EXISTING_TOPIC_ID_REGEX ) ) { DBId = Integer . parseInt ( id ) ; } this . id = id ; }
Set the ID for the Content Specification Topic .
15,730
public List < TopicRelationship > getTopicRelationships ( ) { ArrayList < TopicRelationship > relationships = new ArrayList < TopicRelationship > ( topicRelationships ) ; for ( final TargetRelationship relationship : topicTargetRelationships ) { relationships . add ( new TopicRelationship ( relationship . getPrimaryRel...
Gets the list of Topic to Topic relationships .
15,731
public List < TargetRelationship > getTargetRelationships ( ) { final List < TargetRelationship > relationships = new ArrayList < TargetRelationship > ( levelRelationships ) ; relationships . addAll ( topicTargetRelationships ) ; return relationships ; }
Gets the list of Target relationships .
15,732
public List < TopicRelationship > getRelatedTopicRelationships ( ) { final ArrayList < TopicRelationship > relationships = new ArrayList < TopicRelationship > ( ) ; for ( final TopicRelationship relationship : topicRelationships ) { if ( relationship . getType ( ) == RelationshipType . REFER_TO ) { relationships . add ...
Gets the list of Topic Relationships for this topic whose type is RELATED .
15,733
public List < TargetRelationship > getRelatedLevelRelationships ( ) { final ArrayList < TargetRelationship > relationships = new ArrayList < TargetRelationship > ( ) ; for ( final TargetRelationship relationship : levelRelationships ) { if ( relationship . getType ( ) == RelationshipType . REFER_TO ) { relationships . ...
Gets the list of Level Relationships for this topic whose type is RELATED .
15,734
public List < TopicRelationship > getPrerequisiteTopicRelationships ( ) { final ArrayList < TopicRelationship > relationships = new ArrayList < TopicRelationship > ( ) ; for ( final TopicRelationship relationship : topicRelationships ) { if ( relationship . getType ( ) == RelationshipType . PREREQUISITE ) { relationshi...
Gets the list of Topic Relationships for this topic whose type is PREREQUISITE .
15,735
public List < TargetRelationship > getPrerequisiteLevelRelationships ( ) { final ArrayList < TargetRelationship > relationships = new ArrayList < TargetRelationship > ( ) ; for ( final TargetRelationship relationship : levelRelationships ) { if ( relationship . getType ( ) == RelationshipType . PREREQUISITE ) { relatio...
Gets the list of Level Relationships for this topic whose type is PREREQUISITE .
15,736
public List < TopicRelationship > getLinkListTopicRelationships ( ) { final ArrayList < TopicRelationship > relationships = new ArrayList < TopicRelationship > ( ) ; for ( final TopicRelationship relationship : topicRelationships ) { if ( relationship . getType ( ) == RelationshipType . LINKLIST ) { relationships . add...
Gets the list of Topic Relationships for this topic whose type is LINKLIST .
15,737
public List < TargetRelationship > getLinkListLevelRelationships ( ) { final ArrayList < TargetRelationship > relationships = new ArrayList < TargetRelationship > ( ) ; for ( final TargetRelationship relationship : levelRelationships ) { if ( relationship . getType ( ) == RelationshipType . LINKLIST ) { relationships ....
Gets the list of Level Relationships for this topic whose type is LINKLIST .
15,738
public List < TopicRelationship > getNextTopicRelationships ( ) { ArrayList < TopicRelationship > relationships = new ArrayList < TopicRelationship > ( ) ; for ( TopicRelationship relationship : topicRelationships ) { if ( relationship . getType ( ) == RelationshipType . NEXT ) { relationships . add ( relationship ) ; ...
Gets the list of Topic Relationships for this topic whose type is NEXT .
15,739
public List < TopicRelationship > getPrevTopicRelationships ( ) { ArrayList < TopicRelationship > relationships = new ArrayList < TopicRelationship > ( ) ; for ( TopicRelationship relationship : topicRelationships ) { if ( relationship . getType ( ) == RelationshipType . PREVIOUS ) { relationships . add ( relationship ...
Gets the list of Topic Relationships for this topic whose type is PREVIOUS .
15,740
public SpecTopic getClosestTopic ( final SpecTopic topic , final boolean checkParentNode ) { if ( this == topic || getId ( ) . equals ( topic . getId ( ) ) ) return this ; if ( getParent ( ) != null ) { if ( getParent ( ) instanceof Level ) { return ( ( Level ) getParent ( ) ) . getClosestTopic ( topic , checkParentNod...
Finds the closest node in the contents of a level
15,741
private void add ( FieldFilter filter ) { switch ( operator ) { case NOT : filters . add ( new NegationFieldFilter ( filter ) ) ; operator = Operator . NONE ; break ; case OR : filters . set ( filters . size ( ) - 1 , new OrFieldFilter ( filters . get ( filters . size ( ) - 1 ) , filter ) ) ; operator = Operator . NONE...
Adds a filter and applies the current operator .
15,742
public FieldFilterBuilder isDefault ( ) { add ( new NegationFieldFilter ( new ModifierFieldFilter ( Modifier . PUBLIC & Modifier . PROTECTED & Modifier . PRIVATE ) ) ) ; return this ; }
Filter fields with default access .
15,743
public FieldFilter build ( ) throws IllegalStateException { if ( filters . isEmpty ( ) ) { throw new IllegalStateException ( "No field filters configured!" ) ; } if ( filters . size ( ) == 1 ) { return filters . get ( 0 ) ; } FieldFilter [ ] fieldFilters = new FieldFilter [ filters . size ( ) ] ; filters . toArray ( fi...
Build and returns a FieldFilter .
15,744
public < T > T asObject ( String string , Class < T > valueType ) throws IllegalArgumentException { int dashIndex = string . indexOf ( '-' ) ; if ( dashIndex == - 1 ) { throw new IllegalArgumentException ( String . format ( "Cannot convert |%s| to locale instance." , string ) ) ; } return ( T ) new Locale ( string . su...
Create locale instance from ISO - 639 language and ISO - 3166 country code for example en - US .
15,745
public String asString ( Object object ) { Locale locale = ( Locale ) object ; StringBuilder builder = new StringBuilder ( 5 ) ; builder . append ( locale . getLanguage ( ) ) ; builder . append ( '-' ) ; builder . append ( locale . getCountry ( ) ) ; return builder . toString ( ) ; }
Return locale instance ISO - 639 language and ISO - 3166 country code for example en - US .
15,746
public RPMBuilder setPreInstallation ( String script , String interpreter ) { addString ( RPMTAG_PREIN , script ) ; addString ( RPMTAG_PREINPROG , interpreter ) ; ensureBinSh ( ) ; return this ; }
Set RPMTAG_PREIN and RPMTAG_PREINPROG
15,747
public RPMBuilder setPostInstallation ( String script , String interpreter ) { addString ( RPMTAG_POSTIN , script ) ; addString ( RPMTAG_POSTINPROG , interpreter ) ; ensureBinSh ( ) ; return this ; }
Set RPMTAG_POSTIN and RPMTAG_POSTINPROG
15,748
public RPMBuilder setPreUnInstallation ( String script , String interpreter ) { addString ( RPMTAG_PREUN , script ) ; addString ( RPMTAG_PREUNPROG , interpreter ) ; ensureBinSh ( ) ; return this ; }
Set RPMTAG_PREUN and RPMTAG_PREUNPROG
15,749
public RPMBuilder setPostUnInstallation ( String script , String interpreter ) { addString ( RPMTAG_POSTUN , script ) ; addString ( RPMTAG_POSTUNPROG , interpreter ) ; ensureBinSh ( ) ; return this ; }
Set RPMTAG_POSTUN and RPMTAG_POSTUNPROG
15,750
public RPMBuilder addProvide ( String name , String version , Condition ... dependency ) { addString ( RPMTAG_PROVIDENAME , name ) ; addString ( RPMTAG_PROVIDEVERSION , version ) ; addInt32 ( RPMTAG_PROVIDEFLAGS , Dependency . or ( dependency ) ) ; ensureVersionReq ( version ) ; return this ; }
Add RPMTAG_PROVIDENAME RPMTAG_PROVIDEVERSION and RPMTAG_PROVIDEFLAGS
15,751
public RPMBuilder addRequire ( String name , String version , Condition ... dependency ) { addString ( RPMTAG_REQUIRENAME , name ) ; addString ( RPMTAG_REQUIREVERSION , version ) ; addInt32 ( RPMTAG_REQUIREFLAGS , Dependency . or ( dependency ) ) ; ensureVersionReq ( version ) ; return this ; }
Add RPMTAG_REQUIRENAME RPMTAG_REQUIREVERSION and RPMTAG_REQUIREFLAGS
15,752
public RPMBuilder addConflict ( String name , String version , Condition ... dependency ) { addString ( RPMTAG_CONFLICTNAME , name ) ; addString ( RPMTAG_CONFLICTVERSION , version ) ; addInt32 ( RPMTAG_CONFLICTFLAGS , Dependency . or ( dependency ) ) ; ensureVersionReq ( version ) ; return this ; }
Add RPMTAG_CONFLICTNAME RPMTAG_CONFLICTVERSION and RPMTAG_CONFLICTFLAGS
15,753
public FileBuilder addFile ( Path source , Path target ) throws IOException { checkTarget ( target ) ; FileBuilder fb = new FileBuilder ( ) ; fb . target = target ; fb . size = ( int ) Files . size ( source ) ; try ( FileChannel fc = FileChannel . open ( source , READ ) ) { fb . content = fc . map ( FileChannel . MapMo...
Add file to package from path .
15,754
public FileBuilder addFile ( ByteBuffer content , Path target ) throws IOException { checkTarget ( target ) ; FileBuilder fb = new FileBuilder ( ) ; fb . content = content ; fb . target = target ; fb . size = content . limit ( ) ; fb . compressFilename ( ) ; fileBuilders . add ( fb ) ; return fb ; }
Add file to package from content
15,755
public Path build ( Path dir ) throws IOException { String name = getName ( ) ; lead = new Lead ( name ) ; addProvide ( getString ( RPMTAG_NAME ) , getString ( RPMTAG_VERSION ) , Condition . EQUAL ) ; addRequireInt ( "rpmlib(CompressedFileNames)" , "3.0.4-1" , Dependency . EQUAL , Dependency . LESS , Dependency . RPMLI...
Creates RPM file in dir . Returns Path of created file .
15,756
public int doSetData ( Object data , boolean bDisplayOption , int iMoveMode ) { int iErrorCode = DBConstants . NORMAL_RETURN ; if ( data != null ) { iErrorCode = this . getFieldCopy ( ) . setData ( data , DBConstants . DONT_DISPLAY , DBConstants . READ_MOVE ) ; if ( iErrorCode != DBConstants . NORMAL_RETURN ) return iE...
Move the physical binary data to this field . If this value is out of range return an error .
15,757
public void setString ( String string ) { m_StaticString = string ; if ( this . getScreenFieldView ( ) . getControl ( ) != null ) this . getScreenFieldView ( ) . setComponentState ( this . getScreenFieldView ( ) . getControl ( ) , string ) ; }
Set the static string for this label .
15,758
public int fieldChanged ( boolean bDisplayOption , int iMoveMode ) { boolean bFlag = this . compareFieldToString ( ) ; if ( m_bDisableIfMatch ) bFlag = ! bFlag ; m_fldToDisable . setEnabled ( bFlag ) ; return DBConstants . NORMAL_RETURN ; }
The Field has Changed . If the target string matches this field disable the target field .
15,759
public void collect ( Path file ) throws IOException { Path targetPath = tempDir . resolve ( projectRoot . relativize ( file ) ) ; Files . createDirectories ( targetPath . getParent ( ) ) ; Files . copy ( file , targetPath ) ; }
Add the given file to the data archive
15,760
public void add ( String file , String contents ) throws IOException { FileUtils . writeStringToFile ( tempDir . resolve ( file ) . toFile ( ) , contents ) ; }
Create new file in the data archive
15,761
public File createArchive ( ) throws IOException , ZipException { File tmpFile = File . createTempFile ( "dw-data" , ".zip" ) ; try { tmpFile . delete ( ) ; ZipFile zipFile = new ZipFile ( tmpFile . getAbsoluteFile ( ) ) ; ZipParameters parameters = new ZipParameters ( ) ; parameters . setCompressionLevel ( Zip4jConsta...
Creates archive containing collected data
15,762
public static final Stream < String > lines ( InputStream is , Charset cs ) { return StreamSupport . stream ( new StringSplitIterator ( is , cs ) , false ) ; }
Reads InputStream as stream of lines . Line separator is \ n while \ r is simply ignored .
15,763
public static final byte [ ] readAllBytes ( InputStream is ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; byte [ ] buf = new byte [ 4096 ] ; int rc = is . read ( buf ) ; while ( rc != - 1 ) { baos . write ( buf , 0 , rc ) ; rc = is . read ( buf ) ; } return baos . toByteArray ( ) ; ...
Read all bytes from InputStream and returns them as byte array . InputStream is not closed after call .
15,764
public static final BufferedInputStream buffer ( InputStream is ) { if ( is instanceof BufferedInputStream ) { return ( BufferedInputStream ) is ; } else { return new BufferedInputStream ( is ) ; } }
Wraps InputStream with BufferedInputStream if is is not BufferedInputStream . If it is returns is .
15,765
public static final void copyResource ( String source , Path target , Class < ? > cls ) throws IOException { try ( InputStream is = cls . getResourceAsStream ( source ) ) { Files . copy ( is , target , REPLACE_EXISTING ) ; } }
Copies class resource to path
15,766
public static final void setTimes ( FileTime lastModifiedTime , FileTime lastAccessTime , FileTime createTime , Path ... files ) throws IOException { for ( Path file : files ) { BasicFileAttributeView view = Files . getFileAttributeView ( file , BasicFileAttributeView . class ) ; view . setTimes ( lastModifiedTime , la...
Set files times . Non null times are changed .
15,767
public Node loadContent ( final Session session , final URL contentDef ) { final SAXParserFactory factory = this . getSAXParserFactory ( ) ; try { factory . setFeature ( "http://apache.org/xml/features/disallow-doctype-decl" , true ) ; final SAXParser parser = factory . newSAXParser ( ) ; final InputSource source = new...
Loads the content from the specified contentDefinition into the JCRRepository using the specified session .
15,768
public static < E extends Comparable < E > > void sortDescending ( List < E > list ) { int index = 0 ; E value = null ; for ( int i = 1 ; i < list . size ( ) ; i ++ ) { index = i ; value = list . remove ( index ) ; while ( index > 0 && value . compareTo ( list . get ( index - 1 ) ) > 0 ) { list . add ( index , list . g...
Sort the list in descending order using this algorithm . The run time of this algorithm depends on the implementation of the list since it has elements added and removed from it .
15,769
public static void sortDescending ( byte [ ] byteArray ) { int index = 0 ; byte value = 0 ; for ( int i = 1 ; i < byteArray . length ; i ++ ) { index = i ; value = byteArray [ index ] ; while ( index > 0 && value > byteArray [ index - 1 ] ) { byteArray [ index ] = byteArray [ index - 1 ] ; index -- ; } byteArray [ inde...
Sort the byte array in descending order using this algorithm .
15,770
public static void sortDescending ( char [ ] charArray ) { int index = 0 ; char value = 0 ; for ( int i = 1 ; i < charArray . length ; i ++ ) { index = i ; value = charArray [ index ] ; while ( index > 0 && value > charArray [ index - 1 ] ) { charArray [ index ] = charArray [ index - 1 ] ; index -- ; } charArray [ inde...
Sort the char array in descending order using this algorithm .
15,771
public static void sortDescending ( double [ ] doubleArray ) { int index = 0 ; double value = 0 ; for ( int i = 1 ; i < doubleArray . length ; i ++ ) { index = i ; value = doubleArray [ index ] ; while ( index > 0 && value > doubleArray [ index - 1 ] ) { doubleArray [ index ] = doubleArray [ index - 1 ] ; index -- ; } ...
Sort the double array in descending order using this algorithm .
15,772
public static void sortDescending ( float [ ] floatArray ) { int index = 0 ; float value = 0 ; for ( int i = 1 ; i < floatArray . length ; i ++ ) { index = i ; value = floatArray [ index ] ; while ( index > 0 && value > floatArray [ index - 1 ] ) { floatArray [ index ] = floatArray [ index - 1 ] ; index -- ; } floatArr...
Sort the float array in descending order using this algorithm .
15,773
public static void sortDescending ( long [ ] longArray ) { int index = 0 ; long value = 0 ; for ( int i = 1 ; i < longArray . length ; i ++ ) { index = i ; value = longArray [ index ] ; while ( index > 0 && value > longArray [ index - 1 ] ) { longArray [ index ] = longArray [ index - 1 ] ; index -- ; } longArray [ inde...
Sort the long array in descending order using this algorithm .
15,774
public static void sortDescending ( short [ ] shortArray ) { int index = 0 ; short value = 0 ; for ( int i = 1 ; i < shortArray . length ; i ++ ) { index = i ; value = shortArray [ index ] ; while ( index > 0 && value > shortArray [ index - 1 ] ) { shortArray [ index ] = shortArray [ index - 1 ] ; index -- ; } shortArr...
Sort the short array in descending order using this algorithm .
15,775
public static Timecode valueOf ( String timecode ) throws IllegalArgumentException { Timecode tc = new Timecode ( ) ; return ( Timecode ) tc . parse ( timecode ) ; }
Returns a Timecode instance for given Timecode storage string . Will return an invalid timecode in case the storage string represents an invalid Timecode
15,776
public static < T > void forEach ( final Iterable < T > iterable , final Consumer < ? super T > consumer ) { checkNotNull ( iterable , "forEach must have a valid iterable" ) ; checkNotNull ( consumer , "forEach must have a valid consumer" ) ; for ( T t : iterable ) { consumer . accept ( t ) ; } }
Accept a consumer for each element of an iterable .
15,777
public static < T , R > R reduce ( final Iterable < T > iterable , final R initial , final BiFunction < R , ? super T , R > accumulator ) { checkNotNull ( iterable , "reduce must have a non null iterable" ) ; checkNotNull ( accumulator , "reduce must have a non null function" ) ; R returnValue = initial ; for ( T r : i...
Perform a reduction of an iterable using an initial value and a two argument function . The function is applied to each element using the last result as the first argument and the element as the second .
15,778
public static < T > Optional < T > find ( final Iterable < ? extends T > iterable , final Predicate < ? super T > predicate ) { checkNotNull ( iterable , "iterable may not be null" ) ; checkNotNull ( predicate , "the predicate may not be null" ) ; for ( T t : iterable ) { if ( predicate . test ( t ) ) { return of ( t )...
Apply a predicate to an iterable returning an optional of the first element where the predicate is true or empty if no true is found .
15,779
public static < T > boolean any ( final Iterable < T > iterable , final Predicate < ? super T > predicate ) { return find ( iterable , predicate ) . isPresent ( ) ; }
Determine if any element of an iterable matches a given predicate .
15,780
public static < F , T > Iterable < T > map ( final Iterable < F > fromIterable , final Function < ? super F , ? extends T > function ) { checkNotNull ( fromIterable , "iterable must be non null" ) ; checkNotNull ( function , "map function must be non null" ) ; return new Iterable < T > ( ) { public Iterator < T > itera...
Create an iterable that maps an existing iterable to a new one by applying a function to each of it s elements .
15,781
public static < T > Iterable < T > filter ( final Iterable < T > fromIterable , final Predicate < ? super T > predicate ) { checkNotNull ( fromIterable , "iterable must be non null" ) ; checkNotNull ( predicate , "predicate must be non null" ) ; return new SupplierIterable < T > ( new Supplier < Optional < T > > ( ) { ...
Create an iterable that filters an existing iterable based on a predicate .
15,782
public static < E > Iterable < E > iterable ( final Enumeration < E > enumeration ) { checkNotNull ( enumeration , "Can not create an Iterable from a null enumeration" ) ; return new Iterable < E > ( ) { public Iterator < E > iterator ( ) { return new ImmutableIterator < E > ( ) { public boolean hasNext ( ) { return en...
Convert an enumeration to an iterator .
15,783
public static < E > Optional < E > get ( final Iterable < E > iterable , final int position ) { checkNotNull ( iterable , "Get requires an iterable" ) ; if ( position < 0 ) { return Optional . empty ( ) ; } int iterablePosition = 0 ; for ( E anIterable : iterable ) { if ( iterablePosition == position ) { return of ( an...
Return an optional of an element from a specified position in an iterable . If the position is out of bounds an empty optional is returned . Positions start at 0 .
15,784
public static < E > Optional < E > last ( final Iterable < E > iterable ) { checkNotNull ( iterable , "last requires a non null iterable" ) ; final Iterator < E > iterator = iterable . iterator ( ) ; if ( ! iterator . hasNext ( ) ) { return Optional . empty ( ) ; } E lastElement ; do { lastElement = iterator . next ( )...
Return the last element of an iterable or empty if the iterable is empty .
15,785
public static String ipV4Address ( ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( JDefaultNumber . randomIntBetweenTwoNumbers ( 2 , 254 ) + "" ) ; sb . append ( "." ) ; sb . append ( JDefaultNumber . randomIntBetweenTwoNumbers ( 2 , 254 ) + "" ) ; sb . append ( "." ) ; sb . append ( JDefaultNumber . randomI...
generates a random IPv4 ip address like 192 . 168 . 2 . 100
15,786
public static String userName ( ) { return fixNonWord ( StringUtils . left ( JDefaultName . firstName ( ) , 1 ) . toLowerCase ( ) + JDefaultName . lastName ( ) . toLowerCase ( ) + JDefaultNumber . randomNumberString ( 2 ) ) ; }
generates a random username in the format of Firstname intial + lastname + random 2 digit ie tjones67
15,787
public CloseableHttpClient NewHttpClient ( ) throws Exception { SSLContext sslcontext = SSLContexts . custom ( ) . loadTrustMaterial ( null , new TrustSelfSignedStrategy ( ) ) . build ( ) ; SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory ( sslcontext ) ; this . httpclient = HttpClients . custom ( ) . ...
create http client
15,788
public boolean hasNext ( ) { try { if ( ! this . parseNextLine ( ) ) { try { m_record . addNew ( ) ; } catch ( DBException e ) { e . printStackTrace ( ) ; } m_record . close ( ) ; m_reader . close ( ) ; return false ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } return true ; }
HasNext Method .
15,789
private void flushCharactersBuffer ( ) throws IOException { if ( charactersBuffer . position ( ) > 0 ) { writer . write ( charactersBuffer . array ( ) , 0 , charactersBuffer . position ( ) ) ; charactersBuffer . rewind ( ) ; } }
Flush characters buffer to underlying writer .
15,790
public int setFieldState ( Object objValue , boolean bDisplayOption , int iMoveMode ) { if ( this . getScreenField ( ) . getConverter ( ) == null ) return DBConstants . NORMAL_RETURN ; if ( ! ( objValue instanceof String ) ) return this . getScreenField ( ) . getConverter ( ) . setData ( objValue , bDisplayOption , iMo...
Set the field to this state . State is defined by the component .
15,791
public static char getFirstToUpper ( String string , char chDefault ) { if ( ( string != null ) && ( string . length ( ) > 0 ) ) chDefault = Character . toUpperCase ( string . charAt ( 0 ) ) ; return chDefault ; }
Return the first char of this string converted to upper case .
15,792
public Record getMainRecord ( ) { if ( this . getScreenField ( ) instanceof BasePanel ) return ( ( BasePanel ) this . getScreenField ( ) ) . getMainRecord ( ) ; else return this . getScreenField ( ) . getParentScreen ( ) . getMainRecord ( ) ; }
Convenience method to get the model s main record .
15,793
public void init ( BaseDatabase database , Record record ) { super . init ( database , record ) ; m_iRow = - 1 ; m_iEOFRow = Integer . MAX_VALUE ; m_iLastOrder = - 1 ; }
Init this table .
15,794
public void close ( ) { super . close ( ) ; try { if ( this . lockOnDBTrxType ( null , DBConstants . AFTER_REFRESH_TYPE , false ) ) this . unlockIfLocked ( this . getRecord ( ) , null ) ; } catch ( DBException ex ) { ex . printStackTrace ( ) ; } try { if ( m_seekResultSet != null ) m_seekResultSet . close ( ) ; m_seekR...
Close this table .
15,795
public String getLastSQLStatement ( int iType ) { switch ( iType ) { case DBConstants . SQL_UPDATE_TYPE : case DBConstants . SQL_INSERT_TABLE_TYPE : case DBConstants . SQL_DELETE_TYPE : return m_strLastSQL ; case DBConstants . SQL_AUTOSEQUENCE_TYPE : case DBConstants . SQL_SEEK_TYPE : if ( ! SHARE_STATEMENTS ) return m...
Get the last SQL string for this statement type
15,796
public void setResultSet ( ResultSet resultSet , int iType ) { if ( this . getResultSet ( iType ) != null ) { try { this . getResultSet ( iType ) . close ( ) ; } catch ( SQLException e ) { e . printStackTrace ( ) ; } } switch ( iType ) { case DBConstants . SQL_SEEK_TYPE : if ( ! SHARE_STATEMENTS ) { m_seekResultSet = r...
Set the ResultSet for this select or seek statement type .
15,797
public int readNextToTarget ( int iTargetPosition , int iRelPosition ) throws DBException { int iRecordStatus = DBConstants . RECORD_NORMAL ; boolean bMore = true ; ResultSet resultSet = ( ResultSet ) this . getResultSet ( ) ; while ( m_iRow < iTargetPosition ) { try { bMore = resultSet . next ( ) ; if ( ! bMore ) { m_...
Read next until you get to this position .
15,798
public MDecimal getKPa ( ) { MDecimal result = new MDecimal ( currentUnit . getConverterTo ( KILO ( PASCAL ) ) . convert ( doubleValue ( ) ) ) ; logger . trace ( MMarker . GETTER , "Converting from {} to Kilo Pascals : {}" , currentUnit , result ) ; return result ; }
get Kilo Pascals
15,799
public MDecimal getMMHg ( ) { MDecimal result = new MDecimal ( currentUnit . getConverterTo ( MILLIMETER_OF_MERCURY ) . convert ( doubleValue ( ) ) ) ; logger . trace ( MMarker . GETTER , "Converting from {} to millimetres of Mecrcury : {}" , currentUnit , result ) ; return result ; }
get millimetres Mercury