idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
37,700 | private boolean equalsSimpleTypeNames ( MethodIdentifier identifier , MethodResult methodResult ) { MethodIdentifier originalIdentifier = methodResult . getOriginalMethodSignature ( ) ; return originalIdentifier . getMethodName ( ) . equals ( identifier . getMethodName ( ) ) && matchesTypeBestEffort ( originalIdentifie... | This is a best - effort approach combining only the simple types . | 105 | 13 |
37,701 | static String normalizeCollection ( final String type ) { if ( isAssignableTo ( type , Types . COLLECTION ) ) { if ( ! getTypeParameters ( type ) . isEmpty ( ) ) { return getTypeParameters ( type ) . get ( 0 ) ; } return Types . OBJECT ; } return type ; } | Normalizes the contained collection type . | 70 | 7 |
37,702 | public List < Instruction > reduceInstructions ( final List < Instruction > instructions ) { lock . lock ( ) ; try { this . instructions = instructions ; stackSizeSimulator . buildStackSizes ( instructions ) ; return reduceInstructionsInternal ( instructions ) ; } finally { lock . unlock ( ) ; } } | Returns all instructions which are somewhat relevant for the returned object of the method . The instructions are visited backwards - starting from the return statement . Load and Store operations are handled as well . | 64 | 36 |
37,703 | private List < Instruction > reduceInstructionsInternal ( final List < Instruction > instructions ) { final List < Instruction > visitedInstructions = new LinkedList <> ( ) ; final Set < Integer > visitedInstructionPositions = new HashSet <> ( ) ; final Set < Integer > handledLoadIndexes = new HashSet <> ( ) ; final Se... | Returns all reduced instructions . | 414 | 5 |
37,704 | private static boolean isLoadIgnored ( final LoadInstruction instruction ) { return Stream . of ( VARIABLE_NAMES_TO_IGNORE ) . anyMatch ( instruction . getName ( ) :: equals ) ; } | Checks if the given LOAD instruction should be ignored for backtracking . | 48 | 15 |
37,705 | public Resources analyze ( Set < Path > projectClassPaths , Set < Path > projectSourcePaths , Set < String > ignoredResources ) { lock . lock ( ) ; try { projectClassPaths . forEach ( this :: addProjectPath ) ; // analyze relevant classes final JobRegistry jobRegistry = JobRegistry . getInstance ( ) ; final Set < Class... | Analyzes all classes in the given project path . | 276 | 10 |
37,706 | private void addToClassPool ( final Path location ) { if ( ! location . toFile ( ) . exists ( ) ) throw new IllegalArgumentException ( "The location '" + location + "' does not exist!" ) ; try { ContextClassReader . addClassPath ( location . toUri ( ) . toURL ( ) ) ; } catch ( Exception e ) { throw new IllegalArgumentE... | Adds the location to the class pool . | 110 | 8 |
37,707 | private void addProjectPath ( final Path path ) { addToClassPool ( path ) ; if ( path . toFile ( ) . isFile ( ) && path . toString ( ) . endsWith ( ".jar" ) ) { addJarClasses ( path ) ; } else if ( path . toFile ( ) . isDirectory ( ) ) { addDirectoryClasses ( path , Paths . get ( "" ) ) ; } else { throw new IllegalArgu... | Adds the project paths and loads all classes . | 123 | 9 |
37,708 | private void addJarClasses ( final Path location ) { try ( final JarFile jarFile = new JarFile ( location . toFile ( ) ) ) { final Enumeration < JarEntry > entries = jarFile . entries ( ) ; while ( entries . hasMoreElements ( ) ) { final JarEntry entry = entries . nextElement ( ) ; final String entryName = entry . getN... | Adds all classes in the given jar - file location to the set of known classes . | 158 | 17 |
37,709 | private void addDirectoryClasses ( final Path location , final Path subPath ) { for ( final File file : location . toFile ( ) . listFiles ( ) ) { if ( file . isDirectory ( ) ) addDirectoryClasses ( location . resolve ( file . getName ( ) ) , subPath . resolve ( file . getName ( ) ) ) ; else if ( file . isFile ( ) && fi... | Adds all classes in the given directory location to the set of known classes . | 145 | 15 |
37,710 | private static String toQualifiedClassName ( final String fileName ) { final String replacedSeparators = fileName . replace ( File . separatorChar , ' ' ) ; return replacedSeparators . substring ( 0 , replacedSeparators . length ( ) - ".class" . length ( ) ) ; } | Converts the given file name of a class - file to the fully - qualified class name . | 67 | 19 |
37,711 | static String getApplicationPath ( final Set < ClassResult > classResults ) { return classResults . stream ( ) . map ( ClassResult :: getApplicationPath ) . filter ( Objects :: nonNull ) . map ( PathNormalizer :: normalize ) . findAny ( ) . orElse ( "" ) ; } | Returns the normalized application path found in any of the given class results . | 64 | 14 |
37,712 | private static List < String > determinePaths ( final MethodResult methodResult ) { final List < String > paths = new LinkedList <> ( ) ; MethodResult currentMethod = methodResult ; while ( true ) { addNonBlank ( currentMethod . getPath ( ) , paths ) ; final ClassResult parentClass = currentMethod . getParentResource (... | Determines all single paths of the method result recursively . All parent class and method results are analyzed as well . | 141 | 25 |
37,713 | private static void addNonBlank ( final String string , final List < String > strings ) { if ( ! StringUtils . isBlank ( string ) && ! "/" . equals ( string ) ) strings . add ( string ) ; } | Adds the string to the list if it is not blank . | 51 | 12 |
37,714 | private static String normalize ( final String path ) { final StringBuilder builder = new StringBuilder ( path ) ; int index = 0 ; int colonIndex = - 1 ; char current = 0 ; char last ; while ( ( index > - 1 ) && ( index < builder . length ( ) ) ) { last = current ; current = builder . charAt ( index ) ; switch ( curren... | Normalizes the given path i . e . trims leading or trailing forward - slashes and removes path parameter matchers . | 221 | 25 |
37,715 | public Element simulate ( final List < Element > arguments , final List < Instruction > instructions , final MethodIdentifier identifier ) { // prevent infinite loops on analysing recursion if ( EXECUTED_PATH_METHODS . contains ( identifier ) ) return new Element ( ) ; lock . lock ( ) ; EXECUTED_PATH_METHODS . add ( id... | Simulates the instructions of the method which will be called with the given arguments . | 122 | 16 |
37,716 | private void injectArguments ( final List < Element > arguments , final MethodIdentifier identifier ) { final boolean staticMethod = identifier . isStaticMethod ( ) ; final int startIndex = staticMethod ? 0 : 1 ; final int endIndex = staticMethod ? arguments . size ( ) - 1 : arguments . size ( ) ; IntStream . rangeClos... | Injects the arguments of the method invocation to the local variables . | 111 | 14 |
37,717 | private static SwaggerType toSwaggerType ( final String type ) { if ( INTEGER_TYPES . contains ( type ) ) return SwaggerType . INTEGER ; if ( DOUBLE_TYPES . contains ( type ) ) return SwaggerType . NUMBER ; if ( BOOLEAN . equals ( type ) || PRIMITIVE_BOOLEAN . equals ( type ) ) return SwaggerType . BOOLEAN ; if ( STRIN... | Converts the given Java type to the Swagger JSON type . | 126 | 13 |
37,718 | public Element merge ( final Element element ) { types . addAll ( element . types ) ; possibleValues . addAll ( element . possibleValues ) ; return this ; } | Merges the other element into this element . | 35 | 9 |
37,719 | public void addMethod ( final String resource , final ResourceMethod method ) { resources . putIfAbsent ( resource , new HashSet <> ( ) ) ; resources . get ( resource ) . add ( method ) ; } | Adds the method to the resource s methods . | 46 | 9 |
37,720 | public Set < ResourceMethod > getMethods ( final String resource ) { return Collections . unmodifiableSet ( resources . get ( resource ) ) ; } | Returns the resource methods for a given resource . | 31 | 9 |
37,721 | public void consolidateMultiplePaths ( ) { Map < String , Set < ResourceMethod > > oldResources = resources ; resources = new HashMap <> ( ) ; oldResources . keySet ( ) . forEach ( s -> consolidateMultipleMethodsForSamePath ( s , oldResources . get ( s ) ) ) ; } | Consolidates the information contained in multiple responses for the same path . Internally creates new resources . | 67 | 20 |
37,722 | public Changelog getChangelog ( final boolean useIntegrationIfConfigured ) throws GitChangelogRepositoryException { try ( GitRepo gitRepo = new GitRepo ( new File ( this . settings . getFromRepo ( ) ) ) ) { return getChangelog ( gitRepo , useIntegrationIfConfigured ) ; } catch ( final IOException e ) { throw new GitCha... | Get the changelog as data object . | 102 | 9 |
37,723 | public void toFile ( final File file ) throws GitChangelogRepositoryException , IOException { createParentDirs ( file ) ; write ( render ( ) . getBytes ( "UTF-8" ) , file ) ; } | Write changelog to file . | 49 | 7 |
37,724 | public void toMediaWiki ( final String username , final String password , final String url , final String title ) throws GitChangelogRepositoryException , GitChangelogIntegrationException { new MediaWikiClient ( url , title , render ( ) ) // . withUser ( username , password ) // . createMediaWikiPage ( ) ; } | Create MediaWiki page with changelog . | 71 | 9 |
37,725 | public Slot insertSlotAt ( final int position , @ NonNull final Slot slot ) { if ( position < 0 || size < position ) { throw new IndexOutOfBoundsException ( "New slot position should be inside the slots list. Or on the tail (position = size)" ) ; } final Slot toInsert = new Slot ( slot ) ; Slot currentSlot = getSlot ( ... | Inserts a slot on a specified position | 282 | 8 |
37,726 | public String uri ( String name ) { try { return String . format ( "otpauth://totp/%s?secret=%s" , URLEncoder . encode ( name , "UTF-8" ) , secret ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalArgumentException ( e . getMessage ( ) , e ) ; } } | Prover - To be used only on the client side Retrieves the encoded URI to generated the QRCode required by Google Authenticator | 83 | 28 |
37,727 | public boolean verify ( String otp ) { long code = Long . parseLong ( otp ) ; long currentInterval = clock . getCurrentInterval ( ) ; int pastResponse = Math . max ( DELAY_WINDOW , 0 ) ; for ( int i = pastResponse ; i >= 0 ; -- i ) { int candidate = generate ( this . secret , currentInterval - i ) ; if ( candidate == c... | Verifier - To be used only on the server side | 100 | 11 |
37,728 | private void reattach ( HeapElement el ) { if ( el . shift ( ) ) { queue . add ( el ) ; } else if ( el . inclusion ) { /* * If we have no live inclusions, then the rest are exclusions which * we can safely discard. */ if ( -- nInclusionsRemaining == 0 ) { queue . clear ( ) ; } } } | If the given element s iterator has more data then push back onto the heap . | 81 | 16 |
37,729 | boolean shift ( ) { if ( ! it . hasNext ( ) ) { return false ; } head = it . next ( ) ; comparable = DateValueComparison . comparable ( head ) ; return true ; } | Discards the current element and move to the next . | 45 | 11 |
37,730 | int [ ] toIntArray ( ) { int [ ] out = new int [ size ( ) ] ; int a = 0 , b = out . length ; for ( int i = - 1 ; ( i = ints . nextSetBit ( i + 1 ) ) >= 0 ; ) { int n = decode ( i ) ; if ( n < 0 ) { out [ a ++ ] = n ; } else { out [ -- b ] = n ; } } //if it contains -3, -1, 0, 1, 2, 4 //then out will be -1, -3, 4, 2, 1,... | Converts this set to a new integer array that is sorted in ascending order . | 156 | 16 |
37,731 | private static void reverse ( int [ ] array , int start , int end ) { for ( int i = start , j = end ; i < -- j ; ++ i ) { int t = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = t ; } } | Reverses an array . | 64 | 6 |
37,732 | public void addTimezonedDate ( String tzid , ICalProperty property , ICalDate date ) { timezonedDates . put ( tzid , new TimezonedDate ( date , property ) ) ; } | Keeps track of a date - time property value that uses a timezone so it can be parsed later . Timezones cannot be handled until the entire iCalendar object has been parsed . | 49 | 39 |
37,733 | public void setValue ( Date value , boolean hasTime ) { setValue ( ( value == null ) ? null : new ICalDate ( value , hasTime ) ) ; } | Sets the date - time value . | 37 | 8 |
37,734 | public List < WarningsGroup > getByProperty ( Class < ? extends ICalProperty > propertyClass ) { List < WarningsGroup > warnings = new ArrayList < WarningsGroup > ( ) ; for ( WarningsGroup group : this . warnings ) { ICalProperty property = group . getProperty ( ) ; if ( property == null ) { continue ; } if ( propertyC... | Gets all validation warnings of a given property . | 102 | 10 |
37,735 | public List < WarningsGroup > getByComponent ( Class < ? extends ICalComponent > componentClass ) { List < WarningsGroup > warnings = new ArrayList < WarningsGroup > ( ) ; for ( WarningsGroup group : this . warnings ) { ICalComponent component = group . getComponent ( ) ; if ( component == null ) { continue ; } if ( co... | Gets all validation warnings of a given component . | 102 | 10 |
37,736 | public String go ( ) { StringWriter sw = new StringWriter ( ) ; try { go ( sw ) ; } catch ( IOException e ) { //should never be thrown because we're writing to a string throw new RuntimeException ( e ) ; } return sw . toString ( ) ; } | Writes the iCalendar objects to a string . | 61 | 11 |
37,737 | public void addDate ( ICalDate date , boolean floating , TimeZone tz ) { if ( date != null && date . hasTime ( ) && ! floating && tz != null ) { dates . add ( date ) ; } } | Records the timezoned date - time values that are being written . This is used to generate a DAYLIGHT property for vCalendar objects . | 50 | 31 |
37,738 | public T get ( V value ) { T found = find ( value ) ; if ( found != null ) { return found ; } synchronized ( runtimeDefined ) { for ( T obj : runtimeDefined ) { if ( matches ( obj , value ) ) { return obj ; } } T created = create ( value ) ; runtimeDefined . add ( created ) ; return created ; } } | Searches for a case object by value creating a new object if one cannot be found . | 81 | 19 |
37,739 | public String asString ( String charset ) throws IOException { Reader reader = buildReader ( charset ) ; return consumeReader ( reader ) ; } | Gets the stream contents as a string . | 31 | 9 |
37,740 | public byte [ ] asByteArray ( ) throws IOException { if ( reader != null ) { throw new IllegalStateException ( "Cannot get raw bytes from a Reader object." ) ; } InputStream in = buildInputStream ( ) ; return consumeInputStream ( in ) ; } | Gets the stream contents as a byte array . | 59 | 10 |
37,741 | public Name setName ( String name ) { Name property = ( name == null ) ? null : new Name ( name ) ; setName ( property ) ; return property ; } | Sets the human - readable name of the calendar as a whole . | 36 | 14 |
37,742 | public Description setDescription ( String description ) { Description property = ( description == null ) ? null : new Description ( description ) ; setDescription ( property ) ; return property ; } | Sets the human - readable description of the calendar as a whole . | 36 | 14 |
37,743 | public Uid setUid ( String uid ) { Uid property = ( uid == null ) ? null : new Uid ( uid ) ; setUid ( property ) ; return property ; } | Sets the calendar s unique identifier . | 44 | 8 |
37,744 | public LastModified setLastModified ( Date lastModified ) { LastModified property = ( lastModified == null ) ? null : new LastModified ( lastModified ) ; setLastModified ( property ) ; return property ; } | Sets the date and time that the information in this calendar object was last revised . | 52 | 17 |
37,745 | public Categories addCategories ( String ... categories ) { Categories prop = new Categories ( categories ) ; addProperty ( prop ) ; return prop ; } | Adds a list of keywords that describe the calendar . | 30 | 10 |
37,746 | public RefreshInterval setRefreshInterval ( Duration refreshInterval ) { RefreshInterval property = ( refreshInterval == null ) ? null : new RefreshInterval ( refreshInterval ) ; setRefreshInterval ( property ) ; return property ; } | Sets the suggested minimum polling interval for checking for updates to the calendar data . | 54 | 16 |
37,747 | public Source setSource ( String url ) { Source property = ( url == null ) ? null : new Source ( url ) ; setSource ( property ) ; return property ; } | Sets the location that the calendar data can be refreshed from . | 36 | 13 |
37,748 | @ Override public ICalendar _readNext ( ) throws IOException { if ( reader . eof ( ) ) { return null ; } context . setVersion ( ICalVersion . V2_0 ) ; JCalDataStreamListenerImpl listener = new JCalDataStreamListenerImpl ( ) ; reader . readNext ( listener ) ; return listener . getICalendar ( ) ; } | Reads the next iCalendar object from the JSON data stream . | 82 | 14 |
37,749 | public static VAlarm audio ( Trigger trigger , Attachment sound ) { VAlarm alarm = new VAlarm ( Action . audio ( ) , trigger ) ; if ( sound != null ) { alarm . addAttachment ( sound ) ; } return alarm ; } | Creates an audio alarm . | 55 | 6 |
37,750 | public static VAlarm display ( Trigger trigger , String displayText ) { VAlarm alarm = new VAlarm ( Action . display ( ) , trigger ) ; alarm . setDescription ( displayText ) ; return alarm ; } | Creates a display alarm . | 47 | 6 |
37,751 | public DurationProperty setDuration ( Duration duration ) { DurationProperty prop = ( duration == null ) ? null : new DurationProperty ( duration ) ; setDuration ( prop ) ; return prop ; } | Sets the length of the pause between alarm repetitions . | 39 | 12 |
37,752 | public Repeat setRepeat ( Integer count ) { Repeat prop = ( count == null ) ? null : new Repeat ( count ) ; setRepeat ( prop ) ; return prop ; } | Sets the number of times an alarm should be repeated after its initial trigger . | 36 | 16 |
37,753 | public void setRepeat ( int count , Duration pauseDuration ) { Repeat repeat = new Repeat ( count ) ; DurationProperty duration = new DurationProperty ( pauseDuration ) ; setRepeat ( repeat ) ; setDuration ( duration ) ; } | Sets the repetition information for the alarm . | 47 | 9 |
37,754 | public static Document createDocument ( ) { try { DocumentBuilderFactory fact = DocumentBuilderFactory . newInstance ( ) ; fact . setNamespaceAware ( true ) ; DocumentBuilder db = fact . newDocumentBuilder ( ) ; return db . newDocument ( ) ; } catch ( ParserConfigurationException e ) { //will probably never be thrown b... | Creates a new XML document . | 91 | 7 |
37,755 | public static Document toDocument ( String xml ) throws SAXException { try { return toDocument ( new StringReader ( xml ) ) ; } catch ( IOException e ) { //reading from string throw new RuntimeException ( e ) ; } } | Parses an XML string into a DOM . | 50 | 10 |
37,756 | public static Document toDocument ( File file ) throws SAXException , IOException { InputStream in = new BufferedInputStream ( new FileInputStream ( file ) ) ; try { return XmlUtils . toDocument ( in ) ; } finally { in . close ( ) ; } } | Parses an XML document from a file . | 61 | 10 |
37,757 | private static Element getFirstChildElement ( Node parent ) { NodeList nodeList = parent . getChildNodes ( ) ; for ( int i = 0 ; i < nodeList . getLength ( ) ; i ++ ) { Node node = nodeList . item ( i ) ; if ( node instanceof Element ) { return ( Element ) node ; } } return null ; } | Gets the first child element of a node . | 78 | 10 |
37,758 | public static boolean hasQName ( Node node , QName qname ) { return qname . getNamespaceURI ( ) . equals ( node . getNamespaceURI ( ) ) && qname . getLocalPart ( ) . equals ( node . getLocalName ( ) ) ; } | Determines if a node has a particular qualified name . | 60 | 12 |
37,759 | public void close ( ) throws IOException { if ( thread . isAlive ( ) ) { thread . closed = true ; thread . interrupt ( ) ; } if ( stream != null ) { stream . close ( ) ; } } | Closes the underlying input stream . | 48 | 7 |
37,760 | public static DataUri parse ( String uri ) { //Syntax: data:[<media type>][;charset=<character set>][;base64],<data> String scheme = "data:" ; if ( uri . length ( ) < scheme . length ( ) || ! uri . substring ( 0 , scheme . length ( ) ) . equalsIgnoreCase ( scheme ) ) { //not a data URI throw Messages . INSTANCE . getIl... | Parses a data URI string . | 577 | 8 |
37,761 | public String toCuaPriority ( ) { if ( value == null || value < 1 || value > 9 ) { return null ; } int letter = ( ( value - 1 ) / 3 ) + ' ' ; int number = ( ( value - 1 ) % 3 ) + 1 ; return ( char ) letter + "" + number ; } | Converts this priority to its two - character CUA code . | 71 | 13 |
37,762 | public List < ICalendar > readAll ( ) throws IOException { List < ICalendar > icals = new ArrayList < ICalendar > ( ) ; ICalendar ical ; while ( ( ical = readNext ( ) ) != null ) { icals . add ( ical ) ; } return icals ; } | Reads all iCalendar objects from the data stream . | 71 | 12 |
37,763 | public ICalendar readNext ( ) throws IOException { warnings . clear ( ) ; context = new ParseContext ( ) ; ICalendar ical = _readNext ( ) ; if ( ical == null ) { return null ; } ical . setVersion ( context . getVersion ( ) ) ; handleTimezones ( ical ) ; return ical ; } | Reads the next iCalendar object from the data stream . | 79 | 13 |
37,764 | public void putAll ( K key , Collection < ? extends V > values ) { if ( values . isEmpty ( ) ) { return ; } key = sanitizeKey ( key ) ; List < V > list = map . get ( key ) ; if ( list == null ) { list = new ArrayList < V > ( ) ; map . put ( key , list ) ; } list . addAll ( values ) ; } | Adds multiple values to the multimap . | 90 | 8 |
37,765 | public List < V > get ( K key ) { key = sanitizeKey ( key ) ; List < V > value = map . get ( key ) ; if ( value == null ) { value = new ArrayList < V > ( 0 ) ; } return new WrappedList ( key , value , null ) ; } | Gets the values associated with the key . Changes to the returned list will update the underlying multimap and vice versa . | 68 | 24 |
37,766 | public V first ( K key ) { key = sanitizeKey ( key ) ; List < V > values = map . get ( key ) ; /* * The list can be null, but never empty. Empty lists are removed from * the map. */ return ( values == null ) ? null : values . get ( 0 ) ; } | Gets the first value that s associated with a key . | 70 | 12 |
37,767 | public boolean remove ( K key , V value ) { key = sanitizeKey ( key ) ; List < V > values = map . get ( key ) ; if ( values == null ) { return false ; } boolean success = values . remove ( value ) ; if ( values . isEmpty ( ) ) { map . remove ( key ) ; } return success ; } | Removes a particular value . | 77 | 6 |
37,768 | public List < V > removeAll ( K key ) { key = sanitizeKey ( key ) ; List < V > removed = map . remove ( key ) ; if ( removed == null ) { return Collections . emptyList ( ) ; } List < V > unmodifiableCopy = Collections . unmodifiableList ( new ArrayList < V > ( removed ) ) ; removed . clear ( ) ; return unmodifiableCopy... | Removes all the values associated with a key | 91 | 9 |
37,769 | public List < V > replace ( K key , V value ) { List < V > replaced = removeAll ( key ) ; if ( value != null ) { put ( key , value ) ; } return replaced ; } | Replaces all values with the given value . | 45 | 9 |
37,770 | public List < V > replace ( K key , Collection < ? extends V > values ) { List < V > replaced = removeAll ( key ) ; putAll ( key , values ) ; return replaced ; } | Replaces all values with the given values . | 43 | 9 |
37,771 | public void clear ( ) { //clear each collection to make previously returned lists empty for ( List < V > value : map . values ( ) ) { value . clear ( ) ; } map . clear ( ) ; } | Clears all entries from the multimap . | 45 | 9 |
37,772 | public List < V > values ( ) { List < V > list = new ArrayList < V > ( ) ; for ( List < V > value : map . values ( ) ) { list . addAll ( value ) ; } return Collections . unmodifiableList ( list ) ; } | Gets all the values in the multimap . | 60 | 10 |
37,773 | public int size ( ) { int size = 0 ; for ( List < V > value : map . values ( ) ) { size += value . size ( ) ; } return size ; } | Gets the number of values in the map . | 39 | 10 |
37,774 | public Integer getIndent ( ) { if ( ! "yes" . equals ( get ( OutputKeys . INDENT ) ) ) { return null ; } String value = get ( INDENT_AMT ) ; return ( value == null ) ? null : Integer . valueOf ( value ) ; } | Gets the number of indent spaces to use for pretty - printing . | 62 | 14 |
37,775 | public static UtcOffset parse ( String text ) { Pattern timeZoneRegex = Pattern . compile ( "^([-\\+])?(\\d{1,2})(:?(\\d{2}))?(:?(\\d{2}))?$" ) ; Matcher m = timeZoneRegex . matcher ( text ) ; if ( ! m . find ( ) ) { throw Messages . INSTANCE . getIllegalArgumentException ( 21 , text ) ; } String signStr = m . group ( ... | Parses a UTC offset from a string . | 204 | 10 |
37,776 | private List < String > splitRRULEValues ( String value ) { List < String > values = new ArrayList < String > ( ) ; Pattern p = Pattern . compile ( "#\\d+|\\d{8}T\\d{6}Z?" ) ; Matcher m = p . matcher ( value ) ; int prevIndex = 0 ; while ( m . find ( ) ) { int end = m . end ( ) ; String subValue = value . substring ( p... | Version 1 . 0 allows multiple RRULE values to be defined inside of the same property . This method extracts each RRULE value from the property value . | 167 | 30 |
37,777 | private List < Observance > calculateSortedObservances ( ) { List < DaylightSavingsTime > daylights = component . getDaylightSavingsTime ( ) ; List < StandardTime > standards = component . getStandardTimes ( ) ; int numObservances = standards . size ( ) + daylights . size ( ) ; List < Observance > sortedObservances = n... | Builds a list of all the observances in the VTIMEZONE component sorted by DTSTART . | 271 | 22 |
37,778 | public Boundary getObservanceBoundary ( Date date ) { utcCalendar . setTime ( date ) ; int year = utcCalendar . get ( Calendar . YEAR ) ; int month = utcCalendar . get ( Calendar . MONTH ) + 1 ; int day = utcCalendar . get ( Calendar . DATE ) ; int hour = utcCalendar . get ( Calendar . HOUR ) ; int minute = utcCalendar... | Gets the timezone information of a date . | 144 | 10 |
37,779 | private Boundary getObservanceBoundary ( int year , int month , int day , int hour , int minute , int second ) { if ( sortedObservances . isEmpty ( ) ) { return null ; } DateValue givenTime = new DateTimeValueImpl ( year , month , day , hour , minute , second ) ; int closestIndex = - 1 ; Observance closest = null ; Dat... | Gets the observance information of a date . | 553 | 10 |
37,780 | private DateValue getObservanceDateClosestToTheGivenDate ( Observance observance , DateValue givenDate , boolean after ) { List < DateValue > dateCache = observanceDateCache . get ( observance ) ; if ( dateCache == null ) { dateCache = new ArrayList < DateValue > ( ) ; observanceDateCache . put ( observance , dateCache... | Iterates through each of the timezone boundary dates defined by the given observance and finds the date that comes closest to the given date . | 728 | 28 |
37,781 | RecurrenceIterator createIterator ( Observance observance ) { List < RecurrenceIterator > inclusions = new ArrayList < RecurrenceIterator > ( ) ; List < RecurrenceIterator > exclusions = new ArrayList < RecurrenceIterator > ( ) ; ICalDate dtstart = getValue ( observance . getDateStart ( ) ) ; if ( dtstart != null ) { D... | Creates an iterator which iterates over each of the dates in an observance . | 516 | 17 |
37,782 | public Classification setClassification ( String classification ) { Classification prop = ( classification == null ) ? null : new Classification ( classification ) ; setClassification ( prop ) ; return prop ; } | Sets the level of sensitivity of the journal entry . If not specified the data within the journal entry should be considered public . | 38 | 25 |
37,783 | public Created setCreated ( Date created ) { Created prop = ( created == null ) ? null : new Created ( created ) ; setCreated ( prop ) ; return prop ; } | Sets the date - time that the journal entry was initially created . | 36 | 14 |
37,784 | public DateStart setDateStart ( Date dateStart , boolean hasTime ) { DateStart prop = ( dateStart == null ) ? null : new DateStart ( dateStart , hasTime ) ; setDateStart ( prop ) ; return prop ; } | Sets the date that the journal entry starts . | 51 | 10 |
37,785 | public LastModified setLastModified ( Date lastModified ) { LastModified prop = ( lastModified == null ) ? null : new LastModified ( lastModified ) ; setLastModified ( prop ) ; return prop ; } | Sets the date - time that the journal entry was last changed . | 52 | 14 |
37,786 | public Organizer setOrganizer ( String email ) { Organizer prop = ( email == null ) ? null : new Organizer ( null , email ) ; setOrganizer ( prop ) ; return prop ; } | Sets the organizer of the journal entry . | 43 | 9 |
37,787 | public Sequence setSequence ( Integer sequence ) { Sequence prop = ( sequence == null ) ? null : new Sequence ( sequence ) ; setSequence ( prop ) ; return prop ; } | Sets the revision number of the journal entry . The organizer can increment this number every time he or she makes a significant change . | 38 | 26 |
37,788 | public Url setUrl ( String url ) { Url prop = ( url == null ) ? null : new Url ( url ) ; setUrl ( prop ) ; return prop ; } | Sets a URL to a resource that contains additional information about the journal entry . | 39 | 16 |
37,789 | public RecurrenceRule setRecurrenceRule ( Recurrence recur ) { RecurrenceRule prop = ( recur == null ) ? null : new RecurrenceRule ( recur ) ; setRecurrenceRule ( prop ) ; return prop ; } | Sets how often the journal entry repeats . | 50 | 9 |
37,790 | public Comment addComment ( String comment ) { Comment prop = new Comment ( comment ) ; addComment ( prop ) ; return prop ; } | Adds a comment to the journal entry . | 28 | 8 |
37,791 | public RelatedTo addRelatedTo ( String uid ) { RelatedTo prop = new RelatedTo ( uid ) ; addRelatedTo ( prop ) ; return prop ; } | Adds a component that the journal entry is related to . | 35 | 11 |
37,792 | public static void repeat ( char c , int count , StringBuilder sb ) { for ( int i = 0 ; i < count ; i ++ ) { sb . append ( c ) ; } } | Creates a string consisting of count occurrences of char c . | 42 | 12 |
37,793 | public TimezoneUrl setTimezoneUrl ( String url ) { TimezoneUrl prop = ( url == null ) ? null : new TimezoneUrl ( url ) ; setTimezoneUrl ( prop ) ; return prop ; } | Sets the timezone URL which points to an iCalendar object that contains further information on the timezone . | 46 | 23 |
37,794 | public void setDuration ( Duration duration , Related related ) { this . date = null ; this . duration = duration ; setRelated ( related ) ; } | Sets a relative time at which the alarm will trigger . | 31 | 12 |
37,795 | protected Collection < ICalVersion > getValueSupportedVersions ( ) { return ( value == null ) ? Collections . < ICalVersion > emptyList ( ) : Arrays . asList ( ICalVersion . values ( ) ) ; } | Gets the iCalendar versions that this property s value is supported in . Meant to be overridden by the child class . | 49 | 27 |
37,796 | public Location setLocation ( String location ) { Location prop = ( location == null ) ? null : new Location ( location ) ; setLocation ( prop ) ; return prop ; } | Sets the physical location of the event . | 36 | 9 |
37,797 | public Priority setPriority ( Integer priority ) { Priority prop = ( priority == null ) ? null : new Priority ( priority ) ; setPriority ( prop ) ; return prop ; } | Sets the priority of the event . | 38 | 8 |
37,798 | public Resources addResources ( String ... resources ) { Resources prop = new Resources ( resources ) ; addResources ( prop ) ; return prop ; } | Adds a list of resources that are needed for the event . | 29 | 12 |
37,799 | public void readNext ( JCalDataStreamListener listener ) throws IOException { if ( parser == null ) { JsonFactory factory = new JsonFactory ( ) ; parser = factory . createParser ( reader ) ; } if ( parser . isClosed ( ) ) { return ; } this . listener = listener ; //find the next iCalendar object JsonToken prev = parser... | Reads the next iCalendar object from the jCal data stream . | 341 | 15 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.