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/component/Observance.java
Observance.setTimezoneOffsetFrom
public TimezoneOffsetFrom setTimezoneOffsetFrom(UtcOffset offset) { TimezoneOffsetFrom prop = new TimezoneOffsetFrom(offset); setTimezoneOffsetFrom(prop); return prop; }
java
public TimezoneOffsetFrom setTimezoneOffsetFrom(UtcOffset offset) { TimezoneOffsetFrom prop = new TimezoneOffsetFrom(offset); setTimezoneOffsetFrom(prop); return prop; }
[ "public", "TimezoneOffsetFrom", "setTimezoneOffsetFrom", "(", "UtcOffset", "offset", ")", "{", "TimezoneOffsetFrom", "prop", "=", "new", "TimezoneOffsetFrom", "(", "offset", ")", ";", "setTimezoneOffsetFrom", "(", "prop", ")", ";", "return", "prop", ";", "}" ]
Sets the UTC offset that the timezone observance transitions from. @param offset the offset @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-104">RFC 5545 p.104-5</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-99">RFC 2445 p.99-100</a>
[ "Sets", "the", "UTC", "offset", "that", "the", "timezone", "observance", "transitions", "from", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/Observance.java#L197-L201
train
mangstadt/biweekly
src/main/java/biweekly/component/Observance.java
Observance.addTimezoneName
public TimezoneName addTimezoneName(String timezoneName) { TimezoneName prop = new TimezoneName(timezoneName); addTimezoneName(prop); return prop; }
java
public TimezoneName addTimezoneName(String timezoneName) { TimezoneName prop = new TimezoneName(timezoneName); addTimezoneName(prop); return prop; }
[ "public", "TimezoneName", "addTimezoneName", "(", "String", "timezoneName", ")", "{", "TimezoneName", "prop", "=", "new", "TimezoneName", "(", "timezoneName", ")", ";", "addTimezoneName", "(", "prop", ")", ";", "return", "prop", ";", "}" ]
Adds a traditional, non-standard name for the timezone observance. @param timezoneName the timezone observance name (e.g. "EST") @return the property that was created @see <a href="http://tools.ietf.org/html/rfc5545#page-103">RFC 5545 p.103-4</a> @see <a href="http://tools.ietf.org/html/rfc2445#page-98">RFC 2445 p.98-9...
[ "Adds", "a", "traditional", "non", "-", "standard", "name", "for", "the", "timezone", "observance", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/Observance.java#L343-L347
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/property/AttachmentScribe.java
AttachmentScribe.getCidUriValue
private static String getCidUriValue(String uri) { int colon = uri.indexOf(':'); if (colon == 3) { String scheme = uri.substring(0, colon); return "cid".equalsIgnoreCase(scheme) ? uri.substring(colon + 1) : null; } if (uri.length() > 0 && uri.charAt(0) == '<' && uri.charAt(uri.length() - 1) == '>') { ...
java
private static String getCidUriValue(String uri) { int colon = uri.indexOf(':'); if (colon == 3) { String scheme = uri.substring(0, colon); return "cid".equalsIgnoreCase(scheme) ? uri.substring(colon + 1) : null; } if (uri.length() > 0 && uri.charAt(0) == '<' && uri.charAt(uri.length() - 1) == '>') { ...
[ "private", "static", "String", "getCidUriValue", "(", "String", "uri", ")", "{", "int", "colon", "=", "uri", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "colon", "==", "3", ")", "{", "String", "scheme", "=", "uri", ".", "substring", "(", "0...
Gets the value of the given "cid" URI. @param uri the "cid" URI @return the URI value or null if the given string is not a "cid" URI
[ "Gets", "the", "value", "of", "the", "given", "cid", "URI", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/property/AttachmentScribe.java#L124-L136
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.getProperty
public <T extends ICalProperty> T getProperty(Class<T> clazz) { return clazz.cast(properties.first(clazz)); }
java
public <T extends ICalProperty> T getProperty(Class<T> clazz) { return clazz.cast(properties.first(clazz)); }
[ "public", "<", "T", "extends", "ICalProperty", ">", "T", "getProperty", "(", "Class", "<", "T", ">", "clazz", ")", "{", "return", "clazz", ".", "cast", "(", "properties", ".", "first", "(", "clazz", ")", ")", ";", "}" ]
Gets the first property of a given class. @param clazz the property class @param <T> the property class @return the property or null if not found
[ "Gets", "the", "first", "property", "of", "a", "given", "class", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L81-L83
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.setProperty
public List<ICalProperty> setProperty(ICalProperty property) { return properties.replace(property.getClass(), property); }
java
public List<ICalProperty> setProperty(ICalProperty property) { return properties.replace(property.getClass(), property); }
[ "public", "List", "<", "ICalProperty", ">", "setProperty", "(", "ICalProperty", "property", ")", "{", "return", "properties", ".", "replace", "(", "property", ".", "getClass", "(", ")", ",", "property", ")", ";", "}" ]
Replaces all existing properties of the given property instance's class with the given property instance. @param property the property @return the replaced properties (this list is immutable)
[ "Replaces", "all", "existing", "properties", "of", "the", "given", "property", "instance", "s", "class", "with", "the", "given", "property", "instance", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L118-L120
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.setProperty
public <T extends ICalProperty> List<T> setProperty(Class<T> clazz, T property) { List<ICalProperty> replaced = properties.replace(clazz, property); return castList(replaced, clazz); }
java
public <T extends ICalProperty> List<T> setProperty(Class<T> clazz, T property) { List<ICalProperty> replaced = properties.replace(clazz, property); return castList(replaced, clazz); }
[ "public", "<", "T", "extends", "ICalProperty", ">", "List", "<", "T", ">", "setProperty", "(", "Class", "<", "T", ">", "clazz", ",", "T", "property", ")", "{", "List", "<", "ICalProperty", ">", "replaced", "=", "properties", ".", "replace", "(", "clazz...
Replaces all existing properties of the given class with a single property instance. If the property instance is null, then all instances of that property will be removed. @param clazz the property class (e.g. "DateStart.class") @param property the property or null to remove all properties of the given class @param <T>...
[ "Replaces", "all", "existing", "properties", "of", "the", "given", "class", "with", "a", "single", "property", "instance", ".", "If", "the", "property", "instance", "is", "null", "then", "all", "instances", "of", "that", "property", "will", "be", "removed", ...
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L132-L135
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.removeProperty
public <T extends ICalProperty> boolean removeProperty(T property) { return properties.remove(property.getClass(), property); }
java
public <T extends ICalProperty> boolean removeProperty(T property) { return properties.remove(property.getClass(), property); }
[ "public", "<", "T", "extends", "ICalProperty", ">", "boolean", "removeProperty", "(", "T", "property", ")", "{", "return", "properties", ".", "remove", "(", "property", ".", "getClass", "(", ")", ",", "property", ")", ";", "}" ]
Removes a specific property instance from this component. @param property the property to remove @param <T> the property class @return true if it was removed, false if it wasn't found
[ "Removes", "a", "specific", "property", "instance", "from", "this", "component", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L143-L145
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.removeProperties
public <T extends ICalProperty> List<T> removeProperties(Class<T> clazz) { List<ICalProperty> removed = properties.removeAll(clazz); return castList(removed, clazz); }
java
public <T extends ICalProperty> List<T> removeProperties(Class<T> clazz) { List<ICalProperty> removed = properties.removeAll(clazz); return castList(removed, clazz); }
[ "public", "<", "T", "extends", "ICalProperty", ">", "List", "<", "T", ">", "removeProperties", "(", "Class", "<", "T", ">", "clazz", ")", "{", "List", "<", "ICalProperty", ">", "removed", "=", "properties", ".", "removeAll", "(", "clazz", ")", ";", "re...
Removes all properties of a given class from this component. @param clazz the class of the properties to remove (e.g. "DateStart.class") @param <T> the property class @return the removed properties (this list is immutable)
[ "Removes", "all", "properties", "of", "a", "given", "class", "from", "this", "component", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L154-L157
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.removeComponent
public <T extends ICalComponent> boolean removeComponent(T component) { return components.remove(component.getClass(), component); }
java
public <T extends ICalComponent> boolean removeComponent(T component) { return components.remove(component.getClass(), component); }
[ "public", "<", "T", "extends", "ICalComponent", ">", "boolean", "removeComponent", "(", "T", "component", ")", "{", "return", "components", ".", "remove", "(", "component", ".", "getClass", "(", ")", ",", "component", ")", ";", "}" ]
Removes a specific sub-component instance from this component. @param component the component to remove @param <T> the component class @return true if it was removed, false if it wasn't found
[ "Removes", "a", "specific", "sub", "-", "component", "instance", "from", "this", "component", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L165-L167
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.removeComponents
public <T extends ICalComponent> List<T> removeComponents(Class<T> clazz) { List<ICalComponent> removed = components.removeAll(clazz); return castList(removed, clazz); }
java
public <T extends ICalComponent> List<T> removeComponents(Class<T> clazz) { List<ICalComponent> removed = components.removeAll(clazz); return castList(removed, clazz); }
[ "public", "<", "T", "extends", "ICalComponent", ">", "List", "<", "T", ">", "removeComponents", "(", "Class", "<", "T", ">", "clazz", ")", "{", "List", "<", "ICalComponent", ">", "removed", "=", "components", ".", "removeAll", "(", "clazz", ")", ";", "...
Removes all sub-components of the given class from this component. @param clazz the class of the components to remove (e.g. "VEvent.class") @param <T> the component class @return the removed components (this list is immutable)
[ "Removes", "all", "sub", "-", "components", "of", "the", "given", "class", "from", "this", "component", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L175-L178
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.getExperimentalProperty
public RawProperty getExperimentalProperty(String name) { for (RawProperty raw : getExperimentalProperties()) { if (raw.getName().equalsIgnoreCase(name)) { return raw; } } return null; }
java
public RawProperty getExperimentalProperty(String name) { for (RawProperty raw : getExperimentalProperties()) { if (raw.getName().equalsIgnoreCase(name)) { return raw; } } return null; }
[ "public", "RawProperty", "getExperimentalProperty", "(", "String", "name", ")", "{", "for", "(", "RawProperty", "raw", ":", "getExperimentalProperties", "(", ")", ")", "{", "if", "(", "raw", ".", "getName", "(", ")", ".", "equalsIgnoreCase", "(", "name", ")"...
Gets the first experimental property with a given name. @param name the property name (case insensitive, e.g. "X-ALT-DESC") @return the experimental property or null if none were found
[ "Gets", "the", "first", "experimental", "property", "with", "a", "given", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L185-L192
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.getExperimentalProperties
public List<RawProperty> getExperimentalProperties(String name) { /* * Note: The returned list is not backed by the parent component because * this would allow RawProperty objects without the specified name to be * added to the list. */ List<RawProperty> toReturn = new ArrayList<RawProperty>(); for (R...
java
public List<RawProperty> getExperimentalProperties(String name) { /* * Note: The returned list is not backed by the parent component because * this would allow RawProperty objects without the specified name to be * added to the list. */ List<RawProperty> toReturn = new ArrayList<RawProperty>(); for (R...
[ "public", "List", "<", "RawProperty", ">", "getExperimentalProperties", "(", "String", "name", ")", "{", "/*\n\t\t * Note: The returned list is not backed by the parent component because\n\t\t * this would allow RawProperty objects without the specified name to be\n\t\t * added to the list.\n\...
Gets all experimental properties with a given name. @param name the property name (case insensitive, e.g. "X-ALT-DESC") @return the experimental properties (this list is immutable)
[ "Gets", "all", "experimental", "properties", "with", "a", "given", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L199-L212
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.removeExperimentalProperties
public List<RawProperty> removeExperimentalProperties(String name) { List<RawProperty> all = getExperimentalProperties(); List<RawProperty> toRemove = new ArrayList<RawProperty>(); for (RawProperty property : all) { if (property.getName().equalsIgnoreCase(name)) { toRemove.add(property); } } all.re...
java
public List<RawProperty> removeExperimentalProperties(String name) { List<RawProperty> all = getExperimentalProperties(); List<RawProperty> toRemove = new ArrayList<RawProperty>(); for (RawProperty property : all) { if (property.getName().equalsIgnoreCase(name)) { toRemove.add(property); } } all.re...
[ "public", "List", "<", "RawProperty", ">", "removeExperimentalProperties", "(", "String", "name", ")", "{", "List", "<", "RawProperty", ">", "all", "=", "getExperimentalProperties", "(", ")", ";", "List", "<", "RawProperty", ">", "toRemove", "=", "new", "Array...
Removes all experimental properties that have the given name. @param name the component name (e.g. "X-ALT-DESC") @return the removed properties (this list is immutable)
[ "Removes", "all", "experimental", "properties", "that", "have", "the", "given", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L276-L287
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.getComponent
public <T extends ICalComponent> T getComponent(Class<T> clazz) { return clazz.cast(components.first(clazz)); }
java
public <T extends ICalComponent> T getComponent(Class<T> clazz) { return clazz.cast(components.first(clazz)); }
[ "public", "<", "T", "extends", "ICalComponent", ">", "T", "getComponent", "(", "Class", "<", "T", ">", "clazz", ")", "{", "return", "clazz", ".", "cast", "(", "components", ".", "first", "(", "clazz", ")", ")", ";", "}" ]
Gets the first sub-component of a given class. @param clazz the component class @param <T> the component class @return the sub-component or null if not found
[ "Gets", "the", "first", "sub", "-", "component", "of", "a", "given", "class", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L295-L297
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.getComponents
public <T extends ICalComponent> List<T> getComponents(Class<T> clazz) { return new ICalComponentList<T>(clazz); }
java
public <T extends ICalComponent> List<T> getComponents(Class<T> clazz) { return new ICalComponentList<T>(clazz); }
[ "public", "<", "T", "extends", "ICalComponent", ">", "List", "<", "T", ">", "getComponents", "(", "Class", "<", "T", ">", "clazz", ")", "{", "return", "new", "ICalComponentList", "<", "T", ">", "(", "clazz", ")", ";", "}" ]
Gets all sub-components of a given class. Changes to the returned list will update the parent component object, and vice versa. @param clazz the component class @param <T> the component class @return the sub-components
[ "Gets", "all", "sub", "-", "components", "of", "a", "given", "class", ".", "Changes", "to", "the", "returned", "list", "will", "update", "the", "parent", "component", "object", "and", "vice", "versa", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L306-L308
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.setComponent
public List<ICalComponent> setComponent(ICalComponent component) { return components.replace(component.getClass(), component); }
java
public List<ICalComponent> setComponent(ICalComponent component) { return components.replace(component.getClass(), component); }
[ "public", "List", "<", "ICalComponent", ">", "setComponent", "(", "ICalComponent", "component", ")", "{", "return", "components", ".", "replace", "(", "component", ".", "getClass", "(", ")", ",", "component", ")", ";", "}" ]
Replaces all sub-components of a given class with the given component. @param component the component @return the replaced sub-components (this list is immutable)
[ "Replaces", "all", "sub", "-", "components", "of", "a", "given", "class", "with", "the", "given", "component", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L331-L333
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.setComponent
public <T extends ICalComponent> List<T> setComponent(Class<T> clazz, T component) { List<ICalComponent> replaced = components.replace(clazz, component); return castList(replaced, clazz); }
java
public <T extends ICalComponent> List<T> setComponent(Class<T> clazz, T component) { List<ICalComponent> replaced = components.replace(clazz, component); return castList(replaced, clazz); }
[ "public", "<", "T", "extends", "ICalComponent", ">", "List", "<", "T", ">", "setComponent", "(", "Class", "<", "T", ">", "clazz", ",", "T", "component", ")", "{", "List", "<", "ICalComponent", ">", "replaced", "=", "components", ".", "replace", "(", "c...
Replaces all sub-components of a given class with the given component. If the component instance is null, then all instances of that component will be removed. @param clazz the component's class @param component the component or null to remove all components of the given class @param <T> the component class @return the...
[ "Replaces", "all", "sub", "-", "components", "of", "a", "given", "class", "with", "the", "given", "component", ".", "If", "the", "component", "instance", "is", "null", "then", "all", "instances", "of", "that", "component", "will", "be", "removed", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L345-L348
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.getExperimentalComponent
public RawComponent getExperimentalComponent(String name) { for (RawComponent component : getExperimentalComponents()) { if (component.getName().equalsIgnoreCase(name)) { return component; } } return null; }
java
public RawComponent getExperimentalComponent(String name) { for (RawComponent component : getExperimentalComponents()) { if (component.getName().equalsIgnoreCase(name)) { return component; } } return null; }
[ "public", "RawComponent", "getExperimentalComponent", "(", "String", "name", ")", "{", "for", "(", "RawComponent", "component", ":", "getExperimentalComponents", "(", ")", ")", "{", "if", "(", "component", ".", "getName", "(", ")", ".", "equalsIgnoreCase", "(", ...
Gets the first experimental sub-component with a given name. @param name the component name (case insensitive, e.g. "X-PARTY") @return the experimental component or null if none were found
[ "Gets", "the", "first", "experimental", "sub", "-", "component", "with", "a", "given", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L355-L362
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.getExperimentalComponents
public List<RawComponent> getExperimentalComponents(String name) { /* * Note: The returned list is not backed by the parent component because * this would allow RawComponent objects without the specified name to * be added to the list. */ List<RawComponent> toReturn = new ArrayList<RawComponent>(); fo...
java
public List<RawComponent> getExperimentalComponents(String name) { /* * Note: The returned list is not backed by the parent component because * this would allow RawComponent objects without the specified name to * be added to the list. */ List<RawComponent> toReturn = new ArrayList<RawComponent>(); fo...
[ "public", "List", "<", "RawComponent", ">", "getExperimentalComponents", "(", "String", "name", ")", "{", "/*\n\t\t * Note: The returned list is not backed by the parent component because\n\t\t * this would allow RawComponent objects without the specified name to\n\t\t * be added to the list.\...
Gets all experimental sub-component with a given name. @param name the component name (case insensitive, e.g. "X-PARTY") @return the experimental components (this list is immutable)
[ "Gets", "all", "experimental", "sub", "-", "component", "with", "a", "given", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L369-L382
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.addExperimentalComponent
public RawComponent addExperimentalComponent(String name) { RawComponent raw = new RawComponent(name); addComponent(raw); return raw; }
java
public RawComponent addExperimentalComponent(String name) { RawComponent raw = new RawComponent(name); addComponent(raw); return raw; }
[ "public", "RawComponent", "addExperimentalComponent", "(", "String", "name", ")", "{", "RawComponent", "raw", "=", "new", "RawComponent", "(", "name", ")", ";", "addComponent", "(", "raw", ")", ";", "return", "raw", ";", "}" ]
Adds an experimental sub-component to this component. @param name the component name (e.g. "X-PARTY") @return the component object that was created
[ "Adds", "an", "experimental", "sub", "-", "component", "to", "this", "component", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L399-L403
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.removeExperimentalComponents
public List<RawComponent> removeExperimentalComponents(String name) { List<RawComponent> all = getExperimentalComponents(); List<RawComponent> toRemove = new ArrayList<RawComponent>(); for (RawComponent property : all) { if (property.getName().equalsIgnoreCase(name)) { toRemove.add(property); } } a...
java
public List<RawComponent> removeExperimentalComponents(String name) { List<RawComponent> all = getExperimentalComponents(); List<RawComponent> toRemove = new ArrayList<RawComponent>(); for (RawComponent property : all) { if (property.getName().equalsIgnoreCase(name)) { toRemove.add(property); } } a...
[ "public", "List", "<", "RawComponent", ">", "removeExperimentalComponents", "(", "String", "name", ")", "{", "List", "<", "RawComponent", ">", "all", "=", "getExperimentalComponents", "(", ")", ";", "List", "<", "RawComponent", ">", "toRemove", "=", "new", "Ar...
Removes all experimental sub-components that have the given name. @param name the component name (e.g. "X-PARTY") @return the removed sub-components (this list is immutable)
[ "Removes", "all", "experimental", "sub", "-", "components", "that", "have", "the", "given", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L421-L432
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.checkRequiredCardinality
protected void checkRequiredCardinality(List<ValidationWarning> warnings, Class<? extends ICalProperty>... classes) { for (Class<? extends ICalProperty> clazz : classes) { List<? extends ICalProperty> props = getProperties(clazz); if (props.isEmpty()) { warnings.add(new ValidationWarning(2, clazz.getSimple...
java
protected void checkRequiredCardinality(List<ValidationWarning> warnings, Class<? extends ICalProperty>... classes) { for (Class<? extends ICalProperty> clazz : classes) { List<? extends ICalProperty> props = getProperties(clazz); if (props.isEmpty()) { warnings.add(new ValidationWarning(2, clazz.getSimple...
[ "protected", "void", "checkRequiredCardinality", "(", "List", "<", "ValidationWarning", ">", "warnings", ",", "Class", "<", "?", "extends", "ICalProperty", ">", "...", "classes", ")", "{", "for", "(", "Class", "<", "?", "extends", "ICalProperty", ">", "clazz",...
Utility method for validating that there is exactly one instance of each of the given properties. @param warnings the list to add the warnings to @param classes the properties to check
[ "Utility", "method", "for", "validating", "that", "there", "is", "exactly", "one", "instance", "of", "each", "of", "the", "given", "properties", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L512-L526
train
mangstadt/biweekly
src/main/java/biweekly/component/ICalComponent.java
ICalComponent.castList
private static <T> List<T> castList(List<?> list, Class<T> castTo) { List<T> casted = new ArrayList<T>(list.size()); for (Object object : list) { casted.add(castTo.cast(object)); } return Collections.unmodifiableList(casted); }
java
private static <T> List<T> castList(List<?> list, Class<T> castTo) { List<T> casted = new ArrayList<T>(list.size()); for (Object object : list) { casted.add(castTo.cast(object)); } return Collections.unmodifiableList(casted); }
[ "private", "static", "<", "T", ">", "List", "<", "T", ">", "castList", "(", "List", "<", "?", ">", "list", ",", "Class", "<", "T", ">", "castTo", ")", "{", "List", "<", "T", ">", "casted", "=", "new", "ArrayList", "<", "T", ">", "(", "list", ...
Casts all objects in the given list to the given class, adding the casted objects to a new list. @param list the list to cast @param castTo the class to cast to @param <T> the class to cast to @return the new list (immutable)
[ "Casts", "all", "objects", "in", "the", "given", "list", "to", "the", "given", "class", "adding", "the", "casted", "objects", "to", "a", "new", "list", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/component/ICalComponent.java#L658-L664
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/property/ICalPropertyScribe.java
ICalPropertyScribe.parseText
public final T parseText(String value, ICalDataType dataType, ICalParameters parameters, ParseContext context) { T property = _parseText(value, dataType, parameters, context); property.setParameters(parameters); return property; }
java
public final T parseText(String value, ICalDataType dataType, ICalParameters parameters, ParseContext context) { T property = _parseText(value, dataType, parameters, context); property.setParameters(parameters); return property; }
[ "public", "final", "T", "parseText", "(", "String", "value", ",", "ICalDataType", "dataType", ",", "ICalParameters", "parameters", ",", "ParseContext", "context", ")", "{", "T", "property", "=", "_parseText", "(", "value", ",", "dataType", ",", "parameters", "...
Unmarshals a property from a plain-text iCalendar data stream. @param value the value as read off the wire @param dataType the data type of the property value. The property's VALUE parameter is used to determine the data type. If the property has no VALUE parameter, then this parameter will be set to the property's def...
[ "Unmarshals", "a", "property", "from", "a", "plain", "-", "text", "iCalendar", "data", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/property/ICalPropertyScribe.java#L244-L248
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/property/ICalPropertyScribe.java
ICalPropertyScribe.jcalValueToString
private static String jcalValueToString(JCalValue value) { List<JsonValue> values = value.getValues(); if (values.size() > 1) { List<String> multi = value.asMulti(); if (!multi.isEmpty()) { return VObjectPropertyValues.writeList(multi); } } if (!values.isEmpty() && values.get(0).getArray() != null...
java
private static String jcalValueToString(JCalValue value) { List<JsonValue> values = value.getValues(); if (values.size() > 1) { List<String> multi = value.asMulti(); if (!multi.isEmpty()) { return VObjectPropertyValues.writeList(multi); } } if (!values.isEmpty() && values.get(0).getArray() != null...
[ "private", "static", "String", "jcalValueToString", "(", "JCalValue", "value", ")", "{", "List", "<", "JsonValue", ">", "values", "=", "value", ".", "getValues", "(", ")", ";", "if", "(", "values", ".", "size", "(", ")", ">", "1", ")", "{", "List", "...
Converts a jCal value to its plain-text format representation. @param value the jCal value @return the plain-text format representation (for example, "1,2,3" for a list of values)
[ "Converts", "a", "jCal", "value", "to", "its", "plain", "-", "text", "format", "representation", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/property/ICalPropertyScribe.java#L534-L558
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/property/ICalPropertyScribe.java
ICalPropertyScribe.date
protected static DateWriter date(Date date) { return date((date == null) ? null : new ICalDate(date)); }
java
protected static DateWriter date(Date date) { return date((date == null) ? null : new ICalDate(date)); }
[ "protected", "static", "DateWriter", "date", "(", "Date", "date", ")", "{", "return", "date", "(", "(", "date", "==", "null", ")", "?", "null", ":", "new", "ICalDate", "(", "date", ")", ")", ";", "}" ]
Formats a date as a string. @param date the date @return the factory object
[ "Formats", "a", "date", "as", "a", "string", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/property/ICalPropertyScribe.java#L624-L626
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/property/ICalPropertyScribe.java
ICalPropertyScribe.handleTzidParameter
protected static ICalParameters handleTzidParameter(ICalProperty property, boolean hasTime, WriteContext context) { ICalParameters parameters = property.getParameters(); //date values don't have timezones if (!hasTime) { return parameters; } //vCal doesn't use the TZID parameter if (context.getVersion(...
java
protected static ICalParameters handleTzidParameter(ICalProperty property, boolean hasTime, WriteContext context) { ICalParameters parameters = property.getParameters(); //date values don't have timezones if (!hasTime) { return parameters; } //vCal doesn't use the TZID parameter if (context.getVersion(...
[ "protected", "static", "ICalParameters", "handleTzidParameter", "(", "ICalProperty", "property", ",", "boolean", "hasTime", ",", "WriteContext", "context", ")", "{", "ICalParameters", "parameters", "=", "property", ".", "getParameters", "(", ")", ";", "//date values d...
Adds a TZID parameter to a property's parameter list if necessary. @param property the property @param hasTime true if the property value has a time component, false if not @param context the write context @return the property's new set of parameters
[ "Adds", "a", "TZID", "parameter", "to", "a", "property", "s", "parameter", "list", "if", "necessary", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/property/ICalPropertyScribe.java#L772-L821
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/ScribeIndex.java
ScribeIndex.getComponentScribe
public ICalComponentScribe<? extends ICalComponent> getComponentScribe(String componentName, ICalVersion version) { componentName = componentName.toUpperCase(); ICalComponentScribe<? extends ICalComponent> scribe = experimentalCompByName.get(componentName); if (scribe == null) { scribe = standardCompByName.ge...
java
public ICalComponentScribe<? extends ICalComponent> getComponentScribe(String componentName, ICalVersion version) { componentName = componentName.toUpperCase(); ICalComponentScribe<? extends ICalComponent> scribe = experimentalCompByName.get(componentName); if (scribe == null) { scribe = standardCompByName.ge...
[ "public", "ICalComponentScribe", "<", "?", "extends", "ICalComponent", ">", "getComponentScribe", "(", "String", "componentName", ",", "ICalVersion", "version", ")", "{", "componentName", "=", "componentName", ".", "toUpperCase", "(", ")", ";", "ICalComponentScribe", ...
Gets a component scribe by name. @param componentName the component name (e.g. "VEVENT") @param version the version of the iCalendar object being parsed @return the component scribe or a {@link RawComponentScribe} if not found
[ "Gets", "a", "component", "scribe", "by", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/ScribeIndex.java#L256-L274
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/ScribeIndex.java
ScribeIndex.getPropertyScribe
public ICalPropertyScribe<? extends ICalProperty> getPropertyScribe(String propertyName, ICalVersion version) { propertyName = propertyName.toUpperCase(); String key = propertyNameKey(propertyName, version); ICalPropertyScribe<? extends ICalProperty> scribe = experimentalPropByName.get(key); if (scribe == null...
java
public ICalPropertyScribe<? extends ICalProperty> getPropertyScribe(String propertyName, ICalVersion version) { propertyName = propertyName.toUpperCase(); String key = propertyNameKey(propertyName, version); ICalPropertyScribe<? extends ICalProperty> scribe = experimentalPropByName.get(key); if (scribe == null...
[ "public", "ICalPropertyScribe", "<", "?", "extends", "ICalProperty", ">", "getPropertyScribe", "(", "String", "propertyName", ",", "ICalVersion", "version", ")", "{", "propertyName", "=", "propertyName", ".", "toUpperCase", "(", ")", ";", "String", "key", "=", "...
Gets a property scribe by name. @param propertyName the property name (e.g. "UID") @param version the version of the iCalendar object being parsed @return the property scribe or a {@link RawPropertyScribe} if not found
[ "Gets", "a", "property", "scribe", "by", "name", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/ScribeIndex.java#L282-L301
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/ScribeIndex.java
ScribeIndex.getComponentScribe
public ICalComponentScribe<? extends ICalComponent> getComponentScribe(Class<? extends ICalComponent> clazz) { ICalComponentScribe<? extends ICalComponent> scribe = experimentalCompByClass.get(clazz); if (scribe != null) { return scribe; } return standardCompByClass.get(clazz); }
java
public ICalComponentScribe<? extends ICalComponent> getComponentScribe(Class<? extends ICalComponent> clazz) { ICalComponentScribe<? extends ICalComponent> scribe = experimentalCompByClass.get(clazz); if (scribe != null) { return scribe; } return standardCompByClass.get(clazz); }
[ "public", "ICalComponentScribe", "<", "?", "extends", "ICalComponent", ">", "getComponentScribe", "(", "Class", "<", "?", "extends", "ICalComponent", ">", "clazz", ")", "{", "ICalComponentScribe", "<", "?", "extends", "ICalComponent", ">", "scribe", "=", "experime...
Gets a component scribe by class. @param clazz the component class @return the component scribe or null if not found
[ "Gets", "a", "component", "scribe", "by", "class", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/ScribeIndex.java#L308-L315
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/ScribeIndex.java
ScribeIndex.getPropertyScribe
public ICalPropertyScribe<? extends ICalProperty> getPropertyScribe(Class<? extends ICalProperty> clazz) { ICalPropertyScribe<? extends ICalProperty> scribe = experimentalPropByClass.get(clazz); if (scribe != null) { return scribe; } return standardPropByClass.get(clazz); }
java
public ICalPropertyScribe<? extends ICalProperty> getPropertyScribe(Class<? extends ICalProperty> clazz) { ICalPropertyScribe<? extends ICalProperty> scribe = experimentalPropByClass.get(clazz); if (scribe != null) { return scribe; } return standardPropByClass.get(clazz); }
[ "public", "ICalPropertyScribe", "<", "?", "extends", "ICalProperty", ">", "getPropertyScribe", "(", "Class", "<", "?", "extends", "ICalProperty", ">", "clazz", ")", "{", "ICalPropertyScribe", "<", "?", "extends", "ICalProperty", ">", "scribe", "=", "experimentalPr...
Gets a property scribe by class. @param clazz the property class @return the property scribe or null if not found
[ "Gets", "a", "property", "scribe", "by", "class", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/ScribeIndex.java#L322-L329
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/ScribeIndex.java
ScribeIndex.getComponentScribe
public ICalComponentScribe<? extends ICalComponent> getComponentScribe(ICalComponent component) { if (component instanceof RawComponent) { RawComponent raw = (RawComponent) component; return new RawComponentScribe(raw.getName()); } return getComponentScribe(component.getClass()); }
java
public ICalComponentScribe<? extends ICalComponent> getComponentScribe(ICalComponent component) { if (component instanceof RawComponent) { RawComponent raw = (RawComponent) component; return new RawComponentScribe(raw.getName()); } return getComponentScribe(component.getClass()); }
[ "public", "ICalComponentScribe", "<", "?", "extends", "ICalComponent", ">", "getComponentScribe", "(", "ICalComponent", "component", ")", "{", "if", "(", "component", "instanceof", "RawComponent", ")", "{", "RawComponent", "raw", "=", "(", "RawComponent", ")", "co...
Gets the appropriate component scribe for a given component instance. @param component the component instance @return the component scribe or null if not found
[ "Gets", "the", "appropriate", "component", "scribe", "for", "a", "given", "component", "instance", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/ScribeIndex.java#L336-L343
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/ScribeIndex.java
ScribeIndex.getPropertyScribe
public ICalPropertyScribe<? extends ICalProperty> getPropertyScribe(ICalProperty property) { if (property instanceof RawProperty) { RawProperty raw = (RawProperty) property; return new RawPropertyScribe(raw.getName()); } return getPropertyScribe(property.getClass()); }
java
public ICalPropertyScribe<? extends ICalProperty> getPropertyScribe(ICalProperty property) { if (property instanceof RawProperty) { RawProperty raw = (RawProperty) property; return new RawPropertyScribe(raw.getName()); } return getPropertyScribe(property.getClass()); }
[ "public", "ICalPropertyScribe", "<", "?", "extends", "ICalProperty", ">", "getPropertyScribe", "(", "ICalProperty", "property", ")", "{", "if", "(", "property", "instanceof", "RawProperty", ")", "{", "RawProperty", "raw", "=", "(", "RawProperty", ")", "property", ...
Gets the appropriate property scribe for a given property instance. @param property the property instance @return the property scribe or null if not found
[ "Gets", "the", "appropriate", "property", "scribe", "for", "a", "given", "property", "instance", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/ScribeIndex.java#L350-L357
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/ScribeIndex.java
ScribeIndex.getPropertyScribe
public ICalPropertyScribe<? extends ICalProperty> getPropertyScribe(QName qname) { ICalPropertyScribe<? extends ICalProperty> scribe = experimentalPropByQName.get(qname); if (scribe == null) { scribe = standardPropByQName.get(qname); } if (scribe == null || !scribe.getSupportedVersions().contains(ICalVersio...
java
public ICalPropertyScribe<? extends ICalProperty> getPropertyScribe(QName qname) { ICalPropertyScribe<? extends ICalProperty> scribe = experimentalPropByQName.get(qname); if (scribe == null) { scribe = standardPropByQName.get(qname); } if (scribe == null || !scribe.getSupportedVersions().contains(ICalVersio...
[ "public", "ICalPropertyScribe", "<", "?", "extends", "ICalProperty", ">", "getPropertyScribe", "(", "QName", "qname", ")", "{", "ICalPropertyScribe", "<", "?", "extends", "ICalProperty", ">", "scribe", "=", "experimentalPropByQName", ".", "get", "(", "qname", ")",...
Gets a property scribe by XML local name and namespace. @param qname the XML local name and namespace @return the property scribe or a {@link XmlScribe} if not found
[ "Gets", "a", "property", "scribe", "by", "XML", "local", "name", "and", "namespace", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/ScribeIndex.java#L364-L378
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/ScribeIndex.java
ScribeIndex.unregister
public void unregister(ICalComponentScribe<? extends ICalComponent> scribe) { experimentalCompByName.remove(scribe.getComponentName().toUpperCase()); experimentalCompByClass.remove(scribe.getComponentClass()); }
java
public void unregister(ICalComponentScribe<? extends ICalComponent> scribe) { experimentalCompByName.remove(scribe.getComponentName().toUpperCase()); experimentalCompByClass.remove(scribe.getComponentClass()); }
[ "public", "void", "unregister", "(", "ICalComponentScribe", "<", "?", "extends", "ICalComponent", ">", "scribe", ")", "{", "experimentalCompByName", ".", "remove", "(", "scribe", ".", "getComponentName", "(", ")", ".", "toUpperCase", "(", ")", ")", ";", "exper...
Unregisters a component scribe. @param scribe the scribe to unregister
[ "Unregisters", "a", "component", "scribe", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/ScribeIndex.java#L405-L408
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/ScribeIndex.java
ScribeIndex.unregister
public void unregister(ICalPropertyScribe<? extends ICalProperty> scribe) { for (ICalVersion version : ICalVersion.values()) { experimentalPropByName.remove(propertyNameKey(scribe, version)); } experimentalPropByClass.remove(scribe.getPropertyClass()); experimentalPropByQName.remove(scribe.getQName()); }
java
public void unregister(ICalPropertyScribe<? extends ICalProperty> scribe) { for (ICalVersion version : ICalVersion.values()) { experimentalPropByName.remove(propertyNameKey(scribe, version)); } experimentalPropByClass.remove(scribe.getPropertyClass()); experimentalPropByQName.remove(scribe.getQName()); }
[ "public", "void", "unregister", "(", "ICalPropertyScribe", "<", "?", "extends", "ICalProperty", ">", "scribe", ")", "{", "for", "(", "ICalVersion", "version", ":", "ICalVersion", ".", "values", "(", ")", ")", "{", "experimentalPropByName", ".", "remove", "(", ...
Unregisters a property scribe @param scribe the scribe to unregister
[ "Unregisters", "a", "property", "scribe" ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/ScribeIndex.java#L414-L420
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/component/VAlarmScribe.java
VAlarmScribe.determineStartDate
private static Date determineStartDate(VAlarm valarm, ICalComponent parent) { Trigger trigger = valarm.getTrigger(); if (trigger == null) { return null; } Date triggerStart = trigger.getDate(); if (triggerStart != null) { return triggerStart; } Duration triggerDuration = trigger.getDuration(); i...
java
private static Date determineStartDate(VAlarm valarm, ICalComponent parent) { Trigger trigger = valarm.getTrigger(); if (trigger == null) { return null; } Date triggerStart = trigger.getDate(); if (triggerStart != null) { return triggerStart; } Duration triggerDuration = trigger.getDuration(); i...
[ "private", "static", "Date", "determineStartDate", "(", "VAlarm", "valarm", ",", "ICalComponent", "parent", ")", "{", "Trigger", "trigger", "=", "valarm", ".", "getTrigger", "(", ")", ";", "if", "(", "trigger", "==", "null", ")", "{", "return", "null", ";"...
Determines what the alarm property's start date should be. @param valarm the component that is being converted to a vCal alarm property @param parent the component's parent @return the start date or null if it cannot be determined
[ "Determines", "what", "the", "alarm", "property", "s", "start", "date", "should", "be", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/component/VAlarmScribe.java#L193-L229
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/Util.java
Util.uniquify
static int[] uniquify(int[] ints) { IntSet iset = new IntSet(); for (int i : ints) { iset.add(i); } return iset.toIntArray(); }
java
static int[] uniquify(int[] ints) { IntSet iset = new IntSet(); for (int i : ints) { iset.add(i); } return iset.toIntArray(); }
[ "static", "int", "[", "]", "uniquify", "(", "int", "[", "]", "ints", ")", "{", "IntSet", "iset", "=", "new", "IntSet", "(", ")", ";", "for", "(", "int", "i", ":", "ints", ")", "{", "iset", ".", "add", "(", "i", ")", ";", "}", "return", "iset"...
Returns a sorted copy of an integer array with duplicate values removed. @param ints the integer array @return the sorted copy with duplicates removed
[ "Returns", "a", "sorted", "copy", "of", "an", "integer", "array", "with", "duplicate", "values", "removed", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/Util.java#L80-L86
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/Util.java
Util.countInPeriod
static int countInPeriod(DayOfWeek dow, DayOfWeek dow0, int nDays) { //two cases: // (1a) dow >= dow0: count === (nDays - (dow - dow0)) / 7 // (1b) dow < dow0: count === (nDays - (7 - dow0 - dow)) / 7 if (dow.getCalendarConstant() >= dow0.getCalendarConstant()) { return 1 + ((nDays - (dow.getCalendarCon...
java
static int countInPeriod(DayOfWeek dow, DayOfWeek dow0, int nDays) { //two cases: // (1a) dow >= dow0: count === (nDays - (dow - dow0)) / 7 // (1b) dow < dow0: count === (nDays - (7 - dow0 - dow)) / 7 if (dow.getCalendarConstant() >= dow0.getCalendarConstant()) { return 1 + ((nDays - (dow.getCalendarCon...
[ "static", "int", "countInPeriod", "(", "DayOfWeek", "dow", ",", "DayOfWeek", "dow0", ",", "int", "nDays", ")", "{", "//two cases:", "// (1a) dow >= dow0: count === (nDays - (dow - dow0)) / 7", "// (1b) dow < dow0: count === (nDays - (7 - dow0 - dow)) / 7", "if", "(", "dow"...
Counts the number of occurrences of a weekday in a given period. @param dow the weekday @param dow0 the weekday of the first day of the period @param nDays the number of days in the period
[ "Counts", "the", "number", "of", "occurrences", "of", "a", "weekday", "in", "a", "given", "period", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/Util.java#L149-L158
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/RRuleIteratorImpl.java
RRuleIteratorImpl.generateInstance
private DateValue generateInstance() { try { do { if (!instanceGenerator.generate(builder)) { return null; } DateValue dUtc = dtStart instanceof TimeValue ? TimeUtils.toUtc(builder.toDateTime(), tzid) : builder.toDate(); if (dUtc.compareTo(lastUtc_) > 0) { return dUtc; } } while (t...
java
private DateValue generateInstance() { try { do { if (!instanceGenerator.generate(builder)) { return null; } DateValue dUtc = dtStart instanceof TimeValue ? TimeUtils.toUtc(builder.toDateTime(), tzid) : builder.toDate(); if (dUtc.compareTo(lastUtc_) > 0) { return dUtc; } } while (t...
[ "private", "DateValue", "generateInstance", "(", ")", "{", "try", "{", "do", "{", "if", "(", "!", "instanceGenerator", ".", "generate", "(", "builder", ")", ")", "{", "return", "null", ";", "}", "DateValue", "dUtc", "=", "dtStart", "instanceof", "TimeValue...
Generates a date. @return a date value in UTC or null if a date value could not be generated
[ "Generates", "a", "date", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/RRuleIteratorImpl.java#L335-L349
train
mangstadt/biweekly
src/main/java/biweekly/io/TimezoneInfo.java
TimezoneInfo.setTimezone
public void setTimezone(ICalProperty property, TimezoneAssignment timezone) { if (timezone == null) { TimezoneAssignment existing = propertyTimezones.remove(property); if (existing != null && existing != defaultTimezone && !propertyTimezones.values().contains(existing)) { assignments.remove(existing); } ...
java
public void setTimezone(ICalProperty property, TimezoneAssignment timezone) { if (timezone == null) { TimezoneAssignment existing = propertyTimezones.remove(property); if (existing != null && existing != defaultTimezone && !propertyTimezones.values().contains(existing)) { assignments.remove(existing); } ...
[ "public", "void", "setTimezone", "(", "ICalProperty", "property", ",", "TimezoneAssignment", "timezone", ")", "{", "if", "(", "timezone", "==", "null", ")", "{", "TimezoneAssignment", "existing", "=", "propertyTimezones", ".", "remove", "(", "property", ")", ";"...
Assigns a timezone to a specific property. @param property the property @param timezone the timezone or null to format the property according to the default timezone (see {@link #setDefaultTimezone}).
[ "Assigns", "a", "timezone", "to", "a", "specific", "property", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/TimezoneInfo.java#L118-L129
train
mangstadt/biweekly
src/main/java/biweekly/io/TimezoneInfo.java
TimezoneInfo.isFloating
public boolean isFloating(ICalProperty property) { if (containsIdentity(floatingProperties, property)) { return true; } if (propertyTimezones.containsKey(property)) { return false; } return globalFloatingTime; }
java
public boolean isFloating(ICalProperty property) { if (containsIdentity(floatingProperties, property)) { return true; } if (propertyTimezones.containsKey(property)) { return false; } return globalFloatingTime; }
[ "public", "boolean", "isFloating", "(", "ICalProperty", "property", ")", "{", "if", "(", "containsIdentity", "(", "floatingProperties", ",", "property", ")", ")", "{", "return", "true", ";", "}", "if", "(", "propertyTimezones", ".", "containsKey", "(", "proper...
Determines if a property value should be formatted in floating time when written to an output stream. @param property the property @return true to format in floating time, false not to
[ "Determines", "if", "a", "property", "value", "should", "be", "formatted", "in", "floating", "time", "when", "written", "to", "an", "output", "stream", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/TimezoneInfo.java#L226-L236
train
mangstadt/biweekly
src/main/java/biweekly/io/TimezoneInfo.java
TimezoneInfo.removeIdentity
private static <T> void removeIdentity(List<T> list, T object) { Iterator<T> it = list.iterator(); while (it.hasNext()) { if (object == it.next()) { it.remove(); } } }
java
private static <T> void removeIdentity(List<T> list, T object) { Iterator<T> it = list.iterator(); while (it.hasNext()) { if (object == it.next()) { it.remove(); } } }
[ "private", "static", "<", "T", ">", "void", "removeIdentity", "(", "List", "<", "T", ">", "list", ",", "T", "object", ")", "{", "Iterator", "<", "T", ">", "it", "=", "list", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(",...
Removes an object from a list using reference equality. @param list the list @param object the object to remove
[ "Removes", "an", "object", "from", "a", "list", "using", "reference", "equality", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/TimezoneInfo.java#L282-L289
train
mangstadt/biweekly
src/main/java/biweekly/io/TimezoneInfo.java
TimezoneInfo.containsIdentity
private static <T> boolean containsIdentity(List<T> list, T object) { for (T item : list) { if (item == object) { return true; } } return false; }
java
private static <T> boolean containsIdentity(List<T> list, T object) { for (T item : list) { if (item == object) { return true; } } return false; }
[ "private", "static", "<", "T", ">", "boolean", "containsIdentity", "(", "List", "<", "T", ">", "list", ",", "T", "object", ")", "{", "for", "(", "T", "item", ":", "list", ")", "{", "if", "(", "item", "==", "object", ")", "{", "return", "true", ";...
Searches for an item in a list using reference equality. @param list the list @param object the object to search for @return true if the object was found, false if not
[ "Searches", "for", "an", "item", "in", "a", "list", "using", "reference", "equality", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/TimezoneInfo.java#L297-L304
train
mangstadt/biweekly
src/main/java/biweekly/io/chain/ChainingXmlWriter.java
ChainingXmlWriter.register
public ChainingXmlWriter register(String parameterName, ICalDataType dataType) { parameterDataTypes.put(parameterName, dataType); return this; }
java
public ChainingXmlWriter register(String parameterName, ICalDataType dataType) { parameterDataTypes.put(parameterName, dataType); return this; }
[ "public", "ChainingXmlWriter", "register", "(", "String", "parameterName", ",", "ICalDataType", "dataType", ")", "{", "parameterDataTypes", ".", "put", "(", "parameterName", ",", "dataType", ")", ";", "return", "this", ";", "}" ]
Registers the data type of a non-standard parameter. Non-standard parameters use the "unknown" data type by default. @param parameterName the parameter name (e.g. "x-foo") @param dataType the data type @return this
[ "Registers", "the", "data", "type", "of", "a", "non", "-", "standard", "parameter", ".", "Non", "-", "standard", "parameters", "use", "the", "unknown", "data", "type", "by", "default", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/chain/ChainingXmlWriter.java#L140-L143
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalModule.java
JCalModule.setScribeIndex
public void setScribeIndex(ScribeIndex index) { this.index = index; serializer.setScribeIndex(index); deserializer.setScribeIndex(index); }
java
public void setScribeIndex(ScribeIndex index) { this.index = index; serializer.setScribeIndex(index); deserializer.setScribeIndex(index); }
[ "public", "void", "setScribeIndex", "(", "ScribeIndex", "index", ")", "{", "this", ".", "index", "=", "index", ";", "serializer", ".", "setScribeIndex", "(", "index", ")", ";", "deserializer", ".", "setScribeIndex", "(", "index", ")", ";", "}" ]
Sets the scribe index for the serializer and deserializer to use. @param index the scribe index
[ "Sets", "the", "scribe", "index", "for", "the", "serializer", "and", "deserializer", "to", "use", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalModule.java#L118-L122
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalValue.java
JCalValue.multi
public static JCalValue multi(List<?> values) { List<JsonValue> multiValues = new ArrayList<JsonValue>(values.size()); for (Object value : values) { multiValues.add(new JsonValue(value)); } return new JCalValue(multiValues); }
java
public static JCalValue multi(List<?> values) { List<JsonValue> multiValues = new ArrayList<JsonValue>(values.size()); for (Object value : values) { multiValues.add(new JsonValue(value)); } return new JCalValue(multiValues); }
[ "public", "static", "JCalValue", "multi", "(", "List", "<", "?", ">", "values", ")", "{", "List", "<", "JsonValue", ">", "multiValues", "=", "new", "ArrayList", "<", "JsonValue", ">", "(", "values", ".", "size", "(", ")", ")", ";", "for", "(", "Objec...
Creates a multi-valued value. @param values the values @return the jCal value
[ "Creates", "a", "multi", "-", "valued", "value", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalValue.java#L83-L89
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalValue.java
JCalValue.structured
public static JCalValue structured(List<List<?>> values) { List<JsonValue> array = new ArrayList<JsonValue>(values.size()); for (List<?> list : values) { if (list.isEmpty()) { array.add(new JsonValue("")); continue; } if (list.size() == 1) { Object value = list.get(0); if (value == null) ...
java
public static JCalValue structured(List<List<?>> values) { List<JsonValue> array = new ArrayList<JsonValue>(values.size()); for (List<?> list : values) { if (list.isEmpty()) { array.add(new JsonValue("")); continue; } if (list.size() == 1) { Object value = list.get(0); if (value == null) ...
[ "public", "static", "JCalValue", "structured", "(", "List", "<", "List", "<", "?", ">", ">", "values", ")", "{", "List", "<", "JsonValue", ">", "array", "=", "new", "ArrayList", "<", "JsonValue", ">", "(", "values", ".", "size", "(", ")", ")", ";", ...
Creates a structured value. @param values the values @return the jCal value
[ "Creates", "a", "structured", "value", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalValue.java#L117-L146
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalValue.java
JCalValue.object
public static JCalValue object(ListMultimap<String, Object> value) { Map<String, JsonValue> object = new LinkedHashMap<String, JsonValue>(); for (Map.Entry<String, List<Object>> entry : value) { String key = entry.getKey(); List<Object> list = entry.getValue(); JsonValue v; if (list.size() == 1) { ...
java
public static JCalValue object(ListMultimap<String, Object> value) { Map<String, JsonValue> object = new LinkedHashMap<String, JsonValue>(); for (Map.Entry<String, List<Object>> entry : value) { String key = entry.getKey(); List<Object> list = entry.getValue(); JsonValue v; if (list.size() == 1) { ...
[ "public", "static", "JCalValue", "object", "(", "ListMultimap", "<", "String", ",", "Object", ">", "value", ")", "{", "Map", "<", "String", ",", "JsonValue", ">", "object", "=", "new", "LinkedHashMap", "<", "String", ",", "JsonValue", ">", "(", ")", ";",...
Creates an object value. @param value the object @return the jCal value
[ "Creates", "an", "object", "value", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalValue.java#L153-L172
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalValue.java
JCalValue.asSingle
public String asSingle() { if (values.isEmpty()) { return ""; } JsonValue first = values.get(0); if (first.isNull()) { return ""; } Object obj = first.getValue(); if (obj != null) { return obj.toString(); } //get the first element of the array List<JsonValue> array = first.getArray(); ...
java
public String asSingle() { if (values.isEmpty()) { return ""; } JsonValue first = values.get(0); if (first.isNull()) { return ""; } Object obj = first.getValue(); if (obj != null) { return obj.toString(); } //get the first element of the array List<JsonValue> array = first.getArray(); ...
[ "public", "String", "asSingle", "(", ")", "{", "if", "(", "values", ".", "isEmpty", "(", ")", ")", "{", "return", "\"\"", ";", "}", "JsonValue", "first", "=", "values", ".", "get", "(", "0", ")", ";", "if", "(", "first", ".", "isNull", "(", ")", ...
Parses this jCal value as a single-valued property value. @return the value or empty string if not found
[ "Parses", "this", "jCal", "value", "as", "a", "single", "-", "valued", "property", "value", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalValue.java#L187-L212
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalValue.java
JCalValue.asStructured
public List<List<String>> asStructured() { if (values.isEmpty()) { return Collections.emptyList(); } JsonValue first = values.get(0); //["request-status", {}, "text", ["2.0", "Success"] ] List<JsonValue> array = first.getArray(); if (array != null) { List<List<String>> components = new ArrayList<Lis...
java
public List<List<String>> asStructured() { if (values.isEmpty()) { return Collections.emptyList(); } JsonValue first = values.get(0); //["request-status", {}, "text", ["2.0", "Success"] ] List<JsonValue> array = first.getArray(); if (array != null) { List<List<String>> components = new ArrayList<Lis...
[ "public", "List", "<", "List", "<", "String", ">", ">", "asStructured", "(", ")", "{", "if", "(", "values", ".", "isEmpty", "(", ")", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "JsonValue", "first", "=", "values", ".", ...
Parses this jCal value as a structured property value. @return the structured values or empty list if not found
[ "Parses", "this", "jCal", "value", "as", "a", "structured", "property", "value", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalValue.java#L218-L286
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalValue.java
JCalValue.asMulti
public List<String> asMulti() { if (values.isEmpty()) { return Collections.emptyList(); } List<String> multi = new ArrayList<String>(values.size()); for (JsonValue value : values) { if (value.isNull()) { multi.add(""); continue; } Object obj = value.getValue(); if (obj != null) { mu...
java
public List<String> asMulti() { if (values.isEmpty()) { return Collections.emptyList(); } List<String> multi = new ArrayList<String>(values.size()); for (JsonValue value : values) { if (value.isNull()) { multi.add(""); continue; } Object obj = value.getValue(); if (obj != null) { mu...
[ "public", "List", "<", "String", ">", "asMulti", "(", ")", "{", "if", "(", "values", ".", "isEmpty", "(", ")", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "List", "<", "String", ">", "multi", "=", "new", "ArrayList", "<...
Parses this jCal value as a multi-valued property value. @return the values or empty list if not found
[ "Parses", "this", "jCal", "value", "as", "a", "multi", "-", "valued", "property", "value", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalValue.java#L292-L311
train
mangstadt/biweekly
src/main/java/biweekly/io/json/JCalValue.java
JCalValue.asObject
public ListMultimap<String, String> asObject() { if (values.isEmpty()) { return new ListMultimap<String, String>(0); } Map<String, JsonValue> map = values.get(0).getObject(); if (map == null) { return new ListMultimap<String, String>(0); } ListMultimap<String, String> values = new ListMultimap<Strin...
java
public ListMultimap<String, String> asObject() { if (values.isEmpty()) { return new ListMultimap<String, String>(0); } Map<String, JsonValue> map = values.get(0).getObject(); if (map == null) { return new ListMultimap<String, String>(0); } ListMultimap<String, String> values = new ListMultimap<Strin...
[ "public", "ListMultimap", "<", "String", ",", "String", ">", "asObject", "(", ")", "{", "if", "(", "values", ".", "isEmpty", "(", ")", ")", "{", "return", "new", "ListMultimap", "<", "String", ",", "String", ">", "(", "0", ")", ";", "}", "Map", "<"...
Parses this jCal value as an object property value. @return the object or an empty map if not found
[ "Parses", "this", "jCal", "value", "as", "an", "object", "property", "value", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/json/JCalValue.java#L317-L359
train
mangstadt/biweekly
src/main/java/biweekly/util/DateTimeComponents.java
DateTimeComponents.parse
public static DateTimeComponents parse(String dateString, Boolean hasTime) { Matcher m = regex.matcher(dateString); if (!m.find()) { throw Messages.INSTANCE.getIllegalArgumentException(19, dateString); } int i = 1; int year = Integer.parseInt(m.group(i++)); int month = Integer.parseInt(m.group(i++)); ...
java
public static DateTimeComponents parse(String dateString, Boolean hasTime) { Matcher m = regex.matcher(dateString); if (!m.find()) { throw Messages.INSTANCE.getIllegalArgumentException(19, dateString); } int i = 1; int year = Integer.parseInt(m.group(i++)); int month = Integer.parseInt(m.group(i++)); ...
[ "public", "static", "DateTimeComponents", "parse", "(", "String", "dateString", ",", "Boolean", "hasTime", ")", "{", "Matcher", "m", "=", "regex", ".", "matcher", "(", "dateString", ")", ";", "if", "(", "!", "m", ".", "find", "(", ")", ")", "{", "throw...
Parses the components out of a date-time string. @param dateString the date-time string (basic and extended formats are supported, e.g. "20130331T020000" or "2013-03-31T02:00:00") @param hasTime true to force the value to be parsed as a date-time value, false to force the value to be parsed as a date value, null to par...
[ "Parses", "the", "components", "out", "of", "a", "date", "-", "time", "string", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/DateTimeComponents.java#L92-L124
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/RecurrenceIteratorFactory.java
RecurrenceIteratorFactory.createRecurrenceIterator
public static RecurrenceIterator createRecurrenceIterator(Collection<? extends DateValue> dates) { DateValue[] datesArray = dates.toArray(new DateValue[0]); return new RDateIteratorImpl(datesArray); }
java
public static RecurrenceIterator createRecurrenceIterator(Collection<? extends DateValue> dates) { DateValue[] datesArray = dates.toArray(new DateValue[0]); return new RDateIteratorImpl(datesArray); }
[ "public", "static", "RecurrenceIterator", "createRecurrenceIterator", "(", "Collection", "<", "?", "extends", "DateValue", ">", "dates", ")", "{", "DateValue", "[", "]", "datesArray", "=", "dates", ".", "toArray", "(", "new", "DateValue", "[", "0", "]", ")", ...
Creates a recurrence iterator from an RDATE or EXDATE list. @param dates the list of dates @return the iterator
[ "Creates", "a", "recurrence", "iterator", "from", "an", "RDATE", "or", "EXDATE", "list", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/RecurrenceIteratorFactory.java#L104-L107
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/RecurrenceIteratorFactory.java
RecurrenceIteratorFactory.createRecurrenceIterable
public static RecurrenceIterable createRecurrenceIterable(final Recurrence rrule, final DateValue dtStart, final TimeZone tzid) { return new RecurrenceIterable() { public RecurrenceIterator iterator() { return createRecurrenceIterator(rrule, dtStart, tzid); } }; }
java
public static RecurrenceIterable createRecurrenceIterable(final Recurrence rrule, final DateValue dtStart, final TimeZone tzid) { return new RecurrenceIterable() { public RecurrenceIterator iterator() { return createRecurrenceIterator(rrule, dtStart, tzid); } }; }
[ "public", "static", "RecurrenceIterable", "createRecurrenceIterable", "(", "final", "Recurrence", "rrule", ",", "final", "DateValue", "dtStart", ",", "final", "TimeZone", "tzid", ")", "{", "return", "new", "RecurrenceIterable", "(", ")", "{", "public", "RecurrenceIt...
Creates a recurrence iterable from an RRULE. @param rrule the recurrence rule @param dtStart the start date of the series @param tzid the timezone that the start date is in, as well as the timezone to iterate in @return the iterable
[ "Creates", "a", "recurrence", "iterable", "from", "an", "RRULE", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/RecurrenceIteratorFactory.java#L117-L123
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/RecurrenceIteratorFactory.java
RecurrenceIteratorFactory.join
public static RecurrenceIterator join(RecurrenceIterator first, RecurrenceIterator... rest) { List<RecurrenceIterator> all = new ArrayList<RecurrenceIterator>(); all.add(first); all.addAll(Arrays.asList(rest)); return new CompoundIteratorImpl(all, Collections.<RecurrenceIterator> emptyList()); }
java
public static RecurrenceIterator join(RecurrenceIterator first, RecurrenceIterator... rest) { List<RecurrenceIterator> all = new ArrayList<RecurrenceIterator>(); all.add(first); all.addAll(Arrays.asList(rest)); return new CompoundIteratorImpl(all, Collections.<RecurrenceIterator> emptyList()); }
[ "public", "static", "RecurrenceIterator", "join", "(", "RecurrenceIterator", "first", ",", "RecurrenceIterator", "...", "rest", ")", "{", "List", "<", "RecurrenceIterator", ">", "all", "=", "new", "ArrayList", "<", "RecurrenceIterator", ">", "(", ")", ";", "all"...
Generates a recurrence iterator that iterates over the union of the given recurrence iterators. @param first the first recurrence iterator @param rest the other recurrence iterators @return the union iterator
[ "Generates", "a", "recurrence", "iterator", "that", "iterates", "over", "the", "union", "of", "the", "given", "recurrence", "iterators", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/RecurrenceIteratorFactory.java#L461-L466
train
mangstadt/biweekly
src/main/java/biweekly/util/Duration.java
Duration.parse
public static Duration parse(String value) { /* * Implementation note: Regular expressions are not used to improve * performance. */ if (value.length() == 0) { throw parseError(value); } int index = 0; char first = value.charAt(index); boolean prior = (first == '-'); if (first == '-' || firs...
java
public static Duration parse(String value) { /* * Implementation note: Regular expressions are not used to improve * performance. */ if (value.length() == 0) { throw parseError(value); } int index = 0; char first = value.charAt(index); boolean prior = (first == '-'); if (first == '-' || firs...
[ "public", "static", "Duration", "parse", "(", "String", "value", ")", "{", "/*\n\t\t * Implementation note: Regular expressions are not used to improve\n\t\t * performance.\n\t\t */", "if", "(", "value", ".", "length", "(", ")", "==", "0", ")", "{", "throw", "parseError",...
Parses a duration string. @param value the duration string (e.g. "P30DT10H") @return the parsed duration @throws IllegalArgumentException if the duration string is invalid
[ "Parses", "a", "duration", "string", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/Duration.java#L75-L146
train
mangstadt/biweekly
src/main/java/biweekly/util/Duration.java
Duration.diff
public static Duration diff(Date start, Date end) { return fromMillis(end.getTime() - start.getTime()); }
java
public static Duration diff(Date start, Date end) { return fromMillis(end.getTime() - start.getTime()); }
[ "public", "static", "Duration", "diff", "(", "Date", "start", ",", "Date", "end", ")", "{", "return", "fromMillis", "(", "end", ".", "getTime", "(", ")", "-", "start", ".", "getTime", "(", ")", ")", ";", "}" ]
Builds a duration based on the difference between two dates. @param start the start date @param end the end date @return the duration
[ "Builds", "a", "duration", "based", "on", "the", "difference", "between", "two", "dates", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/Duration.java#L158-L160
train
mangstadt/biweekly
src/main/java/biweekly/util/Duration.java
Duration.fromMillis
public static Duration fromMillis(long milliseconds) { Duration.Builder builder = builder(); if (milliseconds < 0) { builder.prior(true); milliseconds *= -1; } int seconds = (int) (milliseconds / 1000); Integer weeks = seconds / (60 * 60 * 24 * 7); if (weeks > 0) { builder.weeks(weeks); } se...
java
public static Duration fromMillis(long milliseconds) { Duration.Builder builder = builder(); if (milliseconds < 0) { builder.prior(true); milliseconds *= -1; } int seconds = (int) (milliseconds / 1000); Integer weeks = seconds / (60 * 60 * 24 * 7); if (weeks > 0) { builder.weeks(weeks); } se...
[ "public", "static", "Duration", "fromMillis", "(", "long", "milliseconds", ")", "{", "Duration", ".", "Builder", "builder", "=", "builder", "(", ")", ";", "if", "(", "milliseconds", "<", "0", ")", "{", "builder", ".", "prior", "(", "true", ")", ";", "m...
Builds a duration from a number of milliseconds. @param milliseconds the number of milliseconds @return the duration
[ "Builds", "a", "duration", "from", "a", "number", "of", "milliseconds", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/Duration.java#L167-L206
train
mangstadt/biweekly
src/main/java/biweekly/util/Duration.java
Duration.toMillis
public long toMillis() { long totalSeconds = 0; if (weeks != null) { totalSeconds += 60L * 60 * 24 * 7 * weeks; } if (days != null) { totalSeconds += 60L * 60 * 24 * days; } if (hours != null) { totalSeconds += 60L * 60 * hours; } if (minutes != null) { totalSeconds += 60L * minutes; } ...
java
public long toMillis() { long totalSeconds = 0; if (weeks != null) { totalSeconds += 60L * 60 * 24 * 7 * weeks; } if (days != null) { totalSeconds += 60L * 60 * 24 * days; } if (hours != null) { totalSeconds += 60L * 60 * hours; } if (minutes != null) { totalSeconds += 60L * minutes; } ...
[ "public", "long", "toMillis", "(", ")", "{", "long", "totalSeconds", "=", "0", ";", "if", "(", "weeks", "!=", "null", ")", "{", "totalSeconds", "+=", "60L", "*", "60", "*", "24", "*", "7", "*", "weeks", ";", "}", "if", "(", "days", "!=", "null", ...
Converts the duration value to milliseconds. @return the duration value in milliseconds (will be negative if {@link #isPrior} is true)
[ "Converts", "the", "duration", "value", "to", "milliseconds", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/Duration.java#L302-L325
train
mangstadt/biweekly
src/main/java/biweekly/util/com/google/ical/iter/RDateIteratorImpl.java
RDateIteratorImpl.removeDuplicates
private static DateValue[] removeDuplicates(DateValue[] dates) { int k = 0; for (int i = 1; i < dates.length; ++i) { if (!dates[i].equals(dates[k])) { dates[++k] = dates[i]; } } if (++k < dates.length) { DateValue[] uniqueDates = new DateValue[k]; System.arraycopy(dates, 0, uniqueDates, 0, k); ...
java
private static DateValue[] removeDuplicates(DateValue[] dates) { int k = 0; for (int i = 1; i < dates.length; ++i) { if (!dates[i].equals(dates[k])) { dates[++k] = dates[i]; } } if (++k < dates.length) { DateValue[] uniqueDates = new DateValue[k]; System.arraycopy(dates, 0, uniqueDates, 0, k); ...
[ "private", "static", "DateValue", "[", "]", "removeDuplicates", "(", "DateValue", "[", "]", "dates", ")", "{", "int", "k", "=", "0", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "dates", ".", "length", ";", "++", "i", ")", "{", "if", "...
Removes duplicates from a list of date values. @param dates the date values (must be sorted in ascending order) @return a new array if any elements were removed or the original array if no elements were removed
[ "Removes", "duplicates", "from", "a", "list", "of", "date", "values", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/util/com/google/ical/iter/RDateIteratorImpl.java#L94-L108
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/component/ICalComponentScribe.java
ICalComponentScribe.emptyInstance
public T emptyInstance() { T component = _newInstance(); //remove any properties/components that were created in the constructor component.getProperties().clear(); component.getComponents().clear(); return component; }
java
public T emptyInstance() { T component = _newInstance(); //remove any properties/components that were created in the constructor component.getProperties().clear(); component.getComponents().clear(); return component; }
[ "public", "T", "emptyInstance", "(", ")", "{", "T", "component", "=", "_newInstance", "(", ")", ";", "//remove any properties/components that were created in the constructor", "component", ".", "getProperties", "(", ")", ".", "clear", "(", ")", ";", "component", "."...
Creates a new instance of the component class that doesn't have any properties or sub-components. @return the new instance
[ "Creates", "a", "new", "instance", "of", "the", "component", "class", "that", "doesn", "t", "have", "any", "properties", "or", "sub", "-", "components", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/component/ICalComponentScribe.java#L90-L98
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/component/ICalComponentScribe.java
ICalComponentScribe.getComponents
public List<ICalComponent> getComponents(T component) { return new ArrayList<ICalComponent>(component.getComponents().values()); }
java
public List<ICalComponent> getComponents(T component) { return new ArrayList<ICalComponent>(component.getComponents().values()); }
[ "public", "List", "<", "ICalComponent", ">", "getComponents", "(", "T", "component", ")", "{", "return", "new", "ArrayList", "<", "ICalComponent", ">", "(", "component", ".", "getComponents", "(", ")", ".", "values", "(", ")", ")", ";", "}" ]
Gets the sub-components to marshal. Child classes can override this for better control over which components are marshalled. @param component the component @return the sub-components to marshal
[ "Gets", "the", "sub", "-", "components", "to", "marshal", ".", "Child", "classes", "can", "override", "this", "for", "better", "control", "over", "which", "components", "are", "marshalled", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/component/ICalComponentScribe.java#L112-L114
train
mangstadt/biweekly
src/main/java/biweekly/io/scribe/component/ICalComponentScribe.java
ICalComponentScribe.getProperties
public List<ICalProperty> getProperties(T component) { return new ArrayList<ICalProperty>(component.getProperties().values()); }
java
public List<ICalProperty> getProperties(T component) { return new ArrayList<ICalProperty>(component.getProperties().values()); }
[ "public", "List", "<", "ICalProperty", ">", "getProperties", "(", "T", "component", ")", "{", "return", "new", "ArrayList", "<", "ICalProperty", ">", "(", "component", ".", "getProperties", "(", ")", ".", "values", "(", ")", ")", ";", "}" ]
Gets the properties to marshal. Child classes can override this for better control over which properties are marshalled. @param component the component @return the properties to marshal
[ "Gets", "the", "properties", "to", "marshal", ".", "Child", "classes", "can", "override", "this", "for", "better", "control", "over", "which", "properties", "are", "marshalled", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/scribe/component/ICalComponentScribe.java#L122-L124
train
mangstadt/biweekly
src/main/java/biweekly/io/xml/XCalWriterBase.java
XCalWriterBase.registerParameterDataType
public void registerParameterDataType(String parameterName, ICalDataType dataType) { parameterName = parameterName.toLowerCase(); if (dataType == null) { parameterDataTypes.remove(parameterName); } else { parameterDataTypes.put(parameterName, dataType); } }
java
public void registerParameterDataType(String parameterName, ICalDataType dataType) { parameterName = parameterName.toLowerCase(); if (dataType == null) { parameterDataTypes.remove(parameterName); } else { parameterDataTypes.put(parameterName, dataType); } }
[ "public", "void", "registerParameterDataType", "(", "String", "parameterName", ",", "ICalDataType", "dataType", ")", "{", "parameterName", "=", "parameterName", ".", "toLowerCase", "(", ")", ";", "if", "(", "dataType", "==", "null", ")", "{", "parameterDataTypes",...
Registers the data type of an experimental parameter. Experimental parameters use the "unknown" data type by default. @param parameterName the parameter name (e.g. "x-foo") @param dataType the data type or null to remove
[ "Registers", "the", "data", "type", "of", "an", "experimental", "parameter", ".", "Experimental", "parameters", "use", "the", "unknown", "data", "type", "by", "default", "." ]
2e21350f85c13dfff52fdef98fdbebe2976fcf61
https://github.com/mangstadt/biweekly/blob/2e21350f85c13dfff52fdef98fdbebe2976fcf61/src/main/java/biweekly/io/xml/XCalWriterBase.java#L90-L97
train
offbynull/coroutines
java-agent/src/main/java/com/offbynull/coroutines/javaagent/CoroutinesAgent.java
CoroutinesAgent.premain
public static void premain(String agentArgs, Instrumentation inst) { // How do agent args work? http://stackoverflow.com/questions/23287228/how-do-i-pass-arguments-to-a-java-instrumentation-agent // e.g. java -javaagent:/path/to/agent.jar=argumentstring MarkerType markerType = MarkerTyp...
java
public static void premain(String agentArgs, Instrumentation inst) { // How do agent args work? http://stackoverflow.com/questions/23287228/how-do-i-pass-arguments-to-a-java-instrumentation-agent // e.g. java -javaagent:/path/to/agent.jar=argumentstring MarkerType markerType = MarkerTyp...
[ "public", "static", "void", "premain", "(", "String", "agentArgs", ",", "Instrumentation", "inst", ")", "{", "// How do agent args work? http://stackoverflow.com/questions/23287228/how-do-i-pass-arguments-to-a-java-instrumentation-agent", "// e.g. java -javaagent:/path/to/agent.jar=argumen...
Java agent premain. @param agentArgs args passed in to agent @param inst instrumentation for agent @throws NullPointerException if {@code inst} is {@code null} @throws IllegalArgumentException if {@code agentArgs} is present but not in the expected format, or if the passed in arguments were not parseable
[ "Java", "agent", "premain", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/java-agent/src/main/java/com/offbynull/coroutines/javaagent/CoroutinesAgent.java#L48-L100
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/OperandStackStateGenerators.java
OperandStackStateGenerators.computeSizes
public static StorageSizes computeSizes(Frame<BasicValue> frame, int offset, int length) { Validate.notNull(frame); Validate.isTrue(offset >= 0); Validate.isTrue(length >= 0); Validate.isTrue(offset < frame.getStackSize()); Validate.isTrue(offset + length <= frame.getStackSize())...
java
public static StorageSizes computeSizes(Frame<BasicValue> frame, int offset, int length) { Validate.notNull(frame); Validate.isTrue(offset >= 0); Validate.isTrue(length >= 0); Validate.isTrue(offset < frame.getStackSize()); Validate.isTrue(offset + length <= frame.getStackSize())...
[ "public", "static", "StorageSizes", "computeSizes", "(", "Frame", "<", "BasicValue", ">", "frame", ",", "int", "offset", ",", "int", "length", ")", "{", "Validate", ".", "notNull", "(", "frame", ")", ";", "Validate", ".", "isTrue", "(", "offset", ">=", "...
Compute sizes required for the storage arrays that will contain the operand stack at this frame. @param frame frame to compute for @param offset the position within the operand stack to start calculating @param length the number of stack items to include in calculation @return size required by each storage array @throw...
[ "Compute", "sizes", "required", "for", "the", "storage", "arrays", "that", "will", "contain", "the", "operand", "stack", "at", "this", "frame", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/OperandStackStateGenerators.java#L458-L512
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.jumpTo
public static InsnList jumpTo(LabelNode labelNode) { Validate.notNull(labelNode); InsnList ret = new InsnList(); ret.add(new JumpInsnNode(Opcodes.GOTO, labelNode)); return ret; }
java
public static InsnList jumpTo(LabelNode labelNode) { Validate.notNull(labelNode); InsnList ret = new InsnList(); ret.add(new JumpInsnNode(Opcodes.GOTO, labelNode)); return ret; }
[ "public", "static", "InsnList", "jumpTo", "(", "LabelNode", "labelNode", ")", "{", "Validate", ".", "notNull", "(", "labelNode", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "new", "JumpInsnNode", "(", "Opco...
Generates instructions for an unconditional jump to a label. @param labelNode label to jump to @throws NullPointerException if any argument is {@code null} @return instructions for an unconditional jump to {@code labelNode}
[ "Generates", "instructions", "for", "an", "unconditional", "jump", "to", "a", "label", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L254-L261
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.addLabel
public static InsnList addLabel(LabelNode labelNode) { Validate.notNull(labelNode); InsnList ret = new InsnList(); ret.add(labelNode); return ret; }
java
public static InsnList addLabel(LabelNode labelNode) { Validate.notNull(labelNode); InsnList ret = new InsnList(); ret.add(labelNode); return ret; }
[ "public", "static", "InsnList", "addLabel", "(", "LabelNode", "labelNode", ")", "{", "Validate", ".", "notNull", "(", "labelNode", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "labelNode", ")", ";", "return"...
Generates instructions for a label. @param labelNode label to insert @throws NullPointerException if any argument is {@code null} @return instructions for a label
[ "Generates", "instructions", "for", "a", "label", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L269-L276
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.lineNumber
public static InsnList lineNumber(int num) { Validate.isTrue(num >= 0); InsnList ret = new InsnList(); LabelNode labelNode = new LabelNode(); ret.add(labelNode); ret.add(new LineNumberNode(num, labelNode)); return ret; }
java
public static InsnList lineNumber(int num) { Validate.isTrue(num >= 0); InsnList ret = new InsnList(); LabelNode labelNode = new LabelNode(); ret.add(labelNode); ret.add(new LineNumberNode(num, labelNode)); return ret; }
[ "public", "static", "InsnList", "lineNumber", "(", "int", "num", ")", "{", "Validate", ".", "isTrue", "(", "num", ">=", "0", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "LabelNode", "labelNode", "=", "new", "LabelNode", "(", ")"...
Generates instructions for line numbers. This is useful for debugging. For example, you can put a line number of 99999 or some other special number to denote that the code being executed is instrumented code. Then if a stacktrace happens, you'll know that if instrumented code was immediately involved. @param num line n...
[ "Generates", "instructions", "for", "line", "numbers", ".", "This", "is", "useful", "for", "debugging", ".", "For", "example", "you", "can", "put", "a", "line", "number", "of", "99999", "or", "some", "other", "special", "number", "to", "denote", "that", "t...
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L286-L296
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.pop
public static InsnList pop() { InsnList ret = new InsnList(); ret.add(new InsnNode(Opcodes.POP)); return ret; }
java
public static InsnList pop() { InsnList ret = new InsnList(); ret.add(new InsnNode(Opcodes.POP)); return ret; }
[ "public", "static", "InsnList", "pop", "(", ")", "{", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "new", "InsnNode", "(", "Opcodes", ".", "POP", ")", ")", ";", "return", "ret", ";", "}" ]
Generates instructions to pop an item off the stack. @return instructions for a pop
[ "Generates", "instructions", "to", "pop", "an", "item", "off", "the", "stack", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L302-L307
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.monitorEnter
public static InsnList monitorEnter() { InsnList ret = new InsnList(); ret.add(new InsnNode(Opcodes.MONITORENTER)); return ret; }
java
public static InsnList monitorEnter() { InsnList ret = new InsnList(); ret.add(new InsnNode(Opcodes.MONITORENTER)); return ret; }
[ "public", "static", "InsnList", "monitorEnter", "(", ")", "{", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "new", "InsnNode", "(", "Opcodes", ".", "MONITORENTER", ")", ")", ";", "return", "ret", ";", "}" ]
Generates a MONITORENTER instruction, which consumes an Object from the top of the stack. @return instructions for a pop
[ "Generates", "a", "MONITORENTER", "instruction", "which", "consumes", "an", "Object", "from", "the", "top", "of", "the", "stack", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L329-L334
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.monitorExit
public static InsnList monitorExit() { InsnList ret = new InsnList(); ret.add(new InsnNode(Opcodes.MONITOREXIT)); return ret; }
java
public static InsnList monitorExit() { InsnList ret = new InsnList(); ret.add(new InsnNode(Opcodes.MONITOREXIT)); return ret; }
[ "public", "static", "InsnList", "monitorExit", "(", ")", "{", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "new", "InsnNode", "(", "Opcodes", ".", "MONITOREXIT", ")", ")", ";", "return", "ret", ";", "}" ]
Generates a MONITOREXIT instruction, which consumes an Object from the top of the stack. @return instructions for a pop
[ "Generates", "a", "MONITOREXIT", "instruction", "which", "consumes", "an", "Object", "from", "the", "top", "of", "the", "stack", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L340-L345
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.loadIntConst
public static InsnList loadIntConst(int i) { InsnList ret = new InsnList(); ret.add(new LdcInsnNode(i)); return ret; }
java
public static InsnList loadIntConst(int i) { InsnList ret = new InsnList(); ret.add(new LdcInsnNode(i)); return ret; }
[ "public", "static", "InsnList", "loadIntConst", "(", "int", "i", ")", "{", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "new", "LdcInsnNode", "(", "i", ")", ")", ";", "return", "ret", ";", "}" ]
Generates instructions to push an integer constant on to the stack. @param i integer constant to push @return instructions to push an integer constant
[ "Generates", "instructions", "to", "push", "an", "integer", "constant", "on", "to", "the", "stack", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L352-L356
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.loadStringConst
public static InsnList loadStringConst(String s) { Validate.notNull(s); InsnList ret = new InsnList(); ret.add(new LdcInsnNode(s)); return ret; }
java
public static InsnList loadStringConst(String s) { Validate.notNull(s); InsnList ret = new InsnList(); ret.add(new LdcInsnNode(s)); return ret; }
[ "public", "static", "InsnList", "loadStringConst", "(", "String", "s", ")", "{", "Validate", ".", "notNull", "(", "s", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "new", "LdcInsnNode", "(", "s", ")", ")...
Generates instruction to push a string constant on to the stack. @param s string constant to push @return instructions to push a string constant @throws NullPointerException if any argument is {@code null}
[ "Generates", "instruction", "to", "push", "a", "string", "constant", "on", "to", "the", "stack", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L364-L369
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.loadNull
public static InsnList loadNull() { InsnList ret = new InsnList(); ret.add(new InsnNode(Opcodes.ACONST_NULL)); return ret; }
java
public static InsnList loadNull() { InsnList ret = new InsnList(); ret.add(new InsnNode(Opcodes.ACONST_NULL)); return ret; }
[ "public", "static", "InsnList", "loadNull", "(", ")", "{", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "new", "InsnNode", "(", "Opcodes", ".", "ACONST_NULL", ")", ")", ";", "return", "ret", ";", "}" ]
Generates instruction to push a null on to the stack. @return instructions to push a null
[ "Generates", "instruction", "to", "push", "a", "null", "on", "to", "the", "stack", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L375-L379
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.loadVar
public static InsnList loadVar(Variable variable) { Validate.notNull(variable); InsnList ret = new InsnList(); switch (variable.getType().getSort()) { case Type.BOOLEAN: case Type.BYTE: case Type.CHAR: case Type.SHORT: case Type.INT: ...
java
public static InsnList loadVar(Variable variable) { Validate.notNull(variable); InsnList ret = new InsnList(); switch (variable.getType().getSort()) { case Type.BOOLEAN: case Type.BYTE: case Type.CHAR: case Type.SHORT: case Type.INT: ...
[ "public", "static", "InsnList", "loadVar", "(", "Variable", "variable", ")", "{", "Validate", ".", "notNull", "(", "variable", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "switch", "(", "variable", ".", "getType", "(", ")", ".", ...
Copies a local variable on to the stack. @param variable variable within the local variable table to load from @return instructions to load a local variable on to the stack @throws NullPointerException if any argument is {@code null} @throws IllegalArgumentException if {@code variable} has been released
[ "Copies", "a", "local", "variable", "on", "to", "the", "stack", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L388-L421
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.saveVar
public static InsnList saveVar(Variable variable) { Validate.notNull(variable); InsnList ret = new InsnList(); switch (variable.getType().getSort()) { case Type.BOOLEAN: case Type.BYTE: case Type.CHAR: case Type.SHORT: case Type.INT: ...
java
public static InsnList saveVar(Variable variable) { Validate.notNull(variable); InsnList ret = new InsnList(); switch (variable.getType().getSort()) { case Type.BOOLEAN: case Type.BYTE: case Type.CHAR: case Type.SHORT: case Type.INT: ...
[ "public", "static", "InsnList", "saveVar", "(", "Variable", "variable", ")", "{", "Validate", ".", "notNull", "(", "variable", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "switch", "(", "variable", ".", "getType", "(", ")", ".", ...
Pops the stack in to the the local variable table. You may run in to problems if the item on top of the stack isn't of the same type as the variable it's being put in to. @param variable variable within the local variable table to save to @return instructions to pop an item off the top of the stack and save it to {@cod...
[ "Pops", "the", "stack", "in", "to", "the", "the", "local", "variable", "table", ".", "You", "may", "run", "in", "to", "problems", "if", "the", "item", "on", "top", "of", "the", "stack", "isn", "t", "of", "the", "same", "type", "as", "the", "variable"...
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L431-L462
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.createNewObjectArray
public static InsnList createNewObjectArray(InsnList size) { Validate.notNull(size); InsnList ret = new InsnList(); ret.add(size); ret.add(new TypeInsnNode(Opcodes.ANEWARRAY, "java/lang/Object")); return ret; }
java
public static InsnList createNewObjectArray(InsnList size) { Validate.notNull(size); InsnList ret = new InsnList(); ret.add(size); ret.add(new TypeInsnNode(Opcodes.ANEWARRAY, "java/lang/Object")); return ret; }
[ "public", "static", "InsnList", "createNewObjectArray", "(", "InsnList", "size", ")", "{", "Validate", ".", "notNull", "(", "size", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "size", ")", ";", "ret", "."...
Creates a new object array on the stack. @param size instructions to calculate the size of the new array -- must leave an int on the stack @return instructions to create a new object array -- will leave the object array on the stack @throws NullPointerException if any argument is {@code null}
[ "Creates", "a", "new", "object", "array", "on", "the", "stack", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L534-L543
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.loadArrayLength
public static InsnList loadArrayLength(InsnList arrayRef) { Validate.notNull(arrayRef); InsnList ret = new InsnList(); ret.add(arrayRef); ret.add(new InsnNode(Opcodes.ARRAYLENGTH)); return ret; }
java
public static InsnList loadArrayLength(InsnList arrayRef) { Validate.notNull(arrayRef); InsnList ret = new InsnList(); ret.add(arrayRef); ret.add(new InsnNode(Opcodes.ARRAYLENGTH)); return ret; }
[ "public", "static", "InsnList", "loadArrayLength", "(", "InsnList", "arrayRef", ")", "{", "Validate", ".", "notNull", "(", "arrayRef", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ")", ";", "ret", ".", "add", "(", "arrayRef", ")", ";", "ret"...
Gets the size of an array and puts it on to the stack. @param arrayRef instructions to get the array -- must leave an array on the stack @return instructions to get the size of the array -- will size an int on the stack @throws NullPointerException if any argument is {@code null}
[ "Gets", "the", "size", "of", "an", "array", "and", "puts", "it", "on", "to", "the", "stack", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L551-L559
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.addIntegers
public static InsnList addIntegers(InsnList lhs, InsnList rhs) { Validate.notNull(lhs); Validate.notNull(rhs); InsnList ret = new InsnList(); ret.add(lhs); ret.add(rhs); ret.add(new InsnNode(Opcodes.IADD)); return ret; }
java
public static InsnList addIntegers(InsnList lhs, InsnList rhs) { Validate.notNull(lhs); Validate.notNull(rhs); InsnList ret = new InsnList(); ret.add(lhs); ret.add(rhs); ret.add(new InsnNode(Opcodes.IADD)); return ret; }
[ "public", "static", "InsnList", "addIntegers", "(", "InsnList", "lhs", ",", "InsnList", "rhs", ")", "{", "Validate", ".", "notNull", "(", "lhs", ")", ";", "Validate", ".", "notNull", "(", "rhs", ")", ";", "InsnList", "ret", "=", "new", "InsnList", "(", ...
Adds two integers together and puts the result on to the stack. @param lhs instructions to generate the first operand -- must leave an int on the stack @param rhs instructions to generate the second operand -- must leave an int on the stack @return instructions to add the two numbers together -- will leave an int on th...
[ "Adds", "two", "integers", "together", "and", "puts", "the", "result", "on", "to", "the", "stack", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L568-L579
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.ifIntegersEqual
public static InsnList ifIntegersEqual(InsnList lhs, InsnList rhs, InsnList action) { Validate.notNull(lhs); Validate.notNull(rhs); Validate.notNull(action); InsnList ret = new InsnList(); LabelNode notEqualLabelNode = new LabelNode(); ...
java
public static InsnList ifIntegersEqual(InsnList lhs, InsnList rhs, InsnList action) { Validate.notNull(lhs); Validate.notNull(rhs); Validate.notNull(action); InsnList ret = new InsnList(); LabelNode notEqualLabelNode = new LabelNode(); ...
[ "public", "static", "InsnList", "ifIntegersEqual", "(", "InsnList", "lhs", ",", "InsnList", "rhs", ",", "InsnList", "action", ")", "{", "Validate", ".", "notNull", "(", "lhs", ")", ";", "Validate", ".", "notNull", "(", "rhs", ")", ";", "Validate", ".", "...
Compares two integers and performs some action if the integers are equal. @param lhs left hand side instruction list -- must leave an int on the stack @param rhs right hand side instruction list -- must leave an int on the stack @param action action to perform if results of {@code lhs} and {@code rhs} are equal @return...
[ "Compares", "two", "integers", "and", "performs", "some", "action", "if", "the", "integers", "are", "equal", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L621-L638
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.forEach
public static InsnList forEach(Variable counterVar, Variable arrayLenVar, InsnList array, InsnList action) { Validate.notNull(counterVar); Validate.notNull(arrayLenVar); Validate.notNull(array); Validate.notNull(action); Validate.isTrue(counterVar.getType().equals(Type.INT_TYPE))...
java
public static InsnList forEach(Variable counterVar, Variable arrayLenVar, InsnList array, InsnList action) { Validate.notNull(counterVar); Validate.notNull(arrayLenVar); Validate.notNull(array); Validate.notNull(action); Validate.isTrue(counterVar.getType().equals(Type.INT_TYPE))...
[ "public", "static", "InsnList", "forEach", "(", "Variable", "counterVar", ",", "Variable", "arrayLenVar", ",", "InsnList", "array", ",", "InsnList", "action", ")", "{", "Validate", ".", "notNull", "(", "counterVar", ")", ";", "Validate", ".", "notNull", "(", ...
For each element in an object array, performs an action. @param counterVar parameter used to keep track of count in loop @param arrayLenVar parameter used to keep track of array length @param array object array instruction list -- must leave an array on the stack @param action action to perform on each element -- eleme...
[ "For", "each", "element", "in", "an", "object", "array", "performs", "an", "action", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L702-L751
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.combineObjectArrays
public static InsnList combineObjectArrays(Variable destArrayVar, Variable firstArrayVar, Variable secondArrayVar) { Validate.notNull(destArrayVar); Validate.notNull(firstArrayVar); Validate.notNull(secondArrayVar); Validate.isTrue(destArrayVar.getType().equals(Type.getType(Object[].clas...
java
public static InsnList combineObjectArrays(Variable destArrayVar, Variable firstArrayVar, Variable secondArrayVar) { Validate.notNull(destArrayVar); Validate.notNull(firstArrayVar); Validate.notNull(secondArrayVar); Validate.isTrue(destArrayVar.getType().equals(Type.getType(Object[].clas...
[ "public", "static", "InsnList", "combineObjectArrays", "(", "Variable", "destArrayVar", ",", "Variable", "firstArrayVar", ",", "Variable", "secondArrayVar", ")", "{", "Validate", ".", "notNull", "(", "destArrayVar", ")", ";", "Validate", ".", "notNull", "(", "firs...
Concatenates two object arrays together. @param destArrayVar variable to put concatenated object array in @param firstArrayVar variable of first object array @param secondArrayVar variable of second object array @return instructions to create a new object array where the first part of the array is the contents of {@cod...
[ "Concatenates", "two", "object", "arrays", "together", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L850-L887
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.tryCatchBlock
public static InsnList tryCatchBlock(TryCatchBlockNode tryCatchBlockNode, Type exceptionType, InsnList tryInsnList, InsnList catchInsnList) { Validate.notNull(tryInsnList); // exceptionType can be null Validate.notNull(catchInsnList); if (exceptionType != null) { ...
java
public static InsnList tryCatchBlock(TryCatchBlockNode tryCatchBlockNode, Type exceptionType, InsnList tryInsnList, InsnList catchInsnList) { Validate.notNull(tryInsnList); // exceptionType can be null Validate.notNull(catchInsnList); if (exceptionType != null) { ...
[ "public", "static", "InsnList", "tryCatchBlock", "(", "TryCatchBlockNode", "tryCatchBlockNode", ",", "Type", "exceptionType", ",", "InsnList", "tryInsnList", ",", "InsnList", "catchInsnList", ")", "{", "Validate", ".", "notNull", "(", "tryInsnList", ")", ";", "// ex...
Generates instructions for a try-catch block. @param tryCatchBlockNode try catch block node to populate to with label with relevant information @param exceptionType exception type to catch ({@code null} means catch any exception) @param tryInsnList instructions to execute for try block @param catchInsnList instructions...
[ "Generates", "instructions", "for", "a", "try", "-", "catch", "block", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L983-L1010
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java
GenericGenerators.returnValue
public static InsnList returnValue(Type returnType, InsnList returnValueInsnList) { Validate.notNull(returnType); Validate.isTrue(returnType.getSort() != Type.METHOD); InsnList ret = new InsnList(); ret.add(returnValueInsnList); switch (returnType.getSort()) { ...
java
public static InsnList returnValue(Type returnType, InsnList returnValueInsnList) { Validate.notNull(returnType); Validate.isTrue(returnType.getSort() != Type.METHOD); InsnList ret = new InsnList(); ret.add(returnValueInsnList); switch (returnType.getSort()) { ...
[ "public", "static", "InsnList", "returnValue", "(", "Type", "returnType", ",", "InsnList", "returnValueInsnList", ")", "{", "Validate", ".", "notNull", "(", "returnType", ")", ";", "Validate", ".", "isTrue", "(", "returnType", ".", "getSort", "(", ")", "!=", ...
Generates instructions that returns a value. @param returnType return type of the method this generated bytecode is for @param returnValueInsnList instructions that produce the return value (should leave it on the top of the stack) @return instructions to return a value @throws NullPointerException if any argument is ...
[ "Generates", "instructions", "that", "returns", "a", "value", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L1029-L1066
train
offbynull/coroutines
maven-plugin/src/main/java/com/offbynull/coroutines/mavenplugin/AbstractInstrumentMojo.java
AbstractInstrumentMojo.instrumentPath
protected final void instrumentPath(Log log, List<String> classpath, File path) throws MojoExecutionException { try { Instrumenter instrumenter = getInstrumenter(log, classpath); InstrumentationSettings settings = new InstrumentationSettings(markerType, debugMode, autoSeriali...
java
protected final void instrumentPath(Log log, List<String> classpath, File path) throws MojoExecutionException { try { Instrumenter instrumenter = getInstrumenter(log, classpath); InstrumentationSettings settings = new InstrumentationSettings(markerType, debugMode, autoSeriali...
[ "protected", "final", "void", "instrumentPath", "(", "Log", "log", ",", "List", "<", "String", ">", "classpath", ",", "File", "path", ")", "throws", "MojoExecutionException", "{", "try", "{", "Instrumenter", "instrumenter", "=", "getInstrumenter", "(", "log", ...
Instruments all classes in a path recursively. @param log maven logger @param classpath classpath for classes being instrumented @param path directory containing files to instrument @throws MojoExecutionException if any exception occurs
[ "Instruments", "all", "classes", "in", "a", "path", "recursively", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/maven-plugin/src/main/java/com/offbynull/coroutines/mavenplugin/AbstractInstrumentMojo.java#L57-L67
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/MethodHasher.java
MethodHasher.dumpBytecode
private static byte[] dumpBytecode(MethodNode methodNode) { // Calculate label offsets -- required for hash calculation // we only care about where the labels are in relation to the opcode instructions -- we don't care about things like // LocalVariableNode or other ancillary data because th...
java
private static byte[] dumpBytecode(MethodNode methodNode) { // Calculate label offsets -- required for hash calculation // we only care about where the labels are in relation to the opcode instructions -- we don't care about things like // LocalVariableNode or other ancillary data because th...
[ "private", "static", "byte", "[", "]", "dumpBytecode", "(", "MethodNode", "methodNode", ")", "{", "// Calculate label offsets -- required for hash calculation", "// we only care about where the labels are in relation to the opcode instructions -- we don't care about things like", "// Local...
Takes into account the instructions and operands, as well as the overall structure.
[ "Takes", "into", "account", "the", "instructions", "and", "operands", "as", "well", "as", "the", "overall", "structure", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/MethodHasher.java#L60-L85
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/MethodInvokeUtils.java
MethodInvokeUtils.getReturnTypeOfInvocation
public static Type getReturnTypeOfInvocation(AbstractInsnNode invokeNode) { Validate.notNull(invokeNode); if (invokeNode instanceof MethodInsnNode) { MethodInsnNode methodInsnNode = (MethodInsnNode) invokeNode; Type methodType = Type.getType(methodInsnNode.desc); ret...
java
public static Type getReturnTypeOfInvocation(AbstractInsnNode invokeNode) { Validate.notNull(invokeNode); if (invokeNode instanceof MethodInsnNode) { MethodInsnNode methodInsnNode = (MethodInsnNode) invokeNode; Type methodType = Type.getType(methodInsnNode.desc); ret...
[ "public", "static", "Type", "getReturnTypeOfInvocation", "(", "AbstractInsnNode", "invokeNode", ")", "{", "Validate", ".", "notNull", "(", "invokeNode", ")", ";", "if", "(", "invokeNode", "instanceof", "MethodInsnNode", ")", "{", "MethodInsnNode", "methodInsnNode", ...
Get the return type of the method being invoked. @param invokeNode the invocation instruction (either normal invocation or invokedynamic) @return number of items required on the stack for this method @throws NullPointerException if any argument is {@code null} @throws IllegalArgumentException if {@code invokeNode} is n...
[ "Get", "the", "return", "type", "of", "the", "method", "being", "invoked", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/MethodInvokeUtils.java#L92-L106
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/FileSystemClassInformationRepository.java
FileSystemClassInformationRepository.addIndividual
public void addIndividual(String className, ClassInformation classInformation) { Validate.notNull(className); Validate.notNull(classInformation); Validate.isTrue(!hierarchyMap.containsKey(className)); hierarchyMap.put(className, classInformation); }
java
public void addIndividual(String className, ClassInformation classInformation) { Validate.notNull(className); Validate.notNull(classInformation); Validate.isTrue(!hierarchyMap.containsKey(className)); hierarchyMap.put(className, classInformation); }
[ "public", "void", "addIndividual", "(", "String", "className", ",", "ClassInformation", "classInformation", ")", "{", "Validate", ".", "notNull", "(", "className", ")", ";", "Validate", ".", "notNull", "(", "classInformation", ")", ";", "Validate", ".", "isTrue"...
Add a custom class. @param className name of class @param classInformation information for class @throws NullPointerException if any argument is {@code null} @throws IllegalArgumentException if {@code className} already exists in this repository
[ "Add", "a", "custom", "class", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/FileSystemClassInformationRepository.java#L67-L73
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/FileSystemClassInformationRepository.java
FileSystemClassInformationRepository.addClasspath
public void addClasspath(List<File> classpath) throws IOException { Validate.notNull(classpath); Validate.noNullElements(classpath); for (File classpathElement : classpath) { if (classpathElement.isFile()) { addJar(classpathElement); } else if (classpathE...
java
public void addClasspath(List<File> classpath) throws IOException { Validate.notNull(classpath); Validate.noNullElements(classpath); for (File classpathElement : classpath) { if (classpathElement.isFile()) { addJar(classpathElement); } else if (classpathE...
[ "public", "void", "addClasspath", "(", "List", "<", "File", ">", "classpath", ")", "throws", "IOException", "{", "Validate", ".", "notNull", "(", "classpath", ")", ";", "Validate", ".", "noNullElements", "(", "classpath", ")", ";", "for", "(", "File", "cla...
Add classes contained within a list of JAR files and folders. Note that if a duplicate class is encountered, the original is kept. @param classpath list of JARs and folders to scan @throws NullPointerException if any argument is {@code null} or contains {@code null} elements @throws IOException if an IO error occurs
[ "Add", "classes", "contained", "within", "a", "list", "of", "JAR", "files", "and", "folders", ".", "Note", "that", "if", "a", "duplicate", "class", "is", "encountered", "the", "original", "is", "kept", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/FileSystemClassInformationRepository.java#L81-L94
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/ContinuationGenerators.java
ContinuationGenerators.popMethodResult
private static InsnList popMethodResult(AbstractInsnNode invokeInsnNode) { Validate.notNull(invokeInsnNode); Type returnType = getReturnTypeOfInvocation(invokeInsnNode); InsnList ret = new InsnList(); switch (returnType.getSort()) { case Type.LONG: ...
java
private static InsnList popMethodResult(AbstractInsnNode invokeInsnNode) { Validate.notNull(invokeInsnNode); Type returnType = getReturnTypeOfInvocation(invokeInsnNode); InsnList ret = new InsnList(); switch (returnType.getSort()) { case Type.LONG: ...
[ "private", "static", "InsnList", "popMethodResult", "(", "AbstractInsnNode", "invokeInsnNode", ")", "{", "Validate", ".", "notNull", "(", "invokeInsnNode", ")", ";", "Type", "returnType", "=", "getReturnTypeOfInvocation", "(", "invokeInsnNode", ")", ";", "InsnList", ...
Generates instructions to pop the result of the method off the stack. This will only generate instructions if the method being invoked generates a return value. @param invokeInsnNode instruction for the method that was invoked (can either be of type {@link MethodInsnNode} or {@link InvokeDynamicInsnNode} -- this is use...
[ "Generates", "instructions", "to", "pop", "the", "result", "of", "the", "method", "off", "the", "stack", ".", "This", "will", "only", "generate", "instructions", "if", "the", "method", "being", "invoked", "generates", "a", "return", "value", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/ContinuationGenerators.java#L951-L972
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/SerializationDetailer.java
SerializationDetailer.detail
public void detail(MethodNode methodNode, MethodAttributes attrs, StringBuilder output) { Validate.notNull(methodNode); Validate.notNull(attrs); Validate.notNull(output); int methodId = attrs.getSignature().getMethodId(); output.append("Class Name: ").append(attrs.getSignature(...
java
public void detail(MethodNode methodNode, MethodAttributes attrs, StringBuilder output) { Validate.notNull(methodNode); Validate.notNull(attrs); Validate.notNull(output); int methodId = attrs.getSignature().getMethodId(); output.append("Class Name: ").append(attrs.getSignature(...
[ "public", "void", "detail", "(", "MethodNode", "methodNode", ",", "MethodAttributes", "attrs", ",", "StringBuilder", "output", ")", "{", "Validate", ".", "notNull", "(", "methodNode", ")", ";", "Validate", ".", "notNull", "(", "attrs", ")", ";", "Validate", ...
MUST BE CALLED PRIOR TO INSTRUMENTATION!!!!
[ "MUST", "BE", "CALLED", "PRIOR", "TO", "INSTRUMENTATION!!!!" ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/SerializationDetailer.java#L31-L74
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SimpleClassWriter.java
SimpleClassWriter.getCommonSuperClass
@Override protected String getCommonSuperClass(final String type1, final String type2) { Validate.notNull(type1); Validate.notNull(type2); infoRepo.getInformation(type1); LinkedHashSet<String> type1Hierarchy = flattenHierarchy(type1); LinkedHashSet<String> type2Hiera...
java
@Override protected String getCommonSuperClass(final String type1, final String type2) { Validate.notNull(type1); Validate.notNull(type2); infoRepo.getInformation(type1); LinkedHashSet<String> type1Hierarchy = flattenHierarchy(type1); LinkedHashSet<String> type2Hiera...
[ "@", "Override", "protected", "String", "getCommonSuperClass", "(", "final", "String", "type1", ",", "final", "String", "type2", ")", "{", "Validate", ".", "notNull", "(", "type1", ")", ";", "Validate", ".", "notNull", "(", "type2", ")", ";", "infoRepo", "...
Derives common super class from the super name mapping passed in to the constructor. @param type1 the internal name of a class. @param type2 the internal name of another class. @return the internal name of the common super class of the two given classes @throws NullPointerException if any argument is {@code null}
[ "Derives", "common", "super", "class", "from", "the", "super", "name", "mapping", "passed", "in", "to", "the", "constructor", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SimpleClassWriter.java#L69-L87
train
offbynull/coroutines
user/src/main/java/com/offbynull/coroutines/user/SerializedState.java
SerializedState.validateState
void validateState() { if (frames == null || coroutine == null) { throw new IllegalStateException("Bad state"); } for (int i = 0; i < frames.length; i++) { if (frames[i] == null) { throw new IllegalStateException("Bad state"); } fr...
java
void validateState() { if (frames == null || coroutine == null) { throw new IllegalStateException("Bad state"); } for (int i = 0; i < frames.length; i++) { if (frames[i] == null) { throw new IllegalStateException("Bad state"); } fr...
[ "void", "validateState", "(", ")", "{", "if", "(", "frames", "==", "null", "||", "coroutine", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Bad state\"", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fram...
method to do that.
[ "method", "to", "do", "that", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/user/src/main/java/com/offbynull/coroutines/user/SerializedState.java#L84-L95
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/DebugGenerators.java
DebugGenerators.debugMarker
public static InsnList debugMarker(MarkerType markerType, String text) { Validate.notNull(markerType); Validate.notNull(text); InsnList ret = new InsnList(); switch (markerType) { case NONE: break; case CONSTANT: r...
java
public static InsnList debugMarker(MarkerType markerType, String text) { Validate.notNull(markerType); Validate.notNull(text); InsnList ret = new InsnList(); switch (markerType) { case NONE: break; case CONSTANT: r...
[ "public", "static", "InsnList", "debugMarker", "(", "MarkerType", "markerType", ",", "String", "text", ")", "{", "Validate", ".", "notNull", "(", "markerType", ")", ";", "Validate", ".", "notNull", "(", "text", ")", ";", "InsnList", "ret", "=", "new", "Ins...
Generates instructions for generating marker instructions. These marker instructions are meant to be is useful for debugging instrumented code. For example, you can spot a specific portion of instrumented code by looking for specific markers in the assembly output. @param markerType marker type (determines what kind of...
[ "Generates", "instructions", "for", "generating", "marker", "instructions", ".", "These", "marker", "instructions", "are", "meant", "to", "be", "is", "useful", "for", "debugging", "instrumented", "code", ".", "For", "example", "you", "can", "spot", "a", "specifi...
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/DebugGenerators.java#L46-L69
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/Instrumenter.java
Instrumenter.instrument
public InstrumentationResult instrument(byte[] input, InstrumentationSettings settings) { Validate.notNull(input); Validate.notNull(settings); Validate.isTrue(input.length > 0); // Read class as tree model -- because we're using SimpleClassNode, JSR blocks get inlined ClassRea...
java
public InstrumentationResult instrument(byte[] input, InstrumentationSettings settings) { Validate.notNull(input); Validate.notNull(settings); Validate.isTrue(input.length > 0); // Read class as tree model -- because we're using SimpleClassNode, JSR blocks get inlined ClassRea...
[ "public", "InstrumentationResult", "instrument", "(", "byte", "[", "]", "input", ",", "InstrumentationSettings", "settings", ")", "{", "Validate", ".", "notNull", "(", "input", ")", ";", "Validate", ".", "notNull", "(", "settings", ")", ";", "Validate", ".", ...
Instruments a class. @param input class file contents @param settings instrumentation settings @return instrumentation results @throws IllegalArgumentException if the class could not be instrumented for some reason @throws NullPointerException if any argument is {@code null}
[ "Instruments", "a", "class", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/Instrumenter.java#L90-L149
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java
SearchUtils.findMethodsWithName
public static List<MethodNode> findMethodsWithName(Collection<MethodNode> methodNodes, String name) { Validate.notNull(methodNodes); Validate.notNull(name); Validate.noNullElements(methodNodes); List<MethodNode> ret = new ArrayList<>(); for (MethodNode methodNod...
java
public static List<MethodNode> findMethodsWithName(Collection<MethodNode> methodNodes, String name) { Validate.notNull(methodNodes); Validate.notNull(name); Validate.noNullElements(methodNodes); List<MethodNode> ret = new ArrayList<>(); for (MethodNode methodNod...
[ "public", "static", "List", "<", "MethodNode", ">", "findMethodsWithName", "(", "Collection", "<", "MethodNode", ">", "methodNodes", ",", "String", "name", ")", "{", "Validate", ".", "notNull", "(", "methodNodes", ")", ";", "Validate", ".", "notNull", "(", "...
Find methods within a class with a specific name. @param methodNodes method nodes to search through @param name method name to search for @return list of methods @throws NullPointerException if any argument is {@code null} or contains {@code null} @throws IllegalArgumentException if any element in {@code expectedStarti...
[ "Find", "methods", "within", "a", "class", "with", "a", "specific", "name", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java#L68-L82
train
offbynull/coroutines
instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java
SearchUtils.findStaticMethods
public static List<MethodNode> findStaticMethods(Collection<MethodNode> methodNodes) { Validate.notNull(methodNodes); Validate.noNullElements(methodNodes); List<MethodNode> ret = new ArrayList<>(); for (MethodNode methodNode : methodNodes) { if ((methodNode....
java
public static List<MethodNode> findStaticMethods(Collection<MethodNode> methodNodes) { Validate.notNull(methodNodes); Validate.noNullElements(methodNodes); List<MethodNode> ret = new ArrayList<>(); for (MethodNode methodNode : methodNodes) { if ((methodNode....
[ "public", "static", "List", "<", "MethodNode", ">", "findStaticMethods", "(", "Collection", "<", "MethodNode", ">", "methodNodes", ")", "{", "Validate", ".", "notNull", "(", "methodNodes", ")", ";", "Validate", ".", "noNullElements", "(", "methodNodes", ")", "...
Find static methods within a class. @param methodNodes method nodes to search through @return list of methods @throws NullPointerException if any argument is {@code null} or contains {@code null}
[ "Find", "static", "methods", "within", "a", "class", "." ]
b1b83c293945f53a2f63fca8f15a53e88b796bf5
https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/asm/SearchUtils.java#L90-L103
train