idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
37,800
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 .
37,801
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 .
37,802
public String go ( ) { StringWriter sw = new StringWriter ( ) ; try { go ( sw ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } return sw . toString ( ) ; }
Writes the iCalendar objects to a string .
37,803
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 .
37,804
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 .
37,805
public String asString ( String charset ) throws IOException { Reader reader = buildReader ( charset ) ; return consumeReader ( reader ) ; }
Gets the stream contents as a string .
37,806
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 .
37,807
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 .
37,808
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 .
37,809
public Uid setUid ( String uid ) { Uid property = ( uid == null ) ? null : new Uid ( uid ) ; setUid ( property ) ; return property ; }
Sets the calendar s unique identifier .
37,810
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 .
37,811
public Categories addCategories ( String ... categories ) { Categories prop = new Categories ( categories ) ; addProperty ( prop ) ; return prop ; }
Adds a list of keywords that describe the calendar .
37,812
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 .
37,813
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 .
37,814
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 .
37,815
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 .
37,816
public static VAlarm display ( Trigger trigger , String displayText ) { VAlarm alarm = new VAlarm ( Action . display ( ) , trigger ) ; alarm . setDescription ( displayText ) ; return alarm ; }
Creates a display alarm .
37,817
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 .
37,818
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 .
37,819
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 .
37,820
public static Document createDocument ( ) { try { DocumentBuilderFactory fact = DocumentBuilderFactory . newInstance ( ) ; fact . setNamespaceAware ( true ) ; DocumentBuilder db = fact . newDocumentBuilder ( ) ; return db . newDocument ( ) ; } catch ( ParserConfigurationException e ) { throw new RuntimeException ( e ) ...
Creates a new XML document .
37,821
public static Document toDocument ( String xml ) throws SAXException { try { return toDocument ( new StringReader ( xml ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
Parses an XML string into a DOM .
37,822
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 .
37,823
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 .
37,824
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 .
37,825
public void close ( ) throws IOException { if ( thread . isAlive ( ) ) { thread . closed = true ; thread . interrupt ( ) ; } if ( stream != null ) { stream . close ( ) ; } }
Closes the underlying input stream .
37,826
public static DataUri parse ( String uri ) { String scheme = "data:" ; if ( uri . length ( ) < scheme . length ( ) || ! uri . substring ( 0 , scheme . length ( ) ) . equalsIgnoreCase ( scheme ) ) { throw Messages . INSTANCE . getIllegalArgumentException ( 22 ) ; } String contentType = null ; String charset = null ; boo...
Parses a data URI string .
37,827
public String toCuaPriority ( ) { if ( value == null || value < 1 || value > 9 ) { return null ; } int letter = ( ( value - 1 ) / 3 ) + 'A' ; int number = ( ( value - 1 ) % 3 ) + 1 ; return ( char ) letter + "" + number ; }
Converts this priority to its two - character CUA code .
37,828
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 .
37,829
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 .
37,830
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 .
37,831
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 .
37,832
public V first ( K key ) { key = sanitizeKey ( key ) ; List < V > values = map . get ( key ) ; return ( values == null ) ? null : values . get ( 0 ) ; }
Gets the first value that s associated with a key .
37,833
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 .
37,834
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
37,835
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 .
37,836
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 .
37,837
public void clear ( ) { for ( List < V > value : map . values ( ) ) { value . clear ( ) ; } map . clear ( ) ; }
Clears all entries from the multimap .
37,838
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 .
37,839
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 .
37,840
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 .
37,841
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 .
37,842
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 .
37,843
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 .
37,844
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 .
37,845
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 .
37,846
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 .
37,847
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 .
37,848
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 .
37,849
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 .
37,850
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 .
37,851
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 .
37,852
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 .
37,853
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 .
37,854
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 .
37,855
public RecurrenceRule setRecurrenceRule ( Recurrence recur ) { RecurrenceRule prop = ( recur == null ) ? null : new RecurrenceRule ( recur ) ; setRecurrenceRule ( prop ) ; return prop ; }
Sets how often the journal entry repeats .
37,856
public Comment addComment ( String comment ) { Comment prop = new Comment ( comment ) ; addComment ( prop ) ; return prop ; }
Adds a comment to the journal entry .
37,857
public RelatedTo addRelatedTo ( String uid ) { RelatedTo prop = new RelatedTo ( uid ) ; addRelatedTo ( prop ) ; return prop ; }
Adds a component that the journal entry is related to .
37,858
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 .
37,859
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 .
37,860
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 .
37,861
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 .
37,862
public Location setLocation ( String location ) { Location prop = ( location == null ) ? null : new Location ( location ) ; setLocation ( prop ) ; return prop ; }
Sets the physical location of the event .
37,863
public Priority setPriority ( Integer priority ) { Priority prop = ( priority == null ) ? null : new Priority ( priority ) ; setPriority ( prop ) ; return prop ; }
Sets the priority of the event .
37,864
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 .
37,865
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 ; JsonToken prev = parser . getCurrentToken ( ) ; JsonToke...
Reads the next iCalendar object from the jCal data stream .
37,866
public ICalendar first ( ) throws IOException { StreamReader reader = constructReader ( ) ; if ( index != null ) { reader . setScribeIndex ( index ) ; } try { ICalendar ical = reader . readNext ( ) ; if ( warnings != null ) { warnings . add ( reader . getWarnings ( ) ) ; } return ical ; } finally { if ( closeWhenDone (...
Reads the first iCalendar object from the stream .
37,867
public List < ICalendar > all ( ) throws IOException { StreamReader reader = constructReader ( ) ; if ( index != null ) { reader . setScribeIndex ( index ) ; } try { List < ICalendar > icals = new ArrayList < ICalendar > ( ) ; ICalendar ical ; while ( ( ical = reader . readNext ( ) ) != null ) { if ( warnings != null )...
Reads all iCalendar objects from the stream .
37,868
static Predicate < DateValue > weekIntervalFilter ( final int interval , final DayOfWeek weekStart , final DateValue dtStart ) { return new Predicate < DateValue > ( ) { private static final long serialVersionUID = 7059994888520369846L ; DateValue wkStart ; { DTBuilder wkStartB = new DTBuilder ( dtStart ) ; wkStartB . ...
Constructs a filter that accepts only every X week starting from the week containing the given date .
37,869
static Predicate < DateValue > byHourFilter ( int [ ] hours ) { int hoursByBit = 0 ; for ( int hour : hours ) { hoursByBit |= 1 << hour ; } if ( ( hoursByBit & LOW_24_BITS ) == LOW_24_BITS ) { return Predicates . alwaysTrue ( ) ; } final int bitField = hoursByBit ; return new Predicate < DateValue > ( ) { private stati...
Constructs an hour filter based on a BYHOUR rule .
37,870
public String first ( ICalDataType dataType ) { String dataTypeStr = toLocalName ( dataType ) ; return first ( dataTypeStr ) ; }
Gets the first value of the given data type .
37,871
public String first ( String localName ) { for ( Element child : children ( ) ) { if ( localName . equals ( child . getLocalName ( ) ) && XCAL_NS . equals ( child . getNamespaceURI ( ) ) ) { return child . getTextContent ( ) ; } } return null ; }
Gets the value of the first child element with the given name .
37,872
public List < String > all ( ICalDataType dataType ) { String dataTypeStr = toLocalName ( dataType ) ; return all ( dataTypeStr ) ; }
Gets all the values of a given data type .
37,873
public List < String > all ( String localName ) { List < String > childrenText = new ArrayList < String > ( ) ; for ( Element child : children ( ) ) { if ( localName . equals ( child . getLocalName ( ) ) && XCAL_NS . equals ( child . getNamespaceURI ( ) ) ) { String text = child . getTextContent ( ) ; childrenText . ad...
Gets the values of all child elements that have the given name .
37,874
public Element append ( ICalDataType dataType , String value ) { String dataTypeStr = toLocalName ( dataType ) ; return append ( dataTypeStr , value ) ; }
Adds a value .
37,875
public Element append ( String name , String value ) { Element child = document . createElementNS ( XCAL_NS , name ) ; child . setTextContent ( value ) ; element . appendChild ( child ) ; return child ; }
Adds a child element .
37,876
public List < Element > append ( String name , Collection < String > values ) { List < Element > elements = new ArrayList < Element > ( values . size ( ) ) ; for ( String value : values ) { elements . add ( append ( name , value ) ) ; } return elements ; }
Adds multiple child elements each with the same name .
37,877
public List < XCalElement > children ( ICalDataType dataType ) { String localName = dataType . getName ( ) . toLowerCase ( ) ; List < XCalElement > children = new ArrayList < XCalElement > ( ) ; for ( Element child : children ( ) ) { if ( localName . equals ( child . getLocalName ( ) ) && XCAL_NS . equals ( child . get...
Gets all child elements with the given data type .
37,878
public XCalElement child ( ICalDataType dataType ) { String localName = dataType . getName ( ) . toLowerCase ( ) ; for ( Element child : children ( ) ) { if ( localName . equals ( child . getLocalName ( ) ) && XCAL_NS . equals ( child . getNamespaceURI ( ) ) ) { return new XCalElement ( child ) ; } } return null ; }
Gets the first child element with the given data type .
37,879
public void close ( ) throws IOException { try { if ( ! started ) { handler . startDocument ( ) ; if ( ! icalendarElementExists ) { start ( ICALENDAR ) ; } } if ( ! icalendarElementExists ) { end ( ICALENDAR ) ; } handler . endDocument ( ) ; } catch ( SAXException e ) { throw new IOException ( e ) ; } if ( writer != nu...
Terminates the XML document and closes the output stream .
37,880
public void writeStartComponent ( String componentName ) throws IOException { if ( generator == null ) { init ( ) ; } componentEnded = false ; if ( ! stack . isEmpty ( ) ) { Info parent = stack . getLast ( ) ; if ( ! parent . wroteEndPropertiesArray ) { generator . writeEndArray ( ) ; parent . wroteEndPropertiesArray =...
Writes the beginning of a new component array .
37,881
public void writeEndComponent ( ) throws IOException { if ( stack . isEmpty ( ) ) { throw new IllegalStateException ( Messages . INSTANCE . getExceptionMessage ( 2 ) ) ; } Info cur = stack . removeLast ( ) ; if ( ! cur . wroteEndPropertiesArray ) { generator . writeEndArray ( ) ; } if ( ! cur . wroteStartSubComponentsA...
Closes the current component array .
37,882
public void closeJsonStream ( ) throws IOException { if ( generator == null ) { return ; } while ( ! stack . isEmpty ( ) ) { writeEndComponent ( ) ; } if ( wrapInArray ) { generator . writeEndArray ( ) ; } if ( closeGenerator ) { generator . close ( ) ; } }
Finishes writing the JSON document so that it is syntactically correct . No more data can be written once this method is called .
37,883
static Generator serialInstanceGenerator ( final Predicate < ? super DateValue > filter , final Generator yearGenerator , final Generator monthGenerator , final Generator dayGenerator , final Generator hourGenerator , final Generator minuteGenerator , final Generator secondGenerator ) { if ( skipSubDayGenerators ( hour...
A collector that yields each date in the period without doing any set collecting .
37,884
public void setParameters ( ICalParameters parameters ) { if ( parameters == null ) { throw new NullPointerException ( Messages . INSTANCE . getExceptionMessage ( 16 ) ) ; } this . parameters = parameters ; }
Sets the property s parameters
37,885
public List < String > getParameters ( String name ) { return Collections . unmodifiableList ( parameters . get ( name ) ) ; }
Gets all values of a parameter with the given name .
37,886
public void setParameter ( String name , Collection < String > values ) { parameters . replace ( name , values ) ; }
Replaces all existing values of a parameter with the given values .
37,887
public Completed setCompleted ( Date completed ) { Completed prop = ( completed == null ) ? null : new Completed ( completed ) ; setCompleted ( prop ) ; return prop ; }
Sets the date and time that the to - do task was completed .
37,888
public PercentComplete setPercentComplete ( Integer percent ) { PercentComplete prop = ( percent == null ) ? null : new PercentComplete ( percent ) ; setPercentComplete ( prop ) ; return prop ; }
Sets the amount that the to - do task has been completed .
37,889
public Attendee addAttendee ( String email ) { Attendee prop = new Attendee ( null , email , null ) ; addAttendee ( prop ) ; return prop ; }
Adds a person who is involved in the to - do task .
37,890
public static DateValue add ( DateValue date , DateValue duration ) { DTBuilder db = new DTBuilder ( date ) ; db . year += duration . year ( ) ; db . month += duration . month ( ) ; db . day += duration . day ( ) ; if ( duration instanceof TimeValue ) { TimeValue tdur = ( TimeValue ) duration ; db . hour += tdur . hour...
Adds a duration to a date .
37,891
public static int daysBetween ( int year1 , int month1 , int day1 , int year2 , int month2 , int day2 ) { return fixedFromGregorian ( year1 , month1 , day1 ) - fixedFromGregorian ( year2 , month2 , day2 ) ; }
Calculates the number of days between two dates .
37,892
public static DayOfWeek dayOfWeek ( DateValue date ) { int dayIndex = fixedFromGregorian ( date . year ( ) , date . month ( ) , date . day ( ) ) % 7 ; if ( dayIndex < 0 ) { dayIndex += 7 ; } return DAYS_OF_WEEK [ dayIndex ] ; }
Gets the day of the week the given date falls on .
37,893
public static DayOfWeek firstDayOfWeekInMonth ( int year , int month ) { int result = fixedFromGregorian ( year , month , 1 ) % 7 ; if ( result < 0 ) { result += 7 ; } return DAYS_OF_WEEK [ result ] ; }
Gets the day of the week of the first day in the given month .
37,894
public static DateTimeValue timeFromSecsSinceEpoch ( long secsSinceEpoch ) { int secsInDay = ( int ) ( secsSinceEpoch % SECS_PER_DAY ) ; int daysSinceEpoch = ( int ) ( secsSinceEpoch / SECS_PER_DAY ) ; int approx = ( int ) ( ( daysSinceEpoch + 10 ) * 400L / 146097 ) ; int year = ( daysSinceEpoch >= fixedFromGregorian (...
Computes the gregorian time from the number of seconds since the Proleptic Gregorian Epoch . See Calendrical Calculations Reingold and Dershowitz .
37,895
@ SuppressWarnings ( "unchecked" ) public static < T > Predicate < T > and ( Collection < Predicate < ? super T > > components ) { return and ( components . toArray ( new Predicate [ 0 ] ) ) ; }
Returns a predicate that evaluates to true iff each of its components evaluates to true . The components are evaluated in order and evaluation will be short - circuited as soon as the answer is determined .
37,896
public DateIterator getDateIterator ( ICalDate startDate , TimeZone timezone ) { Recurrence recur = getValue ( ) ; return ( recur == null ) ? new Google2445Utils . EmptyDateIterator ( ) : recur . getDateIterator ( startDate , timezone ) ; }
Creates an iterator that computes the dates defined by this property .
37,897
public boolean isSupported ( ICalVersion version ) { for ( ICalVersion supportedVersion : supportedVersions ) { if ( supportedVersion == version ) { return true ; } } return false ; }
Determines if the parameter value is supported by the given iCalendar version .
37,898
public void write ( ICalendar ical ) throws IOException { Collection < Class < ? > > unregistered = findScribeless ( ical ) ; if ( ! unregistered . isEmpty ( ) ) { List < String > classNames = new ArrayList < String > ( unregistered . size ( ) ) ; for ( Class < ? > clazz : unregistered ) { classNames . add ( clazz . ge...
Writes an iCalendar object to the data stream .
37,899
public TimezoneOffsetTo setTimezoneOffsetTo ( UtcOffset offset ) { TimezoneOffsetTo prop = new TimezoneOffsetTo ( offset ) ; setTimezoneOffsetTo ( prop ) ; return prop ; }
Sets the UTC offset that the timezone observance transitions to .