idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
18,600 | public boolean containsCursor ( long cursorId ) { if ( cursorId < getData ( ) . firstCursorIndex ) { return false ; } return cursorId < ( getData ( ) . firstCursorIndex + getData ( ) . cursorCount ) ; } | Contains cursor boolean . |
18,601 | public Bits bitsTo ( TrieNode toNode ) { if ( index == toNode . index ) return Bits . NULL ; return intervalTo ( toNode ) . toBits ( ) ; } | Bits to bits . |
18,602 | public Interval intervalTo ( TrieNode toNode ) { return new Interval ( toNode . getCursorIndex ( ) - this . getCursorIndex ( ) , toNode . getCursorCount ( ) , this . getCursorCount ( ) ) ; } | Interval to interval . |
18,603 | NodeData update ( Function < NodeData , NodeData > update ) { data = trie . nodes . update ( index , update ) ; return data ; } | Update node data . |
18,604 | public boolean isStringTerminal ( ) { if ( getChar ( ) == NodewalkerCodec . END_OF_STRING ) return true ; if ( getChar ( ) == NodewalkerCodec . FALLBACK && null != getParent ( ) ) return getParent ( ) . isStringTerminal ( ) ; return false ; } | Is string terminal boolean . |
18,605 | public Stream < ? extends TrieNode > streamDecendents ( int level ) { assert ( level > 0 ) ; if ( level == 1 ) { return getChildren ( ) ; } else { return getChildren ( ) . flatMap ( child -> child . streamDecendents ( level - 1 ) ) ; } } | Stream decendents stream . |
18,606 | void writeChildren ( TreeMap < Character , Long > counts ) { int firstIndex = trie . nodes . length ( ) ; counts . forEach ( ( k , v ) -> { if ( v > 0 ) trie . nodes . add ( new NodeData ( k , ( short ) - 1 , - 1 , v , - 1 ) ) ; } ) ; short length = ( short ) ( trie . nodes . length ( ) - firstIndex ) ; trie . ensurePa... | Write children . |
18,607 | public TreeMap < Character , ? extends TrieNode > getChildrenMap ( ) { TreeMap < Character , TrieNode > map = new TreeMap < > ( ) ; getChildren ( ) . forEach ( x -> map . put ( x . getChar ( ) , x ) ) ; return map ; } | Gets children map . |
18,608 | public Map < Character , TrieNode > getGodChildren ( ) { String postContext = this . getString ( ) . substring ( 1 ) ; return trie . tokens ( ) . stream ( ) . collect ( Collectors . toMap ( x -> x , token -> { TrieNode traverse = trie . traverse ( token + postContext ) ; return traverse . getString ( ) . equals ( token... | Gets god children . |
18,609 | public TrieNode getParent ( ) { if ( 0 == index ) return null ; if ( null == parent && - 1 == depth ) { synchronized ( this ) { if ( null == parent ) { parent = newNode ( trie . parentIndex [ index ] ) ; assert ( parent . index < index ) ; } } } return parent ; } | Gets parent . |
18,610 | public TrieNode getContinuation ( char c ) { return ( ( Optional < TrieNode > ) getChild ( c ) ) . orElseGet ( ( ) -> { TrieNode godparent = godparent ( ) ; if ( null == godparent ) return null ; return godparent . getContinuation ( c ) ; } ) ; } | Gets continuation . |
18,611 | public static String mapToPtPath ( final String aID ) { Objects . requireNonNull ( aID ) ; final String encodedID = encodeID ( aID ) ; final List < String > shorties = new ArrayList < > ( ) ; int start = 0 ; while ( start < encodedID . length ( ) ) { int end = start + myShortyLength ; if ( end > encodedID . length ( ) ... | Maps the supplied ID to a Pairtree path . |
18,612 | public static String mapToID ( final String aBasePath , final String aPtPath ) throws InvalidPathException { return mapToID ( removeBasePath ( aBasePath , aPtPath ) ) ; } | Maps the supplied base path to an ID using the supplied Pairtree path . |
18,613 | public static String mapToID ( final String aPtPath ) throws InvalidPathException { final String encapsulatingDir = getEncapsulatingDir ( aPtPath ) ; String id = aPtPath ; if ( id . endsWith ( Character . toString ( mySeparator ) ) ) { id = id . substring ( 0 , id . length ( ) - 1 ) ; } if ( encapsulatingDir != null ) ... | Maps the supplied base path to an ID . |
18,614 | public static String getEncapsulatingDir ( final String aBasePath , final String aPtPath ) throws InvalidPathException { return getEncapsulatingDir ( removeBasePath ( aBasePath , aPtPath ) ) ; } | Extracts the encapsulating directory from the supplied Pairtree path using the supplied base path . |
18,615 | public static String getEncapsulatingDir ( final String aPtPath ) throws InvalidPathException { Objects . requireNonNull ( aPtPath , LOGGER . getMessage ( MessageCodes . PT_003 ) ) ; final String [ ] pPathParts = aPtPath . split ( "\\" + mySeparator ) ; if ( pPathParts . length == SINGLE_PART ) { if ( pPathParts [ 0 ] ... | Extracts the encapsulating directory from the supplied Pairtree path . |
18,616 | private static String concat ( final String ... aPathsVarargs ) { final String path ; Objects . requireNonNull ( aPathsVarargs ) ; if ( aPathsVarargs . length == 0 ) { path = "" ; } else { final StringBuffer pathBuf = new StringBuffer ( ) ; Character lastChar = null ; for ( final String aPathsVararg : aPathsVarargs ) {... | Concatenates the Pairtree paths varargs . |
18,617 | public static String removePrefix ( final String aPrefix , final String aID ) { Objects . requireNonNull ( aPrefix , LOGGER . getMessage ( MessageCodes . PT_006 ) ) ; Objects . requireNonNull ( aID , LOGGER . getMessage ( MessageCodes . PT_004 ) ) ; final String id ; if ( aID . indexOf ( aPrefix ) == 0 ) { id = aID . s... | Removes the supplied Pairtree prefix from the supplied ID . |
18,618 | public static String removeBasePath ( final String aBasePath , final String aPtPath ) { Objects . requireNonNull ( aBasePath , LOGGER . getMessage ( MessageCodes . PT_007 ) ) ; Objects . requireNonNull ( aPtPath , LOGGER . getMessage ( MessageCodes . PT_003 ) ) ; String newPath = aPtPath ; if ( aPtPath . startsWith ( a... | Removes the base path from the supplied Pairtree path . |
18,619 | @ SuppressWarnings ( "checkstyle:BooleanExpressionComplexity" ) public static String encodeID ( final String aID ) { Objects . requireNonNull ( aID , LOGGER . getMessage ( MessageCodes . PT_004 ) ) ; final byte [ ] bytes ; try { bytes = aID . getBytes ( "utf-8" ) ; } catch ( final UnsupportedEncodingException details )... | Cleans an ID for use in a Pairtree path . |
18,620 | public static String decodeID ( final String aID ) { Objects . requireNonNull ( aID , LOGGER . getMessage ( MessageCodes . PT_004 ) ) ; final StringBuilder idBuf = new StringBuilder ( ) ; for ( int index = 0 ; index < aID . length ( ) ; index ++ ) { final char character = aID . charAt ( index ) ; if ( character == EQUA... | Unclean the ID from the Pairtree path . |
18,621 | private final void reset ( ) { backtrackStack . clear ( ) ; actionStack . clear ( ) ; stateStack . clear ( ) ; parserErrors . clear ( ) ; streamPosition = 0 ; stepCounter = 0 ; stateStack . push ( 0 ) ; maxPosition = 0 ; shiftIgnoredTokens ( ) ; } | This method is called just before running the parser to reset all internal values and to clean all stacks . |
18,622 | private final void shiftIgnoredTokens ( ) { if ( streamPosition == getTokenStream ( ) . size ( ) ) { return ; } Token token = getTokenStream ( ) . get ( streamPosition ) ; while ( token . getVisibility ( ) == Visibility . IGNORED ) { streamPosition ++ ; if ( streamPosition == getTokenStream ( ) . size ( ) ) { break ; }... | This method treats all ignored tokens during a shift . The ignored tokens are just skipped by moving the stream position variable forward . |
18,623 | private final ParseTreeNode parse ( ) throws ParserException { try { createActionStack ( ) ; return LRTokenStreamConverter . convert ( getTokenStream ( ) , getGrammar ( ) , actionStack ) ; } catch ( GrammarException e ) { logger . error ( e . getMessage ( ) , e ) ; throw new ParserException ( e . getMessage ( ) ) ; } } | This method does the actual parsing . |
18,624 | private void checkTimeout ( ) throws ParserException { if ( timeout > 0 ) { if ( System . currentTimeMillis ( ) - startTime > timeout * 1000 ) { throw new ParserException ( "Timeout after " + timeout + " seconds near '" + getTokenStream ( ) . getCodeSample ( maxPosition ) + "'!" ) ; } } } | This method checks for the timeout . If the time ran out an ParserException is thrown and the parser process is finished . |
18,625 | private final ParserAction getAction ( ParserActionSet actionSet ) throws GrammarException { if ( actionSet . getActionNumber ( ) == 1 ) { return actionSet . getAction ( ) ; } if ( ! backtrackEnabled ) { logger . trace ( "Action set '" + actionSet + "' is ambiguous and back tracking is disabled!" ) ; throw new GrammarE... | This mehtod returns the currently to be processed action . This method also takes care for ambiguous grammars and backtracking . |
18,626 | @ SuppressWarnings ( "unchecked" ) private final void addBacktrackLocation ( int usedAlternative ) { backtrackStack . push ( new BacktrackLocation ( ( Stack < Integer > ) stateStack . clone ( ) , actionStack . size ( ) , streamPosition , stepCounter , usedAlternative ) ) ; if ( backtrackDepth > 0 ) { while ( backtrackS... | This method adds the backtracking information for the current step . |
18,627 | private final void shift ( ParserAction action ) { stateStack . push ( action . getParameter ( ) ) ; actionStack . add ( action ) ; streamPosition ++ ; shiftIgnoredTokens ( ) ; } | This method is called for shift actions . |
18,628 | private final void reduce ( ParserAction action ) throws ParserException { try { Production production = getGrammar ( ) . getProduction ( action . getParameter ( ) ) ; for ( int i = 0 ; i < production . getConstructions ( ) . size ( ) ; i ++ ) { stateStack . pop ( ) ; } actionStack . add ( action ) ; ParserAction gotoA... | This method is called for reduce actions . |
18,629 | private final void error ( ) throws ParserException { Integer currentState = stateStack . peek ( ) ; parserErrors . addError ( currentState ) ; if ( backtrackEnabled && ! backtrackStack . isEmpty ( ) ) { trackBack ( ) ; return ; } if ( ! backtrackEnabled ) { logger . trace ( "No valid action available and back tracking... | This method is called for an error action . |
18,630 | private final void trackBack ( ) { logger . trace ( "No valid action available. Perform back tracking..." ) ; BacktrackLocation backtrackLocation = backtrackStack . peek ( ) ; streamPosition = backtrackLocation . getStreamPosition ( ) ; stepCounter = backtrackLocation . getStepCounter ( ) ; while ( actionStack . size (... | This method perform the back tracking by popping all relevant information from the stacks . |
18,631 | private ServiceDirectoryCache < String , ModelService > getCache ( ) { if ( cache == null ) { synchronized ( this ) { if ( this . cache == null ) { this . cache = new ServiceDirectoryCache < String , ModelService > ( ) ; } } } return this . cache ; } | Get the ServiceDirectoryCache that caches Services it is lazy initialized . |
18,632 | public Token getNextToken ( ) { if ( nextToken == null ) { try { if ( ! lex ( ) ) { throw new NoSuchElementException ( ) ; } } catch ( IOException e ) { errorMessage = e . getMessage ( ) ; hasErrors_ = true ; throw new NoSuchElementException ( ) ; } } return nextToken ; } | Returns the next token without consuming it . |
18,633 | public String getStateAsString ( ) { Integer state = getState ( ) ; if ( STOPPED . equals ( state ) ) { return "Stopped" ; } if ( STARTING . equals ( state ) ) { return "Starting" ; } if ( RUNNING . equals ( state ) ) { return "Running" ; } if ( STOPPING . equals ( state ) ) { return "Stopping" ; } throw new IllegalSta... | Get the name of current state |
18,634 | public ObjectSchema withProperty ( PropertySchema schema ) { _properties = _properties != null ? _properties : new ArrayList < PropertySchema > ( ) ; _properties . add ( schema ) ; return this ; } | Adds a validation schema for an object property . |
18,635 | public ObjectSchema withRequiredProperty ( String name , Object type , IValidationRule ... rules ) { _properties = _properties != null ? _properties : new ArrayList < PropertySchema > ( ) ; PropertySchema schema = new PropertySchema ( name , type ) ; schema . setRules ( Arrays . asList ( rules ) ) ; schema . makeRequir... | Adds a validation schema for a required object property . |
18,636 | public void createSampleDatas ( ) throws NamingException { final Context ctx = new InitialContext ( ) ; final BeanManager beanManager = ( BeanManager ) ctx . lookup ( "java:comp/env/BeanManager" ) ; final EntityManagerFactory entityManagerFactory = BeanManagerUtils . getOrCreateInstance ( beanManager , EntityManagerFac... | private UserService userService ; |
18,637 | public static void setSystemPropertyIfIsNull ( String key , Object value ) { if ( ! System . getProperties ( ) . containsKey ( key ) ) System . setProperty ( key , value . toString ( ) ) ; } | Sets system property if is null . |
18,638 | public static URL getURL ( String classpathOrFilePath ) { try { return getURI ( classpathOrFilePath ) . toURL ( ) ; } catch ( MalformedURLException e ) { return JMExceptionManager . handleExceptionAndReturnNull ( log , e , "getURL" , classpathOrFilePath ) ; } } | Gets url . |
18,639 | public static URI getResourceURI ( String classpath ) { try { return getResourceURL ( classpath ) . toURI ( ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnNull ( log , e , "getResourceURI" , classpath ) ; } } | Gets resource uri . |
18,640 | public static URI getURI ( String classpathOrFilePath ) { return Optional . ofNullable ( getResourceURI ( classpathOrFilePath ) ) . orElseGet ( ( ) -> new File ( classpathOrFilePath ) . toURI ( ) ) ; } | Gets uri . |
18,641 | public static boolean saveProperties ( Properties inProperties , File saveFile , String comment ) { try { if ( ! saveFile . exists ( ) ) JMFiles . createEmptyFile ( saveFile ) ; BufferedWriter writer = new BufferedWriter ( new FileWriter ( saveFile ) ) ; inProperties . store ( writer , comment ) ; writer . close ( ) ; ... | Save properties boolean . |
18,642 | public static String readStringForZip ( String zipFilePathOrClasspath , String entryName , String charsetName ) { return JMInputStream . toString ( getResourceInputStreamForZip ( zipFilePathOrClasspath , entryName ) , charsetName ) ; } | Read string for zip string . |
18,643 | public static List < String > readLinesForZip ( String zipFilePathOrClasspath , String entryName ) { return JMInputStream . readLines ( getResourceInputStreamForZip ( zipFilePathOrClasspath , entryName ) ) ; } | Read lines for zip list . |
18,644 | public static String getStringWithClasspathOrFilePath ( String classpathOrFilePath , String charsetName ) { return getStringAsOptWithClasspath ( classpathOrFilePath , charsetName ) . orElseGet ( ( ) -> getStringAsOptWithFilePath ( classpathOrFilePath , charsetName ) . orElse ( null ) ) ; } | Gets string with classpath or file path . |
18,645 | public static List < String > readLinesWithClasspathOrFilePath ( String classpathOrFilePath ) { return getStringListAsOptWithClasspath ( classpathOrFilePath ) . filter ( JMPredicate . getGreaterSize ( 0 ) ) . orElseGet ( ( ) -> JMFiles . readLines ( classpathOrFilePath ) ) ; } | Read lines with classpath or file path list . |
18,646 | public static Optional < List < String > > getStringListAsOptWithClasspath ( String classpathOrFilePath ) { return getResourceInputStreamAsOpt ( classpathOrFilePath ) . map ( JMInputStream :: readLines ) ; } | Gets string list as opt with classpath . |
18,647 | public static List < String > readLinesWithFilePathOrClasspath ( String filePathOrClasspath ) { return JMOptional . getOptional ( JMFiles . readLines ( filePathOrClasspath ) ) . orElseGet ( ( ) -> getStringListAsOptWithClasspath ( filePathOrClasspath ) . orElseGet ( Collections :: emptyList ) ) ; } | Read lines with file path or classpath list . |
18,648 | public static String getStringWithFilePathOrClasspath ( String filePathOrClasspath , String charsetName ) { return getStringAsOptWithFilePath ( filePathOrClasspath , charsetName ) . orElseGet ( ( ) -> getStringAsOptWithClasspath ( filePathOrClasspath , charsetName ) . orElse ( null ) ) ; } | Gets string with file path or classpath . |
18,649 | public static Optional < String > getStringAsOptWithFilePath ( String filePath , String charsetName ) { return JMOptional . getOptional ( JMFiles . readString ( filePath , charsetName ) ) ; } | Gets string as opt with file path . |
18,650 | public static Optional < String > getStringAsOptWithClasspath ( String classpath , String charsetName ) { return getResourceInputStreamAsOpt ( classpath ) . map ( resourceInputStream -> JMInputStream . toString ( resourceInputStream , charsetName ) ) ; } | Gets string as opt with classpath . |
18,651 | public static ResourceBundle getResourceBundle ( String baseName , Locale targetLocale ) { Locale . setDefault ( targetLocale ) ; return ResourceBundle . getBundle ( baseName ) ; } | Gets resource bundle . |
18,652 | public int getSourceLineNumberForOffset ( final int offset ) { int lineNumber = - 1 ; lineNumber = 0 ; for ( ; lineNumber < this . lineStartOffsets . length - 1 ; lineNumber ++ ) { if ( this . lineStartOffsets [ lineNumber + 1 ] > offset ) { break ; } } if ( offset > lineStartOffsets [ lineStartOffsets . length - 1 ] )... | 1st character of the line it was usually returning the following line |
18,653 | public void addChild ( Command cmd ) { if ( cmd != null ) { cmd . setContext ( this ) ; commands . add ( cmd ) ; } } | add child command |
18,654 | public void removeChild ( Command cmd ) { if ( ( cmd != null ) && commands . remove ( cmd ) ) { cmd . setContext ( null ) ; } } | remove child command |
18,655 | private boolean isResolved ( ) { if ( getStatus ( ) < Command . CHILDREN_PROCESSED ) { return false ; } for ( int i = 0 ; i < arguments . size ( ) ; ++ i ) { Command arg = arguments . elementAt ( i ) ; if ( ! arg . isResolved ( ) ) { return false ; } } for ( int j = 0 ; j < operations . size ( ) ; ++ j ) { Command opr ... | check if one of arguments or operations is unresolved |
18,656 | public int exec ( Map < String , Command > references ) throws Exception { if ( status < Command . CHILDREN_PROCESSED ) { if ( status < Command . COMMAND_EXECUTED ) { if ( status < Command . CHILDREN_FILTERED ) { status = doBeforeRun ( references ) ; } if ( status == Command . CHILDREN_FILTERED ) { status = doRun ( ref... | execute command and return execution flags |
18,657 | public boolean backtrack ( Map < String , Command > references ) throws Exception { for ( int i = 0 ; i < arguments . size ( ) ; ++ i ) { Command arg = arguments . elementAt ( i ) ; arg . backtrack ( references ) ; } for ( int i = 0 ; i < operations . size ( ) ; ++ i ) { Command opr = operations . elementAt ( i ) ; opr... | execute commands in backtrack order |
18,658 | private int doBeforeRun ( Map < String , Command > references ) throws Exception { if ( status == Command . INITIALIZED ) { for ( int i = 0 ; i < commands . size ( ) ; ++ i ) { Command cmd = commands . elementAt ( i ) ; if ( cmd . isExecutable ( ) ) { arguments . add ( cmd ) ; } else { operations . add ( cmd ) ; } } re... | put command in one of two collections - arguments or operations |
18,659 | private int doAfterRun ( Map < String , Command > references ) throws Exception { if ( status == Command . COMMAND_EXECUTED ) { Vector < Command > toBeRemoved = new Vector < Command > ( ) ; try { Statement [ ] statements = null ; for ( int i = 0 ; i < operations . size ( ) ; ++ i ) { Command cmd = operations . elementA... | run child commands |
18,660 | public boolean isExecutable ( ) { boolean result = isTag ( "object" ) || isTag ( "void" ) && hasAttr ( "class" ) && hasAttr ( "method" ) || isTag ( "array" ) || isPrimitive ( ) || isTag ( "class" ) || isTag ( "null" ) ; return result ; } | Checks if the command could generate object |
18,661 | private Object getTarget ( Map < String , Command > references ) throws Exception { if ( target == null ) { if ( isReference ( ) ) { Command cmd = references . get ( getAttr ( "idref" ) ) ; target = ( cmd != null ) ? cmd . getResultValue ( ) : null ; } else if ( isExecutable ( ) ) { String className = null ; if ( isPri... | get a target through tag and attrs analysis |
18,662 | private Argument [ ] getArguments ( ) { Argument [ ] args = new Argument [ auxArguments . size ( ) + arguments . size ( ) ] ; for ( int i = 0 ; i < auxArguments . size ( ) ; ++ i ) { args [ i ] = auxArguments . elementAt ( i ) ; } for ( int j = 0 ; j < arguments . size ( ) ; ++ j ) { Command cmd = arguments . elementAt... | return a list of arguments as of Argument type |
18,663 | private Object [ ] getArgumentsValues ( ) { Argument [ ] args = getArguments ( ) ; Object [ ] result = new Object [ args . length ] ; for ( int i = 0 ; i < args . length ; ++ i ) { result [ i ] = args [ i ] . getValue ( ) ; } return result ; } | return argument values |
18,664 | private void copyArgumentsToCommands ( ) { Iterator < Command > i = arguments . iterator ( ) ; while ( i . hasNext ( ) ) { Command cmd = i . next ( ) ; cmd . status = Command . CHILDREN_FILTERED ; operations . add ( cmd ) ; } arguments . clear ( ) ; } | copy arguments to treat as commands |
18,665 | public static boolean isPrimitiveClassName ( String className ) { return className . equalsIgnoreCase ( "boolean" ) || className . equalsIgnoreCase ( "byte" ) || className . equalsIgnoreCase ( "char" ) || className . equalsIgnoreCase ( "short" ) || className . equalsIgnoreCase ( "int" ) || className . equalsIgnoreCase ... | Check if the name of class is primitive |
18,666 | private String getPrimitiveClassName ( String data ) { String shortClassName = null ; if ( data . equals ( "int" ) ) { shortClassName = "Integer" ; } else if ( data . equals ( "char" ) ) { shortClassName = "Character" ; } else { shortClassName = data . substring ( 0 , 1 ) . toUpperCase ( ) + data . substring ( 1 , data... | Transforms a primitive class name |
18,667 | public static long toLongWithDefault ( Object value , long defaultValue ) { Long result = toNullableLong ( value ) ; return result != null ? ( long ) result : defaultValue ; } | Converts value into integer or returns default when conversion is not possible . |
18,668 | public Char read ( ) throws IOException { int cp = in . read ( ) ; if ( cp < 0 ) { return null ; } if ( cp == '\033' ) { if ( ! in . ready ( ) ) { return new Unicode ( cp ) ; } int c2 = in . read ( ) ; if ( c2 < 0 ) { return new Unicode ( cp ) ; } StringBuilder charBuilder = new StringBuilder ( ) ; charBuilder . append... | Read the next char . |
18,669 | protected void reset ( ) { writer . flush ( ) ; stack . clear ( ) ; context = new JsonContext ( JsonContext . Mode . VALUE ) ; } | Reset the state of the writer and flush already written content . |
18,670 | public JsonWriter object ( ) { startValue ( ) ; stack . push ( context ) ; context = new JsonContext ( JsonContext . Mode . MAP ) ; writer . write ( '{' ) ; return this ; } | Start an object value . |
18,671 | public JsonWriter array ( ) { startValue ( ) ; stack . push ( context ) ; context = new JsonContext ( JsonContext . Mode . LIST ) ; writer . write ( '[' ) ; return this ; } | Start an array value . |
18,672 | public JsonWriter endObject ( ) { if ( ! context . map ( ) ) { throw new IllegalStateException ( "Unexpected end, not in object." ) ; } if ( context . value ( ) ) { throw new IllegalStateException ( "Expected map value but got end." ) ; } writer . write ( '}' ) ; context = stack . pop ( ) ; return this ; } | The the ongoing object . |
18,673 | public JsonWriter endArray ( ) { if ( ! context . list ( ) ) { throw new IllegalStateException ( "Unexpected end, not in list." ) ; } writer . write ( ']' ) ; context = stack . pop ( ) ; return this ; } | End the ongoing array . |
18,674 | public JsonWriter key ( int key ) { startKey ( ) ; writer . write ( '\"' ) ; writer . print ( key ) ; writer . write ( '\"' ) ; writer . write ( ':' ) ; return this ; } | Write the int as object key . |
18,675 | public JsonWriter key ( double key ) { startKey ( ) ; writer . write ( '\"' ) ; final long i = ( long ) key ; if ( key == ( double ) i ) { writer . print ( i ) ; } else { writer . print ( key ) ; } writer . write ( '\"' ) ; writer . write ( ':' ) ; return this ; } | Write the double as object key . |
18,676 | public JsonWriter key ( CharSequence key ) { startKey ( ) ; if ( key == null ) { throw new IllegalArgumentException ( "Expected map key, but got null." ) ; } writeQuotedAndEscaped ( key ) ; writer . write ( ':' ) ; return this ; } | Write the string as object key . |
18,677 | public JsonWriter keyUnescaped ( CharSequence key ) { startKey ( ) ; if ( key == null ) { throw new IllegalArgumentException ( "Expected map key, but got null." ) ; } writer . write ( '\"' ) ; writer . write ( key . toString ( ) ) ; writer . write ( '\"' ) ; writer . write ( ':' ) ; return this ; } | Write the string as object key without escaping . |
18,678 | public JsonWriter key ( Binary key ) { startKey ( ) ; if ( key == null ) { throw new IllegalArgumentException ( "Expected map key, but got null." ) ; } writer . write ( '\"' ) ; writer . write ( key . toBase64 ( ) ) ; writer . write ( '\"' ) ; writer . write ( ':' ) ; return this ; } | Write the binary as object key . |
18,679 | public JsonWriter keyLiteral ( CharSequence key ) { startKey ( ) ; if ( key == null ) { throw new IllegalArgumentException ( "Expected map key, but got null." ) ; } writer . write ( key . toString ( ) ) ; writer . write ( ':' ) ; return this ; } | Write the string key without quoting or escaping . |
18,680 | public JsonWriter value ( double value ) { startValue ( ) ; final long i = ( long ) value ; if ( value == ( double ) i ) { writer . print ( i ) ; } else { writer . print ( value ) ; } return this ; } | Write double value . |
18,681 | public JsonWriter value ( CharSequence value ) { startValue ( ) ; if ( value == null ) { writer . write ( kNull ) ; } else { writeQuotedAndEscaped ( value ) ; } return this ; } | Write unicode string value . |
18,682 | public JsonWriter valueUnescaped ( CharSequence value ) { startValue ( ) ; if ( value == null ) { writer . write ( kNull ) ; } else { writer . write ( '\"' ) ; writer . write ( value . toString ( ) ) ; writer . write ( '\"' ) ; } return this ; } | Write a string unescaped value . |
18,683 | public JsonWriter value ( Binary value ) { startValue ( ) ; if ( value == null ) { writer . write ( kNull ) ; } else { writer . write ( '\"' ) ; writer . write ( value . toBase64 ( ) ) ; writer . write ( '\"' ) ; } return this ; } | Write binary value . |
18,684 | public JsonWriter valueLiteral ( CharSequence value ) { startValue ( ) ; if ( value == null ) { writer . write ( kNull ) ; } else { writer . write ( value . toString ( ) ) ; } return this ; } | Write a literal string as value . Not quoted and not escaped . |
18,685 | private void writeQuotedAndEscaped ( CharSequence string ) { if ( string != null && string . length ( ) != 0 ) { int len = string . length ( ) ; writer . write ( '\"' ) ; for ( int i = 0 ; i < len ; ++ i ) { char cp = string . charAt ( i ) ; if ( ( cp < 0x7f && cp >= 0x20 && cp != '\"' && cp != '\\' ) || ( cp > 0x7f &&... | Ported from org . json JSONObject . quote and modified for local use . |
18,686 | @ Requires ( "modifier != null" ) @ Ensures ( "getModifiers().contains(modifier)" ) public void addModifier ( ElementModifier modifier ) { switch ( modifier ) { case PRIVATE : case PACKAGE_PRIVATE : case PROTECTED : case PUBLIC : modifiers . remove ( ElementModifier . PRIVATE ) ; modifiers . remove ( ElementModifier . ... | Adds a modifier to this element . This method ensures that exactly one visibility modifier is set . |
18,687 | @ Requires ( "modifier != null" ) @ Ensures ( "!getModifiers().contains(modifier)" ) public void removeModifier ( ElementModifier modifier ) { modifiers . remove ( modifier ) ; switch ( modifier ) { case PRIVATE : case PACKAGE_PRIVATE : case PROTECTED : case PUBLIC : modifiers . add ( ElementModifier . PACKAGE_PRIVATE ... | Removes a modifier from this element . This method ensures that exactly one visibility modifier is set . It defaults to package - private if no other visibility is set . |
18,688 | public Response < R > processResponse ( final int httpResponseCode , final String httpResponseStatusString , final S freesoundResponse ) { final Response < R > response = new Response < > ( httpResponseCode , httpResponseStatusString ) ; if ( response . isErrorResponse ( ) ) { response . setErrorDetails ( extractErrorM... | Set the raw response received from the HTTP call . Contents are passed on to sub - classes for mapping to DTOs . |
18,689 | public Optional < E > get ( int index ) { return getOptional ( linkedList ) . filter ( getGreaterSize ( 0 ) . and ( getGreaterSize ( index ) ) ) . map ( l -> l . get ( index ) ) ; } | Get optional . |
18,690 | public Optional < E > getPrevious ( ) { return Optional . of ( currentIndex ) . filter ( getGreater ( 0 ) ) . map ( i -> linkedList . get ( -- currentIndex ) ) ; } | Gets previous . |
18,691 | public Optional < E > getNext ( ) { return Optional . of ( currentIndex ) . filter ( getLess ( linkedList . size ( ) - 1 ) ) . map ( i -> linkedList . get ( ++ currentIndex ) ) ; } | Gets next . |
18,692 | @ Requires ( { "elements != null" , "!elements.contains(null)" , "clazz != null" , "kinds != null" } ) @ SuppressWarnings ( "unchecked" ) public static < T extends ElementModel > List < ? extends T > filter ( List < ? extends ElementModel > elements , Class < T > clazz , ElementKind ... kinds ) { ArrayList < T > result... | Returns the sublist of all elements of the specified kinds . |
18,693 | @ Requires ( { "element != null" , "clazz != null" , "kinds != null" } ) @ SuppressWarnings ( "unchecked" ) public static < T extends ElementModel > T findEnclosingElement ( ElementModel element , Class < T > clazz , ElementKind ... kinds ) { List < ElementKind > list = Arrays . asList ( kinds ) ; for ( ; ; ) { element... | Returns the closest enclosing element of the specified kind . |
18,694 | @ Requires ( "element != null" ) public static TypeModel getTypeOf ( ElementModel element ) { return findEnclosingElement ( element , TypeModel . class , ElementKind . CLASS , ElementKind . ENUM , ElementKind . INTERFACE ) ; } | Returns the closest enclosing type of the specified element . |
18,695 | @ Requires ( { "name != null" , "!name.isEmpty()" , "kind != null" } ) public static URI getUriForClass ( String name , Kind kind ) { try { return new URI ( "com.google.java.contract://com.google.java.contract/" + name + kind . extension ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( ) ; } ... | Returns a Contracts for Java private URI for the specified class name and kind . |
18,696 | public ServiceRRLoadBalancer getServiceRRLoadBalancer ( String serviceName ) { for ( ServiceRRLoadBalancer lb : svcLBList ) { if ( lb . getServiceName ( ) . equals ( serviceName ) ) { return lb ; } } ServiceRRLoadBalancer lb = new ServiceRRLoadBalancer ( lookupService , serviceName ) ; svcLBList . add ( lb ) ; return l... | Get the ServiceRRLoadBalancer . |
18,697 | public MetadataQueryRRLoadBalancer getMetadataQueryRRLoadBalancer ( ServiceInstanceQuery query ) { for ( MetadataQueryRRLoadBalancer lb : metaQueryLBList ) { if ( lb . getServiceInstanceQuery ( ) . equals ( query ) ) { return lb ; } } MetadataQueryRRLoadBalancer lb = new MetadataQueryRRLoadBalancer ( lookupService , qu... | Get the MetadataQueryRRLoadBalancer . |
18,698 | public ServiceQueryRRLoadBalancer getServiceQueryRRLoadBalancer ( String serviceName , ServiceInstanceQuery query ) { for ( ServiceQueryRRLoadBalancer lb : svcQueryLBList ) { if ( lb . getServiceName ( ) . equals ( serviceName ) && lb . getServiceInstanceQuery ( ) . equals ( query ) ) { return lb ; } } ServiceQueryRRLo... | Get the ServiceQueryRRLoadBalancer . |
18,699 | protected void onMethodEnter ( ) { if ( withPreconditions || withPostconditions || withInvariants ) { enterContractedMethod ( ) ; if ( withPostconditions ) { allocateOldValues ( ContractKind . OLD , oldValueLocals ) ; allocateOldValues ( ContractKind . SIGNAL_OLD , signalOldValueLocals ) ; } mark ( methodStart ) ; Labe... | Advises the method by injecting invariants precondition assertions and old value computations before the original code . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.