idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
4,600 | public void closeWindowPerformed ( SwingFrame frameView ) { if ( ! navigationFrames . contains ( frameView ) ) return ; if ( navigationFrames . size ( ) == 1 && ! askBeforeExit ( frameView ) ) { return ; } if ( frameView . tryToCloseWindow ( ) ) { removeNavigationFrameView ( frameView ) ; } } | Asks the use about closing and then tries to close the Window |
4,601 | private boolean askBeforeExit ( SwingFrame navigationFrameView ) { if ( Configuration . isDevModeActive ( ) ) { return true ; } else { int answer = JOptionPane . showConfirmDialog ( navigationFrameView , Resources . getString ( "Exit.confirm" ) , Resources . getString ( "Exit.confirm.title" ) , JOptionPane . YES_NO_OPT... | Asks about leaving the application |
4,602 | private boolean closeAllWindows ( SwingFrame navigationFrameView ) { for ( int i = navigationFrames . size ( ) - 1 ; i >= 0 ; i -- ) { SwingFrame frameView = navigationFrames . get ( i ) ; if ( ! frameView . tryToCloseWindow ( ) ) return false ; removeNavigationFrameView ( frameView ) ; } return true ; } | Tries to close all windows . Stops at first failed attempt . |
4,603 | private void removeNavigationFrameView ( SwingFrame frameView ) { navigationFrames . remove ( frameView ) ; if ( navigationFrames . size ( ) == 0 ) { System . exit ( 0 ) ; } } | Removes a frameView from the list and exits if it was the last |
4,604 | private synchronized void sleep ( long waitNanos ) throws InterruptedException { while ( waitNanos > 0 && isRunning ( ) ) { long start = System . nanoTime ( ) ; TimeUnit . NANOSECONDS . timedWait ( this , waitNanos ) ; waitNanos -= System . nanoTime ( ) - start ; } } | Wait for the specified amount of time or until this service is stopped whichever comes first . |
4,605 | private List < String > loadKeyList ( ) { Set < String > keySet = new HashSet < String > ( ) ; for ( EDBObjectEntry entry : startState . values ( ) ) { keySet . add ( entry . getKey ( ) ) ; } for ( EDBObjectEntry entry : endState . values ( ) ) { keySet . add ( entry . getKey ( ) ) ; } return new ArrayList < String > (... | loads all keys from the start state and the end state |
4,606 | public Set < OWLAxiom > getSameSourceAxioms ( OWLAxiom axiom , Set < OWLAxiom > toSearch ) { Set < OWLAxiom > axiomSources = axiom2SourceMap . get ( axiom ) ; if ( axiomSources == null ) { return Collections . emptySet ( ) ; } Set < OWLAxiom > result = new HashSet < OWLAxiom > ( ) ; for ( OWLAxiom ax : toSearch ) { Set... | Gets axioms that have the same source axioms as the specified axiom . |
4,607 | private int [ ] tpCreate ( int n ) { if ( n > MAX_TPS ) return null ; int [ ] ret = new int [ n ] ; for ( int i = 0 ; i < n ; i ++ ) ret [ i ] = tpCreate ( ) ; return ret ; } | Batch TP creation |
4,608 | private void tpDelete ( int [ ] IDtimePoint ) { logger . finest ( "Deleting " + IDtimePoint . length + " TP" ) ; for ( int i = 0 ; i < IDtimePoint . length ; i ++ ) { tPoints [ IDtimePoint [ i ] ] . setUsed ( false ) ; if ( IDtimePoint [ i ] == MAX_USED ) MAX_USED -- ; SimpleDistanceConstraint conO = new SimpleDistance... | Batch Time point erase |
4,609 | private boolean cDelete ( Bounds [ ] in , int [ ] from , int [ ] to , boolean canRestore ) throws ConstraintNotFound , MalformedSimpleDistanceConstraint { for ( int i = 0 ; i < in . length ; i ++ ) { long min = in [ i ] . min ; long max = in [ i ] . max ; if ( in [ i ] . max == Long . MAX_VALUE - 1 ) max = H - O ; if (... | throw error in case of parameter inconsistency |
4,610 | public TimePoint getTimePoint ( int Id ) { if ( Id >= MAX_TPS ) return null ; if ( tPoints [ Id ] == null ) return null ; if ( ! tPoints [ Id ] . isUsed ( ) ) return null ; return tPoints [ Id ] ; } | Get a timepoint given its ID . |
4,611 | private boolean fromScratchDistanceMatrixComputation ( ) { logger . fine ( "Propagating (cube) with (#TPs,#cons) = (" + this . MAX_USED + "," + this . theNetwork . getConstraints ( ) . length + ") (call num.: " + ( ++ cubePropCount ) + ")" ) ; for ( int i = 0 ; i < MAX_USED + 1 ; i ++ ) { for ( int j = i ; j < MAX_USED... | from scratch re - computation |
4,612 | private boolean incrementalDistanceMatrixComputation ( int from , int to , Bounds i ) { logger . fine ( "Propagating (quad) with (#TPs,#cons) = (" + this . MAX_USED + "," + this . theNetwork . getConstraints ( ) . length + ") (call num.: " + ( ++ quadPropCount ) + ")" ) ; if ( distance [ to ] [ from ] != APSPSolver . I... | Gd graph propagation function |
4,613 | public boolean changeHorizon ( long val ) { this . removeConstraint ( horizonConstraint ) ; SimpleDistanceConstraint sdc = new SimpleDistanceConstraint ( ) ; sdc . setFrom ( this . getVariable ( 0 ) ) ; sdc . setTo ( this . getVariable ( 1 ) ) ; sdc . setMinimum ( val ) ; sdc . setMaximum ( val ) ; if ( this . addConst... | Set a new horizon for this network . |
4,614 | public FilterChain create ( ) throws FilterConfigurationException { Preconditions . checkState ( filters != null , "list of filters must be set" ) ; Preconditions . checkState ( inputType != null , "inputType must be set" ) ; Preconditions . checkState ( outputType != null , "outputType must be set" ) ; Preconditions .... | The filters - list must be set . If the last - element is not set the last element of the filters - list will be used . |
4,615 | public static String parseCH ( String inputText , boolean partialAllowed ) { if ( StringUtils . isEmpty ( inputText ) ) return null ; String text = cutNonDigitsAtBegin ( inputText ) ; if ( StringUtils . isEmpty ( text ) ) return "" ; text = cutNonDigitsAtEnd ( text ) ; if ( StringUtils . isEmpty ( text ) ) return "" ; ... | Converts a CH - Date String in a yyyy - mm - dd String . The conversion is very lenient and tries to convert as long as its somehow clear what the user may have wanted . |
4,616 | public static LocalDate parse ( String date ) { if ( StringUtils . isEmpty ( date ) ) return null ; try { return parse_ ( date ) ; } catch ( DateTimeParseException x ) { return InvalidValues . createInvalidLocalDate ( date ) ; } } | Tries to be a little bit more clever than the normal parsing . Accept dates like 1 . 2 . 2013 or 010214 |
4,617 | public static LocalDate parse_ ( String date ) { DateTimeFormatter dateTimeFormatter = getDateTimeFormatter ( ) ; if ( germanDateStyle ( ) ) { date = parseCH ( date , false ) ; return LocalDate . parse ( date ) ; } else { return LocalDate . parse ( date , dateTimeFormatter ) ; } } | framework internal only used by LocalDateTimeFormElement |
4,618 | public void addMenuItem ( String index , Class < ? extends WebPage > linkClass , String langKey , String langDescKey , String ... authority ) { addMenuItem ( index , linkClass , langKey , langDescKey , null , authority ) ; } | Adds a new item to main header navigation where the index defines the name of the index which should be the class name ; linkClass defines the class name to be linked to ; langKey defines the language key for the text which should be displayed and authority defines who is authorized to see the link |
4,619 | public static < T > T read ( Class < T > clazz , Object id ) { return execute ( new ReadEntityTransaction < T > ( clazz , id ) ) ; } | transaction is created . |
4,620 | public void listRunningServices ( ) { try { final List < String > formatedOutput = SecurityContext . executeWithSystemPermissions ( new Callable < List < String > > ( ) { public List < String > call ( ) throws Exception { List < String > tmp = new ArrayList < String > ( ) ; List < ServiceReference < Domain > > listServ... | prints out all available services and their alive state |
4,621 | public void deleteService ( String id , boolean force ) { try { if ( id == null || id . isEmpty ( ) ) { id = selectRunningService ( ) ; } final String idFinal = id ; int input = 'Y' ; if ( ! force ) { OutputStreamFormater . printValue ( String . format ( "Do you really want to delete the connector: %s (Y/n): " , id ) )... | delete a service identified by its id if force is true the user does not have to confirm |
4,622 | private String selectRunningService ( ) { String selectedServiceId ; List < String > runningServiceIds = getRunningServiceIds ( ) ; for ( int i = 0 ; i < runningServiceIds . size ( ) ; i ++ ) { String serviceId = runningServiceIds . get ( i ) ; OutputStreamFormater . printTabbedValues ( 9 , String . format ( "[%s]" , i... | let the user chose one of the running services |
4,623 | public List < String > getRunningServiceIds ( ) { List < ServiceReference < Domain > > serviceReferences = osgiUtilsService . listServiceReferences ( Domain . class ) ; List < String > result = new ArrayList < String > ( ) ; for ( ServiceReference < Domain > ref : serviceReferences ) { result . add ( ( String ) ref . g... | returns a list of all service ids |
4,624 | public void createService ( String domainProviderName , boolean force , Map < String , String > attributes ) { if ( domainProviderName == null || domainProviderName . isEmpty ( ) ) { domainProviderName = selectDomainProvider ( ) ; } String domainProviderId = "" ; List < DomainProvider > domainProvider = getDomainProvid... | crate a service for the given domain if force is true input is not verified |
4,625 | public static List < Entry > globalPermissionSetStructure ( String permissionSet ) { Entry permissionSetEntry = namedObject ( permissionSet , SchemaConstants . ouGlobalPermissionSets ( ) ) ; Entry ouDirect = organizationalUnit ( "direct" , permissionSetEntry . getDn ( ) ) ; Entry ouChildrenSets = organizationalUnit ( "... | Returns a list of entries representing a permissionSet . The list should not be reordered since its order follows the tree structure of the DIT . It can be inserted into the DIT right away . |
4,626 | protected void removeUnmappedFields ( JdbcIndex < ? > index ) { Iterator < IndexField < ? > > iterator = index . getFields ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { IndexField < ? > field = iterator . next ( ) ; if ( field . getMappedType ( ) == null ) { LOG . info ( "Removing {} from index {} - no mapped... | Remove fields from the index that have no mapped type information . |
4,627 | public static Model loadPOM ( String pomPath , String localRepo , Collection < RemoteRepository > repositories ) throws ProjectException { RepositoryClient repoClient = new RepositoryClient ( localRepo ) ; NaetherModelResolver resolver = new NaetherModelResolver ( repoClient , repositories ) ; ModelBuildingRequest req ... | Load Maven pom |
4,628 | public String getVersion ( ) { String version = getMavenModel ( ) . getVersion ( ) ; if ( version == null && getMavenModel ( ) . getParent ( ) != null ) { version = getMavenModel ( ) . getParent ( ) . getVersion ( ) ; } return version ; } | Get version of the Project . If null checks the Parent Project s version . |
4,629 | public void addRepository ( String url ) throws ProjectException { List < Repository > repositories = getRepositories ( ) ; if ( repositories == null ) { repositories = new ArrayList < Repository > ( ) ; } try { Repository repository = RepoBuilder . repositoryFromUrl ( url ) ; repositories . add ( repository ) ; } catc... | Add a Repository to the Project |
4,630 | public List < String > getRepositoryUrls ( ) { List < String > urls = new ArrayList < String > ( ) ; for ( Repository repo : getRepositories ( ) ) { urls . add ( repo . getUrl ( ) ) ; } return urls ; } | Get List of Repositories as String url |
4,631 | public void setProjectNotation ( String notation ) { Map < String , String > notationMap = Notation . parse ( notation ) ; this . setGroupId ( notationMap . get ( "groupId" ) ) ; this . setArtifactId ( notationMap . get ( "artifactId" ) ) ; this . setType ( notationMap . get ( "type" ) ) ; this . setVersion ( notationM... | Set Maven Project from String notation |
4,632 | public void addDependency ( String notation , String scope ) { Map < String , String > notationMap = Notation . parse ( notation ) ; Dependency dependency = new Dependency ( ) ; dependency . setGroupId ( notationMap . get ( "groupId" ) ) ; dependency . setArtifactId ( notationMap . get ( "artifactId" ) ) ; dependency .... | Add a Dependency by String notation |
4,633 | public String toXml ( ) throws ProjectException { log . debug ( "Writing xml" ) ; Project copy = this ; copy . removeProperty ( "project.basedir" ) ; StringWriter writer = new StringWriter ( ) ; MavenXpp3Writer pomWriter = new MavenXpp3Writer ( ) ; try { pomWriter . write ( writer , copy . mavenModel ) ; } catch ( IOEx... | Convert Project to POM XML |
4,634 | public static void logReducedStackTrace ( Logger logger , Exception exception ) { Exception here = new Exception ( ) ; String [ ] hereStrings = getStackFrames ( here ) ; String [ ] throwableStrings = getStackFrames ( exception ) ; int linesToSkip = 1 ; while ( throwableStrings . length - linesToSkip > 0 && hereStrings ... | Logs only the relevant part of the stack trace . For example if a getter fails it s irrelevant if the getter is called by a swing class or something else |
4,635 | private static String getStackTrace ( final Throwable throwable ) { final StringWriter sw = new StringWriter ( ) ; final PrintWriter pw = new PrintWriter ( sw , true ) ; throwable . printStackTrace ( pw ) ; return sw . getBuffer ( ) . toString ( ) ; } | from apache ExceptionUtil |
4,636 | public static DataSource getDataSource ( final String jndiName ) throws FactoryException { Validate . notBlank ( jndiName , "The validated character sequence 'jndiName' is null or empty" ) ; try { final Context context = new InitialContext ( ) ; final Object namedObject = context . lookup ( jndiName ) ; if ( DataSource... | Return a DataSource instance for a JNDI managed JDBC data source . |
4,637 | private static void loadDriver ( final String driver ) throws FactoryException { assert driver != null : "The driver cannot be null" ; LOG . debug ( "Loading the database driver '" + driver + "'" ) ; try { Class . forName ( driver ) ; } catch ( ClassNotFoundException e ) { final String error = "Error loading JDBC drive... | Make sure that the database driver exists |
4,638 | private static PoolingDataSource < PoolableConnection > getPoolingDataSource ( final String url , final ConcurrentMap < String , String > properties , final ConnectionProperties poolSpec ) { assert url != null : "The url cannot be null" ; assert properties != null : "The properties cannot be null" ; assert poolSpec != ... | Get a pooled data source for the provided connection parameters . |
4,639 | public static List < String > getLocalPaths ( String localRepoPath , List < String > notations ) throws NaetherException { DefaultServiceLocator locator = new DefaultServiceLocator ( ) ; SimpleLocalRepositoryManagerFactory factory = new SimpleLocalRepositoryManagerFactory ( ) ; factory . initService ( locator ) ; Local... | Get local paths for notations |
4,640 | public Iterator iterator ( ) { Query readAll = m_em . createQuery ( createReadAllQuery ( m_entityClass . getSimpleName ( ) ) ) ; return new JpaIterator ( readAll , m_batchSize ) ; } | Return an iterator that iterates over this source . |
4,641 | public void addProperty ( String key , Object value ) throws ProcessBagException { if ( properties . containsKey ( key ) ) { throw new ProcessBagException ( key + " already used!" ) ; } else { properties . put ( key , value ) ; } } | Adds a new property only if it does not exist already |
4,642 | public int compareTo ( Object arg0 ) { if ( arg0 instanceof SimpleInterval ) { SimpleInterval that = ( SimpleInterval ) arg0 ; return intervalName . compareTo ( that . getIntervalName ( ) ) ; } return 0 ; } | Comapres this to another Interval |
4,643 | public static void initApplication ( String ... args ) { if ( args . length < 1 ) { System . err . println ( "Please specify an Application as argument" ) ; System . exit ( - 1 ) ; } setInstance ( createApplicationByClassName ( args [ 0 ] ) ) ; } | This is just a shortcut for creating the application from jvm arguments . Most frontend main classes use this method |
4,644 | public int [ ] next ( ) { if ( ! hasNext ) return null ; int [ ] result = new int [ r ] ; for ( int i = 0 ; i < r ; i ++ ) result [ i ] = index [ i ] ; moveIndex ( ) ; return result ; } | Get the next permutation . |
4,645 | private void reverseAfter ( int i ) { int start = i + 1 ; int end = n - 1 ; while ( start < end ) { swap ( index , start , end ) ; start ++ ; end -- ; } } | Reverse the index elements to the right of the specified index . |
4,646 | private int rightmostDip ( ) { for ( int i = n - 2 ; i >= 0 ; i -- ) if ( index [ i ] < index [ i + 1 ] ) return i ; return - 1 ; } | that is less than its neighbor on the right . |
4,647 | public HashMap < Type , Double > getInversePossibilities ( ) { HashMap < Type , Double > ret = new HashMap < Type , Double > ( ) ; for ( Type t : Type . values ( ) ) ret . put ( t , 0.0 ) ; for ( Type t : types ) { Type inverseRelation = FuzzyAllenIntervalConstraint . getInverseRelation ( t ) ; HashMap < FuzzyAllenInte... | Get the possibilities of all inverse relations . |
4,648 | public void addStep ( String operationName , List < String > sourceFields , String targetField , Map < String , String > parameters ) { TransformationStep step = new TransformationStep ( ) ; step . setOperationName ( operationName ) ; step . setSourceFields ( sourceFields . toArray ( new String [ sourceFields . size ( ... | Adds a transformation step to this description |
4,649 | public void forwardField ( String sourceField , String targetField ) { TransformationStep step = new TransformationStep ( ) ; step . setTargetField ( targetField ) ; step . setSourceFields ( sourceField ) ; step . setOperationName ( "forward" ) ; steps . add ( step ) ; } | Adds a forward transformation step to the transformation description . The value of the source field is copied to the target field unchanged . Both fields need to have the same object type . |
4,650 | public void concatField ( String targetField , String concatString , String ... sourceFields ) { TransformationStep step = new TransformationStep ( ) ; step . setTargetField ( targetField ) ; step . setSourceFields ( sourceFields ) ; step . setOperationParameter ( TransformationConstants . CONCAT_PARAM , concatString )... | Adds a concat transformation step to the transformation description . The values of the source fields are concatenated to the target field with the concat string between the source fields values . All fields need to be of the type String . |
4,651 | public void splitField ( String sourceField , String targetField , String splitString , String index ) { TransformationStep step = new TransformationStep ( ) ; step . setTargetField ( targetField ) ; step . setSourceFields ( sourceField ) ; step . setOperationParameter ( TransformationConstants . SPLIT_PARAM , splitStr... | Adds a split transformation step to the transformation description . The value of the source field is split based on the split string into parts . Based on the given index the result will be set to the target field . The index needs to be an integer value . All fields need to be of the type String . |
4,652 | public void splitRegexField ( String sourceField , String targetField , String regexString , String index ) { TransformationStep step = new TransformationStep ( ) ; step . setTargetField ( targetField ) ; step . setSourceFields ( sourceField ) ; step . setOperationParameter ( TransformationConstants . REGEX_PARAM , reg... | Adds a split regex transformation step to the transformation description . The value of the source field is split based on the split string as regular expression into parts . Based on the given index the result will be set to the target field . The index needs to be an integer value . All fields need to be of the type ... |
4,653 | public void substringField ( String sourceField , String targetField , String from , String to ) { TransformationStep step = new TransformationStep ( ) ; step . setTargetField ( targetField ) ; step . setSourceFields ( sourceField ) ; step . setOperationParameter ( TransformationConstants . SUBSTRING_FROM_PARAM , from ... | Adds a substring step to the transformation description . The value of the source field is taken and it is tried to build the substring from the given index from to the given index to . From and to must be Integers written as String the value of the source field must also be a String . |
4,654 | public void valueField ( String targetField , String value ) { TransformationStep step = new TransformationStep ( ) ; step . setTargetField ( targetField ) ; step . setOperationParameter ( TransformationConstants . VALUE_PARAM , value ) ; step . setOperationName ( "value" ) ; steps . add ( step ) ; } | Adds a value step to the transformation description . The given value is written to the target field . |
4,655 | public void replaceField ( String sourceField , String targetField , String oldString , String newString ) { TransformationStep step = new TransformationStep ( ) ; step . setSourceFields ( sourceField ) ; step . setTargetField ( targetField ) ; step . setOperationParameter ( TransformationConstants . REPLACE_OLD_PARAM ... | Adds a replace step to the transformation description . The source and the target field need to be of String type . Performs standard string replacement on the string of the source field and writes the result to the target field . |
4,656 | public void padField ( String sourceField , String targetField , String length , String character , String direction ) { TransformationStep step = new TransformationStep ( ) ; step . setSourceFields ( sourceField ) ; step . setTargetField ( targetField ) ; step . setOperationParameter ( TransformationConstants . PAD_LE... | Adds a pad step to the transformation description . The source and the target field need to be of String type . Performs padding operation on the string of the source field and writes the result to the target field . The length describes to which size the padding should be done the pad character describes which charact... |
4,657 | public void removeLeadingField ( String sourceField , String targetField , String regexString , String length ) { TransformationStep step = new TransformationStep ( ) ; step . setSourceFields ( sourceField ) ; step . setTargetField ( targetField ) ; step . setOperationParameter ( TransformationConstants . REMOVELEADING... | Adds a remove leading step to the transformation description . The source and the target field need to be of String type . Based on the given regular expression string the beginning of the source string will be removed until the given maximum length . If the length is 0 the maximum length is ignored . |
4,658 | public void instantiateField ( String targetField , String targetType , String targetTypeInit , String ... sourceFields ) { TransformationStep step = new TransformationStep ( ) ; step . setSourceFields ( sourceFields ) ; step . setTargetField ( targetField ) ; step . setOperationParameter ( TransformationConstants . IN... | Adds an instantiate step to the transformation description . An object defined through the given target type will be created . For the instantiation the targetTypeInit method will be used . If this parameter is null the constructor of the targetType will be used with the object type of the source object as parameter . |
4,659 | @ SuppressWarnings ( { "unchecked" } ) private Predicate convertParametersToPredicate ( Root < ? > from , CriteriaQuery < ? > query ) { List < Predicate > predicates = new ArrayList < > ( ) ; for ( Map . Entry < String , Set < Object > > value : request . getParameters ( ) . entrySet ( ) ) { Subquery < JPAEntry > subqu... | Converts a query request parameter map for a query operation into a list of predicates which need to be added to the criteria query . |
4,660 | protected void set ( PofValue target , Object value ) { navigator . navigate ( target ) . setValue ( value ) ; } | Set the property value into the specified PofValue object . |
4,661 | public Map < String , T > getNodes ( ) { return Maps . transformValues ( Collections . unmodifiableMap ( _nodes ) , input -> ( input != null ) ? input . orElse ( null ) : null ) ; } | Retrieve the available nodes . |
4,662 | private synchronized void loadExistingData ( ) { for ( ChildData childData : _pathCache . getCurrentData ( ) ) { addNode ( childData . getPath ( ) , parseChildData ( childData ) ) ; } } | Loads all of the existing data from the underlying path cache . |
4,663 | private EKBCommit convertEDBCommitToEKBCommit ( EDBCommit commit ) throws EKBException { EKBCommit result = new EKBCommit ( ) ; Map < ModelDescription , Class < ? > > cache = new HashMap < > ( ) ; result . setRevisionNumber ( commit . getRevisionNumber ( ) ) ; result . setComment ( commit . getComment ( ) ) ; result . ... | Converts an EDBCommit object into an EKBCommit object . |
4,664 | private Object createModelOfEDBObject ( EDBObject object , Map < ModelDescription , Class < ? > > cache ) { try { ModelDescription description = getDescriptionFromObject ( object ) ; Class < ? > modelClass ; if ( cache . containsKey ( description ) ) { modelClass = cache . get ( description ) ; } else { modelClass = mo... | Converts an EDBObject instance into a model . For this the method need to retrieve the model class to be able to instantiate the corresponding model objects . If the conversion fails null is returned . |
4,665 | private ModelDescription getDescriptionFromObject ( EDBObject obj ) { String modelName = obj . getString ( EDBConstants . MODEL_TYPE ) ; String modelVersion = obj . getString ( EDBConstants . MODEL_TYPE_VERSION ) ; if ( modelName == null || modelVersion == null ) { throw new IllegalArgumentException ( "The object " + o... | Extracts the required values to lookup a model class from the given EDBObject . If this object does not contain the required information an IllegalArgumentException is thrown . |
4,666 | private void init ( String cacheName , NamedCache cache , IdGenerator idGenerator , IdExtractor idExtractor ) { m_cacheName = cacheName ; m_cache = cache ; m_idGenerator = idGenerator ; m_idExtractor = idExtractor ; } | Initializes CoherenceCacheTarget instance . |
4,667 | public static void main ( String [ ] args ) { if ( args . length < 2 ) { System . err . println ( "Two arguments needed as username and password" ) ; System . exit ( - 1 ) ; } User user = new User ( ) ; user . name = args [ 0 ] ; user . password . setPassword ( args [ 1 ] . toCharArray ( ) ) ; for ( int i = 2 ; i < arg... | Can be used to create entries in the users textfile |
4,668 | public static List < TransformationDescription > getDescriptionsFromXMLInputStream ( InputStream fileContent ) { List < TransformationDescription > desc = new ArrayList < TransformationDescription > ( ) ; try { desc = loadDescrtipionsFromXMLInputSource ( new InputSource ( fileContent ) , null ) ; } catch ( Exception e ... | Scans an input stream for transformation descriptions and returns all successfully read transformation descriptions . |
4,669 | public static List < TransformationDescription > getDescriptionsFromXMLFile ( File file ) { List < TransformationDescription > desc = new ArrayList < TransformationDescription > ( ) ; try { return loadDescrtipionsFromXMLInputSource ( new InputSource ( file . getAbsolutePath ( ) ) , file . getName ( ) ) ; } catch ( Exce... | Scans a XML file for transformation descriptions and returns all successfully read transformation descriptions . |
4,670 | private static List < TransformationDescription > loadDescrtipionsFromXMLInputSource ( InputSource source , String fileName ) throws Exception { XMLReader xr = XMLReaderFactory . createXMLReader ( ) ; TransformationDescriptionXMLReader reader = new TransformationDescriptionXMLReader ( fileName ) ; xr . setContentHandle... | Does the actual parsing . |
4,671 | protected static List < PropertyDescriptor > getWriteableProperties ( Class cls ) { BeanWrapper beanWrapper = new BeanWrapperImpl ( cls ) ; List < PropertyDescriptor > writeableProperties = new ArrayList < PropertyDescriptor > ( ) ; PropertyDescriptor [ ] props = beanWrapper . getPropertyDescriptors ( ) ; for ( Propert... | Returns a list of all writeable properties of a class . |
4,672 | @ Transactional ( readOnly = true ) public Object load ( Object key ) { List < T > results = getJdbcTemplate ( ) . query ( getSelectSql ( ) , getRowMapper ( ) , getPrimaryKeyComponents ( key ) ) ; return results . size ( ) == 0 ? null : results . get ( 0 ) ; } | Load and return a single object from the data store . |
4,673 | public void store ( Object key , Object value ) { getJdbcTemplate ( ) . update ( getMergeSql ( ) , new BeanPropertySqlParameterSource ( value ) ) ; } | Persist a single object into the data store . |
4,674 | String tableToString ( Table table ) { StringBuilder strb = new StringBuilder ( ) ; for ( int row = 0 ; row < table . getRowCount ( ) ; row ++ ) { for ( int col = 0 ; col < table . getColumnCount ( ) ; col ++ ) { strb . append ( table . get ( row , col ) ) ; strb . append ( " " ) ; } strb . append ( "\n" ) ; } return s... | end of inner class LabelLayout |
4,675 | public static ModelWrapper wrap ( Object model ) { if ( ! ( isModel ( model . getClass ( ) ) ) ) { throw new IllegalArgumentException ( "The given object is no model" ) ; } return new ModelWrapper ( ( OpenEngSBModel ) model ) ; } | Creates a model wrapper object out of the given model object . Throws IllegalArgumentException in case the given model object is no model . |
4,676 | public ModelDescription getModelDescription ( ) { String modelName = retrieveModelName ( ) ; String modelVersion = retrieveModelVersion ( ) ; if ( modelName == null || modelVersion == null ) { throw new IllegalArgumentException ( "Unsufficient information to create model description." ) ; } return new ModelDescription ... | Creates the model description object for the underlying model object . |
4,677 | protected String appendContextId ( Object modelId ) { return String . format ( "%s/%s" , ContextHolder . get ( ) . getCurrentContextId ( ) , modelId ) ; } | Appends the currentContext to the given model id . |
4,678 | public int compareTo ( Object arg0 ) { Interval that = ( Interval ) arg0 ; return this . bounds . compareTo ( that . getBounds ( ) ) ; } | Compares this to another Interval |
4,679 | public List < Role > findAllRoles ( ) { List < Role > list = new ArrayList < > ( ) ; List < String > roleStrings ; try { roleStrings = readLines ( rolesFile ) ; } catch ( IOException e ) { throw new FileBasedRuntimeException ( e ) ; } for ( String roleString : roleStrings ) { if ( StringUtils . isNotBlank ( roleString ... | Finds all the available roles . |
4,680 | public static RepeatingView createFieldList ( String id , Class < ? > bean , Map < String , String > values ) { List < AttributeDefinition > attributes = MethodUtil . buildAttributesList ( bean ) ; return createFieldList ( id , attributes , values ) ; } | creates a RepeatingView providing a suitable editor field for every property . |
4,681 | public static RepeatingView createFieldList ( String id , List < AttributeDefinition > attributes , Map < String , String > values ) { RepeatingView fields = new RepeatingView ( id ) ; for ( AttributeDefinition a : attributes ) { WebMarkupContainer row = new WebMarkupContainer ( a . getId ( ) ) ; MapModel < String , St... | creates a RepeatingView providing a suitable editor field for every attribute in the list . |
4,682 | public Map < String , Set < String > > getPropertyConnections ( TransformationDescription description ) { Map < String , Set < String > > propertyMap = getSourceProperties ( description . getSourceModel ( ) ) ; fillPropertyMap ( propertyMap , description ) ; resolveTemporaryProperties ( propertyMap ) ; deleteTemporaryP... | Calculates the connections of properties of the source and target model of a transformation description . Returns a map where the keys are the properties of the source model and the values are a set of property names which are influenced if the key property is changed . |
4,683 | private Map < String , Set < String > > getSourceProperties ( ModelDescription description ) { Map < String , Set < String > > result = new LinkedHashMap < String , Set < String > > ( ) ; try { Class < ? > sourceModel = registry . loadModel ( description ) ; while ( sourceModel != null && ! sourceModel . equals ( Objec... | Returns a map where the keys are the properties of the model described by the given model description . The values are empty sets . |
4,684 | private void fillPropertyMap ( Map < String , Set < String > > map , TransformationDescription description ) { for ( TransformationStep step : description . getTransformingSteps ( ) ) { if ( step . getSourceFields ( ) == null ) { LOGGER . debug ( "Step {} is ignored since no source properties are defined" ) ; continue ... | Fills the given map based on the transformation steps given in the transformation description . It analyzes the transformation step and adds the target of the transformation step to the set of properties which are influenced by the source property . |
4,685 | private void resolveTemporaryProperties ( Map < String , Set < String > > map ) { boolean temporaryPresent = false ; do { temporaryPresent = false ; for ( Map . Entry < String , Set < String > > entry : map . entrySet ( ) ) { Set < String > newProperties = new HashSet < String > ( ) ; Iterator < String > properties = e... | Resolves the temporary properties of the given property map . It replaces the temporary properties in the values of the given map with the values of the temporary property it replaces . This procedure is done until there are no more temporary fields present in the values of the map . |
4,686 | private void deleteTemporaryProperties ( Map < String , Set < String > > map ) { Iterator < String > iterator = map . keySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { String key = iterator . next ( ) ; if ( isTemporaryProperty ( key ) ) { LOGGER . debug ( "Delete temporary field {} from the connection res... | Iterates over the map entries and removes all temporary properties so that a clean map can be returned to the user which is interested in the property connections . |
4,687 | public static boolean loginAtStart ( ) { boolean loginAtStart = Application . getInstance ( ) . isLoginRequired ( ) || Configuration . get ( "MjLoginAtStart" , "false" ) . equals ( "true" ) ; if ( loginAtStart && ! Backend . getInstance ( ) . isAuthenticationActive ( ) ) { throw new IllegalStateException ( "Login requi... | just a helper method for all frontends . Is it at the right place here? |
4,688 | public Optional < Input < String > > createInput ( int maxLength , InputType inputType , InputComponentListener changeListener ) { return Optional . empty ( ) ; } | Frontends may or may not provide special Inputs . Even a single Frontend can sometimes support those Inputs and sometimes not . For example a HTML Frontend depends on the used Browser . Firefox and Microsoft didn t support date and time Inputs for a long time . Also the used device or the user preferences can influence... |
4,689 | public void clear ( ) { List < AbstractTable < ? > > tableList = new ArrayList < AbstractTable < ? > > ( tables . values ( ) ) ; for ( AbstractTable < ? > table : tableList ) { table . clear ( ) ; } } | Use with care . Removes all content of all tables . Should only be used for JUnit tests . |
4,690 | @ SuppressWarnings ( "unchecked" ) public < T > T getObject ( String key , Class < T > clazz ) { EDBObjectEntry entry = get ( key ) ; return entry == null ? null : ( T ) entry . getValue ( ) ; } | Returns the value of the EDBObjectEntry for the given key casted as the given class . Returns null if there is no element for the given key or the value for the given key is null . |
4,691 | public final Boolean isDeleted ( ) { Boolean deleted = getObject ( DELETED_CONST , Boolean . class ) ; return deleted != null ? deleted : false ; } | Returns true if the object is deleted . |
4,692 | public void putEDBObjectEntry ( String key , Object value ) { putEDBObjectEntry ( key , value , value . getClass ( ) ) ; } | Adds an EDBObjectEntry to this EDBObject . It uses the type of the given object value as type parameter |
4,693 | private void appendEntry ( Map . Entry < String , EDBObjectEntry > entry , StringBuilder builder ) { if ( builder . length ( ) > 2 ) { builder . append ( "," ) ; } builder . append ( " \"" ) . append ( entry . getKey ( ) ) . append ( "\"" ) ; builder . append ( " : " ) . append ( entry . getValue ( ) ) ; } | Analyzes the entry and write the specific information into the StringBuilder . |
4,694 | public static EDBObjectEntry convertJPAEntryToEDBObjectEntry ( JPAEntry entry ) { for ( EDBConverterStep step : steps ) { if ( step . doesStepFit ( entry . getType ( ) ) ) { LOGGER . debug ( "EDBConverterStep {} fit for type {}" , step . getClass ( ) . getName ( ) , entry . getType ( ) ) ; return step . convertToEDBObj... | Converts a JPAEntry object into an EDBObjectEntry element . If there is a problem with the instantiation of the type of the JPAEntry the simple string object will be written in the resulting element . To instantiate the type first the static method valueOf of the type will be tried . If that didn t work then the constr... |
4,695 | public static JPAEntry convertEDBObjectEntryToJPAEntry ( EDBObjectEntry entry , JPAObject owner ) { for ( EDBConverterStep step : steps ) { if ( step . doesStepFit ( entry . getType ( ) ) ) { LOGGER . debug ( "EDBConverterStep {} fit for type {}" , step . getClass ( ) . getName ( ) , entry . getType ( ) ) ; return step... | Converts a JPAEntry object into an EDBObjectEntry . |
4,696 | public static EDBObject convertJPAObjectToEDBObject ( JPAObject object ) { EDBObject result = new EDBObject ( object . getOID ( ) ) ; for ( JPAEntry kvp : object . getEntries ( ) ) { EDBObjectEntry entry = convertJPAEntryToEDBObjectEntry ( kvp ) ; result . put ( entry . getKey ( ) , entry ) ; } result . setDeleted ( ob... | Converts a JPAObject object into an EDBObject . |
4,697 | public static JPAObject convertEDBObjectToJPAObject ( EDBObject object ) { JPAObject result = new JPAObject ( ) ; result . setTimestamp ( object . getTimestamp ( ) ) ; result . setOID ( object . getOID ( ) ) ; result . setDeleted ( object . isDeleted ( ) ) ; List < JPAEntry > entries = new ArrayList < JPAEntry > ( ) ; ... | Converts an EDBObject object into a JPAObject object . |
4,698 | public static List < JPAObject > convertEDBObjectsToJPAObjects ( List < EDBObject > objects ) { List < JPAObject > result = new ArrayList < JPAObject > ( ) ; for ( EDBObject object : objects ) { result . add ( convertEDBObjectToJPAObject ( object ) ) ; } return result ; } | Converts a list of EDBObjects into a list of JPAObjects |
4,699 | public static List < EDBObject > convertJPAObjectsToEDBObjects ( List < JPAObject > objects ) { List < EDBObject > result = new ArrayList < EDBObject > ( ) ; for ( JPAObject object : objects ) { result . add ( convertJPAObjectToEDBObject ( object ) ) ; } return result ; } | Converts a list of JPAObjects into a list of EDBObjects |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.