idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
9,900 | private final void setColor ( ColorSet colorSet ) { int [ ] rgb = ColorSet . getRGB ( colorSet ) ; this . red = rgb [ 0 ] / 255.0 ; this . green = rgb [ 1 ] / 255.0 ; this . blue = rgb [ 2 ] / 255.0 ; } | Returns the colorset s RGB values . | 67 | 8 |
9,901 | public static void shutDown ( ) { if ( Quartz . QUARTZ != null && Quartz . QUARTZ . scheduler != null ) { try { Quartz . QUARTZ . scheduler . shutdown ( ) ; } catch ( final SchedulerException e ) { Quartz . LOG . error ( "Problems on shutdown of QuartsSheduler" , e ) ; } } } | ShutDown Quartz . | 80 | 4 |
9,902 | public static GenClassCompiler compile ( TypeElement superClass , ProcessingEnvironment env ) throws IOException { GenClassCompiler compiler ; GrammarDef grammarDef = superClass . getAnnotation ( GrammarDef . class ) ; if ( grammarDef != null ) { compiler = new ParserCompiler ( superClass ) ; } else { DFAMap mapDef = s... | Compiles a subclass for annotated superClass | 180 | 9 |
9,903 | private synchronized boolean refreshAuthToken ( final AuthHandler handler , final boolean forceRefresh ) { if ( handler == null ) { return false ; } AuthToken token = authToken . get ( ) ; if ( ! forceRefresh && token != null && token . isValid ( ) ) { logger . fine ( "Auth token is already valid" ) ; return true ; } t... | Return true if caller should retry false if give up | 390 | 11 |
9,904 | public PropertyDescriptor getPropertyDescriptor ( String propertyName ) { final PropertyDescriptor propertyDescriptor = findPropertyDescriptor ( propertyName ) ; if ( propertyDescriptor == null ) { throw new PropertyNotFoundException ( beanClass , propertyName ) ; } return propertyDescriptor ; } | Get the property descriptor for the named property . Throws an exception if the property does not exist . | 68 | 20 |
9,905 | public PropertyDescriptor findPropertyDescriptor ( String propertyName ) { for ( PropertyDescriptor property : propertyDescriptors ) { if ( property . getName ( ) . equals ( propertyName ) ) { return property ; } } return null ; } | Attempt to get the property descriptor for the named property . | 55 | 11 |
9,906 | public boolean isAssigendTo ( final Company _company ) throws CacheReloadException { final boolean ret ; if ( isRoot ( ) ) { ret = this . companies . isEmpty ( ) ? true : this . companies . contains ( _company ) ; } else { ret = getParentClassification ( ) . isAssigendTo ( _company ) ; } return ret ; } | Check if the root classification of this classification is assigned to the given company . | 81 | 15 |
9,907 | private void overrideAbstractMethods ( ) throws IOException { for ( final ExecutableElement method : El . getEffectiveMethods ( superClass ) ) { if ( method . getModifiers ( ) . contains ( Modifier . ABSTRACT ) ) { if ( method . getAnnotation ( Terminal . class ) != null || method . getAnnotation ( Rule . class ) != nu... | Implement abstract method which have either one parameter and returning something or void type not returning anything . | 315 | 19 |
9,908 | private void init ( ) { this . container = InfinispanCache . findCacheContainer ( ) ; if ( this . container == null ) { try { this . container = new DefaultCacheManager ( this . getClass ( ) . getResourceAsStream ( "/org/efaps/util/cache/infinispan-config.xml" ) ) ; if ( this . container instanceof EmbeddedCacheManager... | init this instance . | 325 | 4 |
9,909 | private void terminate ( ) { if ( this . container != null ) { final Cache < String , Integer > cache = this . container . < String , Integer > getCache ( InfinispanCache . COUNTERCACHE ) ; Integer count = cache . get ( InfinispanCache . COUNTERCACHE ) ; if ( count == null || count < 2 ) { this . container . stop ( ) ;... | Terminate the manager . | 116 | 5 |
9,910 | public < K , V > AdvancedCache < K , V > getIgnReCache ( final String _cacheName ) { return this . container . < K , V > getCache ( _cacheName , true ) . getAdvancedCache ( ) . withFlags ( Flag . IGNORE_RETURN_VALUES , Flag . SKIP_REMOTE_LOOKUP , Flag . SKIP_CACHE_LOAD ) ; } | An advanced cache that does not return the value of the previous value in case of replacement . | 90 | 18 |
9,911 | public < K , V > Cache < K , V > initCache ( final String _cacheName ) { if ( ! exists ( _cacheName ) && ( ( EmbeddedCacheManager ) getContainer ( ) ) . getCacheConfiguration ( _cacheName ) == null ) { ( ( EmbeddedCacheManager ) getContainer ( ) ) . defineConfiguration ( _cacheName , "eFaps-Default" , new Configuration... | Method to init a Cache using the default definitions . | 113 | 10 |
9,912 | public static FacetsConfig getFacetsConfig ( ) { final FacetsConfig ret = new FacetsConfig ( ) ; ret . setHierarchical ( Indexer . Dimension . DIMCREATED . name ( ) , true ) ; return ret ; } | Gets the facets config . | 54 | 6 |
9,913 | public static Analyzer getAnalyzer ( ) throws EFapsException { IAnalyzerProvider provider = null ; if ( EFapsSystemConfiguration . get ( ) . containsAttributeValue ( KernelSettings . INDEXANALYZERPROVCLASS ) ) { final String clazzname = EFapsSystemConfiguration . get ( ) . getAttributeValue ( KernelSettings . INDEXANAL... | Gets the analyzer . | 236 | 6 |
9,914 | @ CallMethod ( pattern = "install/version/script" ) public void addScript ( @ CallParam ( pattern = "install/version/script" ) final String _code , @ CallParam ( pattern = "install/version/script" , attributeName = "type" ) final String _type , @ CallParam ( pattern = "install/version/script" , attributeName = "name" )... | Adds a new Script to this version . | 211 | 8 |
9,915 | @ CallMethod ( pattern = "install/version/description" ) public void appendDescription ( @ CallParam ( pattern = "install/version/description" ) final String _desc ) { if ( _desc != null ) { this . description . append ( _desc . trim ( ) ) . append ( "\n" ) ; } } | Append a description for this version . | 70 | 8 |
9,916 | @ CallMethod ( pattern = "install/version/lifecyle/ignore" ) public void addIgnoredStep ( @ CallParam ( pattern = "install/version/lifecyle/ignore" , attributeName = "step" ) final String _step ) { this . ignoredSteps . add ( UpdateLifecycle . valueOf ( _step . toUpperCase ( ) ) ) ; } | Appends a step which is ignored within the installation of this version . | 85 | 14 |
9,917 | @ Override protected void freeResource ( ) throws EFapsException { try { if ( ! getConnection ( ) . isClosed ( ) ) { getConnection ( ) . close ( ) ; } } catch ( final SQLException e ) { throw new EFapsException ( "Could not close" , e ) ; } } | Frees the resource and gives this connection resource back to the context object . | 69 | 15 |
9,918 | public static < K , V > Configuration newMutable ( TimeUnit expiryTimeUnit , long expiryDurationAmount ) { return new MutableConfiguration < K , V > ( ) . setExpiryPolicyFactory ( factoryOf ( new Duration ( expiryTimeUnit , expiryDurationAmount ) ) ) ; } | Build a new mutable javax . cache . configuration . Configuration with an expiry policy | 66 | 19 |
9,919 | public boolean next ( ) throws EFapsException { initialize ( false ) ; boolean stepForward = true ; boolean ret = true ; while ( stepForward && ret ) { ret = step ( this . selection . getAllSelects ( ) ) ; stepForward = ! this . access . hasAccess ( inst ( ) ) ; } return ret ; } | Move the evaluator to the next value . Skips values the User does not have access to . | 71 | 21 |
9,920 | private boolean step ( final Collection < Select > _selects ) { boolean ret = ! CollectionUtils . isEmpty ( _selects ) ; for ( final Select select : _selects ) { ret = ret && select . next ( ) ; } return ret ; } | Move the selects to the next value . | 56 | 8 |
9,921 | private void evalAccess ( ) throws EFapsException { final List < Instance > instances = new ArrayList <> ( ) ; while ( step ( this . selection . getInstSelects ( ) . values ( ) ) ) { for ( final Entry < String , Select > entry : this . selection . getInstSelects ( ) . entrySet ( ) ) { final Object object = entry . getV... | Evaluate the access for the instances . | 229 | 9 |
9,922 | public DataList getDataList ( ) throws EFapsException { final DataList ret = new DataList ( ) ; while ( next ( ) ) { final ObjectData data = new ObjectData ( ) ; int idx = 1 ; for ( final Select select : this . selection . getSelects ( ) ) { final String key = select . getAlias ( ) == null ? String . valueOf ( idx ) : ... | Gets the data list . | 135 | 6 |
9,923 | protected String makeInfo ( ) { final StringBuilder str = new StringBuilder ( ) ; if ( this . className != null ) { str . append ( "Thrown within class " ) . append ( this . className . getName ( ) ) . append ( ' ' ) ; } if ( this . id != null ) { str . append ( "Id of Exception is " ) . append ( this . id ) . append (... | Prepares a string of all information of this EFapsException . The returned string includes information about the class which throws this exception the exception id and all arguments . | 226 | 32 |
9,924 | private static String getValueFromDB ( final String _key , final String _language ) { String ret = null ; try { boolean closeContext = false ; if ( ! Context . isThreadActive ( ) ) { Context . begin ( ) ; closeContext = true ; } final Connection con = Context . getConnection ( ) ; final PreparedStatement stmt = con . p... | This method is initializing the cache . | 415 | 8 |
9,925 | private static void cacheOnStart ( ) { try { boolean closeContext = false ; if ( ! Context . isThreadActive ( ) ) { Context . begin ( ) ; closeContext = true ; } Context . getThreadContext ( ) ; final Connection con = Context . getConnection ( ) ; final PreparedStatement stmtLang = con . prepareStatement ( DBProperties... | Load the properties that must be cached on start . | 515 | 10 |
9,926 | public static void initialize ( ) { if ( InfinispanCache . get ( ) . exists ( DBProperties . CACHENAME ) ) { InfinispanCache . get ( ) . < String , String > getCache ( DBProperties . CACHENAME ) . clear ( ) ; } else { InfinispanCache . get ( ) . < String , String > getCache ( DBProperties . CACHENAME ) . addListener ( ... | Initialize the Cache be calling it . Used from runtime level . | 120 | 13 |
9,927 | public static int getReadCount ( final Long _userId ) { int ret = 0 ; if ( MessageStatusHolder . CACHE . userID2Read . containsKey ( _userId ) ) { ret = MessageStatusHolder . CACHE . userID2Read . get ( _userId ) ; } return ret ; } | Count of read messages . | 72 | 5 |
9,928 | public static int getUnReadCount ( final Long _userId ) { int ret = 0 ; if ( MessageStatusHolder . CACHE . userID2UnRead . containsKey ( _userId ) ) { ret = MessageStatusHolder . CACHE . userID2UnRead . get ( _userId ) ; } return ret ; } | Count of unread messages . | 75 | 6 |
9,929 | public void setNode ( int number , Vector3D v ) { setNode ( number , v . getX ( ) , v . getY ( ) , v . getZ ( ) ) ; } | Sets coordinate of nodes of this Bezier . | 42 | 11 |
9,930 | public void setAnchorColor ( int index , Color color ) { if ( index <= 0 ) { if ( startColor == null ) { startColor = new RGBColor ( 0.0 , 0.0 , 0.0 ) ; } setGradation ( true ) ; this . startColor = color ; } else if ( index >= 1 ) { if ( endColor == null ) { endColor = new RGBColor ( 0.0 , 0.0 , 0.0 ) ; } setGradation... | Sets the color of the anchor point for gradation . | 121 | 12 |
9,931 | public final double getWidth ( int line ) { if ( strArray . length == 0 ) return 0.0 ; try { return textRenderer . getBounds ( strArray [ line ] ) . getWidth ( ) ; } catch ( GLException e ) { reset = true ; } return 0.0 ; } | Returns letter s width of the current font at its current size and line . | 69 | 15 |
9,932 | public final void setFont ( Font font ) { this . font = font ; textRenderer = new TextRenderer ( font . getAWTFont ( ) , true , true ) ; } | Sets the Font of this Text . | 42 | 8 |
9,933 | public static PermissionSet getPermissionSet ( final Instance _instance ) throws EFapsException { Evaluation . LOG . debug ( "Evaluation PermissionSet for {}" , _instance ) ; final Key accessKey = Key . get4Instance ( _instance ) ; final PermissionSet ret = AccessCache . getPermissionCache ( ) . get ( accessKey ) ; Eva... | Gets the permissions . | 102 | 5 |
9,934 | public static PermissionSet getPermissionSet ( final Instance _instance , final boolean _evaluate ) throws EFapsException { Evaluation . LOG . debug ( "Retrieving PermissionSet for {}" , _instance ) ; final Key accessKey = Key . get4Instance ( _instance ) ; final PermissionSet ret ; if ( AccessCache . getPermissionCach... | Gets the PermissionSet . | 219 | 7 |
9,935 | public static Status getStatus ( final Instance _instance ) throws EFapsException { Evaluation . LOG . debug ( "Retrieving Status for {}" , _instance ) ; long statusId = 0 ; if ( _instance . getType ( ) . isCheckStatus ( ) ) { final Cache < String , Long > cache = AccessCache . getStatusCache ( ) ; if ( cache . contain... | Gets the status . | 256 | 5 |
9,936 | public static void evalStatus ( final Collection < Instance > _instances ) throws EFapsException { Evaluation . LOG . debug ( "Evaluating Status for {}" , _instances ) ; if ( CollectionUtils . isNotEmpty ( _instances ) ) { final Cache < String , Long > cache = AccessCache . getStatusCache ( ) ; final List < Instance > ... | Eval status . | 243 | 4 |
9,937 | public static String addZerosBefore ( String orderNo , int count ) { if ( orderNo == null ) { return "" ; // orderNo = ""; } if ( orderNo . length ( ) > count ) { orderNo = "?" + orderNo . substring ( orderNo . length ( ) - count - 1 , orderNo . length ( ) - 1 ) ; } else { int le = orderNo . length ( ) ; for ( int i = ... | Method addZerosBefore . | 126 | 6 |
9,938 | public Map < String , Set < DataPoint > > getSeries ( ) { return new HashMap < String , Set < DataPoint > > ( store ) ; } | Gets a mapping from series to an unordered set of DataPoints . | 34 | 15 |
9,939 | public void addDataPoint ( String series , DataPoint dataPoint ) { DataSet set = store . get ( series ) ; if ( set == null ) { set = new DataSet ( ) ; store . put ( series , set ) ; } set . add ( dataPoint ) ; } | Adds a new data point to a particular series . | 60 | 10 |
9,940 | public void addDataPointSet ( String series , Set < DataPoint > dataPoints ) { DataSet set = store . get ( series ) ; if ( set == null ) { set = new DataSet ( dataPoints ) ; store . put ( series , set ) ; } else { set . addAll ( dataPoints ) ; } } | Adds a set of DataPoint s to a series . | 70 | 11 |
9,941 | public JSONObject serialize ( Map < String , Object > out ) { JSONObject json = new JSONObject ( ) ; json . put ( "device_id" , deviceId ) ; json . put ( "project_id" , projectId ) ; out . put ( "device_id" , deviceId ) ; out . put ( "project_id" , projectId ) ; JSONArray sourcesArr = new JSONArray ( ) ; List < String ... | Custom serialization method for this object to JSON . | 250 | 10 |
9,942 | public Vector3D getVertex ( int index ) { tmpV . setX ( cornerX . get ( index ) ) ; tmpV . setY ( cornerY . get ( index ) ) ; tmpV . setZ ( cornerZ . get ( index ) ) ; calcG ( ) ; return tmpV ; } | Gets the corner of Polygon . | 67 | 8 |
9,943 | public void removeVertex ( int index ) { this . cornerX . remove ( index ) ; this . cornerY . remove ( index ) ; this . cornerZ . remove ( index ) ; if ( isGradation ( ) == true ) this . cornerColor . remove ( index ) ; setNumberOfCorner ( this . cornerX . size ( ) ) ; calcG ( ) ; } | Removes the corner of Polygon . | 82 | 8 |
9,944 | public void setVertex ( int i , double x , double y , double z ) { this . cornerX . set ( i , x ) ; this . cornerY . set ( i , y ) ; this . cornerZ . set ( i , z ) ; calcG ( ) ; } | Sets the coordinates of the corner . | 61 | 8 |
9,945 | public void setCornerColor ( int index , Color color ) { if ( cornerColor == null ) { for ( int i = 0 ; i < cornerX . size ( ) ; i ++ ) { cornerColor . add ( new RGBColor ( this . fillColor . getRed ( ) , this . fillColor . getGreen ( ) , this . fillColor . getBlue ( ) , this . fillColor . getAlpha ( ) ) ) ; } setGrada... | Sets the color of a corner . | 202 | 8 |
9,946 | public static List < DataPoint > parse ( int [ ] values , long ts ) { List < DataPoint > ret = new ArrayList < DataPoint > ( values . length ) ; for ( int v : values ) { ret . add ( new DataPoint ( ts , v ) ) ; } return ret ; } | Takes an array of values and converts it into a list of DataPoint s with the same timestamp . | 65 | 21 |
9,947 | @ SuppressWarnings ( "unchecked" ) @ SafeVarargs public static < G , ERR > Or < G , Every < ERR > > when ( Or < ? extends G , ? extends Every < ? extends ERR > > or , Function < ? super G , ? extends Validation < ERR > > ... validations ) { return when ( or , Stream . of ( validations ) ) ; } | Enables further validation on an existing accumulating Or by passing validation functions . | 89 | 14 |
9,948 | public static < A , B , ERR , RESULT > Or < RESULT , Every < ERR > > withGood ( Or < ? extends A , ? extends Every < ? extends ERR > > a , Or < ? extends B , ? extends Every < ? extends ERR > > b , BiFunction < ? super A , ? super B , ? extends RESULT > function ) { if ( allGood ( a , b ) ) return Good . of ( function ... | Combines two accumulating Or into a single one using the given function . The resulting Or will be a Good if both Ors are Goods otherwise it will be a Bad containing every error in the Bads . | 129 | 41 |
9,949 | public Vector3D getVertex ( int i ) { tmpV . setX ( x . get ( i ) ) ; tmpV . setY ( y . get ( i ) ) ; tmpV . setZ ( z . get ( i ) ) ; calcG ( ) ; return tmpV ; } | Gets the coordinates of the point . | 64 | 8 |
9,950 | public void removeVertex ( int i ) { this . x . remove ( i ) ; this . y . remove ( i ) ; this . z . remove ( i ) ; this . colors . remove ( i ) ; calcG ( ) ; } | Removes the point from Lines . | 52 | 7 |
9,951 | public void setVertex ( int i , double x , double y ) { this . x . set ( i , x ) ; this . y . set ( i , y ) ; this . z . set ( i , 0d ) ; calcG ( ) ; } | Sets the coordinates of the point . | 56 | 8 |
9,952 | public void setStartCornerColor ( Color color ) { if ( startColor == null ) { startColor = new RGBColor ( 0.0 , 0.0 , 0.0 ) ; } setGradation ( true ) ; this . startColor = color ; } | Sets the start point s color for gradation . | 57 | 11 |
9,953 | public void setEndCornerColor ( Color color ) { if ( endColor == null ) { endColor = new RGBColor ( 0.0 , 0.0 , 0.0 ) ; } setGradation ( true ) ; this . endColor = color ; } | Sets the end point s color for gradation . | 57 | 11 |
9,954 | public void setCornerColor ( int index , Color color ) { if ( ! cornerGradation ) { cornerGradation = true ; } colors . set ( index , color ) ; } | Sets the point s color for gradation . | 39 | 10 |
9,955 | public boolean hasTransitionTo ( CharRange condition , NFAState < T > state ) { Set < Transition < NFAState < T >>> set = transitions . get ( condition ) ; if ( set != null ) { for ( Transition < NFAState < T > > tr : set ) { if ( state . equals ( tr . getTo ( ) ) ) { return true ; } } } return false ; } | Returns true if transition with condition to state exists | 87 | 9 |
9,956 | public RangeSet getConditionsTo ( NFAState < T > state ) { RangeSet rs = new RangeSet ( ) ; for ( CharRange range : transitions . keySet ( ) ) { if ( range != null ) { Set < Transition < NFAState < T >>> set2 = transitions . get ( range ) ; for ( Transition < NFAState < T > > tr : set2 ) { if ( state . equals ( tr . ge... | Returns non epsilon confitions to transit to given state | 115 | 12 |
9,957 | public static boolean isSingleEpsilonOnly ( Set < Transition < NFAState > > set ) { if ( set . size ( ) != 1 ) { return false ; } for ( Transition < NFAState > tr : set ) { if ( tr . isEpsilon ( ) ) { return true ; } } return false ; } | Returns true if set only has one epsilon transition . | 71 | 12 |
9,958 | boolean isDeadEnd ( Set < NFAState < T > > nfaSet ) { for ( Set < Transition < NFAState < T > > > set : transitions . values ( ) ) { for ( Transition < NFAState < T > > t : set ) { if ( ! nfaSet . contains ( t . getTo ( ) ) ) { return false ; } } } return true ; } | Returns true if this state is not accepting and doesn t have any outbound transitions . | 87 | 17 |
9,959 | public DFAState < T > constructDFA ( Scope < DFAState < T > > dfaScope ) { Map < Set < NFAState < T > > , DFAState < T > > all = new HashMap <> ( ) ; Deque < DFAState < T > > unmarked = new ArrayDeque <> ( ) ; Set < NFAState < T > > startSet = epsilonClosure ( dfaScope ) ; DFAState < T > startDfa = new DFAState <> ( df... | Construct a dfa by using this state as starting state . | 426 | 12 |
9,960 | RangeSet getConditions ( ) { RangeSet is = new RangeSet ( ) ; for ( CharRange ic : transitions . keySet ( ) ) { if ( ic != null ) { is . add ( ic ) ; } } return is ; } | Returns all ranges from all transitions | 52 | 6 |
9,961 | private Set < NFAState < T > > epsilonTransitions ( StateVisitSet < NFAState < T > > marked ) { marked . add ( this ) ; Set < NFAState < T > > set = new HashSet <> ( ) ; for ( NFAState < T > nfa : epsilonTransit ( ) ) { if ( ! marked . contains ( nfa ) ) { set . add ( nfa ) ; set . addAll ( nfa . epsilonTransitions ( m... | Returns a set of states that can be reached by epsilon transitions . | 120 | 15 |
9,962 | public Set < NFAState < T > > epsilonClosure ( Scope < DFAState < T > > scope ) { Set < NFAState < T >> set = new HashSet <> ( ) ; set . add ( this ) ; return epsilonClosure ( scope , set ) ; } | Creates a dfa state from all nfa states that can be reached from this state with epsilon move . | 64 | 24 |
9,963 | public void addTransition ( RangeSet rs , NFAState < T > to ) { for ( CharRange c : rs ) { addTransition ( c , to ) ; } edges . add ( to ) ; to . inStates . add ( this ) ; } | Adds a set of transitions | 56 | 5 |
9,964 | public Transition < NFAState < T > > addTransition ( CharRange condition , NFAState < T > to ) { Transition < NFAState < T >> t = new Transition <> ( condition , this , to ) ; Set < Transition < NFAState < T > > > set = transitions . get ( t . getCondition ( ) ) ; if ( set == null ) { set = new HashSet <> ( ) ; transit... | Adds a transition | 135 | 3 |
9,965 | public void addEpsilon ( NFAState < T > to ) { Transition < NFAState < T >> t = new Transition <> ( this , to ) ; Set < Transition < NFAState < T > > > set = transitions . get ( null ) ; if ( set == null ) { set = new HashSet <> ( ) ; transitions . put ( null , set ) ; } set . add ( t ) ; edges . add ( to ) ; to . inSt... | Adds a epsilon transition | 109 | 6 |
9,966 | public void addChildValueSelect ( final AbstractValueSelect _valueSelect ) throws EFapsException { if ( this . child == null ) { this . child = _valueSelect ; _valueSelect . setParentValueSelect ( this ) ; } else { this . child . addChildValueSelect ( _valueSelect ) ; } } | Method adds an AbstractValueSelect as a child of this chain of AbstractValueSelect . | 68 | 17 |
9,967 | public Object getValue ( final List < Object > _objectList ) throws EFapsException { final List < Object > ret = new ArrayList < Object > ( ) ; for ( final Object object : _objectList ) { ret . add ( getValue ( object ) ) ; } return _objectList . size ( ) > 0 ? ( ret . size ( ) > 1 ? ret : ret . get ( 0 ) ) : null ; } | Method to get the value for a list of object . | 91 | 11 |
9,968 | private void preparePrint ( final AbstractPrint _print ) throws EFapsException { for ( final Select select : _print . getSelection ( ) . getAllSelects ( ) ) { for ( final AbstractElement < ? > element : select . getElements ( ) ) { if ( element instanceof AbstractDataElement ) { ( ( AbstractDataElement < ? > ) element ... | Prepare print . | 283 | 4 |
9,969 | private void addTypeCriteria ( final QueryPrint _print ) { final MultiValuedMap < TableIdx , TypeCriteria > typeCriterias = MultiMapUtils . newListValuedHashMap ( ) ; final List < Type > types = _print . getTypes ( ) . stream ( ) . sorted ( ( type1 , type2 ) -> Long . compare ( type1 . getId ( ) , type2 . getId ( ) ) )... | Adds the type criteria . | 464 | 5 |
9,970 | private void executeUpdates ( ) throws EFapsException { ConnectionResource con = null ; try { con = Context . getThreadContext ( ) . getConnectionResource ( ) ; for ( final Entry < SQLTable , AbstractSQLInsertUpdate < ? > > entry : updatemap . entrySet ( ) ) { ( ( SQLUpdate ) entry . getValue ( ) ) . execute ( con ) ; ... | Execute the update . | 118 | 5 |
9,971 | @ SuppressWarnings ( "unchecked" ) protected boolean executeSQLStmt ( final ISelectionProvider _sqlProvider , final String _complStmt ) throws EFapsException { SQLRunner . LOG . debug ( "SQL-Statement: {}" , _complStmt ) ; boolean ret = false ; List < Object [ ] > rows = new ArrayList <> ( ) ; boolean cached = false ; ... | Execute SQL stmt . | 518 | 6 |
9,972 | void processTedQueue ( ) { int totalProcessing = context . taskManager . calcWaitingTaskCountInAllChannels ( ) ; if ( totalProcessing >= TaskManager . LIMIT_TOTAL_WAIT_TASKS ) { logger . warn ( "Total size of waiting tasks ({}) already exceeded limit ({}), skip this iteration (2)" , totalProcessing , TaskManager . LIMI... | heads uniqueness by key1 should be guaranteed by unique index . | 304 | 12 |
9,973 | private void processEventQueue ( final TaskRec head ) { final TedResult headResult = processEvent ( head ) ; TaskConfig tc = context . registry . getTaskConfig ( head . name ) ; if ( tc == null ) { context . taskManager . handleUnknownTasks ( asList ( head ) ) ; return ; } TaskRec lastUnsavedEvent = null ; TedResult la... | process events from queue each after other until ERROR or RETRY will happen | 429 | 14 |
9,974 | static public String [ ] getAllProperties ( ) { java . util . Properties prop = System . getProperties ( ) ; java . util . ArrayList < String > list = new java . util . ArrayList < String > ( ) ; java . util . Enumeration < ? > enumeration = prop . propertyNames ( ) ; while ( enumeration . hasMoreElements ( ) ) { list ... | Get all property names . | 115 | 5 |
9,975 | public void set ( double fov , double aspect , double zNear , double zFar ) { this . fov = fov ; this . aspect = aspect ; this . zNear = zNear ; this . zFar = zFar ; } | Sets a perspective projection applying foreshortening making distant objects appear smaller than closer ones . | 51 | 18 |
9,976 | public static List < CharRange > removeOverlap ( CharRange r1 , CharRange r2 ) { assert r1 . intersect ( r2 ) ; List < CharRange > list = new ArrayList < CharRange > ( ) ; Set < Integer > set = new TreeSet < Integer > ( ) ; set . add ( r1 . getFrom ( ) ) ; set . add ( r1 . getTo ( ) ) ; set . add ( r2 . getFrom ( ) ) ;... | Returns a list of ranges that together gather the same characters as r1 and r2 . None of the resulting ranges doesn t intersect each other . | 160 | 29 |
9,977 | public String getHrefResolved ( ) { if ( Atom10Parser . isAbsoluteURI ( href ) ) { return href ; } else if ( baseURI != null && collectionElement != null ) { final int lastslash = baseURI . lastIndexOf ( "/" ) ; return Atom10Parser . resolveURI ( baseURI . substring ( 0 , lastslash ) , collectionElement , href ) ; } re... | Get resolved URI of the collection or null if impossible to determine | 92 | 12 |
9,978 | public String getHrefResolved ( final String relativeUri ) { if ( Atom10Parser . isAbsoluteURI ( relativeUri ) ) { return relativeUri ; } else if ( baseURI != null && collectionElement != null ) { final int lastslash = baseURI . lastIndexOf ( "/" ) ; return Atom10Parser . resolveURI ( baseURI . substring ( 0 , lastslas... | Get resolved URI using collection s baseURI or null if impossible to determine | 103 | 14 |
9,979 | public boolean accepts ( final String ct ) { for ( final Object element : accepts ) { final String accept = ( String ) element ; if ( accept != null && accept . trim ( ) . equals ( "*/*" ) ) { return true ; } final String entryType = "application/atom+xml" ; final boolean entry = entryType . equals ( ct ) ; if ( entry ... | Returns true if contentType is accepted by collection . | 250 | 10 |
9,980 | public Element collectionToElement ( ) { final Collection collection = this ; final Element element = new Element ( "collection" , AtomService . ATOM_PROTOCOL ) ; element . setAttribute ( "href" , collection . getHref ( ) ) ; final Element titleElem = new Element ( "title" , AtomService . ATOM_FORMAT ) ; titleElem . se... | Serialize an AtomService . Collection into an XML element | 290 | 11 |
9,981 | public void rotate ( double angle ) { double s = Math . sin ( angle ) ; double c = Math . cos ( angle ) ; double temp1 = m00 ; double temp2 = m01 ; m00 = c * temp1 + s * temp2 ; m01 = - s * temp1 + c * temp2 ; temp1 = m10 ; temp2 = m11 ; m10 = c * temp1 + s * temp2 ; m11 = - s * temp1 + c * temp2 ; } | Implementation roughly based on AffineTransform . | 109 | 9 |
9,982 | public Vector3D mult ( Vector3D source ) { Vector3D result = new Vector3D ( ) ; result . setX ( m00 * source . getX ( ) + m01 * source . getY ( ) + m02 ) ; result . setY ( m10 * source . getX ( ) + m11 * source . getY ( ) + m12 ) ; return result ; } | Multiply the x and y coordinates of a Vertex against this matrix . | 86 | 16 |
9,983 | public boolean invert ( ) { double determinant = determinant ( ) ; if ( Math . abs ( determinant ) <= Double . MIN_VALUE ) { return false ; } double t00 = m00 ; double t01 = m01 ; double t02 = m02 ; double t10 = m10 ; double t11 = m11 ; double t12 = m12 ; m00 = t11 / determinant ; m10 = - t10 / determinant ; m01 = - t0... | Invert this matrix . Implementation stolen from OpenJDK . | 161 | 12 |
9,984 | @ JsonAnySetter public void setAdditionalField ( final String key , final Object value ) { this . additionalFields . put ( key , value ) ; } | Add additional field | 35 | 3 |
9,985 | public static Object getGenInstance ( Class < ? > cls , Object ... args ) throws ParserException { Class < ? > parserClass = getGenClass ( cls ) ; try { if ( args . length == 0 ) { return parserClass . newInstance ( ) ; } else { for ( Constructor constructor : parserClass . getConstructors ( ) ) { Class [ ] parameterTy... | Creates generated class instance either by using ClassLoader or by compiling it dynamically | 227 | 15 |
9,986 | public static Class < ? > getGenClass ( Class < ? > cls ) throws ParserException { GenClassname genClassname = cls . getAnnotation ( GenClassname . class ) ; if ( genClassname == null ) { throw new IllegalArgumentException ( "@GenClassname not set in " + cls ) ; } try { return loadGenClass ( cls ) ; } catch ( ClassNotF... | Creates generated class either by using ClassLoader | 215 | 9 |
9,987 | public static Object createDynamicInstance ( Class < ? > cls ) throws IOException { GenClassCompiler pc = GenClassCompiler . compile ( El . getTypeElement ( cls . getCanonicalName ( ) ) , null ) ; return pc . loadDynamic ( ) ; } | Creates instance of implementation class and loads it dynamic . This method is used in testing . | 61 | 18 |
9,988 | public static Class < ? > loadGenClass ( Class < ? > cls ) throws ClassNotFoundException { Class < ? > parserClass = map . get ( cls ) ; if ( parserClass == null ) { GenClassname genClassname = cls . getAnnotation ( GenClassname . class ) ; if ( genClassname == null ) { throw new IllegalArgumentException ( "@GenClassna... | Creates generated class by using ClassLoader . Return null if unable to load class | 131 | 16 |
9,989 | private String getObtainRequestPath ( String requestID , Boolean byResourceID , Boolean byDocID , Boolean idsOnly , String resumptionToken ) { String path = obtainPath ; if ( resumptionToken != null ) { path += "?" + resumptionTokenParam + "=" + resumptionToken ; return path ; } if ( requestID != null ) { path += "?" +... | Obtain the path used for an obtain request | 246 | 9 |
9,990 | private String getHarvestRequestPath ( String requestID , Boolean byResourceID , Boolean byDocID ) { String path = harvestPath ; if ( requestID != null ) { path += "?" + requestIDParam + "=" + requestID ; } else { // error return null ; } if ( byResourceID ) { path += "&" + byResourceIDParam + "=" + booleanTrueString ;... | Obtain the path used for a harvest request | 159 | 9 |
9,991 | private LRResult getObtainJSONData ( String requestID , Boolean byResourceID , Boolean byDocID , Boolean idsOnly , String resumptionToken ) throws LRException { String path = getObtainRequestPath ( requestID , byResourceID , byDocID , idsOnly , resumptionToken ) ; JSONObject json = getJSONFromPath ( path ) ; return new... | Get a result from an obtain request If the resumption token is not null it will override the other parameters for ths request | 89 | 25 |
9,992 | public LRResult getHarvestJSONData ( String requestID , Boolean byResourceID , Boolean byDocID ) throws LRException { String path = getHarvestRequestPath ( requestID , byResourceID , byDocID ) ; JSONObject json = getJSONFromPath ( path ) ; return new LRResult ( json ) ; } | Get a result from a harvest request | 71 | 7 |
9,993 | private String getExtractRequestPath ( String dataServiceName , String viewName , Date from , Date until , Boolean idsOnly , String mainValue , Boolean partial , String mainName ) { String path = extractPath ; if ( viewName != null ) { path += "/" + viewName ; } else { return null ; } if ( dataServiceName != null ) { p... | Get an extract request path | 230 | 5 |
9,994 | private JSONObject getJSONFromPath ( String path ) throws LRException { JSONObject json = null ; String jsonTxt = null ; try { jsonTxt = LRClient . executeJsonGet ( importProtocol + "://" + nodeHost + path ) ; } catch ( Exception e ) { throw new LRException ( LRException . IMPORT_FAILED ) ; //e.printStackTrace(); } try... | Get the data from the specified path as a JSONObject | 150 | 11 |
9,995 | private static int fontStyleToInt ( FontStyle style ) { switch ( style ) { case PLAIN : return java . awt . Font . PLAIN ; case BOLD : return java . awt . Font . BOLD ; case ITALIC : return java . awt . Font . ITALIC ; default : return java . awt . Font . PLAIN ; } } | Return a java . awt . Font style constant from FontStyle . | 80 | 14 |
9,996 | private static FontStyle intToFontStyle ( int style ) { switch ( style ) { case java . awt . Font . PLAIN : return FontStyle . PLAIN ; case java . awt . Font . BOLD : return FontStyle . BOLD ; case java . awt . Font . ITALIC : return FontStyle . ITALIC ; case java . awt . Font . BOLD + java . awt . Font . ITALIC : retu... | Return FontStyle enum value from java . awt . Font style constant . | 117 | 15 |
9,997 | private static FontStyle stringToFontStyle ( String style ) { if ( style . compareToIgnoreCase ( "plain" ) == 0 ) { return FontStyle . PLAIN ; } else if ( style . compareToIgnoreCase ( "bold" ) == 0 ) { return FontStyle . BOLD ; } else if ( style . compareToIgnoreCase ( "italic" ) == 0 ) { return FontStyle . ITALIC ; }... | Return FontStyle enum value from a font style name . | 108 | 11 |
9,998 | public void onReload ( final Container _container ) { final Set < Class < ? > > classesToRemove = new HashSet <> ( ) ; final Set < Class < ? > > classesToAdd = new HashSet <> ( ) ; for ( final Class < ? > c : getClasses ( ) ) { if ( ! this . cachedClasses . contains ( c ) ) { classesToAdd . add ( c ) ; } } for ( final ... | Perform a new search for resource classes and provider classes . | 179 | 12 |
9,999 | private void addInstSelect ( final Select _select , final AbstractDataElement < ? > _element , final Object _attrOrClass , final Type _currentType ) throws CacheReloadException { if ( StringUtils . isNotEmpty ( _element . getPath ( ) ) && ! this . instSelects . containsKey ( _element . getPath ( ) ) ) { final Select in... | Adds the inst select . | 679 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.