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
calimero-project/calimero-core
src/tuwien/auto/calimero/dptxlator/TranslatorTypes.java
TranslatorTypes.hasTranslator
public static boolean hasTranslator(final int mainNumber, final String dptId) { try { final MainType t = getMainType(getMainNumber(mainNumber, dptId)); if (t != null) return t.getSubTypes().get(dptId) != null; } catch (final NumberFormatException e) {} catch (final KNXException e) {} return false; ...
java
public static boolean hasTranslator(final int mainNumber, final String dptId) { try { final MainType t = getMainType(getMainNumber(mainNumber, dptId)); if (t != null) return t.getSubTypes().get(dptId) != null; } catch (final NumberFormatException e) {} catch (final KNXException e) {} return false; ...
[ "public", "static", "boolean", "hasTranslator", "(", "final", "int", "mainNumber", ",", "final", "String", "dptId", ")", "{", "try", "{", "final", "MainType", "t", "=", "getMainType", "(", "getMainNumber", "(", "mainNumber", ",", "dptId", ")", ")", ";", "i...
Does a lookup if the specified DPT is supported by a DPT translator. @param mainNumber data type main number, number &ge; 0; use 0 to infer translator type from <code>dptId</code> argument only @param dptId datapoint type ID to lookup this particular kind of value translation @return <code>true</code> iff translator w...
[ "Does", "a", "lookup", "if", "the", "specified", "DPT", "is", "supported", "by", "a", "DPT", "translator", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/dptxlator/TranslatorTypes.java#L533-L543
train
calimero-project/calimero-core
src/tuwien/auto/calimero/dptxlator/TranslatorTypes.java
TranslatorTypes.createTranslator
public static DPTXlator createTranslator(final String dptId, final byte... data) throws KNXException, KNXIllegalArgumentException { final DPTXlator t = createTranslator(0, dptId); if (data.length > 0) t.setData(data); return t; }
java
public static DPTXlator createTranslator(final String dptId, final byte... data) throws KNXException, KNXIllegalArgumentException { final DPTXlator t = createTranslator(0, dptId); if (data.length > 0) t.setData(data); return t; }
[ "public", "static", "DPTXlator", "createTranslator", "(", "final", "String", "dptId", ",", "final", "byte", "...", "data", ")", "throws", "KNXException", ",", "KNXIllegalArgumentException", "{", "final", "DPTXlator", "t", "=", "createTranslator", "(", "0", ",", ...
Creates a DPT translator for the given datapoint type ID. @param dptId datapoint type ID, formatted as <code>&lt;main number&gt;.&lt;sub number&gt;</code> with a sub number &lt; 100 zero-padded to 3 digits, e.g. "1.001" @param data (optional) KNX datapoint data to set in the created translator for translation @return ...
[ "Creates", "a", "DPT", "translator", "for", "the", "given", "datapoint", "type", "ID", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/dptxlator/TranslatorTypes.java#L649-L656
train
calimero-project/calimero-core
src/tuwien/auto/calimero/link/KNXNetworkLinkIP.java
KNXNetworkLinkIP.newSecureRoutingLink
public static KNXNetworkLinkIP newSecureRoutingLink(final NetworkInterface netif, final InetAddress mcGroup, final byte[] groupKey, final Duration latencyTolerance, final KNXMediumSettings settings) throws KNXException { return new KNXNetworkLinkIP(ROUTING, SecureConnection.newRouting(netif, mcGroup, groupKey, late...
java
public static KNXNetworkLinkIP newSecureRoutingLink(final NetworkInterface netif, final InetAddress mcGroup, final byte[] groupKey, final Duration latencyTolerance, final KNXMediumSettings settings) throws KNXException { return new KNXNetworkLinkIP(ROUTING, SecureConnection.newRouting(netif, mcGroup, groupKey, late...
[ "public", "static", "KNXNetworkLinkIP", "newSecureRoutingLink", "(", "final", "NetworkInterface", "netif", ",", "final", "InetAddress", "mcGroup", ",", "final", "byte", "[", "]", "groupKey", ",", "final", "Duration", "latencyTolerance", ",", "final", "KNXMediumSetting...
Creates a new secure network link using the KNX IP Secure Routing protocol. @param netif local network interface used to join the multicast group and for sending @param mcGroup address of the multicast group to join, use {@link #DefaultMulticast} for the default KNX IP multicast address @param groupKey KNX IP Secure g...
[ "Creates", "a", "new", "secure", "network", "link", "using", "the", "KNX", "IP", "Secure", "Routing", "protocol", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/link/KNXNetworkLinkIP.java#L197-L201
train
calimero-project/calimero-core
src/tuwien/auto/calimero/link/medium/KNXMediumSettings.java
KNXMediumSettings.create
public static KNXMediumSettings create(final int medium, final IndividualAddress device) { switch (medium) { case MEDIUM_TP1: return new TPSettings(device); case MEDIUM_PL110: return new PLSettings(device, null); case MEDIUM_RF: return new RFSettings(device); case MEDIUM_KNXIP: return new KnxIPSe...
java
public static KNXMediumSettings create(final int medium, final IndividualAddress device) { switch (medium) { case MEDIUM_TP1: return new TPSettings(device); case MEDIUM_PL110: return new PLSettings(device, null); case MEDIUM_RF: return new RFSettings(device); case MEDIUM_KNXIP: return new KnxIPSe...
[ "public", "static", "KNXMediumSettings", "create", "(", "final", "int", "medium", ",", "final", "IndividualAddress", "device", ")", "{", "switch", "(", "medium", ")", "{", "case", "MEDIUM_TP1", ":", "return", "new", "TPSettings", "(", "device", ")", ";", "ca...
Creates the medium settings for the specified KNX medium. @param medium the KNX medium type code, see definitions in {@link KNXMediumSettings} @param device individual address to use as source address in KNX messages @return the initialized medium-specific settings @throws KNXIllegalArgumentException on unknown medium...
[ "Creates", "the", "medium", "settings", "for", "the", "specified", "KNX", "medium", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/link/medium/KNXMediumSettings.java#L92-L106
train
calimero-project/calimero-core
src/tuwien/auto/calimero/link/medium/RawFrameFactory.java
RawFrameFactory.create
public static RawFrame create(final int mediumType, final byte[] data, final int offset, final boolean extBusmon) throws KNXFormatException { switch (mediumType) { case KNXMediumSettings.MEDIUM_TP1: return createTP1(data, offset); case KNXMediumSettings.MEDIUM_PL110: return createPL110(data, offset, extB...
java
public static RawFrame create(final int mediumType, final byte[] data, final int offset, final boolean extBusmon) throws KNXFormatException { switch (mediumType) { case KNXMediumSettings.MEDIUM_TP1: return createTP1(data, offset); case KNXMediumSettings.MEDIUM_PL110: return createPL110(data, offset, extB...
[ "public", "static", "RawFrame", "create", "(", "final", "int", "mediumType", ",", "final", "byte", "[", "]", "data", ",", "final", "int", "offset", ",", "final", "boolean", "extBusmon", ")", "throws", "KNXFormatException", "{", "switch", "(", "mediumType", "...
Creates a raw frame out of a byte array for the specified communication medium. This method just invokes one of the other medium type specific creation methods according the given medium type. @param mediumType KNX communication medium, one of the media types declared in {@link KNXMediumSettings} @param data byte arra...
[ "Creates", "a", "raw", "frame", "out", "of", "a", "byte", "array", "for", "the", "specified", "communication", "medium", ".", "This", "method", "just", "invokes", "one", "of", "the", "other", "medium", "type", "specific", "creation", "methods", "according", ...
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/link/medium/RawFrameFactory.java#L67-L80
train
calimero-project/calimero-core
src/tuwien/auto/calimero/link/medium/RawFrameFactory.java
RawFrameFactory.createTP1
public static RawFrame createTP1(final byte[] data, final int offset) throws KNXFormatException { final int ctrl = data[offset] & 0xff; // parse control field and check if valid if ((ctrl & 0x10) == 0x10) { if ((ctrl & 0x40) == 0x00) return new TP1LData(data, offset); else if (ctrl == 0xF0) return ...
java
public static RawFrame createTP1(final byte[] data, final int offset) throws KNXFormatException { final int ctrl = data[offset] & 0xff; // parse control field and check if valid if ((ctrl & 0x10) == 0x10) { if ((ctrl & 0x40) == 0x00) return new TP1LData(data, offset); else if (ctrl == 0xF0) return ...
[ "public", "static", "RawFrame", "createTP1", "(", "final", "byte", "[", "]", "data", ",", "final", "int", "offset", ")", "throws", "KNXFormatException", "{", "final", "int", "ctrl", "=", "data", "[", "offset", "]", "&", "0xff", ";", "// parse control field a...
Creates a raw frame out of a byte array for the TP1 communication medium. @param data byte array containing the TP1 raw frame structure @param offset start offset of frame structure in <code>data</code>, 0 &lt;= offset &lt; <code>data.length</code> @return the created TP1 raw frame @throws KNXFormatException on no val...
[ "Creates", "a", "raw", "frame", "out", "of", "a", "byte", "array", "for", "the", "TP1", "communication", "medium", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/link/medium/RawFrameFactory.java#L91-L103
train
calimero-project/calimero-core
src/tuwien/auto/calimero/xml/DefaultXmlReader.java
DefaultXmlReader.skipComment
private boolean skipComment(final String s) throws KNXMLException { if (s.startsWith("!--")) { String comment = s; while (canRead() && !comment.endsWith("--")) comment = read('>'); return true; } return false; }
java
private boolean skipComment(final String s) throws KNXMLException { if (s.startsWith("!--")) { String comment = s; while (canRead() && !comment.endsWith("--")) comment = read('>'); return true; } return false; }
[ "private", "boolean", "skipComment", "(", "final", "String", "s", ")", "throws", "KNXMLException", "{", "if", "(", "s", ".", "startsWith", "(", "\"!--\"", ")", ")", "{", "String", "comment", "=", "s", ";", "while", "(", "canRead", "(", ")", "&&", "!", ...
checks if '<' marks begin of a comment, and if so skips over it
[ "checks", "if", "<", "marks", "begin", "of", "a", "comment", "and", "if", "so", "skips", "over", "it" ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/xml/DefaultXmlReader.java#L289-L298
train
calimero-project/calimero-core
src/tuwien/auto/calimero/mgmt/PropertyClient.java
PropertyClient.getProperty
public String getProperty(final int objIndex, final int pid) throws KNXException, InterruptedException { return getPropertyTranslated(objIndex, pid, 1, 1).getValue(); }
java
public String getProperty(final int objIndex, final int pid) throws KNXException, InterruptedException { return getPropertyTranslated(objIndex, pid, 1, 1).getValue(); }
[ "public", "String", "getProperty", "(", "final", "int", "objIndex", ",", "final", "int", "pid", ")", "throws", "KNXException", ",", "InterruptedException", "{", "return", "getPropertyTranslated", "(", "objIndex", ",", "pid", ",", "1", ",", "1", ")", ".", "ge...
Gets the first property element using the associated property data type of the requested property. @param objIndex interface object index in the device @param pid property identifier @return property element value represented as string @throws KNXException on adapter errors while querying the property element or data ...
[ "Gets", "the", "first", "property", "element", "using", "the", "associated", "property", "data", "type", "of", "the", "requested", "property", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/mgmt/PropertyClient.java#L556-L560
train
calimero-project/calimero-core
src/tuwien/auto/calimero/mgmt/PropertyClient.java
PropertyClient.getDescriptionByIndex
@Override public Description getDescriptionByIndex(final int objIndex, final int propIndex) throws KNXException, InterruptedException { return createDesc(objIndex, pa.getDescription(objIndex, 0, propIndex)); }
java
@Override public Description getDescriptionByIndex(final int objIndex, final int propIndex) throws KNXException, InterruptedException { return createDesc(objIndex, pa.getDescription(objIndex, 0, propIndex)); }
[ "@", "Override", "public", "Description", "getDescriptionByIndex", "(", "final", "int", "objIndex", ",", "final", "int", "propIndex", ")", "throws", "KNXException", ",", "InterruptedException", "{", "return", "createDesc", "(", "objIndex", ",", "pa", ".", "getDesc...
Gets the property description based on the property index. @param objIndex interface object index in the device @param propIndex property index in the object @return a property description object @throws KNXException on adapter errors while querying the description
[ "Gets", "the", "property", "description", "based", "on", "the", "property", "index", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/mgmt/PropertyClient.java#L601-L606
train
calimero-project/calimero-core
src/tuwien/auto/calimero/mgmt/PropertyClient.java
PropertyClient.scanProperties
public void scanProperties(final boolean allProperties, final Consumer<Description> consumer) throws KNXException, InterruptedException { for (int index = 0; scan(index, allProperties, consumer) > 0; ++index); }
java
public void scanProperties(final boolean allProperties, final Consumer<Description> consumer) throws KNXException, InterruptedException { for (int index = 0; scan(index, allProperties, consumer) > 0; ++index); }
[ "public", "void", "scanProperties", "(", "final", "boolean", "allProperties", ",", "final", "Consumer", "<", "Description", ">", "consumer", ")", "throws", "KNXException", ",", "InterruptedException", "{", "for", "(", "int", "index", "=", "0", ";", "scan", "("...
Does a property description scan of the properties in all interface objects. @param allProperties <code>true</code> to scan all property descriptions in the interface objects, <code>false</code> to only scan the object type descriptions, i.e., {@link PropertyAccess.PID#OBJECT_TYPE} @param consumer invoked on every pro...
[ "Does", "a", "property", "description", "scan", "of", "the", "properties", "in", "all", "interface", "objects", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/mgmt/PropertyClient.java#L619-L623
train
calimero-project/calimero-core
src/tuwien/auto/calimero/mgmt/PropertyClient.java
PropertyClient.scanProperties
public void scanProperties(final int objIndex, final boolean allProperties, final Consumer<Description> consumer) throws KNXException, InterruptedException { scan(objIndex, allProperties, consumer); }
java
public void scanProperties(final int objIndex, final boolean allProperties, final Consumer<Description> consumer) throws KNXException, InterruptedException { scan(objIndex, allProperties, consumer); }
[ "public", "void", "scanProperties", "(", "final", "int", "objIndex", ",", "final", "boolean", "allProperties", ",", "final", "Consumer", "<", "Description", ">", "consumer", ")", "throws", "KNXException", ",", "InterruptedException", "{", "scan", "(", "objIndex", ...
Does a property description scan of the properties of one interface object. @param objIndex interface object index in the device @param allProperties <code>true</code> to scan all property descriptions in that interface object, <code>false</code> to only scan the object type description of the interface object specifi...
[ "Does", "a", "property", "description", "scan", "of", "the", "properties", "of", "one", "interface", "object", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/mgmt/PropertyClient.java#L638-L642
train
calimero-project/calimero-core
src/tuwien/auto/calimero/knxnetip/servicetype/SearchResponse.java
SearchResponse.from
public static SearchResponse from(final KNXnetIPHeader h, final byte[] data, final int offset) throws KNXFormatException { final int svcType = h.getServiceType(); if (svcType != KNXnetIPHeader.SEARCH_RES && svcType != KNXnetIPHeader.SearchResponse) throw new KNXIllegalArgumentException("not a search response"); ...
java
public static SearchResponse from(final KNXnetIPHeader h, final byte[] data, final int offset) throws KNXFormatException { final int svcType = h.getServiceType(); if (svcType != KNXnetIPHeader.SEARCH_RES && svcType != KNXnetIPHeader.SearchResponse) throw new KNXIllegalArgumentException("not a search response"); ...
[ "public", "static", "SearchResponse", "from", "(", "final", "KNXnetIPHeader", "h", ",", "final", "byte", "[", "]", "data", ",", "final", "int", "offset", ")", "throws", "KNXFormatException", "{", "final", "int", "svcType", "=", "h", ".", "getServiceType", "(...
Creates a new search response from a byte array. @param h KNXnet/IP header preceding the search response in the byte array @param data byte array containing a search response @param offset start offset of response in <code>data</code> @return search response @throws KNXFormatException on wrong structure size or invali...
[ "Creates", "a", "new", "search", "response", "from", "a", "byte", "array", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/servicetype/SearchResponse.java#L77-L82
train
calimero-project/calimero-core
src/tuwien/auto/calimero/knxnetip/servicetype/TunnelingFeature.java
TunnelingFeature.newGet
public static TunnelingFeature newGet(final int channelId, final int seq, final InterfaceFeature featureId) { return new TunnelingFeature(KNXnetIPHeader.TunnelingFeatureGet, channelId, seq, featureId, Success); }
java
public static TunnelingFeature newGet(final int channelId, final int seq, final InterfaceFeature featureId) { return new TunnelingFeature(KNXnetIPHeader.TunnelingFeatureGet, channelId, seq, featureId, Success); }
[ "public", "static", "TunnelingFeature", "newGet", "(", "final", "int", "channelId", ",", "final", "int", "seq", ",", "final", "InterfaceFeature", "featureId", ")", "{", "return", "new", "TunnelingFeature", "(", "KNXnetIPHeader", ".", "TunnelingFeatureGet", ",", "c...
Creates a new tunneling feature-get service. @param channelId tunneling connection channel identifier @param seq tunneling connection send sequence number @param featureId the requested interface feature @return new tunneling feature-get service
[ "Creates", "a", "new", "tunneling", "feature", "-", "get", "service", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/servicetype/TunnelingFeature.java#L81-L83
train
calimero-project/calimero-core
src/tuwien/auto/calimero/knxnetip/servicetype/TunnelingFeature.java
TunnelingFeature.newResponse
public static TunnelingFeature newResponse(final int channelId, final int seq, final InterfaceFeature featureId, final ReturnCode result, final byte... featureValue) { return new TunnelingFeature(KNXnetIPHeader.TunnelingFeatureResponse, channelId, seq, featureId, result, featureValue); }
java
public static TunnelingFeature newResponse(final int channelId, final int seq, final InterfaceFeature featureId, final ReturnCode result, final byte... featureValue) { return new TunnelingFeature(KNXnetIPHeader.TunnelingFeatureResponse, channelId, seq, featureId, result, featureValue); }
[ "public", "static", "TunnelingFeature", "newResponse", "(", "final", "int", "channelId", ",", "final", "int", "seq", ",", "final", "InterfaceFeature", "featureId", ",", "final", "ReturnCode", "result", ",", "final", "byte", "...", "featureValue", ")", "{", "retu...
Creates a new tunneling feature-response service. @param channelId tunneling connection channel identifier @param seq tunneling connection send sequence number @param featureId interface feature to respond to @param result result of processing the corresponding tunneling feature-get/set service @param featureValue fea...
[ "Creates", "a", "new", "tunneling", "feature", "-", "response", "service", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/servicetype/TunnelingFeature.java#L95-L99
train
calimero-project/calimero-core
src/tuwien/auto/calimero/knxnetip/servicetype/TunnelingFeature.java
TunnelingFeature.newSet
public static TunnelingFeature newSet(final int channelId, final int seq, final InterfaceFeature featureId, final byte... featureValue) { return new TunnelingFeature(KNXnetIPHeader.TunnelingFeatureSet, channelId, seq, featureId, Success, featureValue); }
java
public static TunnelingFeature newSet(final int channelId, final int seq, final InterfaceFeature featureId, final byte... featureValue) { return new TunnelingFeature(KNXnetIPHeader.TunnelingFeatureSet, channelId, seq, featureId, Success, featureValue); }
[ "public", "static", "TunnelingFeature", "newSet", "(", "final", "int", "channelId", ",", "final", "int", "seq", ",", "final", "InterfaceFeature", "featureId", ",", "final", "byte", "...", "featureValue", ")", "{", "return", "new", "TunnelingFeature", "(", "KNXne...
Creates a new tunneling feature-set service. @param channelId tunneling connection channel identifier @param seq tunneling connection send sequence number @param featureId interface feature which value should be set @param featureValue feature value to set @return new tunneling feature-set service
[ "Creates", "a", "new", "tunneling", "feature", "-", "set", "service", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/servicetype/TunnelingFeature.java#L110-L113
train
calimero-project/calimero-core
src/tuwien/auto/calimero/knxnetip/servicetype/TunnelingFeature.java
TunnelingFeature.newInfo
public static TunnelingFeature newInfo(final int channelId, final int seq, final InterfaceFeature featureId, final byte... featureValue) { return new TunnelingFeature(KNXnetIPHeader.TunnelingFeatureInfo, channelId, seq, featureId, Success, featureValue); }
java
public static TunnelingFeature newInfo(final int channelId, final int seq, final InterfaceFeature featureId, final byte... featureValue) { return new TunnelingFeature(KNXnetIPHeader.TunnelingFeatureInfo, channelId, seq, featureId, Success, featureValue); }
[ "public", "static", "TunnelingFeature", "newInfo", "(", "final", "int", "channelId", ",", "final", "int", "seq", ",", "final", "InterfaceFeature", "featureId", ",", "final", "byte", "...", "featureValue", ")", "{", "return", "new", "TunnelingFeature", "(", "KNXn...
Creates a new tunneling feature-info service. @param channelId tunneling connection channel identifier @param seq tunneling connection send sequence number @param featureId interface feature which should be announced @param featureValue feature value to announce @return new tunneling feature-info service
[ "Creates", "a", "new", "tunneling", "feature", "-", "info", "service", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/servicetype/TunnelingFeature.java#L124-L127
train
calimero-project/calimero-core
src/tuwien/auto/calimero/KNXAddress.java
KNXAddress.create
public static KNXAddress create(final XmlReader r) throws KNXMLException { if (r.getEventType() != XmlReader.START_ELEMENT) r.nextTag(); if (r.getEventType() == XmlReader.START_ELEMENT) { final String type = r.getAttributeValue(null, ATTR_TYPE); if (GroupAddress.ATTR_GROUP.equals(type)) return new Gro...
java
public static KNXAddress create(final XmlReader r) throws KNXMLException { if (r.getEventType() != XmlReader.START_ELEMENT) r.nextTag(); if (r.getEventType() == XmlReader.START_ELEMENT) { final String type = r.getAttributeValue(null, ATTR_TYPE); if (GroupAddress.ATTR_GROUP.equals(type)) return new Gro...
[ "public", "static", "KNXAddress", "create", "(", "final", "XmlReader", "r", ")", "throws", "KNXMLException", "{", "if", "(", "r", ".", "getEventType", "(", ")", "!=", "XmlReader", ".", "START_ELEMENT", ")", "r", ".", "nextTag", "(", ")", ";", "if", "(", ...
Creates a KNX address from xml input, the KNX address element is expected to be the current or next element from the parser. @param r a XML reader @return the created KNXAddress, either of subtype {@link GroupAddress} or {@link IndividualAddress} @throws KNXMLException if the XML element is no KNX address, on unknown ...
[ "Creates", "a", "KNX", "address", "from", "xml", "input", "the", "KNX", "address", "element", "is", "expected", "to", "be", "the", "current", "or", "next", "element", "from", "the", "parser", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/KNXAddress.java#L120-L132
train
calimero-project/calimero-core
src/tuwien/auto/calimero/KNXAddress.java
KNXAddress.save
public void save(final XmlWriter w) throws KNXMLException { w.writeStartElement(TAG_ADDRESS); w.writeAttribute(ATTR_TYPE, getType()); w.writeCharacters(toString()); w.writeEndElement(); }
java
public void save(final XmlWriter w) throws KNXMLException { w.writeStartElement(TAG_ADDRESS); w.writeAttribute(ATTR_TYPE, getType()); w.writeCharacters(toString()); w.writeEndElement(); }
[ "public", "void", "save", "(", "final", "XmlWriter", "w", ")", "throws", "KNXMLException", "{", "w", ".", "writeStartElement", "(", "TAG_ADDRESS", ")", ";", "w", ".", "writeAttribute", "(", "ATTR_TYPE", ",", "getType", "(", ")", ")", ";", "w", ".", "writ...
Writes the KNX address in XML format to the supplied writer. @param w a XML writer @throws KNXMLException on output error
[ "Writes", "the", "KNX", "address", "in", "XML", "format", "to", "the", "supplied", "writer", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/KNXAddress.java#L179-L185
train
calimero-project/calimero-core
src/tuwien/auto/calimero/knxnetip/servicetype/SearchRequest.java
SearchRequest.from
public static SearchRequest from(final KNXnetIPHeader h, final byte[] data, final int offset) throws KNXFormatException { final int svcType = h.getServiceType(); if (svcType != KNXnetIPHeader.SEARCH_REQ && svcType != KNXnetIPHeader.SearchRequest) throw new KNXIllegalArgumentException("not a search request"); r...
java
public static SearchRequest from(final KNXnetIPHeader h, final byte[] data, final int offset) throws KNXFormatException { final int svcType = h.getServiceType(); if (svcType != KNXnetIPHeader.SEARCH_REQ && svcType != KNXnetIPHeader.SearchRequest) throw new KNXIllegalArgumentException("not a search request"); r...
[ "public", "static", "SearchRequest", "from", "(", "final", "KNXnetIPHeader", "h", ",", "final", "byte", "[", "]", "data", ",", "final", "int", "offset", ")", "throws", "KNXFormatException", "{", "final", "int", "svcType", "=", "h", ".", "getServiceType", "("...
Creates a new search request from a byte array. @param h KNXnet/IP header preceding the search request in the byte array @param data byte array containing a search request @param offset start offset of request in <code>data</code> @return search request @throws KNXFormatException on wrong structure size or invalid hos...
[ "Creates", "a", "new", "search", "request", "from", "a", "byte", "array", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/servicetype/SearchRequest.java#L85-L90
train
calimero-project/calimero-core
src/tuwien/auto/calimero/internal/UdpSocketLooper.java
UdpSocketLooper.loop
public void loop() throws IOException { final long start = System.currentTimeMillis(); final byte[] buf = new byte[maxRcvBuf]; try { if (timeout > 0) s.setSoTimeout(timeout); while (!quit) { if (total > 0) { final long now = System.currentTimeMillis(); int to = (int) (start + total - now...
java
public void loop() throws IOException { final long start = System.currentTimeMillis(); final byte[] buf = new byte[maxRcvBuf]; try { if (timeout > 0) s.setSoTimeout(timeout); while (!quit) { if (total > 0) { final long now = System.currentTimeMillis(); int to = (int) (start + total - now...
[ "public", "void", "loop", "(", ")", "throws", "IOException", "{", "final", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "final", "byte", "[", "]", "buf", "=", "new", "byte", "[", "maxRcvBuf", "]", ";", "try", "{", "if", "(...
Runs the looper. @throws IOException on socket I/O error
[ "Runs", "the", "looper", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/internal/UdpSocketLooper.java#L109-L157
train
calimero-project/calimero-core
src/tuwien/auto/calimero/mgmt/TransportLayerImpl.java
TransportLayerImpl.getDestination
public Destination getDestination(final IndividualAddress remote) { final AggregatorProxy proxy = proxies.get(remote); return proxy != null ? proxy.getDestination() : null; }
java
public Destination getDestination(final IndividualAddress remote) { final AggregatorProxy proxy = proxies.get(remote); return proxy != null ? proxy.getDestination() : null; }
[ "public", "Destination", "getDestination", "(", "final", "IndividualAddress", "remote", ")", "{", "final", "AggregatorProxy", "proxy", "=", "proxies", ".", "get", "(", "remote", ")", ";", "return", "proxy", "!=", "null", "?", "proxy", ".", "getDestination", "(...
Returns the destination object for the remote individual address, if such exists. @param remote the remote address to look up @return the destination for that address, or <code>null</code> if no destination is currently maintained by the transport layer
[ "Returns", "the", "destination", "object", "for", "the", "remote", "individual", "address", "if", "such", "exists", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/mgmt/TransportLayerImpl.java#L257-L261
train
calimero-project/calimero-core
src/tuwien/auto/calimero/link/medium/RFLData.java
RFLData.newForTransmitOnlyDevice
static RFLData newForTransmitOnlyDevice(final boolean batteryOk, final int frameType, final int frameNumber, final byte[] serial, final GroupAddress dst, final byte[] tpdu) { return new RFLData(batteryOk, true, frameType, frameNumber, serial, new IndividualAddress( 0x05ff), dst, tpdu); }
java
static RFLData newForTransmitOnlyDevice(final boolean batteryOk, final int frameType, final int frameNumber, final byte[] serial, final GroupAddress dst, final byte[] tpdu) { return new RFLData(batteryOk, true, frameType, frameNumber, serial, new IndividualAddress( 0x05ff), dst, tpdu); }
[ "static", "RFLData", "newForTransmitOnlyDevice", "(", "final", "boolean", "batteryOk", ",", "final", "int", "frameType", ",", "final", "int", "frameNumber", ",", "final", "byte", "[", "]", "serial", ",", "final", "GroupAddress", "dst", ",", "final", "byte", "[...
- datapoints shall be numbered as DP1 = GroupAddr 0x0001, DP2 = 0x0002, ...
[ "-", "datapoints", "shall", "be", "numbered", "as", "DP1", "=", "GroupAddr", "0x0001", "DP2", "=", "0x0002", "..." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/link/medium/RFLData.java#L125-L130
train
calimero-project/calimero-core
src/tuwien/auto/calimero/xml/References.java
References.replace
static String replace(final String text, final boolean toReference) { return toReference ? replaceWithRef(text) : replaceFromRef(text); }
java
static String replace(final String text, final boolean toReference) { return toReference ? replaceWithRef(text) : replaceFromRef(text); }
[ "static", "String", "replace", "(", "final", "String", "text", ",", "final", "boolean", "toReference", ")", "{", "return", "toReference", "?", "replaceWithRef", "(", "text", ")", ":", "replaceFromRef", "(", "text", ")", ";", "}" ]
wrapper for reference replacement
[ "wrapper", "for", "reference", "replacement" ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/xml/References.java#L127-L130
train
calimero-project/calimero-core
src/tuwien/auto/calimero/dptxlator/DptXlatorMeteringValue.java
DptXlatorMeteringValue.coding
private int coding(final String unit) throws KNXFormatException { expUnitAdjustment = 0; // @formatter:off switch (unit) { case "Wh": return 0b00000000; case "MWh": expUnitAdjustment = 6; return 0b10000000; case "kJ": expUnitAdjustment = 3; return 0b00001000; case "GJ": expUnitAdjustment = 9; return 0b10...
java
private int coding(final String unit) throws KNXFormatException { expUnitAdjustment = 0; // @formatter:off switch (unit) { case "Wh": return 0b00000000; case "MWh": expUnitAdjustment = 6; return 0b10000000; case "kJ": expUnitAdjustment = 3; return 0b00001000; case "GJ": expUnitAdjustment = 9; return 0b10...
[ "private", "int", "coding", "(", "final", "String", "unit", ")", "throws", "KNXFormatException", "{", "expUnitAdjustment", "=", "0", ";", "// @formatter:off", "switch", "(", "unit", ")", "{", "case", "\"Wh\"", ":", "return", "0b00000000", ";", "case", "\"MWh\"...
try to find the coding based on unit
[ "try", "to", "find", "the", "coding", "based", "on", "unit" ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/dptxlator/DptXlatorMeteringValue.java#L365-L389
train
calimero-project/calimero-core
src/tuwien/auto/calimero/serial/SerialComAdapter.java
SerialComAdapter.setParity
final int setParity(final int parity) { try { return setControl(PARITY, parity); } catch (final IOException e) { logger.error("set parity failed", e); } return 0; }
java
final int setParity(final int parity) { try { return setControl(PARITY, parity); } catch (final IOException e) { logger.error("set parity failed", e); } return 0; }
[ "final", "int", "setParity", "(", "final", "int", "parity", ")", "{", "try", "{", "return", "setControl", "(", "PARITY", ",", "parity", ")", ";", "}", "catch", "(", "final", "IOException", "e", ")", "{", "logger", ".", "error", "(", "\"set parity failed\...
return previous parity mode
[ "return", "previous", "parity", "mode" ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/serial/SerialComAdapter.java#L228-L237
train
calimero-project/calimero-core
src/tuwien/auto/calimero/datapoint/Datapoint.java
Datapoint.save
public void save(final XmlWriter w) throws KNXMLException { /* XML layout: <datapoint stateBased=[true|false] name=string mainNumber=int dptID=string priority=string> knxAddress ... </datapoint> */ w.writeStartElement(TAG_DATAPOINT); w.writeAttribute(ATTR_STATEBASED, Boolean.toString(stateBased)...
java
public void save(final XmlWriter w) throws KNXMLException { /* XML layout: <datapoint stateBased=[true|false] name=string mainNumber=int dptID=string priority=string> knxAddress ... </datapoint> */ w.writeStartElement(TAG_DATAPOINT); w.writeAttribute(ATTR_STATEBASED, Boolean.toString(stateBased)...
[ "public", "void", "save", "(", "final", "XmlWriter", "w", ")", "throws", "KNXMLException", "{", "/* XML layout:\n\t\t <datapoint stateBased=[true|false] name=string mainNumber=int dptID=string\n\t\t priority=string>\n\t\t knxAddress\n\t\t ...\n\t\t </datapoint>\n\t\t*/", "w", ".", "write...
Saves this datapoint in XML format to the supplied XML writer. @param w a XML writer @throws KNXMLException on error saving this datapoint
[ "Saves", "this", "datapoint", "in", "XML", "format", "to", "the", "supplied", "XML", "writer", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/datapoint/Datapoint.java#L276-L294
train
calimero-project/calimero-core
src/tuwien/auto/calimero/knxnetip/ConnectionBase.java
ConnectionBase.handleServiceType
@SuppressWarnings("unused") protected boolean handleServiceType(final KNXnetIPHeader h, final byte[] data, final int offset, final InetAddress src, final int port) throws KNXFormatException, IOException { // at this subtype level, we don't care about any service type return false; }
java
@SuppressWarnings("unused") protected boolean handleServiceType(final KNXnetIPHeader h, final byte[] data, final int offset, final InetAddress src, final int port) throws KNXFormatException, IOException { // at this subtype level, we don't care about any service type return false; }
[ "@", "SuppressWarnings", "(", "\"unused\"", ")", "protected", "boolean", "handleServiceType", "(", "final", "KNXnetIPHeader", "h", ",", "final", "byte", "[", "]", "data", ",", "final", "int", "offset", ",", "final", "InetAddress", "src", ",", "final", "int", ...
This stub always returns false. @param h received KNXnet/IP header @param data received datagram data @param offset datagram data start offset @param src sender IP address @param port sender UDP port @return <code>true</code> if service type was known and handled (successfully or not), <code>false</code> otherwise @th...
[ "This", "stub", "always", "returns", "false", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/ConnectionBase.java#L374-L380
train
calimero-project/calimero-core
src/tuwien/auto/calimero/knxnetip/ConnectionBase.java
ConnectionBase.setState
protected final void setState(final int newState) { if (closing < 2) { // detect and ignore order of arrival inversion for tunneling.ack/cEMI.con if (internalState == OK && newState == ClientConnection.CEMI_CON_PENDING) return; internalState = newState; if (updateState) state = newState; } e...
java
protected final void setState(final int newState) { if (closing < 2) { // detect and ignore order of arrival inversion for tunneling.ack/cEMI.con if (internalState == OK && newState == ClientConnection.CEMI_CON_PENDING) return; internalState = newState; if (updateState) state = newState; } e...
[ "protected", "final", "void", "setState", "(", "final", "int", "newState", ")", "{", "if", "(", "closing", "<", "2", ")", "{", "// detect and ignore order of arrival inversion for tunneling.ack/cEMI.con", "if", "(", "internalState", "==", "OK", "&&", "newState", "=...
Request to set this connection into a new connection state. @param newState new state to set
[ "Request", "to", "set", "this", "connection", "into", "a", "new", "connection", "state", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/ConnectionBase.java#L387-L399
train
calimero-project/calimero-core
src/tuwien/auto/calimero/knxnetip/ConnectionBase.java
ConnectionBase.checkChannelId
protected boolean checkChannelId(final int id, final String svcType) { if (id == channelId) return true; logger.warn("received service " + svcType + " with wrong channel ID " + id + ", expected " + channelId + " - ignored"); return false; }
java
protected boolean checkChannelId(final int id, final String svcType) { if (id == channelId) return true; logger.warn("received service " + svcType + " with wrong channel ID " + id + ", expected " + channelId + " - ignored"); return false; }
[ "protected", "boolean", "checkChannelId", "(", "final", "int", "id", ",", "final", "String", "svcType", ")", "{", "if", "(", "id", "==", "channelId", ")", "return", "true", ";", "logger", ".", "warn", "(", "\"received service \"", "+", "svcType", "+", "\" ...
Validates channel id received in a packet against the one assigned to this connection. @param id received id to check @param svcType packet service type @return <code>true</code> if valid, <code>false</code> otherwise
[ "Validates", "channel", "id", "received", "in", "a", "packet", "against", "the", "one", "assigned", "to", "this", "connection", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/ConnectionBase.java#L487-L494
train
calimero-project/calimero-core
src/tuwien/auto/calimero/knxnetip/ConnectionBase.java
ConnectionBase.getServiceRequest
protected ServiceRequest getServiceRequest(final KNXnetIPHeader h, final byte[] data, final int offset) throws KNXFormatException { try { return PacketHelper.getServiceRequest(h, data, offset); } catch (final KNXFormatException e) { // check if at least the connection header of the service request // ...
java
protected ServiceRequest getServiceRequest(final KNXnetIPHeader h, final byte[] data, final int offset) throws KNXFormatException { try { return PacketHelper.getServiceRequest(h, data, offset); } catch (final KNXFormatException e) { // check if at least the connection header of the service request // ...
[ "protected", "ServiceRequest", "getServiceRequest", "(", "final", "KNXnetIPHeader", "h", ",", "final", "byte", "[", "]", "data", ",", "final", "int", "offset", ")", "throws", "KNXFormatException", "{", "try", "{", "return", "PacketHelper", ".", "getServiceRequest"...
Extracts the service request out of the supplied packet data. @param h packet KNXnet/IP header @param data contains the data following the KNXnet/IP header @param offset offset into <code>data</code> to message structure past KNXnet/IP header @return the service request @throws KNXFormatException on failure to extract...
[ "Extracts", "the", "service", "request", "out", "of", "the", "supplied", "packet", "data", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/knxnetip/ConnectionBase.java#L505-L520
train
calimero-project/calimero-core
src/tuwien/auto/calimero/cemi/CEMIFactory.java
CEMIFactory.fromEmi
public static CEMI fromEmi(final byte[] frame) throws KNXFormatException { // check for minimum frame length (i.e., a busmonitor frame) if (frame.length < 4) throw new KNXFormatException("EMI frame too short"); int mc = frame[0] & 0xff; // check for system broadcast on open media boolean domainBcast = tr...
java
public static CEMI fromEmi(final byte[] frame) throws KNXFormatException { // check for minimum frame length (i.e., a busmonitor frame) if (frame.length < 4) throw new KNXFormatException("EMI frame too short"); int mc = frame[0] & 0xff; // check for system broadcast on open media boolean domainBcast = tr...
[ "public", "static", "CEMI", "fromEmi", "(", "final", "byte", "[", "]", "frame", ")", "throws", "KNXFormatException", "{", "// check for minimum frame length (i.e., a busmonitor frame)", "if", "(", "frame", ".", "length", "<", "4", ")", "throw", "new", "KNXFormatExce...
Creates a new cEMI message out of the supplied EMI frame. @param frame EMI frame @return the new cEMI message @throws KNXFormatException if no (valid) EMI structure was found or unsupported EMI message code
[ "Creates", "a", "new", "cEMI", "message", "out", "of", "the", "supplied", "EMI", "frame", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/cemi/CEMIFactory.java#L227-L270
train
calimero-project/calimero-core
src/tuwien/auto/calimero/link/medium/RawFrameBase.java
RawFrameBase.init
int init(final ByteArrayInputStream is, final boolean parseDoA) throws KNXFormatException { final int ctrl = is.read(); // parse control field and check if valid if ((ctrl & 0x53) != 0x10) throw new KNXFormatException("invalid control field", ctrl); type = LDATA_FRAME; ext = (ctrl & 0x80) == 0; repetit...
java
int init(final ByteArrayInputStream is, final boolean parseDoA) throws KNXFormatException { final int ctrl = is.read(); // parse control field and check if valid if ((ctrl & 0x53) != 0x10) throw new KNXFormatException("invalid control field", ctrl); type = LDATA_FRAME; ext = (ctrl & 0x80) == 0; repetit...
[ "int", "init", "(", "final", "ByteArrayInputStream", "is", ",", "final", "boolean", "parseDoA", ")", "throws", "KNXFormatException", "{", "final", "int", "ctrl", "=", "is", ".", "read", "(", ")", ";", "// parse control field and check if valid", "if", "(", "(", ...
Inits the basic fields for TP1 and PL110 L-Data format reading the input stream. @param is @param parseDoA parse domain address after control field @return length field value of the raw frame @throws KNXFormatException
[ "Inits", "the", "basic", "fields", "for", "TP1", "and", "PL110", "L", "-", "Data", "format", "reading", "the", "input", "stream", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/link/medium/RawFrameBase.java#L234-L267
train
calimero-project/calimero-core
src/tuwien/auto/calimero/serial/usb/UsbConnection.java
UsbConnection.updateDeviceList
public static void updateDeviceList() throws SecurityException, UsbException { ((org.usb4java.javax.Services) UsbHostManager.getUsbServices()).scan(); }
java
public static void updateDeviceList() throws SecurityException, UsbException { ((org.usb4java.javax.Services) UsbHostManager.getUsbServices()).scan(); }
[ "public", "static", "void", "updateDeviceList", "(", ")", "throws", "SecurityException", ",", "UsbException", "{", "(", "(", "org", ".", "usb4java", ".", "javax", ".", "Services", ")", "UsbHostManager", ".", "getUsbServices", "(", ")", ")", ".", "scan", "(",...
Scans for USB device connection changes, so subsequent traversals provide an updated view of attached USB interfaces. @throws SecurityException on restricted access to USB services indicated as security violation @throws UsbException on error with USB services
[ "Scans", "for", "USB", "device", "connection", "changes", "so", "subsequent", "traversals", "provide", "an", "updated", "view", "of", "attached", "USB", "interfaces", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/serial/usb/UsbConnection.java#L338-L341
train
calimero-project/calimero-core
src/tuwien/auto/calimero/serial/usb/UsbConnection.java
UsbConnection.getKnxDevices
public static List<UsbDevice> getKnxDevices() { final List<UsbDevice> knx = new ArrayList<>(); for (final UsbDevice d : getDevices()) { final int vendor = d.getUsbDeviceDescriptor().idVendor() & 0xffff; for (final int v : vendorIds) if (v == vendor) knx.add(d); } return knx; }
java
public static List<UsbDevice> getKnxDevices() { final List<UsbDevice> knx = new ArrayList<>(); for (final UsbDevice d : getDevices()) { final int vendor = d.getUsbDeviceDescriptor().idVendor() & 0xffff; for (final int v : vendorIds) if (v == vendor) knx.add(d); } return knx; }
[ "public", "static", "List", "<", "UsbDevice", ">", "getKnxDevices", "(", ")", "{", "final", "List", "<", "UsbDevice", ">", "knx", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "final", "UsbDevice", "d", ":", "getDevices", "(", ")", ")", "...
Returns the list of KNX devices currently attached to the host, based on known KNX vendor IDs. @return the list of found KNX devices
[ "Returns", "the", "list", "of", "KNX", "devices", "currently", "attached", "to", "the", "host", "based", "on", "known", "KNX", "vendor", "IDs", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/serial/usb/UsbConnection.java#L353-L363
train
calimero-project/calimero-core
src/tuwien/auto/calimero/serial/usb/UsbConnection.java
UsbConnection.getVirtualSerialKnxDevices
public static List<UsbDevice> getVirtualSerialKnxDevices() throws SecurityException { final List<UsbDevice> knx = new ArrayList<>(); for (final UsbDevice d : getDevices()) { final int vendor = d.getUsbDeviceDescriptor().idVendor() & 0xffff; final int product = d.getUsbDeviceDescriptor().idProduct() & 0xffff;...
java
public static List<UsbDevice> getVirtualSerialKnxDevices() throws SecurityException { final List<UsbDevice> knx = new ArrayList<>(); for (final UsbDevice d : getDevices()) { final int vendor = d.getUsbDeviceDescriptor().idVendor() & 0xffff; final int product = d.getUsbDeviceDescriptor().idProduct() & 0xffff;...
[ "public", "static", "List", "<", "UsbDevice", ">", "getVirtualSerialKnxDevices", "(", ")", "throws", "SecurityException", "{", "final", "List", "<", "UsbDevice", ">", "knx", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "final", "UsbDevice", "d",...
internal use only
[ "internal", "use", "only" ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/serial/usb/UsbConnection.java#L366-L379
train
calimero-project/calimero-core
src/tuwien/auto/calimero/serial/usb/UsbConnection.java
UsbConnection.deviceDescriptor
public final DD0 deviceDescriptor() throws KNXPortClosedException, KNXTimeoutException, InterruptedException { return DD0.from((int) toUnsigned(getFeature(BusAccessServerFeature.DeviceDescriptorType0))); }
java
public final DD0 deviceDescriptor() throws KNXPortClosedException, KNXTimeoutException, InterruptedException { return DD0.from((int) toUnsigned(getFeature(BusAccessServerFeature.DeviceDescriptorType0))); }
[ "public", "final", "DD0", "deviceDescriptor", "(", ")", "throws", "KNXPortClosedException", ",", "KNXTimeoutException", ",", "InterruptedException", "{", "return", "DD0", ".", "from", "(", "(", "int", ")", "toUnsigned", "(", "getFeature", "(", "BusAccessServerFeatur...
Returns the KNX device descriptor type 0 of the USB interface. @return device descriptor type 0 @throws KNXPortClosedException on closed port @throws KNXTimeoutException on response timeout @throws InterruptedException on interrupt @see tuwien.auto.calimero.DeviceDescriptor
[ "Returns", "the", "KNX", "device", "descriptor", "type", "0", "of", "the", "USB", "interface", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/serial/usb/UsbConnection.java#L505-L507
train
calimero-project/calimero-core
src/tuwien/auto/calimero/serial/usb/UsbConnection.java
UsbConnection.removeClaimedInterfaceNumberOnWindows
private void removeClaimedInterfaceNumberOnWindows() { try { final Class<? extends UsbDevice> c = dev.getClass(); final Class<?> abstractDevice = c.getSuperclass(); final Field field = abstractDevice.getDeclaredField("claimedInterfaceNumbers"); field.setAccessible(true); final Object set = field.get(d...
java
private void removeClaimedInterfaceNumberOnWindows() { try { final Class<? extends UsbDevice> c = dev.getClass(); final Class<?> abstractDevice = c.getSuperclass(); final Field field = abstractDevice.getDeclaredField("claimedInterfaceNumbers"); field.setAccessible(true); final Object set = field.get(d...
[ "private", "void", "removeClaimedInterfaceNumberOnWindows", "(", ")", "{", "try", "{", "final", "Class", "<", "?", "extends", "UsbDevice", ">", "c", "=", "dev", ".", "getClass", "(", ")", ";", "final", "Class", "<", "?", ">", "abstractDevice", "=", "c", ...
Subsequent claims of that interface then always fail.
[ "Subsequent", "claims", "of", "that", "interface", "then", "always", "fail", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/serial/usb/UsbConnection.java#L711-L729
train
calimero-project/calimero-core
src/tuwien/auto/calimero/serial/usb/UsbConnection.java
UsbConnection.trimAtNull
private static String trimAtNull(final String s) { final int end = s.indexOf((char) 0); return end > -1 ? s.substring(0, end) : s; }
java
private static String trimAtNull(final String s) { final int end = s.indexOf((char) 0); return end > -1 ? s.substring(0, end) : s; }
[ "private", "static", "String", "trimAtNull", "(", "final", "String", "s", ")", "{", "final", "int", "end", "=", "s", ".", "indexOf", "(", "(", "char", ")", "0", ")", ";", "return", "end", ">", "-", "1", "?", "s", ".", "substring", "(", "0", ",", ...
sometimes the usb4java high-level API returns strings which exceed past the null terminator
[ "sometimes", "the", "usb4java", "high", "-", "level", "API", "returns", "strings", "which", "exceed", "past", "the", "null", "terminator" ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/serial/usb/UsbConnection.java#L959-L963
train
calimero-project/calimero-core
src/tuwien/auto/calimero/serial/usb/UsbConnection.java
UsbConnection.findDeviceByNameLowLevel
private static UsbDevice findDeviceByNameLowLevel(final String name) throws KNXException { final List<String> list = getDeviceDescriptionsLowLevel(); if (name.isEmpty()) list.removeIf(i -> !isKnxInterfaceId(i.substring(i.indexOf("ID") + 3, i.indexOf("\n")))); else list.removeIf(i -> i.toLowerCase().indexOf...
java
private static UsbDevice findDeviceByNameLowLevel(final String name) throws KNXException { final List<String> list = getDeviceDescriptionsLowLevel(); if (name.isEmpty()) list.removeIf(i -> !isKnxInterfaceId(i.substring(i.indexOf("ID") + 3, i.indexOf("\n")))); else list.removeIf(i -> i.toLowerCase().indexOf...
[ "private", "static", "UsbDevice", "findDeviceByNameLowLevel", "(", "final", "String", "name", ")", "throws", "KNXException", "{", "final", "List", "<", "String", ">", "list", "=", "getDeviceDescriptionsLowLevel", "(", ")", ";", "if", "(", "name", ".", "isEmpty",...
string. Pass that ID to findDevice. which will do the lookup by ID.
[ "string", ".", "Pass", "that", "ID", "to", "findDevice", ".", "which", "will", "do", "the", "lookup", "by", "ID", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/serial/usb/UsbConnection.java#L986-L999
train
calimero-project/calimero-core
src/tuwien/auto/calimero/serial/usb/UsbConnection.java
UsbConnection.getDeviceDescriptionsLowLevel
private static List<String> getDeviceDescriptionsLowLevel() { final Context ctx = new Context(); final int err = LibUsb.init(ctx); if (err != 0) { slogger.error("LibUsb initialization error {}: {}", -err, LibUsb.strError(err)); return Collections.emptyList(); } try { final DeviceList list = new Devi...
java
private static List<String> getDeviceDescriptionsLowLevel() { final Context ctx = new Context(); final int err = LibUsb.init(ctx); if (err != 0) { slogger.error("LibUsb initialization error {}: {}", -err, LibUsb.strError(err)); return Collections.emptyList(); } try { final DeviceList list = new Devi...
[ "private", "static", "List", "<", "String", ">", "getDeviceDescriptionsLowLevel", "(", ")", "{", "final", "Context", "ctx", "=", "new", "Context", "(", ")", ";", "final", "int", "err", "=", "LibUsb", ".", "init", "(", "ctx", ")", ";", "if", "(", "err",...
This method avoids any further issues down the road by using the ASCII descriptors.
[ "This", "method", "avoids", "any", "further", "issues", "down", "the", "road", "by", "using", "the", "ASCII", "descriptors", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/serial/usb/UsbConnection.java#L1004-L1030
train
calimero-project/calimero-core
src/tuwien/auto/calimero/DataUnitBuilder.java
DataUnitBuilder.getAPDUService
public static int getAPDUService(final byte[] apdu) { if (apdu.length < 2) throw new KNXIllegalArgumentException("getting APDU service from [0x" + toHex(apdu, "") + "], APCI length < 2"); // high 4 bits of APCI final int apci4 = (apdu[0] & 0x03) << 2 | (apdu[1] & 0xC0) >> 6; // lowest 6 bits of APCI ...
java
public static int getAPDUService(final byte[] apdu) { if (apdu.length < 2) throw new KNXIllegalArgumentException("getting APDU service from [0x" + toHex(apdu, "") + "], APCI length < 2"); // high 4 bits of APCI final int apci4 = (apdu[0] & 0x03) << 2 | (apdu[1] & 0xC0) >> 6; // lowest 6 bits of APCI ...
[ "public", "static", "int", "getAPDUService", "(", "final", "byte", "[", "]", "apdu", ")", "{", "if", "(", "apdu", ".", "length", "<", "2", ")", "throw", "new", "KNXIllegalArgumentException", "(", "\"getting APDU service from [0x\"", "+", "toHex", "(", "apdu", ...
Returns the application layer service of a given protocol data unit. @param apdu application layer protocol data unit, requires <code>apdu.length</code> &gt; 1 @return APDU service code
[ "Returns", "the", "application", "layer", "service", "of", "a", "given", "protocol", "data", "unit", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/DataUnitBuilder.java#L72-L118
train
calimero-project/calimero-core
src/tuwien/auto/calimero/DataUnitBuilder.java
DataUnitBuilder.getTPDUService
public static int getTPDUService(final byte[] tpdu) { final int ctrl = tpdu[0] & 0xff; if ((ctrl & 0xFC) == 0) return 0; // 0x04 is tag_group service code, not used by us if ((ctrl & 0xFC) == 0x04) return 0x04; if ((ctrl & 0xC0) == 0x40) return T_DATA_CONNECTED; if (ctrl == T_CONNECT) return T_...
java
public static int getTPDUService(final byte[] tpdu) { final int ctrl = tpdu[0] & 0xff; if ((ctrl & 0xFC) == 0) return 0; // 0x04 is tag_group service code, not used by us if ((ctrl & 0xFC) == 0x04) return 0x04; if ((ctrl & 0xC0) == 0x40) return T_DATA_CONNECTED; if (ctrl == T_CONNECT) return T_...
[ "public", "static", "int", "getTPDUService", "(", "final", "byte", "[", "]", "tpdu", ")", "{", "final", "int", "ctrl", "=", "tpdu", "[", "0", "]", "&", "0xff", ";", "if", "(", "(", "ctrl", "&", "0xFC", ")", "==", "0", ")", "return", "0", ";", "...
Returns the transport layer service of a given protocol data unit. @param tpdu transport layer protocol data unit @return TPDU service code
[ "Returns", "the", "transport", "layer", "service", "of", "a", "given", "protocol", "data", "unit", "." ]
7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8
https://github.com/calimero-project/calimero-core/blob/7e6f547c6bd75fa985bfeb5b47ba671df2ea01e8/src/tuwien/auto/calimero/DataUnitBuilder.java#L126-L146
train
cjdev/httpobjects
jetty-9/src/main/java/org/httpobjects/jetty/HttpObjectsJettyHandler.java
HttpObjectsJettyHandler.launchServerContract
public static JettyServerContract launchServerContract(int port, HttpObject... objects){ JettyServerContract server = new JettyServerDelegate(new Server(port)); server.setHandler(new HttpObjectsJettyHandler(Collections.singletonList(new GenericHeaderField("Cache-Control", "no-cache")), objects)); ...
java
public static JettyServerContract launchServerContract(int port, HttpObject... objects){ JettyServerContract server = new JettyServerDelegate(new Server(port)); server.setHandler(new HttpObjectsJettyHandler(Collections.singletonList(new GenericHeaderField("Cache-Control", "no-cache")), objects)); ...
[ "public", "static", "JettyServerContract", "launchServerContract", "(", "int", "port", ",", "HttpObject", "...", "objects", ")", "{", "JettyServerContract", "server", "=", "new", "JettyServerDelegate", "(", "new", "Server", "(", "port", ")", ")", ";", "server", ...
Replaced checked exceptions with unchecked exceptions.
[ "Replaced", "checked", "exceptions", "with", "unchecked", "exceptions", "." ]
c8bdcb26b2d10e8b29a31442f1c55817a3482190
https://github.com/cjdev/httpobjects/blob/c8bdcb26b2d10e8b29a31442f1c55817a3482190/jetty-9/src/main/java/org/httpobjects/jetty/HttpObjectsJettyHandler.java#L126-L131
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Document.java
Document.setC4Document
private void setC4Document(C4Document c4doc) { synchronized (lock) { replaceC4Document(c4doc); data = null; if (c4doc != null && !c4doc.deleted()) { data = c4doc.getSelectedBody2(); } updateDictionary(); } }
java
private void setC4Document(C4Document c4doc) { synchronized (lock) { replaceC4Document(c4doc); data = null; if (c4doc != null && !c4doc.deleted()) { data = c4doc.getSelectedBody2(); } updateDictionary(); } }
[ "private", "void", "setC4Document", "(", "C4Document", "c4doc", ")", "{", "synchronized", "(", "lock", ")", "{", "replaceC4Document", "(", "c4doc", ")", ";", "data", "=", "null", ";", "if", "(", "c4doc", "!=", "null", "&&", "!", "c4doc", ".", "deleted", ...
Sets c4doc and updates my root dictionary
[ "Sets", "c4doc", "and", "updates", "my", "root", "dictionary" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Document.java#L507-L514
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractReplicatorConfiguration.java
AbstractReplicatorConfiguration.setHeaders
@NonNull public ReplicatorConfiguration setHeaders(Map<String, String> headers) { if (readonly) { throw new IllegalStateException("ReplicatorConfiguration is readonly mode."); } this.headers = new HashMap<>(headers); return getReplicatorConfiguration(); }
java
@NonNull public ReplicatorConfiguration setHeaders(Map<String, String> headers) { if (readonly) { throw new IllegalStateException("ReplicatorConfiguration is readonly mode."); } this.headers = new HashMap<>(headers); return getReplicatorConfiguration(); }
[ "@", "NonNull", "public", "ReplicatorConfiguration", "setHeaders", "(", "Map", "<", "String", ",", "String", ">", "headers", ")", "{", "if", "(", "readonly", ")", "{", "throw", "new", "IllegalStateException", "(", "\"ReplicatorConfiguration is readonly mode.\"", ")"...
Sets the extra HTTP headers to send in all requests to the remote target. @param headers The HTTP Headers. @return The self object.
[ "Sets", "the", "extra", "HTTP", "headers", "to", "send", "in", "all", "requests", "to", "the", "remote", "target", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractReplicatorConfiguration.java#L194-L199
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractReplicatorConfiguration.java
AbstractReplicatorConfiguration.setPullFilter
@NonNull public ReplicatorConfiguration setPullFilter(ReplicationFilter pullFilter) { if (readonly) { throw new IllegalStateException("ReplicatorConfiguration is readonly mode."); } this.pullFilter = pullFilter; return getReplicatorConfiguration(); }
java
@NonNull public ReplicatorConfiguration setPullFilter(ReplicationFilter pullFilter) { if (readonly) { throw new IllegalStateException("ReplicatorConfiguration is readonly mode."); } this.pullFilter = pullFilter; return getReplicatorConfiguration(); }
[ "@", "NonNull", "public", "ReplicatorConfiguration", "setPullFilter", "(", "ReplicationFilter", "pullFilter", ")", "{", "if", "(", "readonly", ")", "{", "throw", "new", "IllegalStateException", "(", "\"ReplicatorConfiguration is readonly mode.\"", ")", ";", "}", "this",...
Sets a filter object for validating whether the documents can be pulled from the remote endpoint. Only documents for which the object returns true are replicated. @param pullFilter The filter to filter the document to be pulled. @return The self object.
[ "Sets", "a", "filter", "object", "for", "validating", "whether", "the", "documents", "can", "be", "pulled", "from", "the", "remote", "endpoint", ".", "Only", "documents", "for", "which", "the", "object", "returns", "true", "are", "replicated", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractReplicatorConfiguration.java#L224-L229
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractReplicatorConfiguration.java
AbstractReplicatorConfiguration.setPushFilter
@NonNull public ReplicatorConfiguration setPushFilter(ReplicationFilter pushFilter) { if (readonly) { throw new IllegalStateException("ReplicatorConfiguration is readonly mode."); } this.pushFilter = pushFilter; return getReplicatorConfiguration(); }
java
@NonNull public ReplicatorConfiguration setPushFilter(ReplicationFilter pushFilter) { if (readonly) { throw new IllegalStateException("ReplicatorConfiguration is readonly mode."); } this.pushFilter = pushFilter; return getReplicatorConfiguration(); }
[ "@", "NonNull", "public", "ReplicatorConfiguration", "setPushFilter", "(", "ReplicationFilter", "pushFilter", ")", "{", "if", "(", "readonly", ")", "{", "throw", "new", "IllegalStateException", "(", "\"ReplicatorConfiguration is readonly mode.\"", ")", ";", "}", "this",...
Sets a filter object for validating whether the documents can be pushed to the remote endpoint. @param pushFilter The filter to filter the document to be pushed. @return The self object.
[ "Sets", "a", "filter", "object", "for", "validating", "whether", "the", "documents", "can", "be", "pushed", "to", "the", "remote", "endpoint", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractReplicatorConfiguration.java#L238-L243
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.setData
@NonNull @Override public MutableArray setData(List<Object> data) { synchronized (lock) { internalArray.clear(); for (Object obj : data) { internalArray.append(Fleece.toCBLObject(obj)); } return this; } }
java
@NonNull @Override public MutableArray setData(List<Object> data) { synchronized (lock) { internalArray.clear(); for (Object obj : data) { internalArray.append(Fleece.toCBLObject(obj)); } return this; } }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "setData", "(", "List", "<", "Object", ">", "data", ")", "{", "synchronized", "(", "lock", ")", "{", "internalArray", ".", "clear", "(", ")", ";", "for", "(", "Object", "obj", ":", "data", ")",...
Set an array as a content. Allowed value types are List, Date, Map, Number, null, String, Array, Blob, and Dictionary. The List and Map must contain only the above types. Setting the new array content will replcace the current data including the existing Array and Dictionary objects. @param data the array @return The ...
[ "Set", "an", "array", "as", "a", "content", ".", "Allowed", "value", "types", "are", "List", "Date", "Map", "Number", "null", "String", "Array", "Blob", "and", "Dictionary", ".", "The", "List", "and", "Map", "must", "contain", "only", "the", "above", "ty...
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L81-L89
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.setValue
@NonNull @Override public MutableArray setValue(int index, Object value) { synchronized (lock) { if (Fleece.valueWouldChange(value, internalArray.get(index), internalArray) && (!internalArray.set(index, Fleece.toCBLObject(value)))) { throwRangeException(index)...
java
@NonNull @Override public MutableArray setValue(int index, Object value) { synchronized (lock) { if (Fleece.valueWouldChange(value, internalArray.get(index), internalArray) && (!internalArray.set(index, Fleece.toCBLObject(value)))) { throwRangeException(index)...
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "setValue", "(", "int", "index", ",", "Object", "value", ")", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "Fleece", ".", "valueWouldChange", "(", "value", ",", "internalArray", ".", "get...
Set an object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the object @return The self object
[ "Set", "an", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L98-L108
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.setString
@NonNull @Override public MutableArray setString(int index, String value) { return setValue(index, value); }
java
@NonNull @Override public MutableArray setString(int index, String value) { return setValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "setString", "(", "int", "index", ",", "String", "value", ")", "{", "return", "setValue", "(", "index", ",", "value", ")", ";", "}" ]
Sets an String object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the String object @return The self object
[ "Sets", "an", "String", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L117-L121
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.setNumber
@NonNull @Override public MutableArray setNumber(int index, Number value) { return setValue(index, value); }
java
@NonNull @Override public MutableArray setNumber(int index, Number value) { return setValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "setNumber", "(", "int", "index", ",", "Number", "value", ")", "{", "return", "setValue", "(", "index", ",", "value", ")", ";", "}" ]
Sets an NSNumber object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Number object @return The self object
[ "Sets", "an", "NSNumber", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L130-L134
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.setBlob
@NonNull @Override public MutableArray setBlob(int index, Blob value) { return setValue(index, value); }
java
@NonNull @Override public MutableArray setBlob(int index, Blob value) { return setValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "setBlob", "(", "int", "index", ",", "Blob", "value", ")", "{", "return", "setValue", "(", "index", ",", "value", ")", ";", "}" ]
Sets a Blob object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Blob object @return The self object
[ "Sets", "a", "Blob", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L208-L212
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.setDate
@NonNull @Override public MutableArray setDate(int index, Date value) { return setValue(index, value); }
java
@NonNull @Override public MutableArray setDate(int index, Date value) { return setValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "setDate", "(", "int", "index", ",", "Date", "value", ")", "{", "return", "setValue", "(", "index", ",", "value", ")", ";", "}" ]
Sets a Date object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Date object @return The self object
[ "Sets", "a", "Date", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L221-L225
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.setArray
@NonNull @Override public MutableArray setArray(int index, Array value) { return setValue(index, value); }
java
@NonNull @Override public MutableArray setArray(int index, Array value) { return setValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "setArray", "(", "int", "index", ",", "Array", "value", ")", "{", "return", "setValue", "(", "index", ",", "value", ")", ";", "}" ]
Sets a Array object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Array object @return The self object
[ "Sets", "a", "Array", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L234-L238
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.setDictionary
@NonNull @Override public MutableArray setDictionary(int index, Dictionary value) { return setValue(index, value); }
java
@NonNull @Override public MutableArray setDictionary(int index, Dictionary value) { return setValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "setDictionary", "(", "int", "index", ",", "Dictionary", "value", ")", "{", "return", "setValue", "(", "index", ",", "value", ")", ";", "}" ]
Sets a Dictionary object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Dictionary object @return The self object
[ "Sets", "a", "Dictionary", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L247-L251
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.addValue
@NonNull @Override public MutableArray addValue(Object value) { synchronized (lock) { internalArray.append(Fleece.toCBLObject(value)); return this; } }
java
@NonNull @Override public MutableArray addValue(Object value) { synchronized (lock) { internalArray.append(Fleece.toCBLObject(value)); return this; } }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "addValue", "(", "Object", "value", ")", "{", "synchronized", "(", "lock", ")", "{", "internalArray", ".", "append", "(", "Fleece", ".", "toCBLObject", "(", "value", ")", ")", ";", "return", "this"...
Adds an object to the end of the array. @param value the object @return The self object
[ "Adds", "an", "object", "to", "the", "end", "of", "the", "array", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L259-L266
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.insertValue
@NonNull @Override public MutableArray insertValue(int index, Object value) { synchronized (lock) { if (!internalArray.insert(index, Fleece.toCBLObject(value))) { throwRangeException(index); } return this; } }
java
@NonNull @Override public MutableArray insertValue(int index, Object value) { synchronized (lock) { if (!internalArray.insert(index, Fleece.toCBLObject(value))) { throwRangeException(index); } return this; } }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "insertValue", "(", "int", "index", ",", "Object", "value", ")", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "!", "internalArray", ".", "insert", "(", "index", ",", "Fleece", ".", "toC...
Inserts an object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the object @return The self object
[ "Inserts", "an", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L407-L414
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.insertString
@NonNull @Override public MutableArray insertString(int index, String value) { return insertValue(index, value); }
java
@NonNull @Override public MutableArray insertString(int index, String value) { return insertValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "insertString", "(", "int", "index", ",", "String", "value", ")", "{", "return", "insertValue", "(", "index", ",", "value", ")", ";", "}" ]
Inserts a String object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the String object @return The self object
[ "Inserts", "a", "String", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L423-L427
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.insertNumber
@NonNull @Override public MutableArray insertNumber(int index, Number value) { return insertValue(index, value); }
java
@NonNull @Override public MutableArray insertNumber(int index, Number value) { return insertValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "insertNumber", "(", "int", "index", ",", "Number", "value", ")", "{", "return", "insertValue", "(", "index", ",", "value", ")", ";", "}" ]
Inserts a Number object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Number object @return The self object
[ "Inserts", "a", "Number", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L436-L440
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.insertBlob
@NonNull @Override public MutableArray insertBlob(int index, Blob value) { return insertValue(index, value); }
java
@NonNull @Override public MutableArray insertBlob(int index, Blob value) { return insertValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "insertBlob", "(", "int", "index", ",", "Blob", "value", ")", "{", "return", "insertValue", "(", "index", ",", "value", ")", ";", "}" ]
Inserts a Blob object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Blob object @return The self object
[ "Inserts", "a", "Blob", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L514-L518
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.insertDate
@NonNull @Override public MutableArray insertDate(int index, Date value) { return insertValue(index, value); }
java
@NonNull @Override public MutableArray insertDate(int index, Date value) { return insertValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "insertDate", "(", "int", "index", ",", "Date", "value", ")", "{", "return", "insertValue", "(", "index", ",", "value", ")", ";", "}" ]
Inserts a Date object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Date object @return The self object
[ "Inserts", "a", "Date", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L527-L531
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.insertArray
@NonNull @Override public MutableArray insertArray(int index, Array value) { return insertValue(index, value); }
java
@NonNull @Override public MutableArray insertArray(int index, Array value) { return insertValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "insertArray", "(", "int", "index", ",", "Array", "value", ")", "{", "return", "insertValue", "(", "index", ",", "value", ")", ";", "}" ]
Inserts an Array object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Array object @return The self object
[ "Inserts", "an", "Array", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L540-L544
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.insertDictionary
@NonNull @Override public MutableArray insertDictionary(int index, Dictionary value) { return insertValue(index, value); }
java
@NonNull @Override public MutableArray insertDictionary(int index, Dictionary value) { return insertValue(index, value); }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "insertDictionary", "(", "int", "index", ",", "Dictionary", "value", ")", "{", "return", "insertValue", "(", "index", ",", "value", ")", ";", "}" ]
Inserts a Dictionary object at the given index. @param index the index. This value must not exceed the bounds of the array. @param value the Dictionary object @return The self object
[ "Inserts", "a", "Dictionary", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L553-L557
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/MutableArray.java
MutableArray.remove
@NonNull @Override public MutableArray remove(int index) { synchronized (lock) { if (!internalArray.remove(index)) { throwRangeException(index); } return this; } }
java
@NonNull @Override public MutableArray remove(int index) { synchronized (lock) { if (!internalArray.remove(index)) { throwRangeException(index); } return this; } }
[ "@", "NonNull", "@", "Override", "public", "MutableArray", "remove", "(", "int", "index", ")", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "!", "internalArray", ".", "remove", "(", "index", ")", ")", "{", "throwRangeException", "(", "index", "...
Removes the object at the given index. @param index the index. This value must not exceed the bounds of the array. @return The self object
[ "Removes", "the", "object", "at", "the", "given", "index", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/MutableArray.java#L565-L572
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/internal/core/C4BlobStore.java
C4BlobStore.getContents
public FLSliceResult getContents(C4BlobKey blobKey) throws LiteCoreException { return new FLSliceResult(getContents(handle, blobKey.getHandle())); }
java
public FLSliceResult getContents(C4BlobKey blobKey) throws LiteCoreException { return new FLSliceResult(getContents(handle, blobKey.getHandle())); }
[ "public", "FLSliceResult", "getContents", "(", "C4BlobKey", "blobKey", ")", "throws", "LiteCoreException", "{", "return", "new", "FLSliceResult", "(", "getContents", "(", "handle", ",", "blobKey", ".", "getHandle", "(", ")", ")", ")", ";", "}" ]
Reads the entire contents of a blob into memory. Caller is responsible for freeing it.
[ "Reads", "the", "entire", "contents", "of", "a", "blob", "into", "memory", ".", "Caller", "is", "responsible", "for", "freeing", "it", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/internal/core/C4BlobStore.java#L101-L103
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/internal/core/C4BlobStore.java
C4BlobStore.openReadStream
public C4BlobReadStream openReadStream(C4BlobKey blobKey) throws LiteCoreException { return new C4BlobReadStream(openReadStream(handle, blobKey.getHandle())); }
java
public C4BlobReadStream openReadStream(C4BlobKey blobKey) throws LiteCoreException { return new C4BlobReadStream(openReadStream(handle, blobKey.getHandle())); }
[ "public", "C4BlobReadStream", "openReadStream", "(", "C4BlobKey", "blobKey", ")", "throws", "LiteCoreException", "{", "return", "new", "C4BlobReadStream", "(", "openReadStream", "(", "handle", ",", "blobKey", ".", "getHandle", "(", ")", ")", ")", ";", "}" ]
Opens a blob for reading, as a random-access byte stream.
[ "Opens", "a", "blob", "for", "reading", "as", "a", "random", "-", "access", "byte", "stream", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/internal/core/C4BlobStore.java#L135-L137
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/internal/fleece/MArray.java
MArray.get
public MValue get(long index) { if (index < 0 || index >= values.size()) { return MValue.EMPTY; } MValue value = values.get((int) index); if (value.isEmpty() && (baseArray != null)) { value = new MValue(baseArray.get(index)); values.set((int) index, value); } ...
java
public MValue get(long index) { if (index < 0 || index >= values.size()) { return MValue.EMPTY; } MValue value = values.get((int) index); if (value.isEmpty() && (baseArray != null)) { value = new MValue(baseArray.get(index)); values.set((int) index, value); } ...
[ "public", "MValue", "get", "(", "long", "index", ")", "{", "if", "(", "index", "<", "0", "||", "index", ">=", "values", ".", "size", "(", ")", ")", "{", "return", "MValue", ".", "EMPTY", ";", "}", "MValue", "value", "=", "values", ".", "get", "("...
Returns a reference to the MValue of the item at the given index. If the index is out of range, returns an empty MValue.
[ "Returns", "a", "reference", "to", "the", "MValue", "of", "the", "item", "at", "the", "given", "index", ".", "If", "the", "index", "is", "out", "of", "range", "returns", "an", "empty", "MValue", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/internal/fleece/MArray.java#L72-L82
train
couchbase/couchbase-lite-java
templates/CBLVersion.java
CBLVersion.getVersionInfo
public static String getVersionInfo() { String info = versionInfo.get(); if (info == null) { info = String.format(Locale.ENGLISH, VERSION_INFO, getLibInfo(), getSysInfo()); versionInfo.compareAndSet(null, info); } return info; }
java
public static String getVersionInfo() { String info = versionInfo.get(); if (info == null) { info = String.format(Locale.ENGLISH, VERSION_INFO, getLibInfo(), getSysInfo()); versionInfo.compareAndSet(null, info); } return info; }
[ "public", "static", "String", "getVersionInfo", "(", ")", "{", "String", "info", "=", "versionInfo", ".", "get", "(", ")", ";", "if", "(", "info", "==", "null", ")", "{", "info", "=", "String", ".", "format", "(", "Locale", ".", "ENGLISH", ",", "VERS...
This is the full library build and environment information.
[ "This", "is", "the", "full", "library", "build", "and", "environment", "information", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/templates/CBLVersion.java#L56-L65
train
couchbase/couchbase-lite-java
templates/CBLVersion.java
CBLVersion.getLibInfo
public static String getLibInfo() { String info = libInfo.get(); if (info == null) { info = String.format(Locale.ENGLISH, LIB_INFO, C4.getVersion()); libInfo.compareAndSet(null, info); } return info; }
java
public static String getLibInfo() { String info = libInfo.get(); if (info == null) { info = String.format(Locale.ENGLISH, LIB_INFO, C4.getVersion()); libInfo.compareAndSet(null, info); } return info; }
[ "public", "static", "String", "getLibInfo", "(", ")", "{", "String", "info", "=", "libInfo", ".", "get", "(", ")", ";", "if", "(", "info", "==", "null", ")", "{", "info", "=", "String", ".", "format", "(", "Locale", ".", "ENGLISH", ",", "LIB_INFO", ...
This is the short library build information.
[ "This", "is", "the", "short", "library", "build", "information", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/templates/CBLVersion.java#L68-L77
train
couchbase/couchbase-lite-java
templates/CBLVersion.java
CBLVersion.getSysInfo
public static String getSysInfo() { String info = sysInfo.get(); if (info == null) { info = String.format(Locale.ENGLISH, SYS_INFO, System.getProperty("os.name", "unknown")); sysInfo.compareAndSet(null, info); } return info; }
java
public static String getSysInfo() { String info = sysInfo.get(); if (info == null) { info = String.format(Locale.ENGLISH, SYS_INFO, System.getProperty("os.name", "unknown")); sysInfo.compareAndSet(null, info); } return info; }
[ "public", "static", "String", "getSysInfo", "(", ")", "{", "String", "info", "=", "sysInfo", ".", "get", "(", ")", ";", "if", "(", "info", "==", "null", ")", "{", "info", "=", "String", ".", "format", "(", "Locale", ".", "ENGLISH", ",", "SYS_INFO", ...
This is information about the system on which we are running.
[ "This", "is", "information", "about", "the", "system", "on", "which", "we", "are", "running", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/templates/CBLVersion.java#L80-L90
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Dictionary.java
Dictionary.toMap
@NonNull @Override public Map<String, Object> toMap() { synchronized (lock) { final Map<String, Object> result = new HashMap<>(); for (String key : internalDict) { result.put(key, Fleece.toObject(getMValue(internalDict, key).asNative(internalDict))); }...
java
@NonNull @Override public Map<String, Object> toMap() { synchronized (lock) { final Map<String, Object> result = new HashMap<>(); for (String key : internalDict) { result.put(key, Fleece.toObject(getMValue(internalDict, key).asNative(internalDict))); }...
[ "@", "NonNull", "@", "Override", "public", "Map", "<", "String", ",", "Object", ">", "toMap", "(", ")", "{", "synchronized", "(", "lock", ")", "{", "final", "Map", "<", "String", ",", "Object", ">", "result", "=", "new", "HashMap", "<>", "(", ")", ...
Gets content of the current object as an Map. The values contained in the returned Map object are all JSON based values. @return the Map object representing the content of the current object in the JSON format.
[ "Gets", "content", "of", "the", "current", "object", "as", "an", "Map", ".", "The", "values", "contained", "in", "the", "returned", "Map", "object", "are", "all", "JSON", "based", "values", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Dictionary.java#L315-L325
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.getString
@Override public String getString(int index) { check(index); final Object obj = fleeceValueToObject(index); return obj instanceof String ? (String) obj : null; }
java
@Override public String getString(int index) { check(index); final Object obj = fleeceValueToObject(index); return obj instanceof String ? (String) obj : null; }
[ "@", "Override", "public", "String", "getString", "(", "int", "index", ")", "{", "check", "(", "index", ")", ";", "final", "Object", "obj", "=", "fleeceValueToObject", "(", "index", ")", ";", "return", "obj", "instanceof", "String", "?", "(", "String", "...
The projecting result value at the given index as a String object @param index The select result index. @return The String object.
[ "The", "projecting", "result", "value", "at", "the", "given", "index", "as", "a", "String", "object" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L100-L105
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.getNumber
@Override public Number getNumber(int index) { check(index); return CBLConverter.asNumber(fleeceValueToObject(index)); }
java
@Override public Number getNumber(int index) { check(index); return CBLConverter.asNumber(fleeceValueToObject(index)); }
[ "@", "Override", "public", "Number", "getNumber", "(", "int", "index", ")", "{", "check", "(", "index", ")", ";", "return", "CBLConverter", ".", "asNumber", "(", "fleeceValueToObject", "(", "index", ")", ")", ";", "}" ]
The projecting result value at the given index as a Number object @param index The select result index. @return The Number object.
[ "The", "projecting", "result", "value", "at", "the", "given", "index", "as", "a", "Number", "object" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L113-L117
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.getInt
@Override public int getInt(int index) { check(index); final FLValue flValue = values.get(index); return flValue != null ? (int) flValue.asInt() : 0; }
java
@Override public int getInt(int index) { check(index); final FLValue flValue = values.get(index); return flValue != null ? (int) flValue.asInt() : 0; }
[ "@", "Override", "public", "int", "getInt", "(", "int", "index", ")", "{", "check", "(", "index", ")", ";", "final", "FLValue", "flValue", "=", "values", ".", "get", "(", "index", ")", ";", "return", "flValue", "!=", "null", "?", "(", "int", ")", "...
The projecting result value at the given index as a integer value @param index The select result index. @return The integer value.
[ "The", "projecting", "result", "value", "at", "the", "given", "index", "as", "a", "integer", "value" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L125-L130
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.getFloat
@Override public float getFloat(int index) { check(index); final FLValue flValue = values.get(index); return flValue != null ? flValue.asFloat() : 0.0F; }
java
@Override public float getFloat(int index) { check(index); final FLValue flValue = values.get(index); return flValue != null ? flValue.asFloat() : 0.0F; }
[ "@", "Override", "public", "float", "getFloat", "(", "int", "index", ")", "{", "check", "(", "index", ")", ";", "final", "FLValue", "flValue", "=", "values", ".", "get", "(", "index", ")", ";", "return", "flValue", "!=", "null", "?", "flValue", ".", ...
The projecting result value at the given index as a float value @param index The select result index. @return The float value.
[ "The", "projecting", "result", "value", "at", "the", "given", "index", "as", "a", "float", "value" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L151-L156
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.getDouble
@Override public double getDouble(int index) { check(index); final FLValue flValue = values.get(index); return flValue != null ? flValue.asDouble() : 0.0; }
java
@Override public double getDouble(int index) { check(index); final FLValue flValue = values.get(index); return flValue != null ? flValue.asDouble() : 0.0; }
[ "@", "Override", "public", "double", "getDouble", "(", "int", "index", ")", "{", "check", "(", "index", ")", ";", "final", "FLValue", "flValue", "=", "values", ".", "get", "(", "index", ")", ";", "return", "flValue", "!=", "null", "?", "flValue", ".", ...
The projecting result value at the given index as a double value @param index The select result index. @return The double value.
[ "The", "projecting", "result", "value", "at", "the", "given", "index", "as", "a", "double", "value" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L164-L169
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.getBoolean
@Override public boolean getBoolean(int index) { check(index); final FLValue flValue = values.get(index); return flValue != null && flValue.asBool(); }
java
@Override public boolean getBoolean(int index) { check(index); final FLValue flValue = values.get(index); return flValue != null && flValue.asBool(); }
[ "@", "Override", "public", "boolean", "getBoolean", "(", "int", "index", ")", "{", "check", "(", "index", ")", ";", "final", "FLValue", "flValue", "=", "values", ".", "get", "(", "index", ")", ";", "return", "flValue", "!=", "null", "&&", "flValue", "....
The projecting result value at the given index as a boolean value @param index The select result index. @return The boolean value.
[ "The", "projecting", "result", "value", "at", "the", "given", "index", "as", "a", "boolean", "value" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L177-L182
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.getBlob
@Override public Blob getBlob(int index) { check(index); final Object obj = fleeceValueToObject(index); return obj instanceof Blob ? (Blob) obj : null; }
java
@Override public Blob getBlob(int index) { check(index); final Object obj = fleeceValueToObject(index); return obj instanceof Blob ? (Blob) obj : null; }
[ "@", "Override", "public", "Blob", "getBlob", "(", "int", "index", ")", "{", "check", "(", "index", ")", ";", "final", "Object", "obj", "=", "fleeceValueToObject", "(", "index", ")", ";", "return", "obj", "instanceof", "Blob", "?", "(", "Blob", ")", "o...
The projecting result value at the given index as a Blob object @param index The select result index. @return The Blob object.
[ "The", "projecting", "result", "value", "at", "the", "given", "index", "as", "a", "Blob", "object" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L190-L195
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.getDate
@Override public Date getDate(int index) { check(index); return DateUtils.fromJson(getString(index)); }
java
@Override public Date getDate(int index) { check(index); return DateUtils.fromJson(getString(index)); }
[ "@", "Override", "public", "Date", "getDate", "(", "int", "index", ")", "{", "check", "(", "index", ")", ";", "return", "DateUtils", ".", "fromJson", "(", "getString", "(", "index", ")", ")", ";", "}" ]
The projecting result value at the given index as an Array object @param index The select result index. @return The object.
[ "The", "projecting", "result", "value", "at", "the", "given", "index", "as", "an", "Array", "object" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L203-L207
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.getArray
@Override public Array getArray(int index) { check(index); final Object obj = fleeceValueToObject(index); return obj instanceof Array ? (Array) obj : null; }
java
@Override public Array getArray(int index) { check(index); final Object obj = fleeceValueToObject(index); return obj instanceof Array ? (Array) obj : null; }
[ "@", "Override", "public", "Array", "getArray", "(", "int", "index", ")", "{", "check", "(", "index", ")", ";", "final", "Object", "obj", "=", "fleeceValueToObject", "(", "index", ")", ";", "return", "obj", "instanceof", "Array", "?", "(", "Array", ")", ...
The projecting result value at the given index as a Array object @param index The select result index. @return The object.
[ "The", "projecting", "result", "value", "at", "the", "given", "index", "as", "a", "Array", "object" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L215-L220
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.getDictionary
@Override public Dictionary getDictionary(int index) { check(index); final Object obj = fleeceValueToObject(index); return obj instanceof Dictionary ? (Dictionary) obj : null; }
java
@Override public Dictionary getDictionary(int index) { check(index); final Object obj = fleeceValueToObject(index); return obj instanceof Dictionary ? (Dictionary) obj : null; }
[ "@", "Override", "public", "Dictionary", "getDictionary", "(", "int", "index", ")", "{", "check", "(", "index", ")", ";", "final", "Object", "obj", "=", "fleeceValueToObject", "(", "index", ")", ";", "return", "obj", "instanceof", "Dictionary", "?", "(", "...
The projecting result value at the given index as a Dictionary object @param index The select result index. @return The object.
[ "The", "projecting", "result", "value", "at", "the", "given", "index", "as", "a", "Dictionary", "object" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L228-L233
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.toList
@NonNull @Override public List<Object> toList() { final List<Object> array = new ArrayList<>(); for (int i = 0; i < count(); i++) { array.add(values.get(i).asObject()); } return array; }
java
@NonNull @Override public List<Object> toList() { final List<Object> array = new ArrayList<>(); for (int i = 0; i < count(); i++) { array.add(values.get(i).asObject()); } return array; }
[ "@", "NonNull", "@", "Override", "public", "List", "<", "Object", ">", "toList", "(", ")", "{", "final", "List", "<", "Object", ">", "array", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ...
Gets all values as an List. The value types of the values contained in the returned List object are Array, Blob, Dictionary, Number types, String, and null. @return The List representing all values.
[ "Gets", "all", "values", "as", "an", "List", ".", "The", "value", "types", "of", "the", "values", "contained", "in", "the", "returned", "List", "object", "are", "Array", "Blob", "Dictionary", "Number", "types", "String", "and", "null", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L241-L249
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Result.java
Result.toMap
@NonNull @Override public Map<String, Object> toMap() { final List<Object> values = toList(); final Map<String, Object> dict = new HashMap<>(); for (String name : rs.getColumnNames().keySet()) { final int index = indexForColumnName(name); if (index >= 0) { dict.pu...
java
@NonNull @Override public Map<String, Object> toMap() { final List<Object> values = toList(); final Map<String, Object> dict = new HashMap<>(); for (String name : rs.getColumnNames().keySet()) { final int index = indexForColumnName(name); if (index >= 0) { dict.pu...
[ "@", "NonNull", "@", "Override", "public", "Map", "<", "String", ",", "Object", ">", "toMap", "(", ")", "{", "final", "List", "<", "Object", ">", "values", "=", "toList", "(", ")", ";", "final", "Map", "<", "String", ",", "Object", ">", "dict", "="...
Gets all values as a Dictionary. The value types of the values contained in the returned Dictionary object are Array, Blob, Dictionary, Number types, String, and null. @return The Map representing all values.
[ "Gets", "all", "values", "as", "a", "Dictionary", ".", "The", "value", "types", "of", "the", "values", "contained", "in", "the", "returned", "Dictionary", "object", "are", "Array", "Blob", "Dictionary", "Number", "types", "String", "and", "null", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Result.java#L451-L461
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Expression.java
Expression.isNullOrMissing
@NonNull public Expression isNullOrMissing() { return new UnaryExpression(this, UnaryExpression.OpType.Null) .or(new UnaryExpression(this, UnaryExpression.OpType.Missing)); }
java
@NonNull public Expression isNullOrMissing() { return new UnaryExpression(this, UnaryExpression.OpType.Null) .or(new UnaryExpression(this, UnaryExpression.OpType.Missing)); }
[ "@", "NonNull", "public", "Expression", "isNullOrMissing", "(", ")", "{", "return", "new", "UnaryExpression", "(", "this", ",", "UnaryExpression", ".", "OpType", ".", "Null", ")", ".", "or", "(", "new", "UnaryExpression", "(", "this", ",", "UnaryExpression", ...
Creates an IS NULL OR MISSING expression that evaluates whether or not the current expression is null or missing. @return An IS NULL expression.
[ "Creates", "an", "IS", "NULL", "OR", "MISSING", "expression", "that", "evaluates", "whether", "or", "not", "the", "current", "expression", "is", "null", "or", "missing", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Expression.java#L815-L819
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/LiteCoreException.java
LiteCoreException.throwException
public static void throwException(int domain, int code, String msg) throws LiteCoreException { throw new LiteCoreException(domain, code, msg); }
java
public static void throwException(int domain, int code, String msg) throws LiteCoreException { throw new LiteCoreException(domain, code, msg); }
[ "public", "static", "void", "throwException", "(", "int", "domain", ",", "int", "code", ",", "String", "msg", ")", "throws", "LiteCoreException", "{", "throw", "new", "LiteCoreException", "(", "domain", ",", "code", ",", "msg", ")", ";", "}" ]
NOTE called to throw LiteCoreException from native code to Java
[ "NOTE", "called", "to", "throw", "LiteCoreException", "from", "native", "code", "to", "Java" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/LiteCoreException.java#L25-L27
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractDatabase.java
AbstractDatabase.compact
public void compact() throws CouchbaseLiteException { synchronized (lock) { mustBeOpen(); try { getC4Database().compact(); } catch (LiteCoreException e) { throw CBLStatus.convertException(e); } } }
java
public void compact() throws CouchbaseLiteException { synchronized (lock) { mustBeOpen(); try { getC4Database().compact(); } catch (LiteCoreException e) { throw CBLStatus.convertException(e); } } }
[ "public", "void", "compact", "(", ")", "throws", "CouchbaseLiteException", "{", "synchronized", "(", "lock", ")", "{", "mustBeOpen", "(", ")", ";", "try", "{", "getC4Database", "(", ")", ".", "compact", "(", ")", ";", "}", "catch", "(", "LiteCoreException"...
Compacts the database file by deleting unused attachment files and vacuuming the SQLite database
[ "Compacts", "the", "database", "file", "by", "deleting", "unused", "attachment", "files", "and", "vacuuming", "the", "SQLite", "database" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractDatabase.java#L590-L600
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractDatabase.java
AbstractDatabase.close
public void close() throws CouchbaseLiteException { synchronized (lock) { if (c4db == null) { return; } Log.i(DOMAIN, "Closing %s at path %s", this, getC4Database().getPath()); if (activeReplications.size() > 0) { throw new CouchbaseLiteException( ...
java
public void close() throws CouchbaseLiteException { synchronized (lock) { if (c4db == null) { return; } Log.i(DOMAIN, "Closing %s at path %s", this, getC4Database().getPath()); if (activeReplications.size() > 0) { throw new CouchbaseLiteException( ...
[ "public", "void", "close", "(", ")", "throws", "CouchbaseLiteException", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "c4db", "==", "null", ")", "{", "return", ";", "}", "Log", ".", "i", "(", "DOMAIN", ",", "\"Closing %s at path %s\"", ",", "th...
Closes a database. @throws CouchbaseLiteException Throws an exception if any error occurs during the operation.
[ "Closes", "a", "database", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractDatabase.java#L684-L717
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractDatabase.java
AbstractDatabase.delete
public void delete() throws CouchbaseLiteException { synchronized (lock) { mustBeOpen(); Log.i(DOMAIN, "Deleting %s at path %s", this, getC4Database().getPath()); if (activeReplications.size() > 0) { throw new CouchbaseLiteException( "Can...
java
public void delete() throws CouchbaseLiteException { synchronized (lock) { mustBeOpen(); Log.i(DOMAIN, "Deleting %s at path %s", this, getC4Database().getPath()); if (activeReplications.size() > 0) { throw new CouchbaseLiteException( "Can...
[ "public", "void", "delete", "(", ")", "throws", "CouchbaseLiteException", "{", "synchronized", "(", "lock", ")", "{", "mustBeOpen", "(", ")", ";", "Log", ".", "i", "(", "DOMAIN", ",", "\"Deleting %s at path %s\"", ",", "this", ",", "getC4Database", "(", ")",...
Deletes a database. @throws CouchbaseLiteException Throws an exception if any error occurs during the operation.
[ "Deletes", "a", "database", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractDatabase.java#L724-L758
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractDatabase.java
AbstractDatabase.save
private boolean save(Document document, boolean deletion, ConcurrencyControl concurrencyControl) throws CouchbaseLiteException { if (deletion && !document.exists()) { throw new CouchbaseLiteException("Cannot delete a document that has not yet been saved.", CBLError.Domain.CBL...
java
private boolean save(Document document, boolean deletion, ConcurrencyControl concurrencyControl) throws CouchbaseLiteException { if (deletion && !document.exists()) { throw new CouchbaseLiteException("Cannot delete a document that has not yet been saved.", CBLError.Domain.CBL...
[ "private", "boolean", "save", "(", "Document", "document", ",", "boolean", "deletion", ",", "ConcurrencyControl", "concurrencyControl", ")", "throws", "CouchbaseLiteException", "{", "if", "(", "deletion", "&&", "!", "document", ".", "exists", "(", ")", ")", "{",...
The main save method.
[ "The", "main", "save", "method", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractDatabase.java#L1181-L1261
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/LiveQuery.java
LiveQuery.start
void start() { synchronized (lock) { if (query.getDatabase() == null) { throw new IllegalArgumentException("associated database should not be null."); } observing = true; releaseResultSet(); query.getDatabase().getActiveLiveQueries().a...
java
void start() { synchronized (lock) { if (query.getDatabase() == null) { throw new IllegalArgumentException("associated database should not be null."); } observing = true; releaseResultSet(); query.getDatabase().getActiveLiveQueries().a...
[ "void", "start", "(", ")", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "query", ".", "getDatabase", "(", ")", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"associated database should not be null.\"", ")", ";", "}", "o...
Starts observing database changes and reports changes in the query result.
[ "Starts", "observing", "database", "changes", "and", "reports", "changes", "in", "the", "query", "result", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/LiveQuery.java#L113-L127
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/LiveQuery.java
LiveQuery.stop
private void stop(boolean removeFromList) { synchronized (lock) { observing = false; willUpdate = false; // cancels the delayed update started by -databaseChanged if (query != null && query.getDatabase() != null && dbListenerToken != null) { query.getDatabase(...
java
private void stop(boolean removeFromList) { synchronized (lock) { observing = false; willUpdate = false; // cancels the delayed update started by -databaseChanged if (query != null && query.getDatabase() != null && dbListenerToken != null) { query.getDatabase(...
[ "private", "void", "stop", "(", "boolean", "removeFromList", ")", "{", "synchronized", "(", "lock", ")", "{", "observing", "=", "false", ";", "willUpdate", "=", "false", ";", "// cancels the delayed update started by -databaseChanged", "if", "(", "query", "!=", "n...
Stops observing database changes.
[ "Stops", "observing", "database", "changes", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/LiveQuery.java#L159-L172
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/internal/core/C4Database.java
C4Database.createReplicator
public C4Replicator createReplicator( C4Socket openSocket, int push, int pull, byte[] options, C4ReplicatorListener listener, Object replicatorContext) throws LiteCoreException { return new C4Replicator(handle, openSocket.handle, push, pull, options, l...
java
public C4Replicator createReplicator( C4Socket openSocket, int push, int pull, byte[] options, C4ReplicatorListener listener, Object replicatorContext) throws LiteCoreException { return new C4Replicator(handle, openSocket.handle, push, pull, options, l...
[ "public", "C4Replicator", "createReplicator", "(", "C4Socket", "openSocket", ",", "int", "push", ",", "int", "pull", ",", "byte", "[", "]", "options", ",", "C4ReplicatorListener", "listener", ",", "Object", "replicatorContext", ")", "throws", "LiteCoreException", ...
- Fleece-related
[ "-", "Fleece", "-", "related" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/internal/core/C4Database.java#L417-L426
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractNetworkReachabilityManager.java
AbstractNetworkReachabilityManager.addNetworkReachabilityListener
void addNetworkReachabilityListener(NetworkReachabilityListener listener) { synchronized (listeners) { listeners.add(listener); if (listeners.size() == 1) { startListening(); } } }
java
void addNetworkReachabilityListener(NetworkReachabilityListener listener) { synchronized (listeners) { listeners.add(listener); if (listeners.size() == 1) { startListening(); } } }
[ "void", "addNetworkReachabilityListener", "(", "NetworkReachabilityListener", "listener", ")", "{", "synchronized", "(", "listeners", ")", "{", "listeners", ".", "add", "(", "listener", ")", ";", "if", "(", "listeners", ".", "size", "(", ")", "==", "1", ")", ...
Add Network Reachability Listener
[ "Add", "Network", "Reachability", "Listener" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractNetworkReachabilityManager.java#L39-L44
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractNetworkReachabilityManager.java
AbstractNetworkReachabilityManager.removeNetworkReachabilityListener
void removeNetworkReachabilityListener(NetworkReachabilityListener listener) { synchronized (listeners) { listeners.remove(listener); if (listeners.size() == 0) { stopListening(); } } }
java
void removeNetworkReachabilityListener(NetworkReachabilityListener listener) { synchronized (listeners) { listeners.remove(listener); if (listeners.size() == 0) { stopListening(); } } }
[ "void", "removeNetworkReachabilityListener", "(", "NetworkReachabilityListener", "listener", ")", "{", "synchronized", "(", "listeners", ")", "{", "listeners", ".", "remove", "(", "listener", ")", ";", "if", "(", "listeners", ".", "size", "(", ")", "==", "0", ...
Remove Network Reachability Listener
[ "Remove", "Network", "Reachability", "Listener" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractNetworkReachabilityManager.java#L49-L54
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractNetworkReachabilityManager.java
AbstractNetworkReachabilityManager.notifyListenersNetworkReachable
void notifyListenersNetworkReachable() { // NOTE: synchronized(listener) causes deadlock with listeners and Replicator.lock. final Set<NetworkReachabilityListener> copy = new HashSet<>(listeners); for (NetworkReachabilityListener listener : copy) { if (listener != null) { listener.ne...
java
void notifyListenersNetworkReachable() { // NOTE: synchronized(listener) causes deadlock with listeners and Replicator.lock. final Set<NetworkReachabilityListener> copy = new HashSet<>(listeners); for (NetworkReachabilityListener listener : copy) { if (listener != null) { listener.ne...
[ "void", "notifyListenersNetworkReachable", "(", ")", "{", "// NOTE: synchronized(listener) causes deadlock with listeners and Replicator.lock.", "final", "Set", "<", "NetworkReachabilityListener", ">", "copy", "=", "new", "HashSet", "<>", "(", "listeners", ")", ";", "for", ...
Notify listeners that the network is now reachable
[ "Notify", "listeners", "that", "the", "network", "is", "now", "reachable" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractNetworkReachabilityManager.java#L59-L65
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/AbstractNetworkReachabilityManager.java
AbstractNetworkReachabilityManager.notifyListenersNetworkUneachable
void notifyListenersNetworkUneachable() { // NOTE: synchronized(listener) causes deadlock with listeners and Replicator.lock. final Set<NetworkReachabilityListener> copy = new HashSet<>(listeners); for (NetworkReachabilityListener listener : copy) { if (listener != null) { listener.n...
java
void notifyListenersNetworkUneachable() { // NOTE: synchronized(listener) causes deadlock with listeners and Replicator.lock. final Set<NetworkReachabilityListener> copy = new HashSet<>(listeners); for (NetworkReachabilityListener listener : copy) { if (listener != null) { listener.n...
[ "void", "notifyListenersNetworkUneachable", "(", ")", "{", "// NOTE: synchronized(listener) causes deadlock with listeners and Replicator.lock.", "final", "Set", "<", "NetworkReachabilityListener", ">", "copy", "=", "new", "HashSet", "<>", "(", "listeners", ")", ";", "for", ...
Notify listeners that the network is now unreachable
[ "Notify", "listeners", "that", "the", "network", "is", "now", "unreachable" ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/AbstractNetworkReachabilityManager.java#L70-L76
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Array.java
Array.getValue
@Override public Object getValue(int index) { synchronized (lock) { return getMValue(internalArray, index).asNative(internalArray); } }
java
@Override public Object getValue(int index) { synchronized (lock) { return getMValue(internalArray, index).asNative(internalArray); } }
[ "@", "Override", "public", "Object", "getValue", "(", "int", "index", ")", "{", "synchronized", "(", "lock", ")", "{", "return", "getMValue", "(", "internalArray", ",", "index", ")", ".", "asNative", "(", "internalArray", ")", ";", "}", "}" ]
Gets value at the given index as an object. The object types are Blob, Array, Dictionary, Number, or String based on the underlying data type; or nil if the value is nil. @param index the index. This value must not exceed the bounds of the array. @return the Object or null.
[ "Gets", "value", "at", "the", "given", "index", "as", "an", "object", ".", "The", "object", "types", "are", "Blob", "Array", "Dictionary", "Number", "or", "String", "based", "on", "the", "underlying", "data", "type", ";", "or", "nil", "if", "the", "value...
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Array.java#L116-L121
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Array.java
Array.getString
@Override public String getString(int index) { synchronized (lock) { final Object obj = getMValue(internalArray, index).asNative(internalArray); return obj instanceof String ? (String) obj : null; } }
java
@Override public String getString(int index) { synchronized (lock) { final Object obj = getMValue(internalArray, index).asNative(internalArray); return obj instanceof String ? (String) obj : null; } }
[ "@", "Override", "public", "String", "getString", "(", "int", "index", ")", "{", "synchronized", "(", "lock", ")", "{", "final", "Object", "obj", "=", "getMValue", "(", "internalArray", ",", "index", ")", ".", "asNative", "(", "internalArray", ")", ";", ...
Gets value at the given index as a String. Returns null if the value doesn't exist, or its value is not a String. @param index the index. This value must not exceed the bounds of the array. @return the String or null.
[ "Gets", "value", "at", "the", "given", "index", "as", "a", "String", ".", "Returns", "null", "if", "the", "value", "doesn", "t", "exist", "or", "its", "value", "is", "not", "a", "String", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Array.java#L129-L135
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Array.java
Array.getNumber
@Override public Number getNumber(int index) { synchronized (lock) { return CBLConverter.asNumber(getMValue(internalArray, index).asNative(internalArray)); } }
java
@Override public Number getNumber(int index) { synchronized (lock) { return CBLConverter.asNumber(getMValue(internalArray, index).asNative(internalArray)); } }
[ "@", "Override", "public", "Number", "getNumber", "(", "int", "index", ")", "{", "synchronized", "(", "lock", ")", "{", "return", "CBLConverter", ".", "asNumber", "(", "getMValue", "(", "internalArray", ",", "index", ")", ".", "asNative", "(", "internalArray...
Gets value at the given index as a Number. Returns null if the value doesn't exist, or its value is not a Number. @param index the index. This value must not exceed the bounds of the array. @return the Number or nil.
[ "Gets", "value", "at", "the", "given", "index", "as", "a", "Number", ".", "Returns", "null", "if", "the", "value", "doesn", "t", "exist", "or", "its", "value", "is", "not", "a", "Number", "." ]
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Array.java#L143-L148
train
couchbase/couchbase-lite-java
src/main/java/com/couchbase/lite/Array.java
Array.getInt
@Override public int getInt(int index) { synchronized (lock) { return CBLConverter.asInteger(getMValue(internalArray, index), internalArray); } }
java
@Override public int getInt(int index) { synchronized (lock) { return CBLConverter.asInteger(getMValue(internalArray, index), internalArray); } }
[ "@", "Override", "public", "int", "getInt", "(", "int", "index", ")", "{", "synchronized", "(", "lock", ")", "{", "return", "CBLConverter", ".", "asInteger", "(", "getMValue", "(", "internalArray", ",", "index", ")", ",", "internalArray", ")", ";", "}", ...
Gets value at the given index as an int. Floating point values will be rounded. The value `true` is returned as 1, `false` as 0. Returns 0 if the value doesn't exist or does not have a numeric value. @param index the index. This value must not exceed the bounds of the array. @return the int value.
[ "Gets", "value", "at", "the", "given", "index", "as", "an", "int", ".", "Floating", "point", "values", "will", "be", "rounded", ".", "The", "value", "true", "is", "returned", "as", "1", "false", "as", "0", ".", "Returns", "0", "if", "the", "value", "...
cb72c44186456e6191a9ad0a7feb310011d0b081
https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Array.java#L158-L163
train