repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
mangstadt/biweekly
src/main/java/biweekly/ValidationWarnings.java
ValidationWarnings.getByProperty
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 (propertyClass == pr...
java
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 (propertyClass == pr...
[ "public", "List", "<", "WarningsGroup", ">", "getByProperty", "(", "Class", "<", "?", "extends", "ICalProperty", ">", "propertyClass", ")", "{", "List", "<", "WarningsGroup", ">", "warnings", "=", "new", "ArrayList", "<", "WarningsGroup", ">", "(", ")", ";",...
Gets all validation warnings of a given property. @param propertyClass the property (e.g. {@code DateStart.class}) @return the validation warnings
[ "Gets", "all", "validation", "warnings", "of", "a", "given", "property", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/ValidationWarnings.java#L96-L109
train
mangstadt/biweekly
src/main/java/biweekly/ValidationWarnings.java
ValidationWarnings.getByComponent
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 (componentCla...
java
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 (componentCla...
[ "public", "List", "<", "WarningsGroup", ">", "getByComponent", "(", "Class", "<", "?", "extends", "ICalComponent", ">", "componentClass", ")", "{", "List", "<", "WarningsGroup", ">", "warnings", "=", "new", "ArrayList", "<", "WarningsGroup", ">", "(", ")", "...
Gets all validation warnings of a given component. @param componentClass the component (e.g. {@code VEvent.class}) @return the validation warnings
[ "Gets", "all", "validation", "warnings", "of", "a", "given", "component", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/ValidationWarnings.java#L116-L129
train
mangstadt/biweekly
src/main/java/biweekly/io/chain/ChainingTextWriter.java
ChainingTextWriter.go
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(); }
java
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(); }
[ "public", "String", "go", "(", ")", "{", "StringWriter", "sw", "=", "new", "StringWriter", "(", ")", ";", "try", "{", "go", "(", "sw", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "//should never be thrown because we're writing to a string", "t...
Writes the iCalendar objects to a string. @return the iCalendar string
[ "Writes", "the", "iCalendar", "objects", "to", "a", "string", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/chain/ChainingTextWriter.java#L135-L144
train
mangstadt/biweekly
src/main/java/biweekly/io/WriteContext.java
WriteContext.addDate
public void addDate(ICalDate date, boolean floating, TimeZone tz) { if (date != null && date.hasTime() && !floating && tz != null) { dates.add(date); } }
java
public void addDate(ICalDate date, boolean floating, TimeZone tz) { if (date != null && date.hasTime() && !floating && tz != null) { dates.add(date); } }
[ "public", "void", "addDate", "(", "ICalDate", "date", ",", "boolean", "floating", ",", "TimeZone", "tz", ")", "{", "if", "(", "date", "!=", "null", "&&", "date", ".", "hasTime", "(", ")", "&&", "!", "floating", "&&", "tz", "!=", "null", ")", "{", "...
Records the timezoned date-time values that are being written. This is used to generate a DAYLIGHT property for vCalendar objects. @param floating true if the date is floating, false if not @param tz the timezone to format the date in or null for UTC @param date the date value
[ "Records", "the", "timezoned", "date", "-", "time", "values", "that", "are", "being", "written", ".", "This", "is", "used", "to", "generate", "a", "DAYLIGHT", "property", "for", "vCalendar", "objects", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/WriteContext.java#L112-L116
train
mangstadt/biweekly
src/main/java/biweekly/util/CaseClasses.java
CaseClasses.get
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; } }
java
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; } }
[ "public", "T", "get", "(", "V", "value", ")", "{", "T", "found", "=", "find", "(", "value", ")", ";", "if", "(", "found", "!=", "null", ")", "{", "return", "found", ";", "}", "synchronized", "(", "runtimeDefined", ")", "{", "for", "(", "T", "obj"...
Searches for a case object by value, creating a new object if one cannot be found. @param value the value @return the object
[ "Searches", "for", "a", "case", "object", "by", "value", "creating", "a", "new", "object", "if", "one", "cannot", "be", "found", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/CaseClasses.java#L96-L113
train
mangstadt/biweekly
src/main/java/biweekly/util/Gobble.java
Gobble.asString
public String asString(String charset) throws IOException { Reader reader = buildReader(charset); return consumeReader(reader); }
java
public String asString(String charset) throws IOException { Reader reader = buildReader(charset); return consumeReader(reader); }
[ "public", "String", "asString", "(", "String", "charset", ")", "throws", "IOException", "{", "Reader", "reader", "=", "buildReader", "(", "charset", ")", ";", "return", "consumeReader", "(", "reader", ")", ";", "}" ]
Gets the stream contents as a string. @param charset the character set to decode the stream data with (this parameter is ignored if a {@link Reader} was passed into this class's constructor) @return the string @throws IOException if there was a problem reading from the stream
[ "Gets", "the", "stream", "contents", "as", "a", "string", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/Gobble.java#L96-L99
train
mangstadt/biweekly
src/main/java/biweekly/util/Gobble.java
Gobble.asByteArray
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); }
java
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); }
[ "public", "byte", "[", "]", "asByteArray", "(", ")", "throws", "IOException", "{", "if", "(", "reader", "!=", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Cannot get raw bytes from a Reader object.\"", ")", ";", "}", "InputStream", "in", "=...
Gets the stream contents as a byte array. @return the byte array @throws IOException if there was a problem reading from the stream @throws IllegalStateException if a {@link Reader} object was passed into this class's constructor
[ "Gets", "the", "stream", "contents", "as", "a", "byte", "array", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/Gobble.java#L108-L115
train
mangstadt/biweekly
src/main/java/biweekly/ICalendar.java
ICalendar.setName
public Name setName(String name) { Name property = (name == null) ? null : new Name(name); setName(property); return property; }
java
public Name setName(String name) { Name property = (name == null) ? null : new Name(name); setName(property); return property; }
[ "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. @param name the name or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/draft-ietf-calext-extensions-01#page-5">draft-ietf-calext-extensions-01 p.5</a>
[ "Sets", "the", "human", "-", "readable", "name", "of", "the", "calendar", "as", "a", "whole", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/ICalendar.java#L416-L420
train
mangstadt/biweekly
src/main/java/biweekly/ICalendar.java
ICalendar.setDescription
public Description setDescription(String description) { Description property = (description == null) ? null : new Description(description); setDescription(property); return property; }
java
public Description setDescription(String description) { Description property = (description == null) ? null : new Description(description); setDescription(property); return property; }
[ "public", "Description", "setDescription", "(", "String", "description", ")", "{", "Description", "property", "=", "(", "description", "==", "null", ")", "?", "null", ":", "new", "Description", "(", "description", ")", ";", "setDescription", "(", "property", "...
Sets the human-readable description of the calendar as a whole. @param description the description or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/draft-ietf-calext-extensions-01#page-6">draft-ietf-calext-extensions-01 p.6</a>
[ "Sets", "the", "human", "-", "readable", "description", "of", "the", "calendar", "as", "a", "whole", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/ICalendar.java#L502-L506
train
mangstadt/biweekly
src/main/java/biweekly/ICalendar.java
ICalendar.setUid
public Uid setUid(String uid) { Uid property = (uid == null) ? null : new Uid(uid); setUid(property); return property; }
java
public Uid setUid(String uid) { Uid property = (uid == null) ? null : new Uid(uid); setUid(property); return property; }
[ "public", "Uid", "setUid", "(", "String", "uid", ")", "{", "Uid", "property", "=", "(", "uid", "==", "null", ")", "?", "null", ":", "new", "Uid", "(", "uid", ")", ";", "setUid", "(", "property", ")", ";", "return", "property", ";", "}" ]
Sets the calendar's unique identifier. @param uid the unique identifier or null to remove @return the property object that was created @see <a href="http://tools.ietf.org/html/draft-ietf-calext-extensions-01#page-6">draft-ietf-calext-extensions-01 p.6</a>
[ "Sets", "the", "calendar", "s", "unique", "identifier", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/ICalendar.java#L579-L583
train
mangstadt/biweekly
src/main/java/biweekly/ICalendar.java
ICalendar.setLastModified
public LastModified setLastModified(Date lastModified) { LastModified property = (lastModified == null) ? null : new LastModified(lastModified); setLastModified(property); return property; }
java
public LastModified setLastModified(Date lastModified) { LastModified property = (lastModified == null) ? null : new LastModified(lastModified); setLastModified(property); return property; }
[ "public", "LastModified", "setLastModified", "(", "Date", "lastModified", ")", "{", "LastModified", "property", "=", "(", "lastModified", "==", "null", ")", "?", "null", ":", "new", "LastModified", "(", "lastModified", ")", ";", "setLastModified", "(", "property...
Sets the date and time that the information in this calendar object was last revised. @param lastModified the date and time or null to remove @return the property object that was created @see <a href="http://tools.ietf.org/html/draft-ietf-calext-extensions-01#page-7">draft-ietf-calext-extensions-01 p.7</a>
[ "Sets", "the", "date", "and", "time", "that", "the", "information", "in", "this", "calendar", "object", "was", "last", "revised", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/ICalendar.java#L618-L622
train
mangstadt/biweekly
src/main/java/biweekly/ICalendar.java
ICalendar.addCategories
public Categories addCategories(String... categories) { Categories prop = new Categories(categories); addProperty(prop); return prop; }
java
public Categories addCategories(String... categories) { Categories prop = new Categories(categories); addProperty(prop); return prop; }
[ "public", "Categories", "addCategories", "(", "String", "...", "categories", ")", "{", "Categories", "prop", "=", "new", "Categories", "(", "categories", ")", ";", "addProperty", "(", "prop", ")", ";", "return", "prop", ";", "}" ]
Adds a list of keywords that describe the calendar. @param categories the categories to add @return the property object that was created @see <a href="http://tools.ietf.org/html/draft-ietf-calext-extensions-01#page-7">draft-ietf-calext-extensions-01 p.7</a>
[ "Adds", "a", "list", "of", "keywords", "that", "describe", "the", "calendar", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/ICalendar.java#L697-L701
train
mangstadt/biweekly
src/main/java/biweekly/ICalendar.java
ICalendar.setRefreshInterval
public RefreshInterval setRefreshInterval(Duration refreshInterval) { RefreshInterval property = (refreshInterval == null) ? null : new RefreshInterval(refreshInterval); setRefreshInterval(property); return property; }
java
public RefreshInterval setRefreshInterval(Duration refreshInterval) { RefreshInterval property = (refreshInterval == null) ? null : new RefreshInterval(refreshInterval); setRefreshInterval(property); return property; }
[ "public", "RefreshInterval", "setRefreshInterval", "(", "Duration", "refreshInterval", ")", "{", "RefreshInterval", "property", "=", "(", "refreshInterval", "==", "null", ")", "?", "null", ":", "new", "RefreshInterval", "(", "refreshInterval", ")", ";", "setRefreshI...
Sets the suggested minimum polling interval for checking for updates to the calendar data. @param refreshInterval the refresh interval or null to remove @return the property object that was created @see <a href="http://tools.ietf.org/html/draft-ietf-calext-extensions-01#page-7">draft-ietf-calext-extensions-01 p.7</a>
[ "Sets", "the", "suggested", "minimum", "polling", "interval", "for", "checking", "for", "updates", "to", "the", "calendar", "data", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/ICalendar.java#L736-L740
train
mangstadt/biweekly
src/main/java/biweekly/ICalendar.java
ICalendar.setSource
public Source setSource(String url) { Source property = (url == null) ? null : new Source(url); setSource(property); return property; }
java
public Source setSource(String url) { Source property = (url == null) ? null : new Source(url); setSource(property); return property; }
[ "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. @param url the source or null to remove @return the property object that was created @see <a href="http://tools.ietf.org/html/draft-ietf-calext-extensions-01#page-8">draft-ietf-calext-extensions-01 p.8</a>
[ "Sets", "the", "location", "that", "the", "calendar", "data", "can", "be", "refreshed", "from", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/ICalendar.java#L772-L776
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalReader.java
JCalReader._readNext
@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(); }
java
@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(); }
[ "@", "Override", "public", "ICalendar", "_readNext", "(", ")", "throws", "IOException", "{", "if", "(", "reader", ".", "eof", "(", ")", ")", "{", "return", "null", ";", "}", "context", ".", "setVersion", "(", "ICalVersion", ".", "V2_0", ")", ";", "JCal...
Reads the next iCalendar object from the JSON data stream. @return the iCalendar object or null if there are no more @throws JCalParseException if the jCal syntax is incorrect (the JSON syntax may be valid, but it is not in the correct jCal format). @throws JsonParseException if the JSON syntax is incorrect @throws IOE...
[ "Reads", "the", "next", "iCalendar", "object", "from", "the", "JSON", "data", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalReader.java#L136-L148
train
mangstadt/biweekly
src/main/java/biweekly/component/VAlarm.java
VAlarm.audio
public static VAlarm audio(Trigger trigger, Attachment sound) { VAlarm alarm = new VAlarm(Action.audio(), trigger); if (sound != null) { alarm.addAttachment(sound); } return alarm; }
java
public static VAlarm audio(Trigger trigger, Attachment sound) { VAlarm alarm = new VAlarm(Action.audio(), trigger); if (sound != null) { alarm.addAttachment(sound); } return alarm; }
[ "public", "static", "VAlarm", "audio", "(", "Trigger", "trigger", ",", "Attachment", "sound", ")", "{", "VAlarm", "alarm", "=", "new", "VAlarm", "(", "Action", ".", "audio", "(", ")", ",", "trigger", ")", ";", "if", "(", "sound", "!=", "null", ")", "...
Creates an audio alarm. @param trigger the trigger @param sound a sound to play when the alarm triggers @return the alarm
[ "Creates", "an", "audio", "alarm", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VAlarm.java#L118-L124
train
mangstadt/biweekly
src/main/java/biweekly/component/VAlarm.java
VAlarm.display
public static VAlarm display(Trigger trigger, String displayText) { VAlarm alarm = new VAlarm(Action.display(), trigger); alarm.setDescription(displayText); return alarm; }
java
public static VAlarm display(Trigger trigger, String displayText) { VAlarm alarm = new VAlarm(Action.display(), trigger); alarm.setDescription(displayText); return alarm; }
[ "public", "static", "VAlarm", "display", "(", "Trigger", "trigger", ",", "String", "displayText", ")", "{", "VAlarm", "alarm", "=", "new", "VAlarm", "(", "Action", ".", "display", "(", ")", ",", "trigger", ")", ";", "alarm", ".", "setDescription", "(", "...
Creates a display alarm. @param trigger the trigger @param displayText the display text @return the alarm
[ "Creates", "a", "display", "alarm", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VAlarm.java#L132-L136
train
mangstadt/biweekly
src/main/java/biweekly/component/VAlarm.java
VAlarm.setDuration
public DurationProperty setDuration(Duration duration) { DurationProperty prop = (duration == null) ? null : new DurationProperty(duration); setDuration(prop); return prop; }
java
public DurationProperty setDuration(Duration duration) { DurationProperty prop = (duration == null) ? null : new DurationProperty(duration); setDuration(prop); return prop; }
[ "public", "DurationProperty", "setDuration", "(", "Duration", "duration", ")", "{", "DurationProperty", "prop", "=", "(", "duration", "==", "null", ")", "?", "null", ":", "new", "DurationProperty", "(", "duration", ")", ";", "setDuration", "(", "prop", ")", ...
Sets the length of the pause between alarm repetitions. @param duration the duration or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-99">RFC 5545 p.99</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-94">RFC 2445 p.94-5</a>
[ "Sets", "the", "length", "of", "the", "pause", "between", "alarm", "repetitions", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VAlarm.java#L428-L432
train
mangstadt/biweekly
src/main/java/biweekly/component/VAlarm.java
VAlarm.setRepeat
public Repeat setRepeat(Integer count) { Repeat prop = (count == null) ? null : new Repeat(count); setRepeat(prop); return prop; }
java
public Repeat setRepeat(Integer count) { Repeat prop = (count == null) ? null : new Repeat(count); setRepeat(prop); return prop; }
[ "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. @param count the repeat count (e.g. "2" to repeat it two more times after it was initially triggered, for a total of three times) or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-...
[ "Sets", "the", "number", "of", "times", "an", "alarm", "should", "be", "repeated", "after", "its", "initial", "trigger", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VAlarm.java#L471-L475
train
mangstadt/biweekly
src/main/java/biweekly/component/VAlarm.java
VAlarm.setRepeat
public void setRepeat(int count, Duration pauseDuration) { Repeat repeat = new Repeat(count); DurationProperty duration = new DurationProperty(pauseDuration); setRepeat(repeat); setDuration(duration); }
java
public void setRepeat(int count, Duration pauseDuration) { Repeat repeat = new Repeat(count); DurationProperty duration = new DurationProperty(pauseDuration); setRepeat(repeat); setDuration(duration); }
[ "public", "void", "setRepeat", "(", "int", "count", ",", "Duration", "pauseDuration", ")", "{", "Repeat", "repeat", "=", "new", "Repeat", "(", "count", ")", ";", "DurationProperty", "duration", "=", "new", "DurationProperty", "(", "pauseDuration", ")", ";", ...
Sets the repetition information for the alarm. @param count the repeat count (e.g. "2" to repeat it two more times after it was initially triggered, for a total of three times) @param pauseDuration the length of the pause between repeats @see <a href="http://tools.ietf.org/html/rfc5545#page-133">RFC 5545 p.133</a> @see...
[ "Sets", "the", "repetition", "information", "for", "the", "alarm", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VAlarm.java#L487-L492
train
mangstadt/biweekly
src/main/java/biweekly/util/XmlUtils.java
XmlUtils.createDocument
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 because...
java
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 because...
[ "public", "static", "Document", "createDocument", "(", ")", "{", "try", "{", "DocumentBuilderFactory", "fact", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "fact", ".", "setNamespaceAware", "(", "true", ")", ";", "DocumentBuilder", "db", "="...
Creates a new XML document. @return the XML document
[ "Creates", "a", "new", "XML", "document", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/XmlUtils.java#L75-L85
train
mangstadt/biweekly
src/main/java/biweekly/util/XmlUtils.java
XmlUtils.toDocument
public static Document toDocument(String xml) throws SAXException { try { return toDocument(new StringReader(xml)); } catch (IOException e) { //reading from string throw new RuntimeException(e); } }
java
public static Document toDocument(String xml) throws SAXException { try { return toDocument(new StringReader(xml)); } catch (IOException e) { //reading from string throw new RuntimeException(e); } }
[ "public", "static", "Document", "toDocument", "(", "String", "xml", ")", "throws", "SAXException", "{", "try", "{", "return", "toDocument", "(", "new", "StringReader", "(", "xml", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "//reading f...
Parses an XML string into a DOM. @param xml the XML string @return the parsed DOM @throws SAXException if the string is not valid XML
[ "Parses", "an", "XML", "string", "into", "a", "DOM", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/XmlUtils.java#L93-L100
train
mangstadt/biweekly
src/main/java/biweekly/util/XmlUtils.java
XmlUtils.toDocument
public static Document toDocument(File file) throws SAXException, IOException { InputStream in = new BufferedInputStream(new FileInputStream(file)); try { return XmlUtils.toDocument(in); } finally { in.close(); } }
java
public static Document toDocument(File file) throws SAXException, IOException { InputStream in = new BufferedInputStream(new FileInputStream(file)); try { return XmlUtils.toDocument(in); } finally { in.close(); } }
[ "public", "static", "Document", "toDocument", "(", "File", "file", ")", "throws", "SAXException", ",", "IOException", "{", "InputStream", "in", "=", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "file", ")", ")", ";", "try", "{", "return", ...
Parses an XML document from a file. @param file the file @return the parsed DOM @throws SAXException if the XML is not valid @throws IOException if there is a problem reading from the file
[ "Parses", "an", "XML", "document", "from", "a", "file", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/XmlUtils.java#L109-L116
train
mangstadt/biweekly
src/main/java/biweekly/util/XmlUtils.java
XmlUtils.getFirstChildElement
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; }
java
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; }
[ "private", "static", "Element", "getFirstChildElement", "(", "Node", "parent", ")", "{", "NodeList", "nodeList", "=", "parent", ".", "getChildNodes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nodeList", ".", "getLength", "(", ")", ...
Gets the first child element of a node. @param parent the node @return the first child element or null if there are no child elements
[ "Gets", "the", "first", "child", "element", "of", "a", "node", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/XmlUtils.java#L335-L344
train
mangstadt/biweekly
src/main/java/biweekly/util/XmlUtils.java
XmlUtils.hasQName
public static boolean hasQName(Node node, QName qname) { return qname.getNamespaceURI().equals(node.getNamespaceURI()) && qname.getLocalPart().equals(node.getLocalName()); }
java
public static boolean hasQName(Node node, QName qname) { return qname.getNamespaceURI().equals(node.getNamespaceURI()) && qname.getLocalPart().equals(node.getLocalName()); }
[ "public", "static", "boolean", "hasQName", "(", "Node", "node", ",", "QName", "qname", ")", "{", "return", "qname", ".", "getNamespaceURI", "(", ")", ".", "equals", "(", "node", ".", "getNamespaceURI", "(", ")", ")", "&&", "qname", ".", "getLocalPart", "...
Determines if a node has a particular qualified name. @param node the node @param qname the qualified name @return true if the node has the given qualified name, false if not
[ "Determines", "if", "a", "node", "has", "a", "particular", "qualified", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/XmlUtils.java#L352-L354
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalReader.java
XCalReader.close
public void close() throws IOException { if (thread.isAlive()) { thread.closed = true; thread.interrupt(); } if (stream != null) { stream.close(); } }
java
public void close() throws IOException { if (thread.isAlive()) { thread.closed = true; thread.interrupt(); } if (stream != null) { stream.close(); } }
[ "public", "void", "close", "(", ")", "throws", "IOException", "{", "if", "(", "thread", ".", "isAlive", "(", ")", ")", "{", "thread", ".", "closed", "=", "true", ";", "thread", ".", "interrupt", "(", ")", ";", "}", "if", "(", "stream", "!=", "null"...
Closes the underlying input stream.
[ "Closes", "the", "underlying", "input", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalReader.java#L610-L619
train
mangstadt/biweekly
src/main/java/biweekly/util/DataUri.java
DataUri.parse
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.getIllegalArgumentExceptio...
java
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.getIllegalArgumentExceptio...
[ "public", "static", "DataUri", "parse", "(", "String", "uri", ")", "{", "//Syntax: data:[<media type>][;charset=<character set>][;base64],<data>", "String", "scheme", "=", "\"data:\"", ";", "if", "(", "uri", ".", "length", "(", ")", "<", "scheme", ".", "length", "...
Parses a data URI string. @param uri the URI string (e.g. "data:image/jpeg;base64,[base64 string]") @return the parsed data URI @throws IllegalArgumentException if the string is not a valid data URI or it cannot be parsed
[ "Parses", "a", "data", "URI", "string", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/DataUri.java#L95-L168
train
mangstadt/biweekly
src/main/java/biweekly/property/Priority.java
Priority.toCuaPriority
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; }
java
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; }
[ "public", "String", "toCuaPriority", "(", ")", "{", "if", "(", "value", "==", "null", "||", "value", "<", "1", "||", "value", ">", "9", ")", "{", "return", "null", ";", "}", "int", "letter", "=", "(", "(", "value", "-", "1", ")", "/", "3", ")",...
Converts this priority to its two-character CUA code. @return the CUA code (e.g. "B1" for "4") or null if the priority cannot be converted to a CUA code
[ "Converts", "this", "priority", "to", "its", "two", "-", "character", "CUA", "code", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/property/Priority.java#L103-L110
train
mangstadt/biweekly
src/main/java/biweekly/io/StreamReader.java
StreamReader.readAll
public List<ICalendar> readAll() throws IOException { List<ICalendar> icals = new ArrayList<ICalendar>(); ICalendar ical; while ((ical = readNext()) != null) { icals.add(ical); } return icals; }
java
public List<ICalendar> readAll() throws IOException { List<ICalendar> icals = new ArrayList<ICalendar>(); ICalendar ical; while ((ical = readNext()) != null) { icals.add(ical); } return icals; }
[ "public", "List", "<", "ICalendar", ">", "readAll", "(", ")", "throws", "IOException", "{", "List", "<", "ICalendar", ">", "icals", "=", "new", "ArrayList", "<", "ICalendar", ">", "(", ")", ";", "ICalendar", "ical", ";", "while", "(", "(", "ical", "=",...
Reads all iCalendar objects from the data stream. @return the iCalendar objects @throws IOException if there's a problem reading from the stream
[ "Reads", "all", "iCalendar", "objects", "from", "the", "data", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/StreamReader.java#L122-L129
train
mangstadt/biweekly
src/main/java/biweekly/io/StreamReader.java
StreamReader.readNext
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; }
java
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; }
[ "public", "ICalendar", "readNext", "(", ")", "throws", "IOException", "{", "warnings", ".", "clear", "(", ")", ";", "context", "=", "new", "ParseContext", "(", ")", ";", "ICalendar", "ical", "=", "_readNext", "(", ")", ";", "if", "(", "ical", "==", "nu...
Reads the next iCalendar object from the data stream. @return the next iCalendar object or null if there are no more @throws IOException if there's a problem reading from the stream
[ "Reads", "the", "next", "iCalendar", "object", "from", "the", "data", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/StreamReader.java#L136-L147
train
mangstadt/biweekly
src/main/java/biweekly/util/ListMultimap.java
ListMultimap.putAll
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); }
java
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); }
[ "public", "void", "putAll", "(", "K", "key", ",", "Collection", "<", "?", "extends", "V", ">", "values", ")", "{", "if", "(", "values", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "key", "=", "sanitizeKey", "(", "key", ")", ";", "List...
Adds multiple values to the multimap. @param key the key @param values the values to add
[ "Adds", "multiple", "values", "to", "the", "multimap", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L135-L147
train
mangstadt/biweekly
src/main/java/biweekly/util/ListMultimap.java
ListMultimap.get
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); }
java
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); }
[ "public", "List", "<", "V", ">", "get", "(", "K", "key", ")", "{", "key", "=", "sanitizeKey", "(", "key", ")", ";", "List", "<", "V", ">", "value", "=", "map", ".", "get", "(", "key", ")", ";", "if", "(", "value", "==", "null", ")", "{", "v...
Gets the values associated with the key. Changes to the returned list will update the underlying multimap, and vice versa. @param key the key @return the list of values or empty list if the key doesn't exist
[ "Gets", "the", "values", "associated", "with", "the", "key", ".", "Changes", "to", "the", "returned", "list", "will", "update", "the", "underlying", "multimap", "and", "vice", "versa", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L155-L162
train
mangstadt/biweekly
src/main/java/biweekly/util/ListMultimap.java
ListMultimap.first
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); }
java
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); }
[ "public", "V", "first", "(", "K", "key", ")", "{", "key", "=", "sanitizeKey", "(", "key", ")", ";", "List", "<", "V", ">", "values", "=", "map", ".", "get", "(", "key", ")", ";", "/*\n\t\t * The list can be null, but never empty. Empty lists are removed from\n...
Gets the first value that's associated with a key. @param key the key @return the first value or null if the key doesn't exist
[ "Gets", "the", "first", "value", "that", "s", "associated", "with", "a", "key", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L169-L178
train
mangstadt/biweekly
src/main/java/biweekly/util/ListMultimap.java
ListMultimap.remove
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; }
java
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; }
[ "public", "boolean", "remove", "(", "K", "key", ",", "V", "value", ")", "{", "key", "=", "sanitizeKey", "(", "key", ")", ";", "List", "<", "V", ">", "values", "=", "map", ".", "get", "(", "key", ")", ";", "if", "(", "values", "==", "null", ")",...
Removes a particular value. @param key the key @param value the value to remove @return true if the multimap contained the value, false if not
[ "Removes", "a", "particular", "value", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L196-L208
train
mangstadt/biweekly
src/main/java/biweekly/util/ListMultimap.java
ListMultimap.removeAll
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; }
java
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; }
[ "public", "List", "<", "V", ">", "removeAll", "(", "K", "key", ")", "{", "key", "=", "sanitizeKey", "(", "key", ")", ";", "List", "<", "V", ">", "removed", "=", "map", ".", "remove", "(", "key", ")", ";", "if", "(", "removed", "==", "null", ")"...
Removes all the values associated with a key @param key the key to remove @return the removed values or an empty list if the key doesn't exist (this list is immutable)
[ "Removes", "all", "the", "values", "associated", "with", "a", "key" ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L216-L226
train
mangstadt/biweekly
src/main/java/biweekly/util/ListMultimap.java
ListMultimap.replace
public List<V> replace(K key, V value) { List<V> replaced = removeAll(key); if (value != null) { put(key, value); } return replaced; }
java
public List<V> replace(K key, V value) { List<V> replaced = removeAll(key); if (value != null) { put(key, value); } return replaced; }
[ "public", "List", "<", "V", ">", "replace", "(", "K", "key", ",", "V", "value", ")", "{", "List", "<", "V", ">", "replaced", "=", "removeAll", "(", "key", ")", ";", "if", "(", "value", "!=", "null", ")", "{", "put", "(", "key", ",", "value", ...
Replaces all values with the given value. @param key the key @param value the value with which to replace all existing values, or null to remove all values @return the values that were replaced (this list is immutable)
[ "Replaces", "all", "values", "with", "the", "given", "value", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L235-L241
train
mangstadt/biweekly
src/main/java/biweekly/util/ListMultimap.java
ListMultimap.replace
public List<V> replace(K key, Collection<? extends V> values) { List<V> replaced = removeAll(key); putAll(key, values); return replaced; }
java
public List<V> replace(K key, Collection<? extends V> values) { List<V> replaced = removeAll(key); putAll(key, values); return replaced; }
[ "public", "List", "<", "V", ">", "replace", "(", "K", "key", ",", "Collection", "<", "?", "extends", "V", ">", "values", ")", "{", "List", "<", "V", ">", "replaced", "=", "removeAll", "(", "key", ")", ";", "putAll", "(", "key", ",", "values", ")"...
Replaces all values with the given values. @param key the key @param values the values with which to replace all existing values @return the values that were replaced (this list is immutable)
[ "Replaces", "all", "values", "with", "the", "given", "values", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L249-L253
train
mangstadt/biweekly
src/main/java/biweekly/util/ListMultimap.java
ListMultimap.clear
public void clear() { //clear each collection to make previously returned lists empty for (List<V> value : map.values()) { value.clear(); } map.clear(); }
java
public void clear() { //clear each collection to make previously returned lists empty for (List<V> value : map.values()) { value.clear(); } map.clear(); }
[ "public", "void", "clear", "(", ")", "{", "//clear each collection to make previously returned lists empty", "for", "(", "List", "<", "V", ">", "value", ":", "map", ".", "values", "(", ")", ")", "{", "value", ".", "clear", "(", ")", ";", "}", "map", ".", ...
Clears all entries from the multimap.
[ "Clears", "all", "entries", "from", "the", "multimap", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L258-L264
train
mangstadt/biweekly
src/main/java/biweekly/util/ListMultimap.java
ListMultimap.values
public List<V> values() { List<V> list = new ArrayList<V>(); for (List<V> value : map.values()) { list.addAll(value); } return Collections.unmodifiableList(list); }
java
public List<V> values() { List<V> list = new ArrayList<V>(); for (List<V> value : map.values()) { list.addAll(value); } return Collections.unmodifiableList(list); }
[ "public", "List", "<", "V", ">", "values", "(", ")", "{", "List", "<", "V", ">", "list", "=", "new", "ArrayList", "<", "V", ">", "(", ")", ";", "for", "(", "List", "<", "V", ">", "value", ":", "map", ".", "values", "(", ")", ")", "{", "list...
Gets all the values in the multimap. @return the values (this list is immutable)
[ "Gets", "all", "the", "values", "in", "the", "multimap", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L278-L284
train
mangstadt/biweekly
src/main/java/biweekly/util/ListMultimap.java
ListMultimap.size
public int size() { int size = 0; for (List<V> value : map.values()) { size += value.size(); } return size; }
java
public int size() { int size = 0; for (List<V> value : map.values()) { size += value.size(); } return size; }
[ "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. @return the number of values
[ "Gets", "the", "number", "of", "values", "in", "the", "map", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/ListMultimap.java#L298-L304
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalOutputProperties.java
XCalOutputProperties.getIndent
public Integer getIndent() { if (!"yes".equals(get(OutputKeys.INDENT))) { return null; } String value = get(INDENT_AMT); return (value == null) ? null : Integer.valueOf(value); }
java
public Integer getIndent() { if (!"yes".equals(get(OutputKeys.INDENT))) { return null; } String value = get(INDENT_AMT); return (value == null) ? null : Integer.valueOf(value); }
[ "public", "Integer", "getIndent", "(", ")", "{", "if", "(", "!", "\"yes\"", ".", "equals", "(", "get", "(", "OutputKeys", ".", "INDENT", ")", ")", ")", "{", "return", "null", ";", "}", "String", "value", "=", "get", "(", "INDENT_AMT", ")", ";", "re...
Gets the number of indent spaces to use for pretty-printing. @return the number of indent spaces or null if pretty-printing is disabled
[ "Gets", "the", "number", "of", "indent", "spaces", "to", "use", "for", "pretty", "-", "printing", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalOutputProperties.java#L67-L74
train
mangstadt/biweekly
src/main/java/biweekly/util/UtcOffset.java
UtcOffset.parse
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(1); boolean positi...
java
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(1); boolean positi...
[ "public", "static", "UtcOffset", "parse", "(", "String", "text", ")", "{", "Pattern", "timeZoneRegex", "=", "Pattern", ".", "compile", "(", "\"^([-\\\\+])?(\\\\d{1,2})(:?(\\\\d{2}))?(:?(\\\\d{2}))?$\"", ")", ";", "Matcher", "m", "=", "timeZoneRegex", ".", "matcher", ...
Parses a UTC offset from a string. @param text the text to parse (e.g. "-0500") @return the parsed UTC offset @throws IllegalArgumentException if the text cannot be parsed
[ "Parses", "a", "UTC", "offset", "from", "a", "string", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/UtcOffset.java#L70-L88
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/property/RecurrencePropertyScribe.java
RecurrencePropertyScribe.splitRRULEValues
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(prevIndex, end).trim(); ...
java
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(prevIndex, end).trim(); ...
[ "private", "List", "<", "String", ">", "splitRRULEValues", "(", "String", "value", ")", "{", "List", "<", "String", ">", "values", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "Pattern", "p", "=", "Pattern", ".", "compile", "(", "\"#\\\\...
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. @param value the property value @return the RRULE values
[ "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", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/property/RecurrencePropertyScribe.java#L264-L282
train
mangstadt/biweekly
src/main/java/biweekly/io/ICalTimeZone.java
ICalTimeZone.calculateSortedObservances
private List<Observance> calculateSortedObservances() { List<DaylightSavingsTime> daylights = component.getDaylightSavingsTime(); List<StandardTime> standards = component.getStandardTimes(); int numObservances = standards.size() + daylights.size(); List<Observance> sortedObservances = new ArrayList<Observance>...
java
private List<Observance> calculateSortedObservances() { List<DaylightSavingsTime> daylights = component.getDaylightSavingsTime(); List<StandardTime> standards = component.getStandardTimes(); int numObservances = standards.size() + daylights.size(); List<Observance> sortedObservances = new ArrayList<Observance>...
[ "private", "List", "<", "Observance", ">", "calculateSortedObservances", "(", ")", "{", "List", "<", "DaylightSavingsTime", ">", "daylights", "=", "component", ".", "getDaylightSavingsTime", "(", ")", ";", "List", "<", "StandardTime", ">", "standards", "=", "com...
Builds a list of all the observances in the VTIMEZONE component, sorted by DTSTART. @return the sorted observances
[ "Builds", "a", "list", "of", "all", "the", "observances", "in", "the", "VTIMEZONE", "component", "sorted", "by", "DTSTART", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/ICalTimeZone.java#L106-L135
train
mangstadt/biweekly
src/main/java/biweekly/io/ICalTimeZone.java
ICalTimeZone.getObservanceBoundary
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.get(Calendar.MINUTE); int ...
java
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.get(Calendar.MINUTE); int ...
[ "public", "Boundary", "getObservanceBoundary", "(", "Date", "date", ")", "{", "utcCalendar", ".", "setTime", "(", "date", ")", ";", "int", "year", "=", "utcCalendar", ".", "get", "(", "Calendar", ".", "YEAR", ")", ";", "int", "month", "=", "utcCalendar", ...
Gets the timezone information of a date. @param date the date @return the timezone information
[ "Gets", "the", "timezone", "information", "of", "a", "date", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/ICalTimeZone.java#L263-L273
train
mangstadt/biweekly
src/main/java/biweekly/io/ICalTimeZone.java
ICalTimeZone.getObservanceBoundary
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; DateValue clos...
java
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; DateValue clos...
[ "private", "Boundary", "getObservanceBoundary", "(", "int", "year", ",", "int", "month", ",", "int", "day", ",", "int", "hour", ",", "int", "minute", ",", "int", "second", ")", "{", "if", "(", "sortedObservances", ".", "isEmpty", "(", ")", ")", "{", "r...
Gets the observance information of a date. @param year the year @param month the month (1-12) @param day the day of the month @param hour the hour @param minute the minute @param second the second @return the observance information or null if none was found
[ "Gets", "the", "observance", "information", "of", "a", "date", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/ICalTimeZone.java#L325-L376
train
mangstadt/biweekly
src/main/java/biweekly/io/ICalTimeZone.java
ICalTimeZone.getObservanceDateClosestToTheGivenDate
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); } if (dat...
java
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); } if (dat...
[ "private", "DateValue", "getObservanceDateClosestToTheGivenDate", "(", "Observance", "observance", ",", "DateValue", "givenDate", ",", "boolean", "after", ")", "{", "List", "<", "DateValue", ">", "dateCache", "=", "observanceDateCache", ".", "get", "(", "observance", ...
Iterates through each of the timezone boundary dates defined by the given observance and finds the date that comes closest to the given date. @param observance the observance @param givenDate the given date @param after true to return the closest date <b>greater than</b> the given date, false to return the closest date...
[ "Iterates", "through", "each", "of", "the", "timezone", "boundary", "dates", "defined", "by", "the", "given", "observance", "and", "finds", "the", "date", "that", "comes", "closest", "to", "the", "given", "date", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/ICalTimeZone.java#L388-L489
train
mangstadt/biweekly
src/main/java/biweekly/io/ICalTimeZone.java
ICalTimeZone.createIterator
RecurrenceIterator createIterator(Observance observance) { List<RecurrenceIterator> inclusions = new ArrayList<RecurrenceIterator>(); List<RecurrenceIterator> exclusions = new ArrayList<RecurrenceIterator>(); ICalDate dtstart = getValue(observance.getDateStart()); if (dtstart != null) { DateValue dtstartVal...
java
RecurrenceIterator createIterator(Observance observance) { List<RecurrenceIterator> inclusions = new ArrayList<RecurrenceIterator>(); List<RecurrenceIterator> exclusions = new ArrayList<RecurrenceIterator>(); ICalDate dtstart = getValue(observance.getDateStart()); if (dtstart != null) { DateValue dtstartVal...
[ "RecurrenceIterator", "createIterator", "(", "Observance", "observance", ")", "{", "List", "<", "RecurrenceIterator", ">", "inclusions", "=", "new", "ArrayList", "<", "RecurrenceIterator", ">", "(", ")", ";", "List", "<", "RecurrenceIterator", ">", "exclusions", "...
Creates an iterator which iterates over each of the dates in an observance. @param observance the observance @return the iterator
[ "Creates", "an", "iterator", "which", "iterates", "over", "each", "of", "the", "dates", "in", "an", "observance", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/ICalTimeZone.java#L497-L548
train
mangstadt/biweekly
src/main/java/biweekly/component/VJournal.java
VJournal.setClassification
public Classification setClassification(String classification) { Classification prop = (classification == null) ? null : new Classification(classification); setClassification(prop); return prop; }
java
public Classification setClassification(String classification) { Classification prop = (classification == null) ? null : new Classification(classification); setClassification(prop); return prop; }
[ "public", "Classification", "setClassification", "(", "String", "classification", ")", "{", "Classification", "prop", "=", "(", "classification", "==", "null", ")", "?", "null", ":", "new", "Classification", "(", "classification", ")", ";", "setClassification", "(...
Sets the level of sensitivity of the journal entry. If not specified, the data within the journal entry should be considered "public". @param classification the classification level (e.g. "CONFIDENTIAL") or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-82">RF...
[ "Sets", "the", "level", "of", "sensitivity", "of", "the", "journal", "entry", ".", "If", "not", "specified", "the", "data", "within", "the", "journal", "entry", "should", "be", "considered", "public", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L255-L259
train
mangstadt/biweekly
src/main/java/biweekly/component/VJournal.java
VJournal.setCreated
public Created setCreated(Date created) { Created prop = (created == null) ? null : new Created(created); setCreated(prop); return prop; }
java
public Created setCreated(Date created) { Created prop = (created == null) ? null : new Created(created); setCreated(prop); return prop; }
[ "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. @param created the creation date-time or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-136">RFC 5545 p.136</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-129">RFC 2445 p.129-30</a>
[ "Sets", "the", "date", "-", "time", "that", "the", "journal", "entry", "was", "initially", "created", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L294-L298
train
mangstadt/biweekly
src/main/java/biweekly/component/VJournal.java
VJournal.setDateStart
public DateStart setDateStart(Date dateStart, boolean hasTime) { DateStart prop = (dateStart == null) ? null : new DateStart(dateStart, hasTime); setDateStart(prop); return prop; }
java
public DateStart setDateStart(Date dateStart, boolean hasTime) { DateStart prop = (dateStart == null) ? null : new DateStart(dateStart, hasTime); setDateStart(prop); return prop; }
[ "public", "DateStart", "setDateStart", "(", "Date", "dateStart", ",", "boolean", "hasTime", ")", "{", "DateStart", "prop", "=", "(", "dateStart", "==", "null", ")", "?", "null", ":", "new", "DateStart", "(", "dateStart", ",", "hasTime", ")", ";", "setDateS...
Sets the date that the journal entry starts. @param dateStart the start date or null to remove @param hasTime true if the date has a time component, false if it is strictly a date (if false, the given Date object should be created by a {@link java.util.Calendar Calendar} object that uses the JVM's default timezone) @re...
[ "Sets", "the", "date", "that", "the", "journal", "entry", "starts", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L350-L354
train
mangstadt/biweekly
src/main/java/biweekly/component/VJournal.java
VJournal.setLastModified
public LastModified setLastModified(Date lastModified) { LastModified prop = (lastModified == null) ? null : new LastModified(lastModified); setLastModified(prop); return prop; }
java
public LastModified setLastModified(Date lastModified) { LastModified prop = (lastModified == null) ? null : new LastModified(lastModified); setLastModified(prop); return prop; }
[ "public", "LastModified", "setLastModified", "(", "Date", "lastModified", ")", "{", "LastModified", "prop", "=", "(", "lastModified", "==", "null", ")", "?", "null", ":", "new", "LastModified", "(", "lastModified", ")", ";", "setLastModified", "(", "prop", ")"...
Sets the date-time that the journal entry was last changed. @param lastModified the last modified date or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-138">RFC 5545 p.138</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-131">RFC 2445 p.131</a>
[ "Sets", "the", "date", "-", "time", "that", "the", "journal", "entry", "was", "last", "changed", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L389-L393
train
mangstadt/biweekly
src/main/java/biweekly/component/VJournal.java
VJournal.setOrganizer
public Organizer setOrganizer(String email) { Organizer prop = (email == null) ? null : new Organizer(null, email); setOrganizer(prop); return prop; }
java
public Organizer setOrganizer(String email) { Organizer prop = (email == null) ? null : new Organizer(null, email); setOrganizer(prop); return prop; }
[ "public", "Organizer", "setOrganizer", "(", "String", "email", ")", "{", "Organizer", "prop", "=", "(", "email", "==", "null", ")", "?", "null", ":", "new", "Organizer", "(", "null", ",", "email", ")", ";", "setOrganizer", "(", "prop", ")", ";", "retur...
Sets the organizer of the journal entry. @param email the organizer's email address (e.g. "johndoe@example.com") or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-111">RFC 5545 p.111-2</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-106">RFC 2445 p.1...
[ "Sets", "the", "organizer", "of", "the", "journal", "entry", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L429-L433
train
mangstadt/biweekly
src/main/java/biweekly/component/VJournal.java
VJournal.setSequence
public Sequence setSequence(Integer sequence) { Sequence prop = (sequence == null) ? null : new Sequence(sequence); setSequence(prop); return prop; }
java
public Sequence setSequence(Integer sequence) { Sequence prop = (sequence == null) ? null : new Sequence(sequence); setSequence(prop); return prop; }
[ "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. @param sequence the sequence number @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-138">RFC 5545 p.138-9</a> @see <a href="http://tools.iet...
[ "Sets", "the", "revision", "number", "of", "the", "journal", "entry", ".", "The", "organizer", "can", "increment", "this", "number", "every", "time", "he", "or", "she", "makes", "a", "significant", "change", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L519-L523
train
mangstadt/biweekly
src/main/java/biweekly/component/VJournal.java
VJournal.setUrl
public Url setUrl(String url) { Url prop = (url == null) ? null : new Url(url); setUrl(prop); return prop; }
java
public Url setUrl(String url) { Url prop = (url == null) ? null : new Url(url); setUrl(prop); return prop; }
[ "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. @param url the URL (e.g. "http://example.com/resource.ics") or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-116">RFC 5545 p.116-7</a> @see <a href="http://tools.ietf.org/h...
[ "Sets", "a", "URL", "to", "a", "resource", "that", "contains", "additional", "information", "about", "the", "journal", "entry", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L652-L656
train
mangstadt/biweekly
src/main/java/biweekly/component/VJournal.java
VJournal.setRecurrenceRule
public RecurrenceRule setRecurrenceRule(Recurrence recur) { RecurrenceRule prop = (recur == null) ? null : new RecurrenceRule(recur); setRecurrenceRule(prop); return prop; }
java
public RecurrenceRule setRecurrenceRule(Recurrence recur) { RecurrenceRule prop = (recur == null) ? null : new RecurrenceRule(recur); setRecurrenceRule(prop); return prop; }
[ "public", "RecurrenceRule", "setRecurrenceRule", "(", "Recurrence", "recur", ")", "{", "RecurrenceRule", "prop", "=", "(", "recur", "==", "null", ")", "?", "null", ":", "new", "RecurrenceRule", "(", "recur", ")", ";", "setRecurrenceRule", "(", "prop", ")", "...
Sets how often the journal entry repeats. @param recur the recurrence rule or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-122">RFC 5545 p.122-32</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-117">RFC 2445 p.117-25</a>
[ "Sets", "how", "often", "the", "journal", "entry", "repeats", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L679-L683
train
mangstadt/biweekly
src/main/java/biweekly/component/VJournal.java
VJournal.addComment
public Comment addComment(String comment) { Comment prop = new Comment(comment); addComment(prop); return prop; }
java
public Comment addComment(String comment) { Comment prop = new Comment(comment); addComment(prop); return prop; }
[ "public", "Comment", "addComment", "(", "String", "comment", ")", "{", "Comment", "prop", "=", "new", "Comment", "(", "comment", ")", ";", "addComment", "(", "prop", ")", ";", "return", "prop", ";", "}" ]
Adds a comment to the journal entry. @param comment the comment to add @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-83">RFC 5545 p.83-4</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-80">RFC 2445 p.80-1</a>
[ "Adds", "a", "comment", "to", "the", "journal", "entry", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L852-L856
train
mangstadt/biweekly
src/main/java/biweekly/component/VJournal.java
VJournal.addRelatedTo
public RelatedTo addRelatedTo(String uid) { RelatedTo prop = new RelatedTo(uid); addRelatedTo(prop); return prop; }
java
public RelatedTo addRelatedTo(String uid) { RelatedTo prop = new RelatedTo(uid); addRelatedTo(prop); return prop; }
[ "public", "RelatedTo", "addRelatedTo", "(", "String", "uid", ")", "{", "RelatedTo", "prop", "=", "new", "RelatedTo", "(", "uid", ")", ";", "addRelatedTo", "(", "prop", ")", ";", "return", "prop", ";", "}" ]
Adds a component that the journal entry is related to. @param uid the UID of the other component @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-115">RFC 5545 p.115-6</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-109-10">RFC 2445 p.109-10</a>
[ "Adds", "a", "component", "that", "the", "journal", "entry", "is", "related", "to", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VJournal.java#L1016-L1020
train
mangstadt/biweekly
src/main/java/biweekly/util/StringUtils.java
StringUtils.repeat
public static void repeat(char c, int count, StringBuilder sb) { for (int i = 0; i < count; i++) { sb.append(c); } }
java
public static void repeat(char c, int count, StringBuilder sb) { for (int i = 0; i < count; i++) { sb.append(c); } }
[ "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". @param c the character to repeat @param count the number of times to repeat the character @param sb the character sequence to append the characters to
[ "Creates", "a", "string", "consisting", "of", "count", "occurrences", "of", "char", "c", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/StringUtils.java#L83-L87
train
mangstadt/biweekly
src/main/java/biweekly/component/VTimezone.java
VTimezone.setTimezoneUrl
public TimezoneUrl setTimezoneUrl(String url) { TimezoneUrl prop = (url == null) ? null : new TimezoneUrl(url); setTimezoneUrl(prop); return prop; }
java
public TimezoneUrl setTimezoneUrl(String url) { TimezoneUrl prop = (url == null) ? null : new TimezoneUrl(url); setTimezoneUrl(prop); return prop; }
[ "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. @param url the timezone URL (e.g. "http://example.com/America-New_York.ics") or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-106">RFC 5545 p.106</a>...
[ "Sets", "the", "timezone", "URL", "which", "points", "to", "an", "iCalendar", "object", "that", "contains", "further", "information", "on", "the", "timezone", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VTimezone.java#L206-L210
train
mangstadt/biweekly
src/main/java/biweekly/property/Trigger.java
Trigger.setDuration
public void setDuration(Duration duration, Related related) { this.date = null; this.duration = duration; setRelated(related); }
java
public void setDuration(Duration duration, Related related) { this.date = null; this.duration = duration; setRelated(related); }
[ "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. @param duration the relative time @param related the date-time field that the duration is relative to
[ "Sets", "a", "relative", "time", "at", "which", "the", "alarm", "will", "trigger", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/property/Trigger.java#L103-L107
train
mangstadt/biweekly
src/main/java/biweekly/property/EnumProperty.java
EnumProperty.getValueSupportedVersions
protected Collection<ICalVersion> getValueSupportedVersions() { return (value == null) ? Collections.<ICalVersion> emptyList() : Arrays.asList(ICalVersion.values()); }
java
protected Collection<ICalVersion> getValueSupportedVersions() { return (value == null) ? Collections.<ICalVersion> emptyList() : Arrays.asList(ICalVersion.values()); }
[ "protected", "Collection", "<", "ICalVersion", ">", "getValueSupportedVersions", "(", ")", "{", "return", "(", "value", "==", "null", ")", "?", "Collections", ".", "<", "ICalVersion", ">", "emptyList", "(", ")", ":", "Arrays", ".", "asList", "(", "ICalVersio...
Gets the iCalendar versions that this property's value is supported in. Meant to be overridden by the child class. @return the supported versions
[ "Gets", "the", "iCalendar", "versions", "that", "this", "property", "s", "value", "is", "supported", "in", ".", "Meant", "to", "be", "overridden", "by", "the", "child", "class", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/property/EnumProperty.java#L80-L82
train
mangstadt/biweekly
src/main/java/biweekly/component/VEvent.java
VEvent.setLocation
public Location setLocation(String location) { Location prop = (location == null) ? null : new Location(location); setLocation(prop); return prop; }
java
public Location setLocation(String location) { Location prop = (location == null) ? null : new Location(location); setLocation(prop); return prop; }
[ "public", "Location", "setLocation", "(", "String", "location", ")", "{", "Location", "prop", "=", "(", "location", "==", "null", ")", "?", "null", ":", "new", "Location", "(", "location", ")", ";", "setLocation", "(", "prop", ")", ";", "return", "prop",...
Sets the physical location of the event. @param location the location (e.g. "Room 101") or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-87">RFC 5545 p.87-8</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-84">RFC 2445 p.84</a> @see <a href="http://w...
[ "Sets", "the", "physical", "location", "of", "the", "event", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VEvent.java#L443-L447
train
mangstadt/biweekly
src/main/java/biweekly/component/VEvent.java
VEvent.setPriority
public Priority setPriority(Integer priority) { Priority prop = (priority == null) ? null : new Priority(priority); setPriority(prop); return prop; }
java
public Priority setPriority(Integer priority) { Priority prop = (priority == null) ? null : new Priority(priority); setPriority(prop); return prop; }
[ "public", "Priority", "setPriority", "(", "Integer", "priority", ")", "{", "Priority", "prop", "=", "(", "priority", "==", "null", ")", "?", "null", ":", "new", "Priority", "(", "priority", ")", ";", "setPriority", "(", "prop", ")", ";", "return", "prop"...
Sets the priority of the event. @param priority the priority ("0" is undefined, "1" is the highest, "9" is the lowest) or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-89">RFC 5545 p.89-90</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-85">RFC 2445...
[ "Sets", "the", "priority", "of", "the", "event", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VEvent.java#L486-L490
train
mangstadt/biweekly
src/main/java/biweekly/component/VEvent.java
VEvent.addResources
public Resources addResources(String... resources) { Resources prop = new Resources(resources); addResources(prop); return prop; }
java
public Resources addResources(String... resources) { Resources prop = new Resources(resources); addResources(prop); return prop; }
[ "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. @param resources the resources to add (e.g. "easel", "projector") @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-91">RFC 5545 p.91</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-87">RFC 2445 p.87-8</a> @see <...
[ "Adds", "a", "list", "of", "resources", "that", "are", "needed", "for", "the", "event", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VEvent.java#L1402-L1406
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalRawReader.java
JCalRawReader.readNext
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 = pars...
java
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 = pars...
[ "public", "void", "readNext", "(", "JCalDataStreamListener", "listener", ")", "throws", "IOException", "{", "if", "(", "parser", "==", "null", ")", "{", "JsonFactory", "factory", "=", "new", "JsonFactory", "(", ")", ";", "parser", "=", "factory", ".", "creat...
Reads the next iCalendar object from the jCal data stream. @param listener handles the iCalendar data as it is read off the wire @throws JCalParseException if the jCal syntax is incorrect (the JSON syntax may be valid, but it is not in the correct jCal format). @throws JsonParseException if the JSON syntax is incorrect...
[ "Reads", "the", "next", "iCalendar", "object", "from", "the", "jCal", "data", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalRawReader.java#L96-L140
train
mangstadt/biweekly
src/main/java/biweekly/io/chain/ChainingParser.java
ChainingParser.first
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(...
java
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(...
[ "public", "ICalendar", "first", "(", ")", "throws", "IOException", "{", "StreamReader", "reader", "=", "constructReader", "(", ")", ";", "if", "(", "index", "!=", "null", ")", "{", "reader", ".", "setScribeIndex", "(", "index", ")", ";", "}", "try", "{",...
Reads the first iCalendar object from the stream. @return the iCalendar object or null if there are none @throws IOException if there's an I/O problem
[ "Reads", "the", "first", "iCalendar", "object", "from", "the", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/chain/ChainingParser.java#L134-L151
train
mangstadt/biweekly
src/main/java/biweekly/io/chain/ChainingParser.java
ChainingParser.all
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) { war...
java
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) { war...
[ "public", "List", "<", "ICalendar", ">", "all", "(", ")", "throws", "IOException", "{", "StreamReader", "reader", "=", "constructReader", "(", ")", ";", "if", "(", "index", "!=", "null", ")", "{", "reader", ".", "setScribeIndex", "(", "index", ")", ";", ...
Reads all iCalendar objects from the stream. @return the parsed iCalendar objects @throws IOException if there's an I/O problem
[ "Reads", "all", "iCalendar", "objects", "from", "the", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/chain/ChainingParser.java#L158-L179
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/Filters.java
Filters.weekIntervalFilter
static Predicate<DateValue> weekIntervalFilter(final int interval, final DayOfWeek weekStart, final DateValue dtStart) { return new Predicate<DateValue>() { private static final long serialVersionUID = 7059994888520369846L; //the latest day with day of week weekStart on or before dtStart DateValue wkStart; ...
java
static Predicate<DateValue> weekIntervalFilter(final int interval, final DayOfWeek weekStart, final DateValue dtStart) { return new Predicate<DateValue>() { private static final long serialVersionUID = 7059994888520369846L; //the latest day with day of week weekStart on or before dtStart DateValue wkStart; ...
[ "static", "Predicate", "<", "DateValue", ">", "weekIntervalFilter", "(", "final", "int", "interval", ",", "final", "DayOfWeek", "weekStart", ",", "final", "DateValue", "dtStart", ")", "{", "return", "new", "Predicate", "<", "DateValue", ">", "(", ")", "{", "...
Constructs a filter that accepts only every X week starting from the week containing the given date. @param interval the interval (for example, 3 for "every third week"; must be &gt; 0) @param weekStart the day of the week that the week starts on @param dtStart the filter will start at the week that contains this date ...
[ "Constructs", "a", "filter", "that", "accepts", "only", "every", "X", "week", "starting", "from", "the", "week", "containing", "the", "given", "date", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/Filters.java#L180-L201
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/Filters.java
Filters.byHourFilter
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 static fi...
java
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 static fi...
[ "static", "Predicate", "<", "DateValue", ">", "byHourFilter", "(", "int", "[", "]", "hours", ")", "{", "int", "hoursByBit", "=", "0", ";", "for", "(", "int", "hour", ":", "hours", ")", "{", "hoursByBit", "|=", "1", "<<", "hour", ";", "}", "if", "("...
Constructs an hour filter based on a BYHOUR rule. @param hours hours of the day (values must be in range [0,23]) @return the filter
[ "Constructs", "an", "hour", "filter", "based", "on", "a", "BYHOUR", "rule", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/Filters.java#L211-L231
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalElement.java
XCalElement.first
public String first(ICalDataType dataType) { String dataTypeStr = toLocalName(dataType); return first(dataTypeStr); }
java
public String first(ICalDataType dataType) { String dataTypeStr = toLocalName(dataType); return first(dataTypeStr); }
[ "public", "String", "first", "(", "ICalDataType", "dataType", ")", "{", "String", "dataTypeStr", "=", "toLocalName", "(", "dataType", ")", ";", "return", "first", "(", "dataTypeStr", ")", ";", "}" ]
Gets the first value of the given data type. @param dataType the data type to look for or null for the "unknown" data type @return the value or null if not found
[ "Gets", "the", "first", "value", "of", "the", "given", "data", "type", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalElement.java#L63-L66
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalElement.java
XCalElement.first
public String first(String localName) { for (Element child : children()) { if (localName.equals(child.getLocalName()) && XCAL_NS.equals(child.getNamespaceURI())) { return child.getTextContent(); } } return null; }
java
public String first(String localName) { for (Element child : children()) { if (localName.equals(child.getLocalName()) && XCAL_NS.equals(child.getNamespaceURI())) { return child.getTextContent(); } } return null; }
[ "public", "String", "first", "(", "String", "localName", ")", "{", "for", "(", "Element", "child", ":", "children", "(", ")", ")", "{", "if", "(", "localName", ".", "equals", "(", "child", ".", "getLocalName", "(", ")", ")", "&&", "XCAL_NS", ".", "eq...
Gets the value of the first child element with the given name. @param localName the name of the element @return the element's text or null if not found
[ "Gets", "the", "value", "of", "the", "first", "child", "element", "with", "the", "given", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalElement.java#L73-L80
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalElement.java
XCalElement.all
public List<String> all(ICalDataType dataType) { String dataTypeStr = toLocalName(dataType); return all(dataTypeStr); }
java
public List<String> all(ICalDataType dataType) { String dataTypeStr = toLocalName(dataType); return all(dataTypeStr); }
[ "public", "List", "<", "String", ">", "all", "(", "ICalDataType", "dataType", ")", "{", "String", "dataTypeStr", "=", "toLocalName", "(", "dataType", ")", ";", "return", "all", "(", "dataTypeStr", ")", ";", "}" ]
Gets all the values of a given data type. @param dataType the data type to look for or null for the "unknown" data type @return the values
[ "Gets", "all", "the", "values", "of", "a", "given", "data", "type", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalElement.java#L88-L91
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalElement.java
XCalElement.all
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.add(text); } } return chil...
java
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.add(text); } } return chil...
[ "public", "List", "<", "String", ">", "all", "(", "String", "localName", ")", "{", "List", "<", "String", ">", "childrenText", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "Element", "child", ":", "children", "(", ")", ")",...
Gets the values of all child elements that have the given name. @param localName the element name @return the values of the child elements
[ "Gets", "the", "values", "of", "all", "child", "elements", "that", "have", "the", "given", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalElement.java#L98-L107
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalElement.java
XCalElement.append
public Element append(ICalDataType dataType, String value) { String dataTypeStr = toLocalName(dataType); return append(dataTypeStr, value); }
java
public Element append(ICalDataType dataType, String value) { String dataTypeStr = toLocalName(dataType); return append(dataTypeStr, value); }
[ "public", "Element", "append", "(", "ICalDataType", "dataType", ",", "String", "value", ")", "{", "String", "dataTypeStr", "=", "toLocalName", "(", "dataType", ")", ";", "return", "append", "(", "dataTypeStr", ",", "value", ")", ";", "}" ]
Adds a value. @param dataType the data type or null for the "unknown" data type @param value the value @return the created element
[ "Adds", "a", "value", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalElement.java#L115-L118
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalElement.java
XCalElement.append
public Element append(String name, String value) { Element child = document.createElementNS(XCAL_NS, name); child.setTextContent(value); element.appendChild(child); return child; }
java
public Element append(String name, String value) { Element child = document.createElementNS(XCAL_NS, name); child.setTextContent(value); element.appendChild(child); return child; }
[ "public", "Element", "append", "(", "String", "name", ",", "String", "value", ")", "{", "Element", "child", "=", "document", ".", "createElementNS", "(", "XCAL_NS", ",", "name", ")", ";", "child", ".", "setTextContent", "(", "value", ")", ";", "element", ...
Adds a child element. @param name the name of the child element @param value the value of the child element. @return the created element
[ "Adds", "a", "child", "element", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalElement.java#L126-L131
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalElement.java
XCalElement.append
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; }
java
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; }
[ "public", "List", "<", "Element", ">", "append", "(", "String", "name", ",", "Collection", "<", "String", ">", "values", ")", "{", "List", "<", "Element", ">", "elements", "=", "new", "ArrayList", "<", "Element", ">", "(", "values", ".", "size", "(", ...
Adds multiple child elements, each with the same name. @param name the name for all the child elements @param values the values of each child element @return the created elements
[ "Adds", "multiple", "child", "elements", "each", "with", "the", "same", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalElement.java#L157-L163
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalElement.java
XCalElement.children
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.getNamespaceURI())) { children.add...
java
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.getNamespaceURI())) { children.add...
[ "public", "List", "<", "XCalElement", ">", "children", "(", "ICalDataType", "dataType", ")", "{", "String", "localName", "=", "dataType", ".", "getName", "(", ")", ".", "toLowerCase", "(", ")", ";", "List", "<", "XCalElement", ">", "children", "=", "new", ...
Gets all child elements with the given data type. @param dataType the data type @return the child elements
[ "Gets", "all", "child", "elements", "with", "the", "given", "data", "type", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalElement.java#L194-L203
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalElement.java
XCalElement.child
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; }
java
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; }
[ "public", "XCalElement", "child", "(", "ICalDataType", "dataType", ")", "{", "String", "localName", "=", "dataType", ".", "getName", "(", ")", ".", "toLowerCase", "(", ")", ";", "for", "(", "Element", "child", ":", "children", "(", ")", ")", "{", "if", ...
Gets the first child element with the given data type. @param dataType the data type @return the child element or null if not found
[ "Gets", "the", "first", "child", "element", "with", "the", "given", "data", "type", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalElement.java#L210-L218
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalWriter.java
XCalWriter.close
public void close() throws IOException { try { if (!started) { handler.startDocument(); if (!icalendarElementExists) { //don't output a <icalendar> element if the parent is a <icalendar> element start(ICALENDAR); } } if (!icalendarElementExists) { end(ICALENDAR); } handler.e...
java
public void close() throws IOException { try { if (!started) { handler.startDocument(); if (!icalendarElementExists) { //don't output a <icalendar> element if the parent is a <icalendar> element start(ICALENDAR); } } if (!icalendarElementExists) { end(ICALENDAR); } handler.e...
[ "public", "void", "close", "(", ")", "throws", "IOException", "{", "try", "{", "if", "(", "!", "started", ")", "{", "handler", ".", "startDocument", "(", ")", ";", "if", "(", "!", "icalendarElementExists", ")", "{", "//don't output a <icalendar> element if the...
Terminates the XML document and closes the output stream.
[ "Terminates", "the", "XML", "document", "and", "closes", "the", "output", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalWriter.java#L516-L538
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalRawWriter.java
JCalRawWriter.writeStartComponent
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 = true;...
java
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 = true;...
[ "public", "void", "writeStartComponent", "(", "String", "componentName", ")", "throws", "IOException", "{", "if", "(", "generator", "==", "null", ")", "{", "init", "(", ")", ";", "}", "componentEnded", "=", "false", ";", "if", "(", "!", "stack", ".", "is...
Writes the beginning of a new component array. @param componentName the component name (e.g. "vevent") @throws IOException if there's an I/O problem
[ "Writes", "the", "beginning", "of", "a", "new", "component", "array", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalRawWriter.java#L116-L140
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalRawWriter.java
JCalRawWriter.writeEndComponent
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.wroteStartSubComponentsArray) { generato...
java
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.wroteStartSubComponentsArray) { generato...
[ "public", "void", "writeEndComponent", "(", ")", "throws", "IOException", "{", "if", "(", "stack", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "Messages", ".", "INSTANCE", ".", "getExceptionMessage", "(", "2", ")", ")", ...
Closes the current component array. @throws IllegalStateException if there are no open components ( {@link #writeStartComponent(String)} must be called first) @throws IOException if there's an I/O problem
[ "Closes", "the", "current", "component", "array", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalRawWriter.java#L148-L165
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalRawWriter.java
JCalRawWriter.closeJsonStream
public void closeJsonStream() throws IOException { if (generator == null) { return; } while (!stack.isEmpty()) { writeEndComponent(); } if (wrapInArray) { generator.writeEndArray(); } if (closeGenerator) { generator.close(); } }
java
public void closeJsonStream() throws IOException { if (generator == null) { return; } while (!stack.isEmpty()) { writeEndComponent(); } if (wrapInArray) { generator.writeEndArray(); } if (closeGenerator) { generator.close(); } }
[ "public", "void", "closeJsonStream", "(", ")", "throws", "IOException", "{", "if", "(", "generator", "==", "null", ")", "{", "return", ";", "}", "while", "(", "!", "stack", ".", "isEmpty", "(", ")", ")", "{", "writeEndComponent", "(", ")", ";", "}", ...
Finishes writing the JSON document so that it is syntactically correct. No more data can be written once this method is called. @throws IOException if there's a problem closing the stream
[ "Finishes", "writing", "the", "JSON", "document", "so", "that", "it", "is", "syntactically", "correct", ".", "No", "more", "data", "can", "be", "written", "once", "this", "method", "is", "called", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalRawWriter.java#L308-L324
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/InstanceGenerators.java
InstanceGenerators.serialInstanceGenerator
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(hourGenerator, mi...
java
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(hourGenerator, mi...
[ "static", "Generator", "serialInstanceGenerator", "(", "final", "Predicate", "<", "?", "super", "DateValue", ">", "filter", ",", "final", "Generator", "yearGenerator", ",", "final", "Generator", "monthGenerator", ",", "final", "Generator", "dayGenerator", ",", "fina...
A collector that yields each date in the period without doing any set collecting.
[ "A", "collector", "that", "yields", "each", "date", "in", "the", "period", "without", "doing", "any", "set", "collecting", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/InstanceGenerators.java#L64-L124
train
mangstadt/biweekly
src/main/java/biweekly/property/ICalProperty.java
ICalProperty.setParameters
public void setParameters(ICalParameters parameters) { if (parameters == null) { throw new NullPointerException(Messages.INSTANCE.getExceptionMessage(16)); } this.parameters = parameters; }
java
public void setParameters(ICalParameters parameters) { if (parameters == null) { throw new NullPointerException(Messages.INSTANCE.getExceptionMessage(16)); } this.parameters = parameters; }
[ "public", "void", "setParameters", "(", "ICalParameters", "parameters", ")", "{", "if", "(", "parameters", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "Messages", ".", "INSTANCE", ".", "getExceptionMessage", "(", "16", ")", ")", ";", ...
Sets the property's parameters @param parameters the parameters (cannot be null)
[ "Sets", "the", "property", "s", "parameters" ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/property/ICalProperty.java#L76-L81
train
mangstadt/biweekly
src/main/java/biweekly/property/ICalProperty.java
ICalProperty.getParameters
public List<String> getParameters(String name) { return Collections.unmodifiableList(parameters.get(name)); }
java
public List<String> getParameters(String name) { return Collections.unmodifiableList(parameters.get(name)); }
[ "public", "List", "<", "String", ">", "getParameters", "(", "String", "name", ")", "{", "return", "Collections", ".", "unmodifiableList", "(", "parameters", ".", "get", "(", "name", ")", ")", ";", "}" ]
Gets all values of a parameter with the given name. @param name the parameter name (case insensitive, e.g. "LANGUAGE") @return the parameter values (this list is immutable)
[ "Gets", "all", "values", "of", "a", "parameter", "with", "the", "given", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/property/ICalProperty.java#L97-L99
train
mangstadt/biweekly
src/main/java/biweekly/property/ICalProperty.java
ICalProperty.setParameter
public void setParameter(String name, Collection<String> values) { parameters.replace(name, values); }
java
public void setParameter(String name, Collection<String> values) { parameters.replace(name, values); }
[ "public", "void", "setParameter", "(", "String", "name", ",", "Collection", "<", "String", ">", "values", ")", "{", "parameters", ".", "replace", "(", "name", ",", "values", ")", ";", "}" ]
Replaces all existing values of a parameter with the given values. @param name the parameter name (case insensitive, e.g. "LANGUAGE") @param values the parameter values
[ "Replaces", "all", "existing", "values", "of", "a", "parameter", "with", "the", "given", "values", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/property/ICalProperty.java#L124-L126
train
mangstadt/biweekly
src/main/java/biweekly/component/VTodo.java
VTodo.setCompleted
public Completed setCompleted(Date completed) { Completed prop = (completed == null) ? null : new Completed(completed); setCompleted(prop); return prop; }
java
public Completed setCompleted(Date completed) { Completed prop = (completed == null) ? null : new Completed(completed); setCompleted(prop); return prop; }
[ "public", "Completed", "setCompleted", "(", "Date", "completed", ")", "{", "Completed", "prop", "=", "(", "completed", "==", "null", ")", "?", "null", ":", "new", "Completed", "(", "completed", ")", ";", "setCompleted", "(", "prop", ")", ";", "return", "...
Sets the date and time that the to-do task was completed. @param completed the completion date or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-94">RFC 5545 p.94-5</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-90">RFC 2445 p.90-1</a> @see <a href=...
[ "Sets", "the", "date", "and", "time", "that", "the", "to", "-", "do", "task", "was", "completed", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VTodo.java#L310-L314
train
mangstadt/biweekly
src/main/java/biweekly/component/VTodo.java
VTodo.setPercentComplete
public PercentComplete setPercentComplete(Integer percent) { PercentComplete prop = (percent == null) ? null : new PercentComplete(percent); setPercentComplete(prop); return prop; }
java
public PercentComplete setPercentComplete(Integer percent) { PercentComplete prop = (percent == null) ? null : new PercentComplete(percent); setPercentComplete(prop); return prop; }
[ "public", "PercentComplete", "setPercentComplete", "(", "Integer", "percent", ")", "{", "PercentComplete", "prop", "=", "(", "percent", "==", "null", ")", "?", "null", ":", "new", "PercentComplete", "(", "percent", ")", ";", "setPercentComplete", "(", "prop", ...
Sets the amount that the to-do task has been completed. @param percent the percent complete (e.g. "50" for 50%) or null to remove @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-88">RFC 5545 p.88-9</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-85">RFC 2445 p.85</a...
[ "Sets", "the", "amount", "that", "the", "to", "-", "do", "task", "has", "been", "completed", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VTodo.java#L646-L650
train
mangstadt/biweekly
src/main/java/biweekly/component/VTodo.java
VTodo.addAttendee
public Attendee addAttendee(String email) { Attendee prop = new Attendee(null, email, null); addAttendee(prop); return prop; }
java
public Attendee addAttendee(String email) { Attendee prop = new Attendee(null, email, null); addAttendee(prop); return prop; }
[ "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. @param email the attendee's email address @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-107">RFC 5545 p.107-9</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-102">RFC 2445 p.102-4</a> @see <a href="http://www.imc.or...
[ "Adds", "a", "person", "who", "is", "involved", "in", "the", "to", "-", "do", "task", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/VTodo.java#L1141-L1145
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java
TimeUtils.add
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(); db.minute += td...
java
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(); db.minute += td...
[ "public", "static", "DateValue", "add", "(", "DateValue", "date", ",", "DateValue", "duration", ")", "{", "DTBuilder", "db", "=", "new", "DTBuilder", "(", "date", ")", ";", "db", ".", "year", "+=", "duration", ".", "year", "(", ")", ";", "db", ".", "...
Adds a duration to a date. @param date the date @param duration the duration to add to the date @return the result
[ "Adds", "a", "duration", "to", "a", "date", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java#L148-L161
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java
TimeUtils.daysBetween
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); }
java
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); }
[ "public", "static", "int", "daysBetween", "(", "int", "year1", ",", "int", "month1", ",", "int", "day1", ",", "int", "year2", ",", "int", "month2", ",", "int", "day2", ")", "{", "return", "fixedFromGregorian", "(", "year1", ",", "month1", ",", "day1", ...
Calculates the number of days between two dates. @param year1 the year of the first date @param month1 the month of the first date @param day1 the day of the first date @param year2 the year of the second date @param month2 the month of the second date @param day2 the day of the second date @return the number of days
[ "Calculates", "the", "number", "of", "days", "between", "two", "dates", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java#L183-L185
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java
TimeUtils.dayOfWeek
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]; }
java
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]; }
[ "public", "static", "DayOfWeek", "dayOfWeek", "(", "DateValue", "date", ")", "{", "int", "dayIndex", "=", "fixedFromGregorian", "(", "date", ".", "year", "(", ")", ",", "date", ".", "month", "(", ")", ",", "date", ".", "day", "(", ")", ")", "%", "7",...
Gets the day of the week the given date falls on. @param date the date @return the day of the week
[ "Gets", "the", "day", "of", "the", "week", "the", "given", "date", "falls", "on", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java#L294-L300
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java
TimeUtils.firstDayOfWeekInMonth
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]; }
java
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]; }
[ "public", "static", "DayOfWeek", "firstDayOfWeekInMonth", "(", "int", "year", ",", "int", "month", ")", "{", "int", "result", "=", "fixedFromGregorian", "(", "year", ",", "month", ",", "1", ")", "%", "7", ";", "if", "(", "result", "<", "0", ")", "{", ...
Gets the day of the week of the first day in the given month. @param year the year @param month the month (1-12) @return the day of the week
[ "Gets", "the", "day", "of", "the", "week", "of", "the", "first", "day", "in", "the", "given", "month", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java#L308-L314
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java
TimeUtils.timeFromSecsSinceEpoch
public static DateTimeValue timeFromSecsSinceEpoch(long secsSinceEpoch) { // TODO: should we handle -ve years? int secsInDay = (int) (secsSinceEpoch % SECS_PER_DAY); int daysSinceEpoch = (int) (secsSinceEpoch / SECS_PER_DAY); int approx = (int) ((daysSinceEpoch + 10) * 400L / 146097); int year = (daysSinceEpo...
java
public static DateTimeValue timeFromSecsSinceEpoch(long secsSinceEpoch) { // TODO: should we handle -ve years? int secsInDay = (int) (secsSinceEpoch % SECS_PER_DAY); int daysSinceEpoch = (int) (secsSinceEpoch / SECS_PER_DAY); int approx = (int) ((daysSinceEpoch + 10) * 400L / 146097); int year = (daysSinceEpo...
[ "public", "static", "DateTimeValue", "timeFromSecsSinceEpoch", "(", "long", "secsSinceEpoch", ")", "{", "// TODO: should we handle -ve years?", "int", "secsInDay", "=", "(", "int", ")", "(", "secsSinceEpoch", "%", "SECS_PER_DAY", ")", ";", "int", "daysSinceEpoch", "="...
Computes the gregorian time from the number of seconds since the Proleptic Gregorian Epoch. See "Calendrical Calculations", Reingold and Dershowitz. @param secsSinceEpoch the number of seconds since the epoch @return the gregorian time
[ "Computes", "the", "gregorian", "time", "from", "the", "number", "of", "seconds", "since", "the", "Proleptic", "Gregorian", "Epoch", ".", "See", "Calendrical", "Calculations", "Reingold", "and", "Dershowitz", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/util/TimeUtils.java#L323-L344
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/util/Predicates.java
Predicates.and
@SuppressWarnings("unchecked") public static <T> Predicate<T> and(Collection<Predicate<? super T>> components) { return and(components.toArray(new Predicate[0])); }
java
@SuppressWarnings("unchecked") public static <T> Predicate<T> and(Collection<Predicate<? super T>> components) { return and(components.toArray(new Predicate[0])); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Predicate", "<", "T", ">", "and", "(", "Collection", "<", "Predicate", "<", "?", "super", "T", ">", ">", "components", ")", "{", "return", "and", "(", "components", ...
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. @param components the predicates to evaluate @param <T> the input type @return the resultant predicate
[ "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", "a...
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/util/Predicates.java#L114-L117
train
mangstadt/biweekly
src/main/java/biweekly/property/RecurrenceProperty.java
RecurrenceProperty.getDateIterator
public DateIterator getDateIterator(ICalDate startDate, TimeZone timezone) { Recurrence recur = getValue(); return (recur == null) ? new Google2445Utils.EmptyDateIterator() : recur.getDateIterator(startDate, timezone); }
java
public DateIterator getDateIterator(ICalDate startDate, TimeZone timezone) { Recurrence recur = getValue(); return (recur == null) ? new Google2445Utils.EmptyDateIterator() : recur.getDateIterator(startDate, timezone); }
[ "public", "DateIterator", "getDateIterator", "(", "ICalDate", "startDate", ",", "TimeZone", "timezone", ")", "{", "Recurrence", "recur", "=", "getValue", "(", ")", ";", "return", "(", "recur", "==", "null", ")", "?", "new", "Google2445Utils", ".", "EmptyDateIt...
Creates an iterator that computes the dates defined by this property. @param startDate the date that the recurrence starts (typically, the value of the accompanying {@link DateStart} property) @param timezone the timezone to iterate in (typically, the timezone associated with the {@link DateStart} property). This is ne...
[ "Creates", "an", "iterator", "that", "computes", "the", "dates", "defined", "by", "this", "property", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/property/RecurrenceProperty.java#L88-L91
train
mangstadt/biweekly
src/main/java/biweekly/parameter/VersionedEnumParameterValue.java
VersionedEnumParameterValue.isSupported
public boolean isSupported(ICalVersion version) { for (ICalVersion supportedVersion : supportedVersions) { if (supportedVersion == version) { return true; } } return false; }
java
public boolean isSupported(ICalVersion version) { for (ICalVersion supportedVersion : supportedVersions) { if (supportedVersion == version) { return true; } } return false; }
[ "public", "boolean", "isSupported", "(", "ICalVersion", "version", ")", "{", "for", "(", "ICalVersion", "supportedVersion", ":", "supportedVersions", ")", "{", "if", "(", "supportedVersion", "==", "version", ")", "{", "return", "true", ";", "}", "}", "return",...
Determines if the parameter value is supported by the given iCalendar version. @param version the iCalendar version @return true if it is supported, false if not
[ "Determines", "if", "the", "parameter", "value", "is", "supported", "by", "the", "given", "iCalendar", "version", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/parameter/VersionedEnumParameterValue.java#L54-L61
train
mangstadt/biweekly
src/main/java/biweekly/io/StreamWriter.java
StreamWriter.write
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.getName()); } throw Message...
java
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.getName()); } throw Message...
[ "public", "void", "write", "(", "ICalendar", "ical", ")", "throws", "IOException", "{", "Collection", "<", "Class", "<", "?", ">", ">", "unregistered", "=", "findScribeless", "(", "ical", ")", ";", "if", "(", "!", "unregistered", ".", "isEmpty", "(", ")"...
Writes an iCalendar object to the data stream. @param ical the iCalendar object to write @throws IllegalArgumentException if the scribe class for a component or property object cannot be found (only happens when an experimental property/component scribe is not registered with the {@code registerScribe} method.) @throws...
[ "Writes", "an", "iCalendar", "object", "to", "the", "data", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/StreamWriter.java#L71-L84
train
mangstadt/biweekly
src/main/java/biweekly/component/Observance.java
Observance.setTimezoneOffsetTo
public TimezoneOffsetTo setTimezoneOffsetTo(UtcOffset offset) { TimezoneOffsetTo prop = new TimezoneOffsetTo(offset); setTimezoneOffsetTo(prop); return prop; }
java
public TimezoneOffsetTo setTimezoneOffsetTo(UtcOffset offset) { TimezoneOffsetTo prop = new TimezoneOffsetTo(offset); setTimezoneOffsetTo(prop); return prop; }
[ "public", "TimezoneOffsetTo", "setTimezoneOffsetTo", "(", "UtcOffset", "offset", ")", "{", "TimezoneOffsetTo", "prop", "=", "new", "TimezoneOffsetTo", "(", "offset", ")", ";", "setTimezoneOffsetTo", "(", "prop", ")", ";", "return", "prop", ";", "}" ]
Sets the UTC offset that the timezone observance transitions to. @param offset the offset @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-105">RFC 5545 p.105-6</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-100">RFC 2445 p.100-1</a>
[ "Sets", "the", "UTC", "offset", "that", "the", "timezone", "observance", "transitions", "to", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/Observance.java#L158-L162
train