idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
123,900 | void setIsoEntry ( final Iso9660FileEntry entry ) { if ( null != this . entry ) { throw new RuntimeException ( "Cannot change the underlying entry once it has been set" ) ; } if ( null == entry ) { throw new IllegalArgumentException ( "'entry' cannot be null" ) ; } this . entry = entry ; this . type = ( entry . isDirec... | Sets the Iso9660FileEntry that backs this FileObject . This method is package - private because IsoFileSystem pre - creates some directory entries when building the file index and it needs to set the backing entry after the fact . |
123,901 | protected void doCloseCommunicationLink ( ) { if ( null != this . fileSystem && ! this . fileSystem . isClosed ( ) ) { try { this . fileSystem . close ( ) ; } catch ( IOException ex ) { VfsLog . warn ( getLogger ( ) , log , "vfs.provider.iso/close-iso-file.error :" + this . fileSystem , ex ) ; } } } | Closes the underlying . iso file . |
123,902 | public Iterator < ISO9660Directory > unsortedIterator ( ) { if ( unsortedIterator == null ) { unsortedIterator = new ISO9660DirectoryIterator ( this , false ) ; } unsortedIterator . reset ( ) ; return unsortedIterator ; } | Returns a directory iterator to traverse the directory hierarchy using a recursive method |
123,903 | protected final boolean readBlock ( final long block , final byte [ ] buffer ) throws IOException { final int bytesRead = readData ( block * this . blockSize , buffer , 0 , this . blockSize ) ; if ( bytesRead <= 0 ) { return false ; } if ( this . blockSize != bytesRead ) { throw new IOException ( "Could not deserialize... | Read the data for the specified block into the specified buffer . |
123,904 | protected final synchronized int readData ( final long startPos , final byte [ ] buffer , final int offset , final int len ) throws IOException { seek ( startPos ) ; return read ( buffer , offset , len ) ; } | Read file data starting at the specified position . |
123,905 | public void setVersion ( int version ) throws HandlerException { if ( version < 1 || version > ISO9660Constants . MAX_FILE_VERSION ) { throw new HandlerException ( "Invalid file version: " + version ) ; } this . version = version ; if ( parent != null ) { parent . forceSort ( ) ; } } | Set file version |
123,906 | public static long getUInt32 ( byte [ ] src , int offset ) { final long v0 = src [ offset ] & 0xFF ; final long v1 = src [ offset + 1 ] & 0xFF ; final long v2 = src [ offset + 2 ] & 0xFF ; final long v3 = src [ offset + 3 ] & 0xFF ; return ( ( v3 << 24 ) | ( v2 << 16 ) | ( v1 << 8 ) | v0 ) ; } | Gets a 32 - bit unsigned integer from the given byte array at the given offset . |
123,907 | public void addModeForPattern ( String pattern , Integer mode ) { System . out . println ( String . format ( "*** Recording pattern \"%s\" with mode %o" , pattern , mode ) ) ; patternToModeMap . put ( pattern , mode ) ; } | Add a new mode for a specific file pattern . |
123,908 | public static String getDChars ( byte [ ] block , int pos , int length ) { return new String ( block , pos - 1 , length ) . trim ( ) ; } | Gets a string of d - characters . See section 7 . 4 . 1 . |
123,909 | public void setMovedDirectoryStore ( ) { if ( movedDirectoriesStore == null ) { movedDirectoriesStore = new ISO9660Directory ( MOVED_DIRECTORIES_STORE_NAME ) ; addDirectory ( movedDirectoriesStore ) ; sortedIterator = null ; } } | Create and Add Moved Directories Store to Directory Hierarchy |
123,910 | public void setUCS2Level ( int level ) throws ConfigException { if ( level != 1 && level != 2 && level != 3 ) { throw new ConfigException ( this , "Invalid UCS-2 level: " + level ) ; } this . ucs2_level = level ; } | Set UCS - 2 Level |
123,911 | public void allowASCII ( boolean allow ) { this . allowASCII = allow ; ISO9660NamingConventions . FORCE_ISO9660_CHARSET = ! allow ; if ( allow ) { System . out . println ( "Warning: Allowing the full ASCII character set breaks ISO 9660 conformance." ) ; } } | Allow ASCII for filenames and other strings |
123,912 | private void deserializePrimary ( byte [ ] descriptor ) throws IOException { if ( this . hasPrimary ) { return ; } validateBlockSize ( descriptor ) ; if ( ! this . hasSupplementary ) { deserializeCommon ( descriptor ) ; } this . standardIdentifier = Util . getDChars ( descriptor , 2 , 5 ) ; this . volumeSetSize = Util ... | Read the fields of a primary volume descriptor . |
123,913 | private void deserializeSupplementary ( byte [ ] descriptor ) throws IOException { if ( this . hasSupplementary ) { return ; } validateBlockSize ( descriptor ) ; String escapeSequences = Util . getDChars ( descriptor , 89 , 32 ) ; String enc = getEncoding ( escapeSequences ) ; if ( null != enc ) { this . encoding = enc... | The supplementary descriptor sets the character encoding and may override the common descriptor information . |
123,914 | private void deserializeCommon ( byte [ ] descriptor ) throws IOException { this . systemIdentifier = Util . getAChars ( descriptor , 9 , 32 , this . encoding ) ; this . volumeIdentifier = Util . getDChars ( descriptor , 41 , 32 , this . encoding ) ; this . volumeSetIdentifier = Util . getDChars ( descriptor , 191 , 12... | Read the information common to primary and secondary volume descriptors . |
123,915 | private void validateBlockSize ( byte [ ] descriptor ) throws IOException { int blockSize = Util . getUInt16Both ( descriptor , 129 ) ; if ( blockSize != Constants . DEFAULT_BLOCK_SIZE ) { throw new LoopFileSystemException ( "Invalid block size: " + blockSize ) ; } } | Check that the block size is what we expect . |
123,916 | private String getEncoding ( String escapeSequences ) { String encoding = null ; if ( escapeSequences . equals ( "%/@" ) ) { encoding = "UTF-16BE" ; } else if ( escapeSequences . equals ( "%/C" ) ) { encoding = "UTF-16BE" ; } else if ( escapeSequences . equals ( "%/E" ) ) { encoding = "UTF-16BE" ; } return encoding ; } | Derive an encoding name from the given escape sequences . |
123,917 | public void finalizeDisc ( File isoPath ) { ISOImageFileHandler handler = null ; try { handler = new ISOImageFileHandler ( isoPath ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } try { CreateISO iso = new CreateISO ( handler , root ) ; try { iso . process ( iso9660config , rockConfig , jolietConfi... | Close out the disc . |
123,918 | public List < FileItemStream > items ( String fieldName ) { List < FileItemStream > filteredItems = new ArrayList < FileItemStream > ( ) ; for ( FileItemStream fis : _items ) { if ( fis . getFieldName ( ) . equals ( fieldName ) ) filteredItems . add ( fis ) ; } return filteredItems ; } | find items with given form field name |
123,919 | public static FsItemFilter createMimeFilter ( final String [ ] mimeFilters ) { if ( mimeFilters == null || mimeFilters . length == 0 ) return FILTER_ALL ; return new FsItemFilter ( ) { public boolean accepts ( FsItemEx item ) { String mimeType = item . getMimeType ( ) . toUpperCase ( ) ; for ( String mf : mimeFilters )... | returns a FsItemFilter according to given mimeFilters |
123,920 | protected CommandExecutorFactory createCommandExecutorFactory ( ServletConfig config ) { DefaultCommandExecutorFactory defaultCommandExecutorFactory = new DefaultCommandExecutorFactory ( ) ; defaultCommandExecutorFactory . setClassNamePattern ( "cn.bluejoe.elfinder.controller.executors.%sCommandExecutor" ) ; defaultCom... | create a command executor factory |
123,921 | protected ConnectorController createConnectorController ( ServletConfig config ) { ConnectorController connectorController = new ConnectorController ( ) ; connectorController . setCommandExecutorFactory ( createCommandExecutorFactory ( config ) ) ; connectorController . setFsServiceFactory ( createServiceFactory ( conf... | create a connector controller |
123,922 | protected StaticFsServiceFactory createServiceFactory ( ServletConfig config ) { StaticFsServiceFactory staticFsServiceFactory = new StaticFsServiceFactory ( ) ; DefaultFsService fsService = createFsService ( ) ; staticFsServiceFactory . setFsService ( fsService ) ; return staticFsServiceFactory ; } | create a service factory |
123,923 | private Collection < FsItemEx > findRecursively ( FsItemFilter filter , FsItem root ) { List < FsItemEx > results = new ArrayList < FsItemEx > ( ) ; FsVolume vol = root . getVolume ( ) ; for ( FsItem child : vol . listChildren ( root ) ) { if ( vol . isFolder ( child ) ) { results . addAll ( findRecursively ( filter , ... | find files recursively in specific folder |
123,924 | static void removeEntityGraphs ( Map < String , Object > queryHints ) { if ( queryHints == null ) { return ; } queryHints . remove ( EntityGraph . EntityGraphType . FETCH . getKey ( ) ) ; queryHints . remove ( EntityGraph . EntityGraphType . LOAD . getKey ( ) ) ; } | Remove all EntityGraph pre existing in the QueryHints |
123,925 | static EntityManager proxy ( EntityManager entityManager ) { ProxyFactory proxyFactory = new ProxyFactory ( entityManager ) ; proxyFactory . addAdvice ( new RepositoryEntityManagerEntityGraphInjector ( ) ) ; return ( EntityManager ) proxyFactory . getProxy ( ) ; } | Builds a proxy on entity manager which is aware of methods that can make use of query hints . |
123,926 | private void addEntityGraphToFindMethodQueryHints ( EntityGraphBean entityGraphCandidate , MethodInvocation invocation ) { LOG . trace ( "Trying to push the EntityGraph candidate to the query hints find method" ) ; Map < String , Object > queryProperties = null ; int index = 0 ; for ( Object argument : invocation . get... | Push the current entity graph to the find method query hints . |
123,927 | public void execute ( ) throws MojoExecutionException { super . execute ( ) ; try { lambdaFunctions . forEach ( context -> { try { deleteTriggers . andThen ( deleteFunction ) . apply ( context . withFunctionArn ( lambdaClient . getFunction ( new GetFunctionRequest ( ) . withFunctionName ( context . getFunctionName ( ) ... | The entry point into the AWS lambda function . |
123,928 | public void storeAs ( String queryName ) { QueryRecorder . queryCompleted ( this . query ) ; QueryMemento qm = this . createMemento ( ) ; IDBAccess dbAccess = ( ( IIntDomainAccess ) this . domainAccess ) . getInternalDomainAccess ( ) . getDBAccess ( ) ; String qLabel = ( ( IIntDomainAccess ) this . domainAccess ) . get... | Store the query with the domain model under the given name . |
123,929 | public QueryPersistor augment ( DomainObjectMatch < ? > domainObjectMatch , String as ) { if ( this . augmentations == null ) this . augmentations = new HashMap < DomainObjectMatch < ? > , String > ( ) ; this . augmentations . put ( domainObjectMatch , as ) ; return this ; } | Give a name to a DomainObjectMatch for better readability in a Java - DSL like string representation |
123,930 | @ SuppressWarnings ( "unchecked" ) public < T > DomainObjectMatch < T > createMatchFrom ( DomainObjectMatch < T > domainObjectMatch ) { DomainObjectMatch < T > ret ; FromPreviousQueryExpression pqe ; DomainObjectMatch < ? > match ; DomainObjectMatch < ? > delegate = APIAccess . getDelegate ( domainObjectMatch ) ; if ( ... | Create a match from a DomainObjectMatch specified in the context of another query |
123,931 | @ SuppressWarnings ( "unchecked" ) public < T > DomainObjectMatch < T > createMatchFor ( T domainObject ) { DomainObjectMatch < T > ret ; if ( domainObject . getClass ( ) . equals ( DomainObject . class ) ) { List < DomainObject > source = new ArrayList < DomainObject > ( ) ; source . add ( ( DomainObject ) domainObjec... | Create a match for a domain object which was retrieved by another query |
123,932 | public TerminalResult BR_OPEN ( ) { ConcatenateExpression ce = new ConcatenateExpression ( Concatenator . BR_OPEN ) ; this . astObjectsContainer . addAstObject ( ce ) ; TerminalResult ret = APIAccess . createTerminalResult ( ce ) ; QueryRecorder . recordInvocation ( this , "BR_OPEN" , ret ) ; return ret ; } | Open a block encapsulating predicate expressions |
123,933 | public Order ORDER ( DomainObjectMatch < ? > toOrder ) { DomainObjectMatch < ? > delegate = APIAccess . getDelegate ( toOrder ) ; DomainObjectMatch < ? > match = delegate != null ? delegate : toOrder ; OrderExpression oe = this . queryExecutor . getOrderFor ( match ) ; Order ret = APIAccess . createOrder ( oe ) ; Query... | Define an order on a set of domain objects which are specified by a DomainObjectMatch in the context of the domain query . |
123,934 | public Traverse TRAVERSE_FROM ( DomainObjectMatch < ? > start ) { DomainObjectMatch < ? > delegate = APIAccess . getDelegate ( start ) ; DomainObjectMatch < ? > match = delegate != null ? delegate : start ; TraversalExpression te = new TraversalExpression ( match , this . queryExecutor ) ; this . queryExecutor . addAst... | Start traversing the graph of domain objects . |
123,935 | public < T > Select < T > SELECT_FROM ( DomainObjectMatch < T > start ) { DomainObjectMatch < ? > delegate = APIAccess . getDelegate ( start ) ; DomainObjectMatch < ? > match = delegate != null ? delegate : start ; SelectExpression < T > se = new SelectExpression < T > ( APIAccess . getDomainObjectType ( start ) , matc... | Select domain objects out of a set of other domain objects . |
123,936 | public Collect COLLECT ( JcProperty attribute ) { CollectExpression ce = new CollectExpression ( attribute , this . getIntAccess ( ) ) ; Collect coll = APIAccess . createCollect ( ce ) ; this . queryExecutor . addAstObject ( ce ) ; QueryRecorder . recordInvocation ( this , "COLLECT" , coll , QueryRecorder . placeHolder... | Collect the specified attribute from all objects in a DomainObjectMatch |
123,937 | @ SuppressWarnings ( "unchecked" ) public < T > DomainObjectMatch < T > INTERSECTION ( DomainObjectMatch < T > ... set ) { DomainObjectMatch < T > ret = this . union_Intersection ( false , set ) ; Object [ ] placeHolders = new Object [ set . length ] ; DomainObjectMatch < ? > delegate ; DomainObjectMatch < ? > match ; ... | Build the intersection of the specified sets |
123,938 | public DomainQueryResult execute ( ) { DomainQueryResult ret = new DomainQueryResult ( this ) ; Object so = this . queryExecutor . getMappingInfo ( ) . getInternalDomainAccess ( ) . getSyncObject ( ) ; if ( so != null ) { synchronized ( so ) { this . queryExecutor . execute ( ) ; } } else this . queryExecutor . execute... | Execute the domain query |
123,939 | public CountQueryResult executeCount ( ) { CountQueryResult ret = new CountQueryResult ( this ) ; Object so = this . queryExecutor . getMappingInfo ( ) . getInternalDomainAccess ( ) . getSyncObject ( ) ; if ( so != null ) { synchronized ( so ) { this . queryExecutor . executeCount ( ) ; } } else this . queryExecutor . ... | Retrieve the count for every DomainObjectMatch of the query in order to support pagination |
123,940 | public String toJSON ( RecordedQuery query ) { StringWriter sw = new StringWriter ( ) ; JsonGenerator generator ; if ( this . prettyFormat != Format . NONE ) { JsonGeneratorFactory gf = JSONWriter . getPrettyGeneratorFactory ( ) ; generator = gf . createGenerator ( sw ) ; } else generator = Json . createGenerator ( sw ... | Answer a JSON representation of a recorded query |
123,941 | public RecordedQuery fromJSON ( String json ) { RecordedQuery ret = new RecordedQuery ( false ) ; StringReader sr = new StringReader ( json ) ; JsonReader reader = Json . createReader ( sr ) ; JsonObject jsonResult = reader . readObject ( ) ; ret . setGeneric ( jsonResult . getBoolean ( GENERIC ) ) ; JsonArray augmenta... | Build a recorded query from it s JSON representation |
123,942 | public GrProperty getProperty ( String propertyName ) { for ( GrProperty prop : getProperties ( ) ) { if ( prop . getName ( ) . equals ( propertyName ) ) return prop ; } return null ; } | return a property |
123,943 | public GrProperty addProperty ( String name , Object value ) { GrProperty prop = GrAccess . createProperty ( name ) ; prop . setValue ( value ) ; return getPropertiesContainer ( ) . addElement ( prop ) ; } | add a new property throw a RuntimeException if the property already exists |
123,944 | public long countOf ( DomainObjectMatch < ? > match ) { long ret ; Object so = InternalAccess . getQueryExecutor ( this . domainQuery ) . getMappingInfo ( ) . getInternalDomainAccess ( ) . getSyncObject ( ) ; if ( so != null ) { synchronized ( so ) { ret = intCountOf ( match ) ; } } else ret = intCountOf ( match ) ; re... | Answer the number of domain objects |
123,945 | public static String writePretty ( JsonObject jsonObject ) { JsonWriterFactory factory = createPrettyWriterFactory ( ) ; StringWriter sw = new StringWriter ( ) ; JsonWriter writer = factory . createWriter ( sw ) ; writer . writeObject ( jsonObject ) ; String ret = sw . toString ( ) ; writer . close ( ) ; return ret ; } | write a JsonObject formatted in a pretty way into a String |
123,946 | public static void printQuery ( JcQuery query , QueryToObserve toObserve , Format format ) { boolean titlePrinted = false ; ContentToObserve tob = QueriesPrintObserver . contentToObserve ( toObserve ) ; if ( tob == ContentToObserve . CYPHER || tob == ContentToObserve . CYPHER_JSON ) { titlePrinted = true ; QueriesPrint... | map to CYPHER statements and map to JSON print the mapping results to System . out |
123,947 | public static void printQueries ( List < JcQuery > queries , QueryToObserve toObserve , Format format ) { boolean titlePrinted = false ; ContentToObserve tob = QueriesPrintObserver . contentToObserve ( toObserve ) ; if ( tob == ContentToObserve . CYPHER || tob == ContentToObserve . CYPHER_JSON ) { titlePrinted = true ;... | map to CYPHER statements and map to JSON print the mapping results to the output streams configured in QueriesPrintObserver |
123,948 | public static List < String > availableDomains ( IDBAccess dbAccess ) { List < GrNode > resultList = loadAllDomainInfoNodes ( dbAccess ) ; List < String > domains = new ArrayList < String > ( ) ; for ( GrNode rNode : resultList ) { domains . add ( rNode . getProperty ( DomainInfoNameProperty ) . getValue ( ) . toString... | answer the names of available domains . |
123,949 | public List < DomainObjectType > getDomainObjectTypes ( ) { List < DomainObjectType > resultList = new ArrayList < DomainObjectType > ( ) ; GrNode infoNode = loadDomainInfoNode ( ) ; GrProperty prop = infoNode . getProperty ( DomainInfoLabel2ClassProperty ) ; if ( prop != null ) { @ SuppressWarnings ( "unchecked" ) Lis... | answer a list of DomainObjectTypes stored in the domain graph |
123,950 | public List < String > getDomainObjectTypeNames ( ) { List < DomainObjectType > types = getDomainObjectTypes ( ) ; List < String > typeNames = new ArrayList < String > ( types . size ( ) ) ; for ( DomainObjectType typ : types ) { typeNames . add ( typ . getTypeName ( ) ) ; } return typeNames ; } | answer a list of names of DomainObjectTypes stored in the domain graph |
123,951 | public T addElement ( T element ) { getElements ( ) ; if ( ! containsElement ( this . elements , element ) ) { this . elements . add ( element ) ; element . addChangeListener ( this . elementChangeListener ) ; element . notifyState ( ) ; return element ; } throw new RuntimeException ( element . toString ( ) + " already... | add a new element throw a RuntimeException if the element already exists |
123,952 | private SyncState checkForElementStates ( SyncState ... states ) { if ( this . elements != null ) { for ( T elem : this . elements ) { for ( SyncState state : states ) { if ( elem . getSyncState ( ) != state ) return elem . getSyncState ( ) ; } } } return null ; } | check all elements if their state is one of the given states |
123,953 | public void addListFieldValue ( String fieldName , Object value ) { Object val = value ; if ( value instanceof DomainObject ) val = ( ( DomainObject ) value ) . getRawObject ( ) ; Object lst = getFieldValue ( fieldName , true ) ; DOField fld = getDomainObjectType ( ) . getFieldByName ( fieldName ) ; String ctn = fld . ... | Add a value to a list or array field |
123,954 | public Object getListFieldValue ( String fieldName , int index ) { Object ret = null ; Object val = getFieldValue ( fieldName , true ) ; if ( val instanceof List < ? > ) { List < ? > list = ( List < ? > ) val ; Object cval = list . get ( index ) ; DomainObject gdo = getForRawObject ( cval ) ; if ( gdo != null ) ret = g... | if the field is a list or array answer the value at the given index . |
123,955 | public int getIndexOfValue ( String fieldName , Object value ) { int ret = - 1 ; Object val = value ; if ( value instanceof DomainObject ) val = ( ( DomainObject ) value ) . getRawObject ( ) ; Object lst = getFieldValue ( fieldName , true ) ; if ( lst instanceof List < ? > ) { List < ? > list = ( List < ? > ) lst ; for... | Returns the index of the first occurrence of the specified value in the list field or - 1 if the list field does not contain the value . |
123,956 | public void clearListField ( String fieldName ) { Object val = getFieldValue ( fieldName , true ) ; if ( val instanceof List < ? > ) ( ( List < ? > ) val ) . clear ( ) ; else if ( val != null && val . getClass ( ) . isArray ( ) ) { DOField fld = getDomainObjectType ( ) . getFieldByName ( fieldName ) ; String ctn = fld ... | Removes all of the elements from the list field . |
123,957 | public int getListFieldLength ( String fieldName ) { int ret = - 1 ; Object val = getFieldValue ( fieldName , true ) ; if ( val instanceof List < ? > ) ret = ( ( List < ? > ) val ) . size ( ) ; else if ( val != null && val . getClass ( ) . isArray ( ) ) { ret = Array . getLength ( val ) ; } else { if ( ! getDomainObjec... | Answer the length of a list field |
123,958 | @ SuppressWarnings ( "unchecked" ) public DomainObjectMatch < T > ELEMENTS ( TerminalResult ... where ) { DomainObjectMatch < T > ret ; SelectExpression < T > se = this . getSelectExpression ( ) ; DomainObjectMatch < ? > selDom = APIAccess . createDomainObjectMatch ( se . getStart ( ) . getDomainObjectType ( ) , se . g... | Specify one or more predicate expressions to constrain the set of domain objects |
123,959 | private JcError checkLockingError ( List < JcQueryResult > results , boolean hasCreateQuery , List < ElemId2Query > elemIds2Query ) { JcError error = null ; if ( this . lockingStrategy == Locking . OPTIMISTIC ) { JcNumber lockV = new JcNumber ( "lockV" ) ; JcNumber nSum = new JcNumber ( "sum" ) ; int to = hasCreateQuer... | in case of error return the element s id or if not available return - 2 in case of change or - 3 in case of delete in case of ok return - 1 |
123,960 | Parameter getCreateParameter ( String name ) { if ( this . parameters == null ) this . parameters = new HashMap < String , Parameter > ( ) ; Parameter param = this . parameters . get ( name ) ; if ( param == null ) { param = new Parameter ( name ) ; this . parameters . put ( name , param ) ; } return param ; } | Get or create if not exists a query parameter . |
123,961 | public String getDomains ( ) { StringWriter sw = new StringWriter ( ) ; JsonGenerator generator ; if ( this . prettyFormat != Format . NONE ) { JsonGeneratorFactory gf = JSONWriter . getPrettyGeneratorFactory ( ) ; generator = gf . createGenerator ( sw ) ; } else generator = Json . createGenerator ( sw ) ; generator . ... | Answer a JSON representation of the available domains in the database |
123,962 | public List < Class < ? > > getTypes ( boolean noAbstractTypes ) { List < Class < ? > > typeList = new ArrayList < Class < ? > > ( ) ; this . addType ( typeList , noAbstractTypes ) ; return typeList ; } | Answer a list of types of this CompoundObjectType . |
123,963 | public LiteralMapList resultMapListOf ( JcPrimitive ... key ) { List < List < ? > > results = new ArrayList < List < ? > > ( ) ; LiteralMapList ret = new LiteralMapList ( ) ; int size = - 1 ; ResultHandler . includeNullValues . set ( Boolean . TRUE ) ; try { for ( JcPrimitive k : key ) { List < ? > r = this . resultOf ... | answer a list of literal maps containing result values for the given keys |
123,964 | protected Class < ? > getComponentType ( GrNode rNode ) { Class < ? > compType ; if ( this . getFieldType ( ) . isArray ( ) && ( compType = this . getFieldType ( ) . getComponentType ( ) ) . isPrimitive ( ) ) { return compType ; } return null ; } | only called when to check for a concrete simple component type |
123,965 | public GrLabel getLabel ( String labelName ) { for ( GrLabel lab : getLabels ( ) ) { if ( lab . getName ( ) . equals ( labelName ) ) return lab ; } return null ; } | return a label |
123,966 | public GrLabel addLabel ( String name ) { GrLabel lab = GrAccess . createLabel ( name ) ; return getLabelsContainer ( ) . addElement ( lab ) ; } | add a new label throw a RuntimeException if the label already exists |
123,967 | public TraversalStep FORTH ( String attributeName ) { TraversalExpression te = ( TraversalExpression ) this . astObject ; te . step ( attributeName , 0 ) ; TraversalStep ret = new TraversalStep ( te ) ; QueryRecorder . recordInvocation ( this , "FORTH" , ret , QueryRecorder . literal ( attributeName ) ) ; return ret ; ... | Traverse forward via an attribute |
123,968 | public < T > DomainObjectMatch < T > TO ( Class < T > domainObjectType ) { TraversalExpression te = ( TraversalExpression ) this . astObject ; DomainObjectMatch < T > ret = APIAccess . createDomainObjectMatch ( domainObjectType , te . getQueryExecutor ( ) . getDomainObjectMatches ( ) . size ( ) , te . getQueryExecutor ... | End the traversal of the domain object graph matching a specific type of domain objects |
123,969 | public void remove ( ) { SyncState oldState = this . syncState ; if ( this . syncState == SyncState . NEW || this . syncState == SyncState . NEW_REMOVED ) this . syncState = SyncState . NEW_REMOVED ; else this . syncState = SyncState . REMOVED ; if ( oldState != this . syncState ) fireChanged ( oldState , this . syncSt... | removes this item |
123,970 | public JcProperty atttribute ( String name ) { if ( this . delegate != null ) return this . delegate . atttribute ( name ) ; JcProperty ret = checkField_getJcVal ( name , JcProperty . class ) ; QueryRecorder . recordInvocationReplace ( this , ret , "atttribute" ) ; return ret ; } | Access an attribute don t rely on a specific attribute type |
123,971 | public JcString stringAtttribute ( String name ) { if ( this . delegate != null ) return this . delegate . stringAtttribute ( name ) ; JcString ret = checkField_getJcVal ( name , JcString . class ) ; QueryRecorder . recordInvocationReplace ( this , ret , "stringAtttribute" ) ; return ret ; } | Access a string attribute |
123,972 | public JcNumber numberAtttribute ( String name ) { if ( this . delegate != null ) return this . delegate . numberAtttribute ( name ) ; JcNumber ret = checkField_getJcVal ( name , JcNumber . class ) ; QueryRecorder . recordInvocationReplace ( this , ret , "numberAtttribute" ) ; return ret ; } | Access a number attribute |
123,973 | public JcBoolean booleanAtttribute ( String name ) { if ( this . delegate != null ) return this . delegate . booleanAtttribute ( name ) ; JcBoolean ret = checkField_getJcVal ( name , JcBoolean . class ) ; QueryRecorder . recordInvocationReplace ( this , ret , "booleanAtttribute" ) ; return ret ; } | Access a boolean attribute |
123,974 | public JcCollection collectionAtttribute ( String name ) { if ( this . delegate != null ) return this . delegate . collectionAtttribute ( name ) ; JcCollection ret = checkField_getJcVal ( name , JcCollection . class ) ; QueryRecorder . recordInvocationReplace ( this , ret , "collectionAtttribute" ) ; return ret ; } | Access a collection attribute |
123,975 | public static IDomainAccess createDomainAccess ( IDBAccess dbAccess , String domainName ) { return IDomainAccessFactory . INSTANCE . createDomainAccess ( dbAccess , domainName ) ; } | Create a domain accessor . |
123,976 | public static IGenericDomainAccess createGenericDomainAccess ( IDBAccess dbAccess , String domainName , DomainLabelUse domainLabelUse ) { return IDomainAccessFactory . INSTANCE . createGenericDomainAccess ( dbAccess , domainName , domainLabelUse ) ; } | Create a domain accessor which works with a generic domain model . |
123,977 | public OrderDirection BY ( String attributeName ) { OrderBy ob = this . orderExpression . getCreateOrderCriteriaFor ( attributeName ) ; OrderDirection ret = new OrderDirection ( ob ) ; QueryRecorder . recordInvocation ( this , "BY" , ret , QueryRecorder . literal ( attributeName ) ) ; return ret ; } | Specify the attribute to be used for sorting |
123,978 | public String getDomainName ( ) { DomainModel model = ( ( IIntDomainAccess ) this . domainAccess ) . getInternalDomainAccess ( ) . getDomainModel ( ) ; StringWriter sw = new StringWriter ( ) ; JsonGenerator generator ; if ( this . prettyFormat != Format . NONE ) { JsonGeneratorFactory gf = JSONWriter . getPrettyGenerat... | Answer a JSON object containing the domain name |
123,979 | public static Graph create ( IDBAccess dbAccess ) { ResultHandler rh = new ResultHandler ( dbAccess ) ; Graph ret = rh . getGraph ( ) ; ret . setSyncState ( SyncState . NEW ) ; return ret ; } | create an empty graph |
123,980 | public GrRelation createRelation ( String type , GrNode startNode , GrNode endNode ) { return this . resultHandler . getLocalElements ( ) . createRelation ( type , startNode , endNode ) ; } | create a relation in the graph |
123,981 | public DomainQuery replayQuery ( RecordedQuery recordedQuery , IDomainAccess domainAccess ) { Boolean br_old = null ; DomainQuery query ; try { if ( ! Settings . TEST_MODE ) { br_old = QueryRecorder . blockRecording . get ( ) ; if ( this . createNew ) QueryRecorder . blockRecording . set ( Boolean . FALSE ) ; else Quer... | Create a domain query from a recorded query . |
123,982 | public GDomainQuery replayGenericQuery ( RecordedQuery recordedQuery , IGenericDomainAccess domainAccess ) { Boolean br_old = null ; GDomainQuery query ; try { if ( ! Settings . TEST_MODE ) { br_old = QueryRecorder . blockRecording . get ( ) ; if ( this . createNew ) QueryRecorder . blockRecording . set ( Boolean . FAL... | Create a generic domain query from a recorded query . |
123,983 | public static JcPrimitive fromType ( Class < ? > type , String name ) { if ( type . equals ( String . class ) ) return new JcString ( name ) ; else if ( type . equals ( Number . class ) ) return new JcNumber ( name ) ; else if ( type . equals ( Boolean . class ) ) return new JcBoolean ( name ) ; return null ; } | Answer an appropriate instance of a JcPrimitive for the given simple - type and name . E . g . given a type java . lang . String a JcString instance will be returned . |
123,984 | public static Object [ ] getEnumValues ( Class < ? extends Enum < ? > > clazz ) { Object [ ] enums = clazz . getEnumConstants ( ) ; if ( enums == null ) { Method [ ] mthds = clazz . getDeclaredMethods ( ) ; Method mthd = null ; for ( Method mth : mthds ) { if ( mth . getName ( ) . equals ( "values" ) ) { mthd = mth ; b... | finds enum values in normal enum classes and in dynamically created ones . |
123,985 | public List < String > getDeclaredFieldNames ( ) { if ( this . declaredFieldNames == null ) { this . declaredFieldNames = new ArrayList < String > ( this . declaredFields . size ( ) ) ; for ( DOField f : this . declaredFields ) { this . declaredFieldNames . add ( f . getName ( ) ) ; } } return this . declaredFieldNames... | Answer a list of all field names declared by this type . |
123,986 | public List < String > getFieldNames ( ) { List < String > ret = new ArrayList < String > ( ) ; DOType typ = this ; while ( typ != null ) { ret . addAll ( typ . getDeclaredFieldNames ( ) ) ; typ = typ . getSuperType ( ) ; } return ret ; } | Answer a list of all field names declared by this type and all it s super types . |
123,987 | public Object getEnumValue ( String name ) { if ( this . kind != Kind . ENUM ) throw new RuntimeException ( "getEnumValue(..) can only be called on an enum" ) ; Object [ ] vals = getEnumValues ( ) ; if ( vals != null ) { for ( Object val : vals ) { if ( ( ( Enum < ? > ) val ) . name ( ) . equals ( name ) ) return val ;... | Answer an enum value with the given name . |
123,988 | @ SuppressWarnings ( "unchecked" ) public Object [ ] getEnumValues ( ) { if ( this . kind != Kind . ENUM ) throw new RuntimeException ( "getEnumValues() can only be called on an enum" ) ; try { return MappingUtil . getEnumValues ( ( Class < ? extends Enum < ? > > ) getRawType ( ) ) ; } catch ( ClassNotFoundException e ... | Answer the list of enum values of this enum . |
123,989 | public static InputStream findInputStreamForResource ( final ZipFile zipFile , final String resourcePath ) throws IOException { final ZipEntry entry = zipFile . getEntry ( resourcePath ) ; InputStream result = null ; if ( entry != null && ! entry . isDirectory ( ) ) { result = zipFile . getInputStream ( entry ) ; } ret... | Get input stream for resource in zip file . |
123,990 | public static byte [ ] toByteArray ( final ZipFile zipFile , final String path ) throws IOException { final InputStream in = findInputStreamForResource ( zipFile , path ) ; byte [ ] result = null ; if ( in != null ) { try { result = IOUtils . toByteArray ( in ) ; } finally { IOUtils . closeQuietly ( in ) ; } } return r... | Read who ; e zip item into byte array . |
123,991 | public static Document loadXmlDocument ( final InputStream inStream , final String charset , final boolean autoClose ) throws SAXException , IOException , ParserConfigurationException { final DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; try { factory . setFeature ( XMLConstants . FEATURE_... | Load and parse XML document from input stream . |
123,992 | public static Element findFirstElement ( final Element node , final String elementName ) { Element result = null ; for ( final Element l : Utils . findDirectChildrenForName ( node , elementName ) ) { result = l ; break ; } return result ; } | Get first direct child for name . |
123,993 | public static List < Element > findDirectChildrenForName ( final Element element , final String childElementname ) { final List < Element > resultList = new ArrayList < Element > ( ) ; final NodeList list = element . getChildNodes ( ) ; for ( int i = 0 ; i < list . getLength ( ) ; i ++ ) { final Node node = list . item... | Find all direct children with defined name . |
123,994 | public static int getMaxImageSize ( ) { int result = MAX_IMAGE_SIDE_SIZE_IN_PIXELS ; try { final String defined = System . getProperty ( PROPERTY_MAX_EMBEDDED_IMAGE_SIDE_SIZE ) ; if ( defined != null ) { LOGGER . info ( "Detected redefined max size for embedded image side : " + defined ) ; result = Math . max ( 8 , Int... | Get max image size . |
123,995 | public static String rescaleImageAndEncodeAsBase64 ( final InputStream in , final int maxSize ) throws IOException { final Image image = ImageIO . read ( in ) ; String result = null ; if ( image != null ) { result = rescaleImageAndEncodeAsBase64 ( image , maxSize ) ; } return result ; } | Load and encode image into Base64 . |
123,996 | public static String rescaleImageAndEncodeAsBase64 ( final File file , final int maxSize ) throws IOException { final Image image = ImageIO . read ( file ) ; if ( image == null ) { throw new IllegalArgumentException ( "Can't load image file : " + file ) ; } return rescaleImageAndEncodeAsBase64 ( image , maxSize ) ; } | Load and encode image into Base64 from file . |
123,997 | public static RenderQuality getDefaultRenderQialityForOs ( ) { RenderQuality result = RenderQuality . DEFAULT ; if ( SystemUtils . IS_OS_MAC || SystemUtils . IS_OS_WINDOWS ) { result = RenderQuality . QUALITY ; } return result ; } | Get default render quality for host OS . |
123,998 | public MMDPrintOptions setScaleType ( final ScaleType scaleOption ) { this . scaleOption = Assertions . assertNotNull ( scaleOption ) ; return this ; } | Set the selected scale option . |
123,999 | public < T > T getSessionObject ( final String key , final Class < T > klazz , final T def ) { this . lock ( ) ; try { T result = klazz . cast ( this . sessionObjects . get ( key ) ) ; return result == null ? def : result ; } finally { this . unlock ( ) ; } } | Get saved session object . Object is presented and saved only for the current panel and only in memory . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.