idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
10,300
private void filterMappingsOfSiblingsByRelation ( List < INode > source , List < INode > target , char semanticRelation ) { int sourceDepth = ( source . get ( 0 ) . getLevel ( ) - 1 ) ; int targetDepth = ( target . get ( 0 ) . getLevel ( ) - 1 ) ; int sourceSize = source . size ( ) ; int targetSize = target . size ( ) ...
Filters the mappings of two siblings node list for which the parents are also supposed to be related . Checks whether in the two given node list there is a pair of nodes related by the given relation and if so if deletes all the other relations for the given 2 nodes setting the current one as strongest .
10,301
private void swapINodes ( List < INode > listOfNodes , int source , int target ) { INode aux = listOfNodes . get ( source ) ; listOfNodes . set ( source , listOfNodes . get ( target ) ) ; listOfNodes . set ( target , aux ) ; }
Swaps the INodes in listOfNodes in the positions source and target .
10,302
private int getRelatedIndex ( List < INode > source , List < INode > target , char relation ) { int srcIndex = sourceIndex . get ( source . get ( 0 ) . getLevel ( ) - 1 ) ; int tgtIndex = targetIndex . get ( target . get ( 0 ) . getLevel ( ) - 1 ) ; int returnIndex = - 1 ; INode sourceNode = source . get ( srcIndex ) ;...
Looks for the related index for the source list at the position sourceIndex in the target list beginning at the targetIndex position for the defined relation .
10,303
private void inc ( ArrayList < Integer > array , int index ) { array . set ( index , array . get ( index ) + 1 ) ; }
Increments by 1 the Integer of the given list of integers at the index position .
10,304
private boolean isRelated ( final INode source , final INode target , final char relation ) { return relation == defautlMappings . getRelation ( source , target ) ; }
Checks if the given source and target elements are related considering the defined relation and the temp .
10,305
private void setStrongestMapping ( INode source , INode target ) { if ( isSameStructure ( source , target ) ) { spsmMapping . setRelation ( source , target , defautlMappings . getRelation ( source , target ) ) ; for ( INode node : defautlMappings . getTargetContext ( ) . getNodesList ( ) ) { if ( source != node && defa...
Sets the relation between source and target as the strongest in the temp setting all the other relations for the same source as IDK if the relations are weaker .
10,306
private void computeStrongestMappingForSource ( INode source ) { INode strongetsRelationInTarget = null ; List < IMappingElement < INode > > strongest = new ArrayList < IMappingElement < INode > > ( ) ; for ( INode j : defautlMappings . getTargetContext ( ) . getNodesList ( ) ) { if ( isSameStructure ( source , j ) ) {...
Looks for the strongest relation for the given source and sets to IDK all the other mappings existing for the same source if they are less precedent .
10,307
private void resolveStrongestMappingConflicts ( INode source , List < IMappingElement < INode > > strongest ) { int strongestIndex = - 1 ; String sourceString = source . getNodeData ( ) . getName ( ) . trim ( ) ; if ( log . isEnabledFor ( Level . DEBUG ) ) { StringBuilder strongRelations = new StringBuilder ( ) ; for (...
Resolves conflicts in case there are more than one element with the strongest relation for a given source node .
10,308
private boolean isSameStructure ( INode source , INode target ) { boolean result = false ; if ( null != source && null != target ) { if ( source . getChildrenList ( ) != null && target . getChildrenList ( ) != null ) { int sourceChildren = source . getChildrenList ( ) . size ( ) ; int targetChildren = target . getChild...
Checks if source and target are structural preserving this is function to function and argument to argument match .
10,309
private boolean existsStrongerInColumn ( INode source , INode target ) { boolean result = false ; char current = defautlMappings . getRelation ( source , target ) ; for ( INode i : defautlMappings . getSourceContext ( ) . getNodesList ( ) ) { if ( i != source && defautlMappings . getRelation ( i , target ) != IMappingE...
Checks if there is no other stronger relation in the same column .
10,310
private int getPrecedenceNumber ( char semanticRelation ) { int precedence = Integer . MAX_VALUE ; if ( semanticRelation == IMappingElement . EQUIVALENCE ) { precedence = 1 ; } else if ( semanticRelation == IMappingElement . MORE_GENERAL ) { precedence = 2 ; } else if ( semanticRelation == IMappingElement . LESS_GENERA...
Gives the precedence order for the given semanticRelation defined in IMappingElement . EQUIVALENT_TO = 1 MORE_GENERAL = 2 LESS_GENERAL = 3 DISJOINT_FROM = 4 IDK = 5
10,311
public ParsedPath append ( ParsedPath other ) { final List < String > composedPath = new ArrayList < > ( this . elements . size ( ) + other . elements . size ( ) ) ; composedPath . addAll ( this . elements ) ; composedPath . addAll ( other . elements ) ; return new ParsedPath ( startsWithDelimiter , composedPath ) ; }
Append the received path to this path .
10,312
void addSubAggs ( QueryConverter queryConverter , Aggregation agg , AggregationBuilder builder ) { Map < String , Aggregation > aggs = agg . getAggs ( ) ; for ( String key : aggs . keySet ( ) ) { Aggregation subAgg = aggs . get ( key ) ; AbstractAggregationBuilder subBuilder = queryConverter . converterAggregation ( su...
add sub - aggs when building search request
10,313
private UninitializedMessageException newUninitializedMessageException ( MessageType message ) { if ( message instanceof AbstractMessageLite ) { return ( ( AbstractMessageLite ) message ) . newUninitializedMessageException ( ) ; } return new UninitializedMessageException ( message ) ; }
Creates an UninitializedMessageException for MessageType .
10,314
private MessageType checkMessageInitialized ( MessageType message ) throws InvalidProtocolBufferException { if ( message != null && ! message . isInitialized ( ) ) { throw newUninitializedMessageException ( message ) . asInvalidProtocolBufferException ( ) . setUnfinishedMessage ( message ) ; } return message ; }
Helper method to check if message is initialized .
10,315
public void readFromObject ( Object object ) { try { Method method = BeanUtils . getReadMethod ( object . getClass ( ) , getName ( ) ) ; if ( method != null ) { Object value = method . invoke ( object ) ; initializeValue ( value ) ; if ( value != null ) { for ( Property subProperty : subProperties ) { subProperty . rea...
Reads the value of this Property from the given object . It uses reflection and looks for a method starting with is or get followed by the capitalized Property name .
10,316
public void writeToObject ( Object object ) { try { Method method = BeanUtils . getWriteMethod ( object . getClass ( ) , getName ( ) ) ; if ( method != null ) { method . invoke ( object , new Object [ ] { getValue ( ) } ) ; } } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalArg...
Writes the value of the Property to the given object . It uses reflection and looks for a method starting with set followed by the capitalized Property name and with one parameter with the same type as the Property .
10,317
public Map < String , String > values ( Object context ) { if ( this . attributes . isEmpty ( ) ) { return Collections . emptyMap ( ) ; } Map < String , String > map = new HashMap < String , String > ( ) ; for ( KAttribute attribute : this . attributes ) { String value = attribute . value ( context ) ; if ( value != nu...
Get the attribute values
10,318
public static String getUniqueId ( URI resourceUri , URI basePath ) { String result = null ; URI relativeUri = basePath . relativize ( resourceUri ) ; if ( ! relativeUri . isAbsolute ( ) ) { result = relativeUri . toASCIIString ( ) ; int slashIndex = result . indexOf ( '/' ) ; int hashIndex = result . indexOf ( '#' ) ;...
Given the URI of a resource it returns the Unique ID . In reality this obtains the first path element after the basePath . Checks for those that are local to the server only . Developed both for hash and slash URIs .
10,319
public static boolean isResourceLocalToServer ( URI resourceUri , URI serverUri ) { URI relativeUri = serverUri . relativize ( resourceUri ) ; return ! relativeUri . isAbsolute ( ) ; }
Figure out whether the URI is actually local to the server . That is it tells whether the resouce is controlled by the server .
10,320
private static Map < String , CellStyle > createStyles ( Workbook wb ) { Map < String , CellStyle > styles = new HashMap < String , CellStyle > ( ) ; CellStyle style ; Font headerFont = wb . createFont ( ) ; style = createBorderedStyle ( wb ) ; style . setAlignment ( CellStyle . ALIGN_CENTER ) ; style . setFillForegrou...
Cell styles used .
10,321
public void print ( String [ ] [ ] values ) throws IOException { if ( values == null || values . length == 0 ) { csvPrinter . println ( ) ; } else { for ( String [ ] value : values ) { csvPrinter . printRecords ( ( Object ) value ) ; } } csvPrinter . flush ( ) ; }
Print several lines of comma separated values . The values will be quoted if needed . Quotes and new line characters will be escaped .
10,322
private boolean isRedundant ( IContextMapping < INode > mapping , INode source , INode target , char R ) { switch ( R ) { case IMappingElement . LESS_GENERAL : { if ( verifyCondition1 ( mapping , source , target ) ) { return true ; } break ; } case IMappingElement . MORE_GENERAL : { if ( verifyCondition2 ( mapping , so...
Checks whether the relation between source and target is redundant or not for minimal mapping .
10,323
private boolean before ( ) throws IOException { if ( closed ) { throw new IOException ( "Attempted read from closed stream." ) ; } switch ( length ) { case EOF : return false ; case UNKNOWN : length = readLength ( ) ; pos = 0 ; if ( length == EOF ) { HeaderList . parse ( src ) ; return false ; } return true ; default :...
Standard processing before reading data .
10,324
public BioCLocation getTotalLocation ( ) { checkArgument ( getLocationCount ( ) > 0 , "No location added" ) ; RangeSet < Integer > rangeSet = TreeRangeSet . create ( ) ; for ( BioCLocation location : getLocations ( ) ) { rangeSet . add ( Range . closedOpen ( location . getOffset ( ) , location . getOffset ( ) + locatio...
Returns the minimal range which encloses all locations in this annotation .
10,325
public static Set < String > getLanguages ( final ITextNode [ ] textNodes ) { SortedSet < String > languages = new TreeSet < String > ( ) ; for ( ITextNode textNode : textNodes ) { IValueNode [ ] valueNodes = textNode . getValueNodes ( ) ; for ( IValueNode valueNode : valueNodes ) { languages . add ( valueNode . getLan...
Gets the languages of all value nodes whose parents are a given array of text nodes .
10,326
public static boolean containsStatus ( final Status status , final Status [ ] statusArray ) { if ( status == null ) { return false ; } for ( Status currentStatus : statusArray ) { if ( currentStatus == status ) { return true ; } } return false ; }
Checks whether a given status is contained in an array of status .
10,327
protected String getNodePathToRoot ( INode node ) { StringBuilder sb = new StringBuilder ( ) ; INode parent = node ; while ( null != parent ) { if ( parent . getNodeData ( ) . getName ( ) . contains ( "\\" ) ) { log . debug ( "source: replacing \\ in: " + parent . getNodeData ( ) . getName ( ) ) ; sb . insert ( 0 , "\\...
Gets the path of a node from root for hash mapping .
10,328
protected HashMap < String , INode > createHash ( IContext context ) { HashMap < String , INode > result = new HashMap < String , INode > ( ) ; int nodeCount = 0 ; for ( INode node : context . getNodesList ( ) ) { result . put ( getNodePathToRoot ( node ) , node ) ; nodeCount ++ ; } if ( log . isEnabledFor ( Level . IN...
Creates hash map for nodes which contains path from root to node for each node .
10,329
public String getMessage ( ) { StringBuilder msg = new StringBuilder ( "\n" ) ; msg . append ( super . getMessage ( ) ) ; if ( detail != null ) { msg . append ( "\n" ) ; msg . append ( detail . getMessage ( ) ) ; if ( detail . getCause ( ) != null ) { msg . append ( detail . getCause ( ) . getMessage ( ) ) ; } } return...
Returns the detail message including the message from the nested exception if there is one .
10,330
public Dimension maximumLayoutSize ( Container parent ) { return new Dimension ( Integer . MAX_VALUE , Integer . MAX_VALUE ) ; }
Returns the maximum size of this component .
10,331
private char matchSuffix ( String str1 , String str2 ) { char rel = IMappingElement . IDK ; int spacePos1 = str1 . lastIndexOf ( ' ' ) ; String prefix = str1 . substring ( 0 , str1 . length ( ) - str2 . length ( ) ) ; if ( - 1 < spacePos1 && ! prefixes . containsKey ( prefix ) ) { if ( str1 . length ( ) == spacePos1 + ...
Computes the relation with suffix matcher .
10,332
public static String removeLeadingAndTrailingDelimiter ( String str , String delimiter ) { final int strLength = str . length ( ) ; final int delimiterLength = delimiter . length ( ) ; final boolean leadingDelimiter = str . startsWith ( delimiter ) ; final boolean trailingDelimiter = strLength > delimiterLength && str ...
Removes the leading and trailing delimiter from a string .
10,333
public static String removeTrailingDelimiter ( String str , String delimiter ) { if ( ! str . endsWith ( delimiter ) ) { return str ; } else { return str . substring ( 0 , str . length ( ) - delimiter . length ( ) ) ; } }
Removes the trailing delimiter from a string .
10,334
public static String removeLeadingDelimiter ( String str , String delimiter ) { if ( ! str . startsWith ( delimiter ) ) { return str ; } else { return str . substring ( delimiter . length ( ) , str . length ( ) ) ; } }
Removes the leading delimiter from a string .
10,335
public static String emptyToNull ( String str ) { return ( str != null && ! str . isEmpty ( ) ) ? str : null ; }
Transform an empty string into null .
10,336
public static < T > String join ( List < T > list , String delimiter ) { if ( list . isEmpty ( ) ) { return "" ; } final StringBuilder sb = new StringBuilder ( ) ; for ( T element : list ) { sb . append ( element ) ; sb . append ( delimiter ) ; } sb . delete ( sb . length ( ) - delimiter . length ( ) , sb . length ( ) ...
Create a string out of the list s elements using the given delimiter .
10,337
protected static Object [ ] mkAxioms ( HashMap < IAtomicConceptOfLabel , String > hashConceptNumber , Map < INode , ArrayList < IAtomicConceptOfLabel > > nmtAcols , Map < String , IAtomicConceptOfLabel > sourceACoLs , Map < String , IAtomicConceptOfLabel > targetACoLs , IContextMapping < IAtomicConceptOfLabel > acolMap...
Makes axioms for a CNF formula out of relations between atomic concepts .
10,338
protected static String DIMACSfromList ( ArrayList < ArrayList < String > > formula ) { StringBuilder dimacs = new StringBuilder ( "" ) ; for ( List < String > conjClause : formula ) { for ( String disjClause : conjClause ) { dimacs . append ( disjClause ) . append ( " " ) ; } dimacs . append ( " 0\n" ) ; } return dima...
Converts parsed formula into DIMACS format .
10,339
public static JFileChooser getFileChooser ( final String id ) { JFileChooser chooser = new JFileChooser ( ) ; track ( chooser , "FileChooser." + id + ".path" ) ; return chooser ; }
Gets the file chooser with the given id . Its current directory will be tracked and restored on subsequent calls .
10,340
public static JFileChooser getDirectoryChooser ( String id ) { JFileChooser chooser ; Class < ? > directoryChooserClass ; try { directoryChooserClass = Class . forName ( "com.l2fprod.common.swing.JDirectoryChooser" ) ; chooser = ( JFileChooser ) directoryChooserClass . newInstance ( ) ; } catch ( ClassNotFoundException...
Gets the directory chooser with the given id . Its current directory will be tracked and restored on subsequent calls .
10,341
public static void track ( Window window ) { Preferences prefs = node ( ) . node ( "Windows" ) ; String bounds = prefs . get ( window . getName ( ) + ".bounds" , null ) ; if ( bounds != null ) { Rectangle rect = ( Rectangle ) ConverterRegistry . instance ( ) . convert ( Rectangle . class , bounds ) ; window . setBounds...
Restores the window size position and state if possible . Tracks the window size position and state .
10,342
public T parse ( String arg ) throws ParseException { if ( isNull ( arg ) ) { if ( nullable ) { return null ; } else { throw new ParseException ( ParseError . INVALID_PARAM , "Parameter doesn't take 'null' values: " + getName ( ) ) ; } } return parseNonNull ( arg ) ; }
Type specialization - subclasses must parse a value of type T .
10,343
public SingleFieldBuilder < MType , BType , IType > setMessage ( MType message ) { if ( message == null ) { throw new NullPointerException ( ) ; } this . message = message ; if ( builder != null ) { builder . dispose ( ) ; builder = null ; } onChanged ( ) ; return this ; }
Sets a message for the field replacing any existing value .
10,344
public SingleFieldBuilder < MType , BType , IType > mergeFrom ( MType value ) { if ( builder == null && message == message . getDefaultInstanceForType ( ) ) { message = value ; } else { getBuilder ( ) . mergeFrom ( value ) ; } onChanged ( ) ; return this ; }
Merges the field from another field .
10,345
public static FastForward setup ( InetAddress addr , int port ) throws SocketException { final DatagramSocket socket = new DatagramSocket ( ) ; return new FastForward ( addr , port , socket ) ; }
Initialization method for a FastForward client .
10,346
public boolean nodeDisjoint ( IContextMapping < IAtomicConceptOfLabel > acolMapping , Map < INode , ArrayList < IAtomicConceptOfLabel > > nmtAcols , Map < String , IAtomicConceptOfLabel > sourceACoLs , Map < String , IAtomicConceptOfLabel > targetACoLs , INode sourceNode , INode targetNode ) throws NodeMatcherException...
Checks whether source node and target node are disjoint .
10,347
public char nodeMatch ( IContextMapping < IAtomicConceptOfLabel > acolMapping , Map < INode , ArrayList < IAtomicConceptOfLabel > > nmtAcols , Map < String , IAtomicConceptOfLabel > sourceACoLs , Map < String , IAtomicConceptOfLabel > targetACoLs , INode sourceNode , INode targetNode ) throws NodeMatcherException { thr...
stub to allow it to be created as node matcher .
10,348
private void initDefaultColors ( ) { this . categoryBackground = UIManager . getColor ( PANEL_BACKGROUND_COLOR_KEY ) ; this . categoryForeground = UIManager . getColor ( TABLE_FOREGROUND_COLOR_KEY ) . darker ( ) . darker ( ) . darker ( ) ; this . selectedCategoryBackground = categoryBackground . darker ( ) ; this . sel...
Initializes the default set of colors used by the PropertySheetTable .
10,349
public TableCellEditor getCellEditor ( int row , int column ) { if ( column == 0 ) { return null ; } Item item = getSheetModel ( ) . getPropertySheetElement ( row ) ; if ( ! item . isProperty ( ) ) { return null ; } TableCellEditor result = null ; Property propery = item . getProperty ( ) ; PropertyEditor editor = getE...
Gets the CellEditor for the given row and column . It uses the editor registry to find a suitable editor for the property .
10,350
private TableCellRenderer getCellRenderer ( Class < ? > type ) { TableCellRenderer renderer = getRendererFactory ( ) . createTableCellRenderer ( type ) ; if ( renderer == null && type != null ) { renderer = getCellRenderer ( type . getSuperclass ( ) ) ; } if ( renderer == null ) { renderer = super . getDefaultRenderer ...
Helper method to lookup a cell renderer based on type .
10,351
public void setModel ( TableModel newModel ) { if ( ! ( newModel instanceof PropertySheetTableModel ) ) { throw new IllegalArgumentException ( "dataModel must be of type " + PropertySheetTableModel . class . getName ( ) ) ; } if ( cancelEditing == null ) { cancelEditing = new CancelEditing ( ) ; } TableModel oldModel =...
Overriden to register a listener on the model . This listener ensures editing is canceled when editing row is being changed .
10,352
static int getIndent ( PropertySheetTable table , Item item ) { int indent ; if ( item . isProperty ( ) ) { if ( ( item . getParent ( ) == null || ! item . getParent ( ) . isProperty ( ) ) && ! item . hasToggle ( ) ) { indent = table . getWantsExtraIndent ( ) ? HOTSPOT_SIZE : 0 ; } else { if ( item . hasToggle ( ) ) { ...
Calculates the required left indent for a given item given its type and its hierarchy level .
10,353
public void process ( SshServer sshd ) throws ExtensionException { ParallelJURLKeyPairProvider urlKeyPairProvider = null ; ServiceLoader < ParallelJURLKeyPairProvider > loader = CacheableServiceLoader . INSTANCE . load ( ParallelJURLKeyPairProvider . class , ParallelJURLKeyPairProvider . class . getClassLoader ( ) ) ; ...
Any others configurations for the sshd server can be done directly with the SshServer object from Apache mina SSHD
10,354
public String after ( String schemeSpecific , String separator ) { int idx ; idx = schemeSpecific . indexOf ( separator ) ; if ( idx == - 1 ) { return null ; } return schemeSpecific . substring ( idx + separator . length ( ) ) ; }
Helper Method for opaquePath implementations
10,355
public static synchronized Router getRouterFor ( ServletContext con ) { String contextPath = EldaRouterRestletSupport . flatContextPath ( con . getContextPath ( ) ) ; TimestampedRouter r = routers . get ( contextPath ) ; long timeNow = System . currentTimeMillis ( ) ; if ( r == null ) { log . info ( "creating router fo...
Answer a router initialised with the URI templates appropriate to this context path . Such a router may already be in the routers table in which case it is used otherwise a new router is created initialised put in the table and returned .
10,356
private boolean notFormat ( Match m , String type ) { return m . getEndpoint ( ) . getRendererNamed ( type ) == null ; }
Answer true of m s endpoint has no formatter called type .
10,357
public void process ( CAS aCAS ) throws AnalysisEngineProcessException { try { JCas jcas = aCAS . getJCas ( ) ; ExperimentUUID experiment = ProcessingStepUtils . getCurrentExperiment ( jcas ) ; AnnotationIndex < Annotation > steps = jcas . getAnnotationIndex ( ProcessingStep . type ) ; String uuid = experiment . getUui...
Reads the results from the retrieval phase from the DOCUMENT and the DOCUEMNT_GS views of the JCAs and generates and evaluates them using the evaluate method from the FMeasureConsumer class .
10,358
private Class < ? > resolveResultJavaType ( Class < ? > resultType , String property , Class < ? > javaType ) { if ( javaType == null && property != null ) { try { MetaClass metaResultType = MetaClass . forClass ( resultType , REFLECTOR_FACTORY ) ; javaType = metaResultType . getSetterType ( property ) ; } catch ( Exce...
copy from mybatis sourceCode
10,359
public Object getNext ( KCall call ) { if ( map . get ( call . getProcedure ( ) . getId ( ) ) == null ) { Object context = call . getProcess ( ) . getContext ( ) ; Method readMethod = null ; try { readMethod = new PropertyDescriptor ( pipelineDataName , context . getClass ( ) ) . getReadMethod ( ) ; } catch ( Introspec...
Based on KProcedure index for data it will return next value from list
10,360
public BeanInfo [ ] getAdditionalBeanInfo ( ) { ArrayList < BeanInfo > bi = new ArrayList < BeanInfo > ( ) ; BeanInfo [ ] biarr = null ; try { for ( Class < ? > cl = com . l2fprod . common . swing . JCollapsiblePane . class . getSuperclass ( ) ; ! cl . equals ( java . awt . Component . class . getSuperclass ( ) ) ; cl ...
Gets the additionalBeanInfo .
10,361
public int getDefaultPropertyIndex ( ) { String defName = "" ; if ( "" . equals ( defName ) ) { return - 1 ; } PropertyDescriptor [ ] pd = getPropertyDescriptors ( ) ; for ( int i = 0 ; i < pd . length ; i ++ ) { if ( pd [ i ] . getName ( ) . equals ( defName ) ) { return i ; } } return - 1 ; }
Gets the defaultPropertyIndex .
10,362
public Image getIcon ( int type ) { if ( type == BeanInfo . ICON_COLOR_16x16 ) { return iconColor16 ; } if ( type == BeanInfo . ICON_MONO_16x16 ) { return iconMono16 ; } if ( type == BeanInfo . ICON_COLOR_32x32 ) { return iconColor32 ; } if ( type == BeanInfo . ICON_MONO_32x32 ) { return iconMono32 ; } return null ; }
Gets the icon .
10,363
public PropertyDescriptor [ ] getPropertyDescriptors ( ) { try { ArrayList < PropertyDescriptor > descriptors = new ArrayList < PropertyDescriptor > ( ) ; PropertyDescriptor descriptor ; try { descriptor = new PropertyDescriptor ( "animated" , com . l2fprod . common . swing . JCollapsiblePane . class ) ; } catch ( Intr...
Gets the Property Descriptors .
10,364
public char match ( ISense source , ISense target ) throws MatcherLibraryException { char result = IMappingElement . IDK ; try { String sSynset = source . getGloss ( ) ; String tLGExtendedGloss = getExtendedGloss ( target , 1 , IMappingElement . LESS_GENERAL ) ; char LGRel = getDominantRelation ( sSynset , tLGExtendedG...
Computes the relation for extended semantic gloss matcher .
10,365
private char getDominantRelation ( String sExtendedGloss , String tExtendedGloss ) throws MatcherLibraryException { int Equals = 0 ; int moreGeneral = 0 ; int lessGeneral = 0 ; int Opposite = 0 ; StringTokenizer stSource = new StringTokenizer ( sExtendedGloss , " ,.\"'()" ) ; String lemmaS , lemmaT ; while ( stSource ....
Gets Semantic relation occurring more frequently between words in two extended glosses .
10,366
private char getRelationFromInts ( int lg , int mg , int syn , int opp ) { if ( ( lg >= mg ) && ( lg >= syn ) && ( lg >= opp ) && ( lg > 0 ) ) { return IMappingElement . LESS_GENERAL ; } if ( ( mg >= lg ) && ( mg >= syn ) && ( mg >= opp ) && ( mg > 0 ) ) { return IMappingElement . MORE_GENERAL ; } if ( ( syn >= mg ) &&...
Decides which relation to return .
10,367
private char getRelationFromRels ( char builtForRel , char glossRel ) { if ( builtForRel == IMappingElement . EQUIVALENCE ) { return glossRel ; } if ( builtForRel == IMappingElement . LESS_GENERAL ) { if ( ( glossRel == IMappingElement . LESS_GENERAL ) || ( glossRel == IMappingElement . EQUIVALENCE ) ) { return IMappin...
Decides which relation to return as a function of relation for which extended gloss was built .
10,368
public Map < ParsedPath , List < CommandDef > > processObject ( Object instance ) { final ClassContext context = new ClassContext ( ) ; doProcess ( instance , context ) ; return context . commandPaths ; }
Process the object s class and all declared inner classes and return all parsed commands with their paths .
10,369
protected void add ( String key , Status status , String masterValue , String value ) { textNodeMap . put ( key , new TextNode ( key , status , masterValue , value ) ) ; }
Adds a record to this CSV file .
10,370
private static List < INode > preorder ( INode root ) { ArrayList < INode > result = new ArrayList < INode > ( ) ; Deque < INode > stack = new ArrayDeque < INode > ( ) ; stack . push ( root ) ; while ( ! stack . isEmpty ( ) ) { INode c = stack . pop ( ) ; result . add ( c ) ; for ( int i = c . getChildCount ( ) - 1 ; i...
Preorders the subtree rooted at the given node .
10,371
public void setContentPane ( Container contentPanel ) { if ( contentPanel == null ) { throw new IllegalArgumentException ( "Content pane can't be null" ) ; } if ( wrapper != null ) { super . remove ( wrapper ) ; } wrapper = new WrapperContainer ( contentPanel ) ; super . addImpl ( wrapper , BorderLayout . CENTER , - 1 ...
Sets the content pane of this JCollapsiblePane . Components must be added to this content pane not to the JCollapsiblePane .
10,372
private void setAnimationParams ( AnimationParams params ) { if ( params == null ) { throw new IllegalArgumentException ( "params can't be null" ) ; } if ( animateTimer != null ) { animateTimer . stop ( ) ; } animationParams = params ; animateTimer = new Timer ( animationParams . waitTime , animator ) ; animateTimer . ...
Sets the parameters controlling the animation .
10,373
public DateFuncSup subtract ( DateSeperator d ) { date . setTime ( date . getTime ( ) - d . parse ( ) ) ; return this ; }
subtract date on supported date
10,374
public DateFuncSup nextMonth ( int next ) { Calendar cal = Calendar . getInstance ( ) ; cal . setTime ( date ) ; cal . add ( Calendar . MONTH , next ) ; date . setTime ( cal . getTimeInMillis ( ) ) ; return this ; }
set date to next months
10,375
public DateFuncSup nextYear ( int next ) { Calendar cal = Calendar . getInstance ( ) ; cal . setTime ( date ) ; cal . add ( Calendar . YEAR , next ) ; date . setTime ( cal . getTimeInMillis ( ) ) ; return this ; }
set date to next years
10,376
public static String toCNF ( INode in , String formula ) throws ContextClassifierException { PEParser parser = new PEParser ( ) ; CNFTransformer transformer = new CNFTransformer ( ) ; String result = formula ; if ( ( formula . contains ( "&" ) && formula . contains ( "|" ) ) || formula . contains ( "~" ) ) { String tmp...
Converts the formula into CNF .
10,377
private String extractLanguage ( String columnHeading ) throws ParseException { int start = columnHeading . indexOf ( '(' ) ; int end = columnHeading . indexOf ( ')' ) ; if ( start == - 1 || end == - 1 || start >= end ) { throwWrongHeaderException ( ) ; } return columnHeading . substring ( start + 1 , end ) ; }
Extracts the language of the master language value and value column heading in the first line of the trema CSV file .
10,378
public final boolean registerMBean ( final Class < ? > clazz ) { if ( this . mbs != null && clazz != null ) { try { final String fqnName = clazz . getCanonicalName ( ) ; final String domain = fqnName . substring ( 0 , fqnName . lastIndexOf ( '.' ) ) ; final String type = fqnName . substring ( fqnName . lastIndexOf ( '....
Try to register standard MBean type in the JMX server
10,379
private void unRegisterMBeans ( ) { if ( beanNames != null ) { for ( ObjectName objectName : beanNames ) { try { mbs . unregisterMBean ( objectName ) ; LaunchingMessageKind . IJMX0006 . format ( objectName ) ; } catch ( MBeanRegistrationException e ) { } catch ( InstanceNotFoundException e ) { } } beanNames . clear ( )...
Unregister all registered MBeans in the JMX server .
10,380
private int numOfTabs ( String line ) { int i = 0 ; while ( i < line . length ( ) && '\t' == line . charAt ( i ) ) { i ++ ; } return i ; }
Counts the number of tabs in the line .
10,381
private void setArrayNodeID ( int index , ArrayList < INode > array , INode node ) { if ( index < array . size ( ) ) { array . set ( index , node ) ; } else { array . add ( index , node ) ; } }
Sets the node at a given position of the array . Changes the current value if there is one if there is no value adds a new one .
10,382
public void makeImmutable ( ) { if ( ! isImmutable ) { overflowEntries = overflowEntries . isEmpty ( ) ? Collections . < K , V > emptyMap ( ) : Collections . unmodifiableMap ( overflowEntries ) ; isImmutable = true ; } }
Make this map immutable from this point forward .
10,383
private void ensureEntryArrayMutable ( ) { checkMutable ( ) ; if ( entryList . isEmpty ( ) && ! ( entryList instanceof ArrayList ) ) { entryList = new ArrayList < Entry > ( maxArraySize ) ; } }
Lazily creates the entry list . Any code that adds to the list must first call this method .
10,384
public String displayConfiguration ( ) { StringBuffer result = new StringBuffer ( ) ; for ( ConfigurationManager confManager : ConfigurationService . getConfigurationService ( ) . getConfigurationManager ( ) . values ( ) ) { Object configuration = confManager . getConfiguration ( ) ; StringWriter writer = new StringWri...
This method is used to display the configurations data loaded from all configuration files .
10,385
public byte [ ] readBytes ( ) throws IOException { Buffer buffer ; try ( InputStream src = newInputStream ( ) ) { buffer = getWorld ( ) . getBuffer ( ) ; synchronized ( buffer ) { return buffer . readBytes ( src ) ; } } }
Reads all bytes of the node .
10,386
public Properties readProperties ( ) throws IOException { Properties p ; try ( Reader src = newReader ( ) ) { p = new Properties ( ) ; p . load ( src ) ; } return p ; }
Reads properties with the encoding for this node
10,387
public T mkfile ( ) throws MkfileException { try { if ( exists ( ) ) { throw new MkfileException ( this ) ; } return writeBytes ( ) ; } catch ( IOException e ) { throw new MkfileException ( this , e ) ; } }
Fails if the file already exists . Features define whether this operation is atomic . This default implementation is not atomic .
10,388
public void copy ( Node dest ) throws NodeNotFoundException , CopyException { try { if ( isDirectory ( ) ) { dest . mkdirOpt ( ) ; copyDirectory ( dest ) ; } else { copyFile ( dest ) ; } } catch ( FileNotFoundException | CopyException e ) { throw e ; } catch ( IOException e ) { throw new CopyException ( this , dest , e...
Copies this to dest . Overwrites existing file and adds to existing directories .
10,389
public Node copyFile ( Node dest ) throws FileNotFoundException , CopyException { try ( OutputStream out = dest . newOutputStream ( ) ) { copyFileTo ( out ) ; } catch ( FileNotFoundException e ) { throw e ; } catch ( IOException e ) { throw new CopyException ( this , dest , e ) ; } return this ; }
Overwrites dest if it already exists .
10,390
public List < Node > copyDirectory ( Node dest ) throws DirectoryNotFoundException , CopyException { return copyDirectory ( dest , new Filter ( ) . includeAll ( ) ) ; }
Convenience method for copy all files . Does not use default - excludes
10,391
public List < Node > copyDirectory ( Node destdir , Filter filter ) throws DirectoryNotFoundException , CopyException { return new Copy ( this , filter ) . directory ( destdir ) ; }
Throws an exception is this or dest is not a directory . Overwrites existing files in dest .
10,392
public Node move ( Node dest , boolean overwrite ) throws NodeNotFoundException , MoveException { try { if ( ! overwrite ) { dest . checkNotExists ( ) ; } copy ( dest ) ; deleteTree ( ) ; } catch ( FileNotFoundException e ) { throw e ; } catch ( IOException e ) { throw new MoveException ( this , dest , "move failed" , ...
Moves this file or directory to dest . Throws an exception if this does not exist or if dest already exists . This method is a default implementation with copy and delete derived classes should override it with a native implementation when available .
10,393
public T link ( T dest ) throws LinkException { if ( ! getClass ( ) . equals ( dest . getClass ( ) ) ) { throw new IllegalArgumentException ( this . getClass ( ) + " vs " + dest . getClass ( ) ) ; } try { checkExists ( ) ; } catch ( IOException e ) { throw new LinkException ( this , e ) ; } dest . mklink ( Filesystem ....
Creates an absolute link dest pointing to this . The signature of this method resembles the copy method .
10,394
public T resolveLink ( ) throws ReadLinkException { String path ; path = readLink ( ) ; if ( path . startsWith ( Filesystem . SEPARATOR_STRING ) ) { return getRoot ( ) . node ( path . substring ( 1 ) , null ) ; } else { return ( T ) getParent ( ) . join ( path ) ; } }
Throws an exception if this is not a link .
10,395
public List < T > find ( String ... includes ) throws IOException { return find ( getWorld ( ) . filter ( ) . include ( includes ) ) ; }
uses default excludes
10,396
private void truncateTempTables ( ) throws SQLException { Logger logger = I2b2ETLUtil . logger ( ) ; logger . log ( Level . INFO , "Truncating temp data tables for query {0}" , this . query . getName ( ) ) ; try ( final Connection conn = openDataDatabaseConnection ( ) ) { conn . setAutoCommit ( true ) ; String [ ] data...
Calls stored procedures to drop all of the temp tables created .
10,397
public int first ( ) { int val ; int i ; for ( i = 0 ; i < data . length ; i ++ ) { if ( data [ i ] != 0 ) { val = data [ i ] ; i <<= SHIFT ; while ( ( val & 1 ) == 0 ) { val >>>= 1 ; i ++ ; } return i ; } } return - 1 ; }
Gets the first element of the set .
10,398
public int last ( ) { int val ; int i ; for ( i = data . length - 1 ; i >= 0 ; i -- ) { if ( data [ i ] != 0 ) { val = data [ i ] >>> 1 ; i <<= SHIFT ; while ( val != 0 ) { val >>>= 1 ; i ++ ; } return i ; } } return - 1 ; }
Gets the last element of the set .
10,399
public int next ( int ele ) { int idx , bit , val ; idx = ele >> SHIFT ; bit = ele & MASK ; val = data [ idx ] >>> bit ; do { val >>>= 1 ; bit ++ ; if ( val == 0 ) { idx ++ ; if ( idx == data . length ) { return - 1 ; } val = data [ idx ] ; bit = 0 ; } } while ( ( val & 1 ) == 0 ) ; return ( idx << SHIFT ) + bit ; }
Gets the element following ele .