idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
21,000 | public void addChildTask ( Task child ) { child . m_parent = this ; m_children . add ( child ) ; setSummary ( true ) ; if ( getParentFile ( ) . getProjectConfig ( ) . getAutoOutlineLevel ( ) == true ) { child . setOutlineLevel ( Integer . valueOf ( NumberHelper . getInt ( getOutlineLevel ( ) ) + 1 ) ) ; } } | This method is used to associate a child task with the current task instance . It has been designed to allow the hierarchical outline structure of tasks in an MPX file to be updated once all of the task data has been read . |
21,001 | public void addChildTaskBefore ( Task child , Task previousSibling ) { int index = m_children . indexOf ( previousSibling ) ; if ( index == - 1 ) { m_children . add ( child ) ; } else { m_children . add ( index , child ) ; } child . m_parent = this ; setSummary ( true ) ; if ( getParentFile ( ) . getProjectConfig ( ) .... | Inserts a child task prior to a given sibling task . |
21,002 | public void removeChildTask ( Task child ) { if ( m_children . remove ( child ) ) { child . m_parent = null ; } setSummary ( ! m_children . isEmpty ( ) ) ; } | Removes a child task . |
21,003 | public ResourceAssignment addResourceAssignment ( Resource resource ) { ResourceAssignment assignment = getExistingResourceAssignment ( resource ) ; if ( assignment == null ) { assignment = new ResourceAssignment ( getParentFile ( ) , this ) ; m_assignments . add ( assignment ) ; getParentFile ( ) . getResourceAssignme... | This method allows a resource assignment to be added to the current task . |
21,004 | public void addResourceAssignment ( ResourceAssignment assignment ) { if ( getExistingResourceAssignment ( assignment . getResource ( ) ) == null ) { m_assignments . add ( assignment ) ; getParentFile ( ) . getResourceAssignments ( ) . add ( assignment ) ; Resource resource = assignment . getResource ( ) ; if ( resourc... | Add a resource assignment which has been populated elsewhere . |
21,005 | private ResourceAssignment getExistingResourceAssignment ( Resource resource ) { ResourceAssignment assignment = null ; Integer resourceUniqueID = null ; if ( resource != null ) { Iterator < ResourceAssignment > iter = m_assignments . iterator ( ) ; resourceUniqueID = resource . getUniqueID ( ) ; while ( iter . hasNext... | Retrieves an existing resource assignment if one is present to prevent duplicate resource assignments being added . |
21,006 | @ SuppressWarnings ( "unchecked" ) public Relation addPredecessor ( Task targetTask , RelationType type , Duration lag ) { if ( lag == null ) { lag = Duration . getInstance ( 0 , TimeUnit . DAYS ) ; } List < Relation > predecessorList = ( List < Relation > ) getCachedValue ( TaskField . PREDECESSORS ) ; Relation predec... | This method allows a predecessor relationship to be added to this task instance . |
21,007 | public void setID ( Integer val ) { ProjectFile parent = getParentFile ( ) ; Integer previous = getID ( ) ; if ( previous != null ) { parent . getTasks ( ) . unmapID ( previous ) ; } parent . getTasks ( ) . mapID ( val , this ) ; set ( TaskField . ID , val ) ; } | The ID field contains the identifier number that Microsoft Project automatically assigns to each task as you add it to the project . The ID indicates the position of a task with respect to the other tasks . |
21,008 | public Duration getBaselineDuration ( ) { Object result = getCachedValue ( TaskField . BASELINE_DURATION ) ; if ( result == null ) { result = getCachedValue ( TaskField . BASELINE_ESTIMATED_DURATION ) ; } if ( ! ( result instanceof Duration ) ) { result = null ; } return ( Duration ) result ; } | The Baseline Duration field shows the original span of time planned to complete a task . |
21,009 | public String getBaselineDurationText ( ) { Object result = getCachedValue ( TaskField . BASELINE_DURATION ) ; if ( result == null ) { result = getCachedValue ( TaskField . BASELINE_ESTIMATED_DURATION ) ; } if ( ! ( result instanceof String ) ) { result = null ; } return ( String ) result ; } | Retrieves the text value for the baseline duration . |
21,010 | public Date getBaselineFinish ( ) { Object result = getCachedValue ( TaskField . BASELINE_FINISH ) ; if ( result == null ) { result = getCachedValue ( TaskField . BASELINE_ESTIMATED_FINISH ) ; } if ( ! ( result instanceof Date ) ) { result = null ; } return ( Date ) result ; } | The Baseline Finish field shows the planned completion date for a task at the time you saved a baseline . Information in this field becomes available when you set a baseline for a task . |
21,011 | public Date getBaselineStart ( ) { Object result = getCachedValue ( TaskField . BASELINE_START ) ; if ( result == null ) { result = getCachedValue ( TaskField . BASELINE_ESTIMATED_START ) ; } if ( ! ( result instanceof Date ) ) { result = null ; } return ( Date ) result ; } | The Baseline Start field shows the planned beginning date for a task at the time you saved a baseline . Information in this field becomes available when you set a baseline . |
21,012 | public Number getCostVariance ( ) { Number variance = ( Number ) getCachedValue ( TaskField . COST_VARIANCE ) ; if ( variance == null ) { Number cost = getCost ( ) ; Number baselineCost = getBaselineCost ( ) ; if ( cost != null && baselineCost != null ) { variance = NumberHelper . getDouble ( cost . doubleValue ( ) - b... | The Cost Variance field shows the difference between the baseline cost and total cost for a task . The total cost is the current estimate of costs based on actual costs and remaining costs . |
21,013 | public boolean getCritical ( ) { Boolean critical = ( Boolean ) getCachedValue ( TaskField . CRITICAL ) ; if ( critical == null ) { Duration totalSlack = getTotalSlack ( ) ; ProjectProperties props = getParentFile ( ) . getProjectProperties ( ) ; int criticalSlackLimit = NumberHelper . getInt ( props . getCriticalSlack... | The Critical field indicates whether a task has any room in the schedule to slip or if a task is on the critical path . The Critical field contains Yes if the task is critical and No if the task is not critical . |
21,014 | public void setOutlineCode ( int index , String value ) { set ( selectField ( TaskFieldLists . CUSTOM_OUTLINE_CODE , index ) , value ) ; } | Set an outline code value . |
21,015 | public Duration getTotalSlack ( ) { Duration totalSlack = ( Duration ) getCachedValue ( TaskField . TOTAL_SLACK ) ; if ( totalSlack == null ) { Duration duration = getDuration ( ) ; if ( duration == null ) { duration = Duration . getInstance ( 0 , TimeUnit . DAYS ) ; } TimeUnit units = duration . getUnits ( ) ; Duratio... | The Total Slack field contains the amount of time a task can be delayed without delaying the project s finish date . |
21,016 | public void setCalendar ( ProjectCalendar calendar ) { set ( TaskField . CALENDAR , calendar ) ; setCalendarUniqueID ( calendar == null ? null : calendar . getUniqueID ( ) ) ; } | Sets the name of the base calendar associated with this task . Note that this attribute appears in MPP9 and MSPDI files . |
21,017 | public Duration getStartSlack ( ) { Duration startSlack = ( Duration ) getCachedValue ( TaskField . START_SLACK ) ; if ( startSlack == null ) { Duration duration = getDuration ( ) ; if ( duration != null ) { startSlack = DateHelper . getVariance ( this , getEarlyStart ( ) , getLateStart ( ) , duration . getUnits ( ) ) ... | Retrieve the start slack . |
21,018 | public Duration getFinishSlack ( ) { Duration finishSlack = ( Duration ) getCachedValue ( TaskField . FINISH_SLACK ) ; if ( finishSlack == null ) { Duration duration = getDuration ( ) ; if ( duration != null ) { finishSlack = DateHelper . getVariance ( this , getEarlyFinish ( ) , getLateFinish ( ) , duration . getUnits... | Retrieve the finish slack . |
21,019 | public Object getFieldByAlias ( String alias ) { return getCachedValue ( getParentFile ( ) . getCustomFields ( ) . getFieldByAlias ( FieldTypeClass . TASK , alias ) ) ; } | Retrieve the value of a field using its alias . |
21,020 | public void setFieldByAlias ( String alias , Object value ) { set ( getParentFile ( ) . getCustomFields ( ) . getFieldByAlias ( FieldTypeClass . TASK , alias ) , value ) ; } | Set the value of a field using its alias . |
21,021 | public boolean getEnterpriseFlag ( int index ) { return ( BooleanHelper . getBoolean ( ( Boolean ) getCachedValue ( selectField ( TaskFieldLists . ENTERPRISE_FLAG , index ) ) ) ) ; } | Retrieve an enterprise field value . |
21,022 | public String getBaselineDurationText ( int baselineNumber ) { Object result = getCachedValue ( selectField ( TaskFieldLists . BASELINE_DURATIONS , baselineNumber ) ) ; if ( result == null ) { result = getCachedValue ( selectField ( TaskFieldLists . BASELINE_ESTIMATED_DURATIONS , baselineNumber ) ) ; } if ( ! ( result ... | Retrieves the baseline duration text value . |
21,023 | public void setBaselineDurationText ( int baselineNumber , String value ) { set ( selectField ( TaskFieldLists . BASELINE_DURATIONS , baselineNumber ) , value ) ; } | Sets the baseline duration text value . |
21,024 | public void setBaselineFinishText ( int baselineNumber , String value ) { set ( selectField ( TaskFieldLists . BASELINE_FINISHES , baselineNumber ) , value ) ; } | Sets the baseline finish text value . |
21,025 | public void setBaselineStartText ( int baselineNumber , String value ) { set ( selectField ( TaskFieldLists . BASELINE_STARTS , baselineNumber ) , value ) ; } | Sets the baseline start text value . |
21,026 | public Date getCompleteThrough ( ) { Date value = ( Date ) getCachedValue ( TaskField . COMPLETE_THROUGH ) ; if ( value == null ) { int percentComplete = NumberHelper . getInt ( getPercentageComplete ( ) ) ; switch ( percentComplete ) { case 0 : { break ; } case 100 : { value = getActualFinish ( ) ; break ; } default :... | Retrieve the complete through date . |
21,027 | public TaskMode getTaskMode ( ) { return BooleanHelper . getBoolean ( ( Boolean ) getCachedValue ( TaskField . TASK_MODE ) ) ? TaskMode . MANUALLY_SCHEDULED : TaskMode . AUTO_SCHEDULED ; } | Retrieves the task mode . |
21,028 | public ProjectCalendar getEffectiveCalendar ( ) { ProjectCalendar result = getCalendar ( ) ; if ( result == null ) { result = getParentFile ( ) . getDefaultCalendar ( ) ; } return result ; } | Retrieve the effective calendar for this task . If the task does not have a specific calendar associated with it fall back to using the default calendar for the project . |
21,029 | public boolean removePredecessor ( Task targetTask , RelationType type , Duration lag ) { boolean matchFound = false ; List < Relation > predecessorList = getPredecessors ( ) ; if ( ! predecessorList . isEmpty ( ) ) { if ( lag == null ) { lag = Duration . getInstance ( 0 , TimeUnit . DAYS ) ; } matchFound = removeRelat... | This method allows a predecessor relationship to be removed from this task instance . It will only delete relationships that exactly match the given targetTask type and lag time . |
21,030 | private boolean removeRelation ( List < Relation > relationList , Task targetTask , RelationType type , Duration lag ) { boolean matchFound = false ; for ( Relation relation : relationList ) { if ( relation . getTargetTask ( ) == targetTask ) { if ( relation . getType ( ) == type && relation . getLag ( ) . compareTo ( ... | Internal method used to locate an remove an item from a list Relations . |
21,031 | private boolean isRelated ( Task task , List < Relation > list ) { boolean result = false ; for ( Relation relation : list ) { if ( relation . getTargetTask ( ) . getUniqueID ( ) . intValue ( ) == task . getUniqueID ( ) . intValue ( ) ) { result = true ; break ; } } return result ; } | Internal method used to test for the existence of a relationship with a task . |
21,032 | public void writeTo ( Writer destination ) { Element eltRuleset = new Element ( "ruleset" ) ; addAttribute ( eltRuleset , "name" , name ) ; addChild ( eltRuleset , "description" , description ) ; for ( PmdRule pmdRule : rules ) { Element eltRule = new Element ( "rule" ) ; addAttribute ( eltRule , "ref" , pmdRule . getR... | Serializes this RuleSet in an XML document . |
21,033 | public PmdRuleSet create ( ) { final SAXBuilder parser = new SAXBuilder ( ) ; final Document dom ; try { dom = parser . build ( source ) ; } catch ( JDOMException | IOException e ) { if ( messages != null ) { messages . addErrorText ( INVALID_INPUT + " : " + e . getMessage ( ) ) ; } LOG . error ( INVALID_INPUT , e ) ; ... | Parses the given Reader for PmdRuleSets . |
21,034 | private static int calculateBeginLine ( RuleViolation pmdViolation ) { int minLine = Math . min ( pmdViolation . getBeginLine ( ) , pmdViolation . getEndLine ( ) ) ; return minLine > 0 ? minLine : calculateEndLine ( pmdViolation ) ; } | Calculates the beginLine of a violation report . |
21,035 | public View findViewById ( int id ) { if ( searchView != null ) { return searchView . findViewById ( id ) ; } else if ( supportView != null ) { return supportView . findViewById ( id ) ; } throw new IllegalStateException ( ERROR_NO_SEARCHVIEW ) ; } | Look for a child view with the given id . If this view has the given id return this view . |
21,036 | public Context getContext ( ) { if ( searchView != null ) { return searchView . getContext ( ) ; } else if ( supportView != null ) { return supportView . getContext ( ) ; } throw new IllegalStateException ( ERROR_NO_SEARCHVIEW ) ; } | Returns the context the view is running in through which it can access the current theme resources etc . |
21,037 | public CharSequence getQuery ( ) { if ( searchView != null ) { return searchView . getQuery ( ) ; } else if ( supportView != null ) { return supportView . getQuery ( ) ; } throw new IllegalStateException ( ERROR_NO_SEARCHVIEW ) ; } | Returns the query string currently in the text field . |
21,038 | public void setOnQueryTextListener ( final SearchView . OnQueryTextListener listener ) { if ( searchView != null ) { searchView . setOnQueryTextListener ( listener ) ; } else if ( supportView != null ) { supportView . setOnQueryTextListener ( new android . support . v7 . widget . SearchView . OnQueryTextListener ( ) { ... | Sets a listener for user actions within the SearchView . |
21,039 | public void setOnCloseListener ( final android . support . v7 . widget . SearchView . OnCloseListener listener ) { if ( searchView != null ) { searchView . setOnCloseListener ( new SearchView . OnCloseListener ( ) { public boolean onClose ( ) { return listener . onClose ( ) ; } } ) ; } else if ( supportView != null ) {... | Sets a listener to inform when the user closes the SearchView . |
21,040 | public static Searcher get ( String variant ) { final Searcher searcher = instances . get ( variant ) ; if ( searcher == null ) { throw new IllegalStateException ( Errors . SEARCHER_GET_BEFORE_CREATE ) ; } return searcher ; } | Gets the Searcher for a given variant . |
21,041 | @ SuppressWarnings ( { "WeakerAccess" , "unused" } ) public Searcher reset ( ) { lastResponsePage = 0 ; lastRequestPage = 0 ; lastResponseId = 0 ; endReached = false ; clearFacetRefinements ( ) ; cancelPendingRequests ( ) ; numericRefinements . clear ( ) ; return this ; } | Resets the helper s state . |
21,042 | @ SuppressWarnings ( { "WeakerAccess" , "unused" } ) public Searcher cancelPendingRequests ( ) { if ( pendingRequests . size ( ) != 0 ) { for ( int i = 0 ; i < pendingRequests . size ( ) ; i ++ ) { int reqId = pendingRequests . keyAt ( i ) ; Request r = pendingRequests . valueAt ( i ) ; if ( ! r . isFinished ( ) && ! r... | Cancels all requests still waiting for a response . |
21,043 | @ SuppressWarnings ( { "WeakerAccess" , "unused" } ) public Searcher addBooleanFilter ( String attribute , Boolean value ) { booleanFilterMap . put ( attribute , value ) ; rebuildQueryFacetFilters ( ) ; return this ; } | Adds a boolean refinement for the next queries . |
21,044 | @ SuppressWarnings ( { "WeakerAccess" , "unused" } ) public Searcher addFacet ( String ... attributes ) { for ( String attribute : attributes ) { final Integer value = facetRequestCount . get ( attribute ) ; facetRequestCount . put ( attribute , value == null ? 1 : value + 1 ) ; if ( value == null || value == 0 ) { fac... | Adds one or several attributes to facet on for the next queries . |
21,045 | @ SuppressWarnings ( { "WeakerAccess" , "unused" } ) public Searcher deleteFacet ( String ... attributes ) { for ( String attribute : attributes ) { facetRequestCount . put ( attribute , 0 ) ; facets . remove ( attribute ) ; } rebuildQueryFacets ( ) ; return this ; } | Forces removal of one or several faceted attributes for the next queries . |
21,046 | public static void checkOperatorIsValid ( int operatorCode ) { switch ( operatorCode ) { case OPERATOR_LT : case OPERATOR_LE : case OPERATOR_EQ : case OPERATOR_NE : case OPERATOR_GE : case OPERATOR_GT : case OPERATOR_UNKNOWN : return ; default : throw new IllegalStateException ( String . format ( Locale . US , ERROR_IN... | Checks if the given operator code is a valid one . |
21,047 | public static String getStringFromJSONPath ( JSONObject record , String path ) { final Object object = getObjectFromJSONPath ( record , path ) ; return object == null ? null : object . toString ( ) ; } | Gets a string attribute from a json object given a path to traverse . |
21,048 | public static HashMap < String , String > getMapFromJSONPath ( JSONObject record , String path ) { return getObjectFromJSONPath ( record , path ) ; } | Gets a Map of attributes from a json object given a path to traverse . |
21,049 | @ SuppressWarnings ( { "WeakerAccess" , "unused" } ) public void enableKeyboardAutoHiding ( ) { keyboardListener = new OnScrollListener ( ) { public void onScrolled ( RecyclerView recyclerView , int dx , int dy ) { if ( dx != 0 || dy != 0 ) { imeManager . hideSoftInputFromWindow ( Hits . this . getWindowToken ( ) , Inp... | Starts closing the keyboard when the hits are scrolled . |
21,050 | public void search ( String query ) { final Query newQuery = searcher . getQuery ( ) . setQuery ( query ) ; searcher . setQuery ( newQuery ) . search ( ) ; } | Triggers a new search with the given text . |
21,051 | @ SuppressWarnings ( { "WeakerAccess" , "unused" } ) public void registerFilters ( List < AlgoliaFilter > filters ) { for ( final AlgoliaFilter filter : filters ) { searcher . addFacet ( filter . getAttribute ( ) ) ; } } | Registers your facet filters adding them to this InstantSearch s widgets . |
21,052 | @ SuppressWarnings ( { "WeakerAccess" , "unused" } ) public void registerWidget ( View widget ) { prepareWidget ( widget ) ; if ( widget instanceof AlgoliaResultsListener ) { AlgoliaResultsListener listener = ( AlgoliaResultsListener ) widget ; if ( ! this . resultListeners . contains ( listener ) ) { this . resultList... | Links the given widget to InstantSearch according to the interfaces it implements . |
21,053 | private List < String > processAllListeners ( View rootView ) { List < String > refinementAttributes = new ArrayList < > ( ) ; final List < AlgoliaResultsListener > resultListeners = LayoutViews . findByClass ( ( ViewGroup ) rootView , AlgoliaResultsListener . class ) ; if ( resultListeners . isEmpty ( ) ) { throw new ... | Finds and sets up the Listeners in the given rootView . |
21,054 | public SuggestAccountsRequest suggestAccounts ( ) throws RestApiException { return new SuggestAccountsRequest ( ) { public List < AccountInfo > get ( ) throws RestApiException { return AccountsRestClient . this . suggestAccounts ( this ) ; } } ; } | Added in Gerrit 2 . 11 . |
21,055 | public static String encode ( String component ) { if ( component != null ) { try { return URLEncoder . encode ( component , UTF_8 . name ( ) ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( "JVM must support UTF-8" , e ) ; } } return null ; } | Encode a path segment escaping characters not valid for a URL . |
21,056 | private Optional < String > getXsrfFromHtmlBody ( HttpResponse loginResponse ) throws IOException { Optional < Cookie > gerritAccountCookie = findGerritAccountCookie ( ) ; if ( gerritAccountCookie . isPresent ( ) ) { Matcher matcher = GERRIT_AUTH_PATTERN . matcher ( EntityUtils . toString ( loginResponse . getEntity ( ... | In Gerrit < 2 . 12 the XSRF token was included in the start page HTML . |
21,057 | private BasicCredentialsProvider getCredentialsProvider ( ) { return new BasicCredentialsProvider ( ) { private Set < AuthScope > authAlreadyTried = Sets . newHashSet ( ) ; public Credentials getCredentials ( AuthScope authscope ) { if ( authAlreadyTried . contains ( authscope ) ) { return null ; } authAlreadyTried . a... | With this impl it only returns the same credentials once . Otherwise it s possible that a loop will occur . When server returns status code 401 the HTTP client provides the same credentials forever . Since we create a new HTTP client for every request we can handle it this way . |
21,058 | public String asString ( ) throws IOException { long len = getContentLength ( ) ; ByteArrayOutputStream buf ; if ( 0 < len ) { buf = new ByteArrayOutputStream ( ( int ) len ) ; } else { buf = new ByteArrayOutputStream ( ) ; } writeTo ( buf ) ; return decode ( buf . toByteArray ( ) , getCharacterEncoding ( ) ) ; } | Return a copy of the result as a String . |
21,059 | private boolean isForGerritHost ( HttpRequest request ) { if ( ! ( request instanceof HttpRequestWrapper ) ) return false ; HttpRequest originalRequest = ( ( HttpRequestWrapper ) request ) . getOriginal ( ) ; if ( ! ( originalRequest instanceof HttpRequestBase ) ) return false ; URI uri = ( ( HttpRequestBase ) original... | Checks if request is intended for Gerrit host . |
21,060 | public static String getRelativePathName ( Path root , Path path ) { Path relative = root . relativize ( path ) ; return Files . isDirectory ( path ) && ! relative . toString ( ) . endsWith ( "/" ) ? String . format ( "%s/" , relative . toString ( ) ) : relative . toString ( ) ; } | Get the relative path of an application |
21,061 | public final void dispose ( ) { getConnectionPool ( ) . ifPresent ( PoolResources :: dispose ) ; getThreadPool ( ) . dispose ( ) ; try { ObjectName name = getByteBufAllocatorObjectName ( ) ; if ( ManagementFactory . getPlatformMBeanServer ( ) . isRegistered ( name ) ) { ManagementFactory . getPlatformMBeanServer ( ) . ... | Disposes resources created to service this connection context |
21,062 | public static < T , R extends Resource < T > > T getEntity ( R resource ) { return resource . getEntity ( ) ; } | Return the entity of a resource |
21,063 | public static < R extends Resource < ? > , U extends PaginatedResponse < R > > Flux < R > getResources ( U response ) { return Flux . fromIterable ( response . getResources ( ) ) ; } | Return a stream of resources from a response |
21,064 | public static Mono < Void > waitForCompletion ( CloudFoundryClient cloudFoundryClient , Duration completionTimeout , String jobId ) { return requestJobV3 ( cloudFoundryClient , jobId ) . filter ( job -> JobState . PROCESSING != job . getState ( ) ) . repeatWhenEmpty ( exponentialBackOff ( Duration . ofSeconds ( 1 ) , D... | Waits for a job V3 to complete |
21,065 | public static String asTime ( long time ) { if ( time > HOUR ) { return String . format ( "%.1f h" , ( time / HOUR ) ) ; } else if ( time > MINUTE ) { return String . format ( "%.1f m" , ( time / MINUTE ) ) ; } else if ( time > SECOND ) { return String . format ( "%.1f s" , ( time / SECOND ) ) ; } else { return String ... | Renders a time period in human readable form |
21,066 | private ClassMatcher buildMatcher ( String tagText ) { String [ ] strings = StringUtil . tokenize ( tagText ) ; if ( strings . length < 2 ) { System . err . println ( "Skipping uncomplete @match tag, type missing: " + tagText + " in view " + viewDoc ) ; return null ; } try { if ( strings [ 0 ] . equals ( "class" ) ) { ... | Factory method that builds the appropriate matcher for |
21,067 | private void addToGraph ( ClassDoc cd ) { if ( visited . contains ( cd . toString ( ) ) ) return ; visited . add ( cd . toString ( ) ) ; cg . printClass ( cd , false ) ; cg . printRelations ( cd ) ; if ( opt . inferRelationships ) cg . printInferredRelations ( cd ) ; if ( opt . inferDependencies ) cg . printInferredDep... | Adds the specified class to the internal class graph along with its relations and dependencies eventually inferring them according to the Options specified for this matcher |
21,068 | public static int optionLength ( String option ) { int result = Standard . optionLength ( option ) ; if ( result != 0 ) return result ; else return UmlGraph . optionLength ( option ) ; } | Option check forwards options to the standard doclet if that one refuses them they are sent to UmlGraph |
21,069 | public static boolean start ( RootDoc root ) { root . printNotice ( "UmlGraphDoc version " + Version . VERSION + ", running the standard doclet" ) ; Standard . start ( root ) ; root . printNotice ( "UmlGraphDoc version " + Version . VERSION + ", altering javadocs" ) ; try { String outputFolder = findOutputPath ( root .... | Standard doclet entry point |
21,070 | private static void generateContextDiagrams ( RootDoc root , Options opt , String outputFolder ) throws IOException { Set < ClassDoc > classDocs = new TreeSet < ClassDoc > ( new Comparator < ClassDoc > ( ) { public int compare ( ClassDoc cd1 , ClassDoc cd2 ) { return cd1 . name ( ) . compareTo ( cd2 . name ( ) ) ; } } ... | Generates the context diagram for a single class |
21,071 | private static void alterHtmlDocs ( Options opt , String outputFolder , String packageName , String className , String htmlFileName , Pattern insertPointPattern , RootDoc root ) throws IOException { File output = new File ( outputFolder , packageName . replace ( "." , "/" ) ) ; File htmlFile = new File ( output , htmlF... | Takes an HTML file looks for the first instance of the specified insertion point and inserts the diagram image reference and a client side map in that point . |
21,072 | private static String findOutputPath ( String [ ] [ ] options ) { for ( int i = 0 ; i < options . length ; i ++ ) { if ( options [ i ] [ 0 ] . equals ( "-d" ) ) return options [ i ] [ 1 ] ; } return "." ; } | Returns the output path specified on the javadoc options |
21,073 | public void setAll ( ) { showAttributes = true ; showEnumerations = true ; showEnumConstants = true ; showOperations = true ; showConstructors = true ; showVisibility = true ; showType = true ; } | Most complete output |
21,074 | public static int optionLength ( String option ) { if ( matchOption ( option , "qualify" , true ) || matchOption ( option , "qualifyGenerics" , true ) || matchOption ( option , "hideGenerics" , true ) || matchOption ( option , "horizontal" , true ) || matchOption ( option , "all" ) || matchOption ( option , "attributes... | Return the number of arguments associated with the specified option . The return value includes the actual option . Will return 0 if the option is not supported . |
21,075 | private void addApiDocRoots ( String packageListUrl ) { BufferedReader br = null ; packageListUrl = fixApiDocRoot ( packageListUrl ) ; try { URL url = new URL ( packageListUrl + "/package-list" ) ; br = new BufferedReader ( new InputStreamReader ( url . openStream ( ) ) ) ; String line ; while ( ( line = br . readLine ... | Adds api doc roots from a link . The folder reffered by the link should contain a package - list file that will be parsed in order to add api doc roots to this configuration |
21,076 | private String fixApiDocRoot ( String str ) { if ( str == null ) return null ; String fixed = str . trim ( ) ; if ( fixed . isEmpty ( ) ) return "" ; if ( File . separatorChar != '/' ) fixed = fixed . replace ( File . separatorChar , '/' ) ; if ( ! fixed . endsWith ( "/" ) ) fixed = fixed + "/" ; return fixed ; } | Trim and append a file separator to the string |
21,077 | public void setOptions ( Doc p ) { if ( p == null ) return ; for ( Tag tag : p . tags ( "opt" ) ) setOption ( StringUtil . tokenize ( tag . text ( ) ) ) ; } | Set the options based on the tag elements of the ClassDoc parameter |
21,078 | public void addRelation ( RelationType relationType , RelationDirection direction ) { int idx = relationType . ordinal ( ) ; directions [ idx ] = directions [ idx ] . sum ( direction ) ; } | Adds eventually merging a direction for the specified relation type |
21,079 | private static String qualifiedName ( Options opt , String r ) { if ( opt . hideGenerics ) r = removeTemplate ( r ) ; if ( opt . showQualified && ( opt . showQualifiedGenerics || r . indexOf ( '<' ) < 0 ) ) return r ; StringBuilder buf = new StringBuilder ( r . length ( ) ) ; qualifiedNameInner ( opt , r , buf , 0 , ! ... | Return the class s name possibly by stripping the leading path |
21,080 | private String visibility ( Options opt , ProgramElementDoc e ) { return opt . showVisibility ? Visibility . get ( e ) . symbol : " " ; } | Print the visibility adornment of element e prefixed by any stereotypes |
21,081 | private String parameter ( Options opt , Parameter p [ ] ) { StringBuilder par = new StringBuilder ( 1000 ) ; for ( int i = 0 ; i < p . length ; i ++ ) { par . append ( p [ i ] . name ( ) + typeAnnotation ( opt , p [ i ] . type ( ) ) ) ; if ( i + 1 < p . length ) par . append ( ", " ) ; } return par . toString ( ) ; } | Print the method parameter p |
21,082 | private String type ( Options opt , Type t , boolean generics ) { return ( ( generics ? opt . showQualifiedGenerics : opt . showQualified ) ? t . qualifiedTypeName ( ) : t . typeName ( ) ) + ( opt . hideGenerics ? "" : typeParameters ( opt , t . asParameterizedType ( ) ) ) ; } | Print a a basic type t |
21,083 | private String typeParameters ( Options opt , ParameterizedType t ) { if ( t == null ) return "" ; StringBuffer tp = new StringBuffer ( 1000 ) . append ( "<" ) ; Type args [ ] = t . typeArguments ( ) ; for ( int i = 0 ; i < args . length ; i ++ ) { tp . append ( type ( opt , args [ i ] , true ) ) ; if ( i != args . ... | Print the parameters of the parameterized type t |
21,084 | private void attributes ( Options opt , FieldDoc fd [ ] ) { for ( FieldDoc f : fd ) { if ( hidden ( f ) ) continue ; stereotype ( opt , f , Align . LEFT ) ; String att = visibility ( opt , f ) + f . name ( ) ; if ( opt . showType ) att += typeAnnotation ( opt , f . type ( ) ) ; tableLine ( Align . LEFT , att ) ; tagval... | Print the class s attributes fd |
21,085 | private boolean operations ( Options opt , ConstructorDoc m [ ] ) { boolean printed = false ; for ( ConstructorDoc cd : m ) { if ( hidden ( cd ) ) continue ; stereotype ( opt , cd , Align . LEFT ) ; String cs = visibility ( opt , cd ) + cd . name ( ) + ( opt . showType ? "(" + parameter ( opt , cd . parameters ( ) ) + ... | Print the class s constructors m |
21,086 | private boolean operations ( Options opt , MethodDoc m [ ] ) { boolean printed = false ; for ( MethodDoc md : m ) { if ( hidden ( md ) ) continue ; if ( md . name ( ) . equals ( "<clinit>" ) && md . isStatic ( ) && md . isPackagePrivate ( ) ) continue ; stereotype ( opt , md , Align . LEFT ) ; String op = visibility ( ... | Print the class s operations m |
21,087 | private void nodeProperties ( Options opt ) { Options def = opt . getGlobalOptions ( ) ; if ( opt . nodeFontName != def . nodeFontName ) w . print ( ",fontname=\"" + opt . nodeFontName + "\"" ) ; if ( opt . nodeFontColor != def . nodeFontColor ) w . print ( ",fontcolor=\"" + opt . nodeFontColor + "\"" ) ; if ( opt . no... | Print the common class node s properties |
21,088 | private void tagvalue ( Options opt , Doc c ) { Tag tags [ ] = c . tags ( "tagvalue" ) ; if ( tags . length == 0 ) return ; for ( Tag tag : tags ) { String t [ ] = tokenize ( tag . text ( ) ) ; if ( t . length != 2 ) { System . err . println ( "@tagvalue expects two fields: " + tag . text ( ) ) ; continue ; } tableLine... | Return as a string the tagged values associated with c |
21,089 | private void stereotype ( Options opt , Doc c , Align align ) { for ( Tag tag : c . tags ( "stereotype" ) ) { String t [ ] = tokenize ( tag . text ( ) ) ; if ( t . length != 1 ) { System . err . println ( "@stereotype expects one field: " + tag . text ( ) ) ; continue ; } tableLine ( align , guilWrap ( opt , t [ 0 ] ) ... | Return as a string the stereotypes associated with c terminated by the escape character term |
21,090 | private boolean hidden ( ProgramElementDoc c ) { if ( c . tags ( "hidden" ) . length > 0 || c . tags ( "view" ) . length > 0 ) return true ; Options opt = optionProvider . getOptionsFor ( c instanceof ClassDoc ? ( ClassDoc ) c : c . containingClass ( ) ) ; return opt . matchesHideExpression ( c . toString ( ) ) || ( op... | Return true if c has a |
21,091 | private boolean hidden ( String className ) { className = removeTemplate ( className ) ; ClassInfo ci = classnames . get ( className ) ; return ci != null ? ci . hidden : optionProvider . getOptionsFor ( className ) . matchesHideExpression ( className ) ; } | Return true if the class name is associated to an hidden class or matches a hide expression |
21,092 | private void allRelation ( Options opt , RelationType rt , ClassDoc from ) { String tagname = rt . lower ; for ( Tag tag : from . tags ( tagname ) ) { String t [ ] = tokenize ( tag . text ( ) ) ; t = t . length == 1 ? new String [ ] { "-" , "-" , "-" , t [ 0 ] } : t ; if ( t . length != 4 ) { System . err . println ( "... | Print all relations for a given s class s tag |
21,093 | public void printRelations ( ClassDoc c ) { Options opt = optionProvider . getOptionsFor ( c ) ; if ( hidden ( c ) || c . name ( ) . equals ( "" ) ) return ; Type s = c . superclassType ( ) ; ClassDoc sc = s != null && ! s . qualifiedTypeName ( ) . equals ( Object . class . getName ( ) ) ? s . asClassDoc ( ) : null ; i... | Print a class s relations |
21,094 | public void printExtraClasses ( RootDoc root ) { Set < String > names = new HashSet < String > ( classnames . keySet ( ) ) ; for ( String className : names ) { ClassInfo info = getClassInfo ( className , true ) ; if ( info . nodePrinted ) continue ; ClassDoc c = root . classNamed ( className ) ; if ( c != null ) { prin... | Print classes that were parts of relationships but not parsed by javadoc |
21,095 | public void printInferredRelations ( ClassDoc c ) { if ( hidden ( c ) ) return ; Options opt = optionProvider . getOptionsFor ( c ) ; for ( FieldDoc field : c . fields ( false ) ) { if ( hidden ( field ) ) continue ; if ( field . isStatic ( ) ) continue ; FieldRelationInfo fri = getFieldRelationInfo ( field ) ; if ( fr... | Prints associations recovered from the fields of a class . An association is inferred only if another relation between the two classes is not already in the graph . |
21,096 | public void printInferredDependencies ( ClassDoc c ) { if ( hidden ( c ) ) return ; Options opt = optionProvider . getOptionsFor ( c ) ; Set < Type > types = new HashSet < Type > ( ) ; for ( MethodDoc method : filterByVisibility ( c . methods ( false ) , opt . inferDependencyVisibility ) ) { types . add ( method . retu... | Prints dependencies recovered from the methods of a class . A dependency is inferred only if another relation between the two classes is not already in the graph . |
21,097 | private < T extends ProgramElementDoc > List < T > filterByVisibility ( T [ ] docs , Visibility visibility ) { if ( visibility == Visibility . PRIVATE ) return Arrays . asList ( docs ) ; List < T > filtered = new ArrayList < T > ( ) ; for ( T doc : docs ) { if ( Visibility . get ( doc ) . compareTo ( visibility ) > 0 )... | Returns all program element docs that have a visibility greater or equal than the specified level |
21,098 | private void firstInnerTableStart ( Options opt ) { w . print ( linePrefix + linePrefix + "<tr>" + opt . shape . extraColumn ( ) + "<td><table border=\"0\" cellspacing=\"0\" " + "cellpadding=\"1\">" + linePostfix ) ; } | Start the first inner table of a class . |
21,099 | private File extractThriftFile ( String artifactId , String fileName , Set < File > thriftFiles ) { for ( File thriftFile : thriftFiles ) { boolean fileFound = false ; if ( fileName . equals ( thriftFile . getName ( ) ) ) { for ( String pathComponent : thriftFile . getPath ( ) . split ( File . separator ) ) { if ( path... | Picks out a File from thriftFiles corresponding to a given artifact ID and file name . Returns null if artifactId and fileName do not map to a thrift file path . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.