conversation
listlengths
2
2
[ { "content": "Obtains a local date in Julian calendar system from the\nproleptic-year, month-of-year and day-of-month fields.\n\n@param prolepticYear the proleptic-year\n@param month the month-of-year\n@param dayOfMonth the day-of-month\n@return the Julian local date, not null\n@throws DateTimeException if u...
[ { "content": "Obtains a local date in Julian calendar system from the\nera, year-of-era and day-of-year fields.\n\n@param era the Julian era, not null\n@param yearOfEra the year-of-era\n@param dayOfYear the day-of-year\n@return the Julian local date, not null\n@throws DateTimeException if unable to create th...
[ { "content": "Obtains a Julian local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Julian local date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n @Sup...
[ { "content": "Obtains a Julian zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Julian zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n @Sup...
[ { "content": "Obtains a local date in Symmetry454 calendar system from the\nproleptic-year, month-of-year and day-of-month fields.\n\n@param prolepticYear the proleptic-year\n@param month the month-of-year\n@param dayOfMonth the day-of-month\n@return the Symmetry454 local date, not null\n@throws DateTimeExce...
[ { "content": "Obtains a local date in Symmetry454 calendar system from the\nera, year-of-era and day-of-year fields.\n\n@param era the Symmetry454 era, not null\n@param yearOfEra the year-of-era\n@param dayOfYear the day-of-year\n@return the Symmetry454 local date, not null\n@throws DateTimeException if unab...
[ { "content": "Obtains a Symmetry454 local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Symmetry454 local date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override...
[ { "content": "Obtains a Symmetry454 zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Symmetry454 zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override...
[ { "content": "Obtains a local date in Symmetry010 calendar system from the\nproleptic-year, month-of-year and day-of-month fields.\n\n@param prolepticYear the proleptic-year\n@param month the month-of-year\n@param dayOfMonth the day-of-month\n@return the Symmetry010 local date, not null\n@throws DateTimeExce...
[ { "content": "Obtains a local date in Symmetry010 calendar system from the\nera, year-of-era and day-of-year fields.\n\n@param era the Symmetry010 era, not null\n@param yearOfEra the year-of-era\n@param dayOfYear the day-of-year\n@return the Symmetry010 local date, not null\n@throws DateTimeException if unab...
[ { "content": "Obtains a Symmetry010 local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Symmetry010 local date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override...
[ { "content": "Obtains a Symmetry010 zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Symmetry010 zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override...
[ { "content": "Obtains a local date in Pax calendar system from the\nproleptic-year, month-of-year and day-of-month fields.\n\n@param prolepticYear the proleptic-year\n@param month the month-of-year\n@param dayOfMonth the day-of-month\n@return the Pax local date, not null\n@throws DateTimeException if unable ...
[ { "content": "Obtains a local date in Pax calendar system from the\nera, year-of-era and day-of-year fields.\n\n@param era the Pax era, not null\n@param yearOfEra the year-of-era\n@param dayOfYear the day-of-year\n@return the Pax local date, not null\n@throws DateTimeException if unable to create the date\n@...
[ { "content": "Obtains a Pax local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Pax local date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n @SuppressW...
[ { "content": "Obtains a Pax zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Pax zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n @SuppressW...
[ { "content": "Obtains a local date in Ethiopic calendar system from the\nera, year-of-era, month-of-year and day-of-month fields.\n\n@param era the Ethiopic era, not null\n@param yearOfEra the year-of-era\n@param month the month-of-year\n@param dayOfMonth the day-of-month\n@return the Ethiopic local date, n...
[ { "content": "Obtains a local date in Ethiopic calendar system from the\nproleptic-year, month-of-year and day-of-month fields.\n\n@param prolepticYear the proleptic-year\n@param month the month-of-year\n@param dayOfMonth the day-of-month\n@return the Ethiopic local date, not null\n@throws DateTimeException ...
[ { "content": "Obtains a local date in Ethiopic calendar system from the\nera, year-of-era and day-of-year fields.\n\n@param era the Ethiopic era, not null\n@param yearOfEra the year-of-era\n@param dayOfYear the day-of-year\n@return the Ethiopic local date, not null\n@throws DateTimeException if unable to cre...
[ { "content": "Obtains a Ethiopic local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Ethiopic local date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n ...
[ { "content": "Obtains a Ethiopic zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Ethiopic zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n ...
[ { "content": "Obtains a local date in Discordian calendar system from the\nproleptic-year, month-of-year and day-of-month fields.\n\n@param prolepticYear the proleptic-year\n@param month the month-of-year\n@param dayOfMonth the day-of-month\n@return the Discordian local date, not null\n@throws DateTimeExcept...
[ { "content": "Obtains a local date in Discordian calendar system from the\nera, year-of-era and day-of-year fields.\n\n@param era the Discordian era, not null\n@param yearOfEra the year-of-era\n@param dayOfYear the day-of-year\n@return the Discordian local date, not null\n@throws DateTimeException if unable ...
[ { "content": "Obtains a Discordian local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Discordian local date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n...
[ { "content": "Obtains a Discordian zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Discordian zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "content": "@Override\n...
[ { "content": "Obtains a local date in International Fixed calendar system from the\nproleptic-year, month-of-year and day-of-month fields.\n\n@param prolepticYear the proleptic-year\n@param month the month-of-year\n@param dayOfMonth the day-of-month\n@return the International Fixed local date, not null\n@thr...
[ { "content": "Obtains a local date in International Fixed calendar system from the\nera, year-of-era and day-of-year fields.\n\n@param era the International Fixed era, not null\n@param yearOfEra the year-of-era\n@param dayOfYear the day-of-year\n@return the International Fixed local date, not null\n@throws D...
[ { "content": "Obtains a International Fixed local date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the International Fixed local date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "cont...
[ { "content": "Obtains a International Fixed zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the International Fixed zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "role": "user" }, { "cont...
[ { "content": "A property tied to the map, updated when the idle state event is fired.\n\n@return", "role": "user" }, { "content": "public final ReadOnlyObjectProperty<LatLongBounds> boundsProperty() {\n if (bounds == null) {\n bounds = new ReadOnlyObjectWrapper<>(getBounds());\n ...
[ { "content": "Adds the supplied marker to the map.\n\n@param marker", "role": "user" }, { "content": "public void addMarker(Marker marker) {\n if (markers == null) {\n markers = new HashSet<>();\n }\n markers.add(marker);\n marker.setMap(this);\n }", "ro...
[ { "content": "Removes the supplied marker from the map.\n\n@param marker", "role": "user" }, { "content": "public void removeMarker(Marker marker) {\n if (markers != null && markers.contains(marker)) {\n markers.remove(marker);\n }\n marker.setMap(null);\n }", ...
[ { "content": "Removes all of the markers from the map.", "role": "user" }, { "content": "public void clearMarkers() {\n if (markers != null && !markers.isEmpty()) {\n markers.forEach((m) -> {\n m.setMap(null);\n });\n markers.clear();\n }...
[ { "content": "Sets a property on this Javascript object for which the value is a\nJavascript object itself.\n\n@param propertyName The name of the property.\n@param propertyValue The value of the property.", "role": "user" }, { "content": "protected void setProperty(String propertyName, JavascriptOb...
[ { "content": "Sets a property on this Javascript object for which the value is a\nJavascriptEnum\n\nThe value is set to what is returned by the getEnumValue() method on the JavascriptEnum\n\n@param propertyName The name of the property.\n@param propertyValue The value of the property.", "role": "user" }, ...
[ { "content": "Gets the property and casts to the appropriate type\n\n@param <T>\n@param key The property name\n@param type The property type\n@return The value of the property", "role": "user" }, { "content": "protected <T> T getProperty(String key, Class<T> type) {\n Object returnValue = get...
[ { "content": "Invokes a JavaScript function that takes no arguments.\n\n@param <T>\n@param function The function to invoke\n@param returnType The type of object to return\n@return The result of the function.", "role": "user" }, { "content": "protected <T> T invokeJavascriptReturnValue(String functio...
[ { "content": "JSObject will return the String \"undefined\" at certain times, so we\nneed to make sure we're not getting a value that looks valid, but isn't.\n\n@param val The value from Javascript to be checked.\n@return Either null or the value passed in.", "role": "user" }, { "content": "protecte...
[ { "content": "Checks a returned Javascript value where we expect a boolean but could\nget null.\n\n@param val The value from Javascript to be checked.\n@param def The default return value, which can be null.\n@return The actual value, or if null, returns false.", "role": "user" }, { "content": "prot...
[ { "content": "Registers a handler and returns the callback key to be passed to\nJavascript.\n\n@param handler Handler to be registered.\n@return A String random UUID that can be used as the callback key.", "role": "user" }, { "content": "public String registerHandler(GFXEventHandler handler) {\n ...
[ { "content": "This method is called from Javascript, passing in the previously created\ncallback key. It uses that to find the correct handler and then passes on\nthe call. State events in the Google Maps API don't pass any parameters.\n\n@param callbackKey Key generated by the call to registerHandler.", "r...
[ { "content": "Builds the path for a closed arc, returning a PolygonOptions that can be\nfurther customised before use.\n\n@param center\n@param start\n@param end\n@param arcType Pass in either ArcType.CHORD or ArcType.ROUND\n@return PolygonOptions with the paths element populated.", "role": "user" }, { ...
[ { "content": "Builds the path for an open arc based on a PolylineOptions.\n\n@param center\n@param start\n@param end\n@return PolylineOptions with the paths element populated.", "role": "user" }, { "content": "public static final PolylineOptions buildOpenArc(LatLong center, LatLong start, LatLong en...
[ { "content": "Generates the points for an arc based on two bearings from a centre point\nand a radius.\n\n@param center The LatLong point of the center.\n@param startBearing North is 0 degrees, East is 90 degrees, etc.\n@param endBearing North is 0 degrees, East is 90 degrees, etc.\n@param radius In metres\n@re...
[ { "content": "The location for this elevation.\n\n@return", "role": "user" }, { "content": "public LatLong getLocation() {\n if (location == null) {\n location = new LatLong((JSObject) (getJSObject().getMember(\"location\")));\n }\n return location;\n }", "role...
[ { "content": "Takes the specified object and converts the argument to a String.\n\n@param arg The object to convert\n@return A String representation of the argument.", "role": "user" }, { "content": "protected String getArgString(Object arg) {\n //if (arg instanceof LatLong) {\n // ...
[ { "content": "Registers an event handler in the repository shared between Javascript\nand Java.\n\n@param h Event handler to be registered.\n@return Callback key that Javascript will use to find this handler.", "role": "user" }, { "content": "private String registerEventHandler(GFXEventHandler h) {\...
[ { "content": "Adds a handler for a mouse type event on the map.\n\n@param obj The object that the event should be registered on.\n@param type Type of the event to register against.\n@param h Handler that will be called when the event occurs.", "role": "user" }, { "content": "public void addUIEventHa...
[ { "content": "From v3_epoly.js, calculates the distance between this LatLong point and\nanother.\n\n@param end The end point to calculate the distance to.\n@return The distance, in metres, to the end point.", "role": "user" }, { "content": "public double distanceFrom(LatLong end) {\n\n double...
[ { "content": "Calculates the LatLong position of the end point of a line the specified\ndistance from this LatLong, along the provided bearing, where North is 0,\nEast is 90 etc.\n\n@param bearing The bearing, in degrees, with North as 0, East as 90 etc.\n@param distance The distance in metres.\n@return A new L...
[ { "content": "Calculates the bearing, in degrees, of the end LatLong point from this\nLatLong point.\n\n@param end The point that the bearing is calculated for.\n@return The bearing, in degrees, of the supplied point from this point.", "role": "user" }, { "content": "public double getBearing(LatLong...
[ { "content": "Create a request for elevations for multiple locations.\n\n@param req\n@param callback", "role": "user" }, { "content": "public void getElevationForLocations(LocationElevationRequest req, ElevationServiceCallback callback) {\n \n this.callback = callback;\n \n ...
[ { "content": "Create a request for elevations for samples along a path.\n\n@param req\n@param callback", "role": "user" }, { "content": "public void getElevationAlongPath(PathElevationRequest req, ElevationServiceCallback callback) {\n \n this.callback = callback;\n \n JS...
[ { "content": "Returns the distance between the two points in meters.", "role": "user" }, { "content": "public static double distance(double lat1, double lon1,\n double lat2, double lon2) {\n double dLat = Math.toRadians(lat2-lat1);\n double dLon = Math.toRadians(...
[ { "content": "Produces the Soundex key for the given string.", "role": "user" }, { "content": "public static String soundex(String str) {\n if (str.length() < 1)\n return \"\"; // no soundex key for the empty string (could use 000)\n \n char[] key = new char[4];\n key[0] = str.charA...
[ { "content": "Builds the mapping table.", "role": "user" }, { "content": "private static char[] buildTable() {\n char[] table = new char[26];\n for (int ix = 0; ix < table.length; ix++)\n table[ix] = '0';\n table['B' - 'A'] = '1';\n table['P' - 'A'] = '1';\n table['F' - 'A'] = '1...
[ { "content": "common utility method for adding a statement to a record", "role": "user" }, { "content": "private void addStatement(RecordImpl record,\n String subject,\n String property,\n String object) {\n Collecti...
[ { "content": "Returns a geoquery.", "role": "user" }, { "content": "public Filter geoSearch(String value) {\n GeopositionComparator comp = (GeopositionComparator) prop.getComparator();\n double dist = comp.getMaxDistance();\n double degrees = DistanceUtils.dist2Degrees(dist, DistanceUtils.E...
[ { "content": "Parses coordinates into a Spatial4j point shape.", "role": "user" }, { "content": "private Point parsePoint(String point) {\n int comma = point.indexOf(',');\n if (comma == -1)\n return null;\n\n float lat = Float.valueOf(point.substring(0, comma));\n float lng = Float...
[ { "content": "Get a configured database connection via JNDI.", "role": "user" }, { "content": "public static Statement open(String jndiPath) {\n try {\n Context ctx = new InitialContext();\n DataSource ds = (DataSource) ctx.lookup(jndiPath);\n Connection conn = ds.getConnection();\...
[ { "content": "Opens a JDBC connection with the given parameters.", "role": "user" }, { "content": "public static Statement open(String driverklass, String jdbcuri,\n Properties props) {\n try {\n Driver driver = (Driver) ObjectUtils.instantiate(driverklass);\n ...
[ { "content": "Closes the JDBC statement and its associated connection.", "role": "user" }, { "content": "public static void close(Statement stmt) {\n try {\n Connection conn = stmt.getConnection();\n try {\n if (!stmt.isClosed())\n stmt.close();\n } catch (Unsupport...
[ { "content": "Verifies that the connection is still alive. Returns true if it\nis, false if it is not. If the connection is broken we try\nclosing everything, too, so that the caller need only open a new\nconnection.", "role": "user" }, { "content": "public static boolean validate(Statement stmt) {\...
[ { "content": "Runs a query that returns a single int.", "role": "user" }, { "content": "public static int queryForInt(Statement stmt, String sql, int nullvalue) {\n try {\n ResultSet rs = stmt.executeQuery(sql);\n try {\n if (!rs.next())\n return nullvalue;\n \n ...
[ { "content": "Returns true if the query result has at least one row.", "role": "user" }, { "content": "public static boolean queryHasResult(Statement stmt, String sql) {\n try {\n ResultSet rs = stmt.executeQuery(sql);\n try {\n return rs.next();\n } finally {\n rs.cl...
[ { "content": "Replaces all characters in the second parameter found in the first\nparameter with the final character.\n@param value the string to replace characters in\n@param chars the characters to replace\n@param replacement the character to insert as replacement", "role": "user" }, { "content": ...
[ { "content": "Removes trailing and leading whitespace, and also reduces each\nsequence of internal whitespace to a single space.", "role": "user" }, { "content": "public static String normalizeWS(String value) {\n char[] tmp = new char[value.length()];\n int pos = 0;\n boolean prevws = fals...
[ { "content": "Returns the value of an optional property, if the property is\nset. If it is not set defval is returned.", "role": "user" }, { "content": "public static String get(Properties props, String name, String defval) {\n String value = props.getProperty(name);\n if (value == null)\n ...
[ { "content": "Returns the data sources belonging to a particular group of data\nsources. Data sources are grouped in record linkage mode, but not\nin deduplication mode, so only use this method in record linkage\nmode.", "role": "user" }, { "content": "public Collection<DataSource> getDataSources(in...
[ { "content": "Adds a data source to the configuration. If in deduplication mode\ngroupno == 0, otherwise it gives the number of the group to which\nthe data source belongs.", "role": "user" }, { "content": "public void addDataSource(int groupno, DataSource datasource) {\n // the loader takes care...
[ { "content": "Returns the probability that the records v1 and v2 came from\nrepresent the same entity, based on high and low probability\nsettings etc.", "role": "user" }, { "content": "public double compare(String v1, String v2) {\n // FIXME: it should be possible here to say that, actually, we\...
[ { "content": "An extension point so we can control how the query gets executed.\nThis exists for testing purposes, not because we believe it will\nactually be used for real.", "role": "user" }, { "content": "public SparqlResult runQuery(String endpoint, String query) {\n return SparqlClient.execu...
[ { "content": "Merges the two classes into a single class. The smaller class is\nremoved, while the largest class is kept.", "role": "user" }, { "content": "private void merge(Integer cid1, Integer cid2) {\n Collection<String> klass1 = classix.get(cid1);\n Collection<String> klass2 = classix.ge...
[ { "content": "Goes through the buckets from ix and out, checking for each\ncandidate if it's in one of the buckets, and if so, increasing\nits score accordingly. No new candidates are added.", "role": "user" }, { "content": "private void bumpScores(Map<Long, Score> candidates,\n ...
[ { "content": "Goes through the first buckets, picking out candidate records and\ntallying up their scores.\n@return the index of the first bucket we did not process", "role": "user" }, { "content": "private int collectCandidates(Map<Long, Score> candidates,\n List<Buck...
[ { "content": "Tokenizes lookup fields and returns all matching buckets in the\nindex.", "role": "user" }, { "content": "private List<Bucket> lookup(Record record) {\n List<Bucket> buckets = new ArrayList();\n for (Property p : config.getLookupProperties()) {\n String propname = p.getName(...
[ { "content": "Starts a background thread which calls the controller every\ncheck_interval milliseconds. Returns immediately, leaving the\nbackground thread running.", "role": "user" }, { "content": "public void spawnThread(DukeController controller, int check_interval) {\n this.controller = contr...
[ { "content": "These exact lines are shared between three different tools, so\nthey have been moved here to reduce code duplication.\n@return The parsed command-line, with options removed.", "role": "user" }, { "content": "public String[] init(String[] argv, int min, int max,\n ...
[ { "content": "Creates a temporary folder using the given prefix to generate its name.\n@param prefix the prefix string to be used in generating the directory's name; may be <i>null</i>\n@return the <code>File</code> to the newly created folder\n@throws IOException", "role": "user" }, { "content": "p...
[ { "content": "Loads the configuration XML from the given string.\n@since 1.3", "role": "user" }, { "content": "public static Configuration loadFromString(String config)\n throws IOException, SAXException {\n ConfigurationImpl cfg = new ConfigurationImpl();\n\n XMLReader parser = XMLReaderFa...
[ { "content": "this method is called from the event methods", "role": "user" }, { "content": "public void endRecord_() {\n // this is where we actually update the link database. basically,\n // all we need to do is to retract those links which weren't seen\n // this time around, and that can...
[ { "content": "Writes the given configuration to the given file.", "role": "user" }, { "content": "public void write(Configuration config)\n throws IOException {\n\n pp.startDocument();\n pp.startElement(\"duke\", null);\n\n // FIXME: here we should write the objects, but that's not\n ...
[ { "content": "Reads the NTriples file from the reader, pushing statements into\nthe handler.", "role": "user" }, { "content": "public static void parse(Reader src, StatementHandler handler)\n throws IOException {\n new NTriplesParser(src, handler).parse();\n }", "role": "assistant" } ]
[ { "content": "This is the original, naive implementation, using the Wagner &\nFischer algorithm from 1974. It uses a flattened matrix for\nspeed, but still computes the entire matrix.", "role": "user" }, { "content": "public static int distance(String s1, String s2) {\n if (s1.length() == 0)\n ...
[ { "content": "Optimized version of the Wagner & Fischer algorithm that only\nkeeps a single column in the matrix in memory at a time. It\nimplements the simple cutoff, but otherwise computes the entire\nmatrix. It is roughly twice as fast as the original function.", "role": "user" }, { "content": "p...
[ { "content": "Flushes all changes to disk.", "role": "user" }, { "content": "public void commit() {\n if (directory == null)\n return;\n\n try {\n if (reader != null)\n reader.close();\n\n // it turns out that IndexWriter.optimize actually slows\n // searches down, b...
[ { "content": "Look up record by identity.", "role": "user" }, { "content": "public Record findRecordById(String id) {\n if (directory == null)\n init();\n\n Property idprop = config.getIdentityProperties().iterator().next();\n for (Record r : lookup(idprop, id))\n if (r.getValue(i...
[ { "content": "look for zero after country code, and remove if present", "role": "user" }, { "content": "public String clean(String value) {\n String orig = value;\n \n // check if there's a + before the first digit\n boolean initialplus = findPlus(value);\n \n // remove everything ...
[ { "content": "Returns true if the information in this link should take\nprecedence over the information in the other link.", "role": "user" }, { "content": "public boolean overrides(Link other) {\n if (other.getStatus() == LinkStatus.ASSERTED &&\n status != LinkStatus.ASSERTED)\n retu...
[ { "content": "Runs the record linkage process.", "role": "user" }, { "content": "public void process() {\n // are we ready to process yet, or have we had an error, and are\n // waiting a bit longer in the hope that it will resolve itself?\n if (error_skips > 0) {\n error_skips--;\n ...
[ { "content": "called by timer thread", "role": "user" }, { "content": "void reportError(Throwable throwable) {\n if (logger != null)\n logger.error(\"Timer reported error\", throwable);\n status = \"Thread blocked on error: \" + throwable;\n error_skips = error_factor;\n }", "role...
[ { "content": "public because it's used by other packages that use Duke", "role": "user" }, { "content": "public static String makePropertyName(String name) {\n char[] buf = new char[name.length() + 3];\n int pos = 0;\n buf[pos++] = 's';\n buf[pos++] = 'e';\n buf[pos++] = 't';\n\n f...
[ { "content": "Maps all views that don't start with \"android\" namespace.\n\n@param names All shared element names.\n@return The obsolete shared element names.", "role": "user" }, { "content": "@NonNull\n private List<String> mapObsoleteElements(List<String> names) {\n List<String> element...
[ { "content": "Removes obsolete elements from names and shared elements.\n\n@param names Shared element names.\n@param sharedElements Shared elements.\n@param elementsToRemove The elements that should be removed.", "role": "user" }, { "content": "private void removeObsoleteElements(List<...
[ { "content": "Binding view holder with payloads is used to handle partial changes in item.", "role": "user" }, { "content": "@Override\n public void onBindViewHolder(GalleryAdapter.ViewHolder holder, int position, List<Object> payloads) {\n if (payloads.isEmpty()) { // If doesn't have any ...
[ { "content": "Creates a slice for directly a raw memory address. This is\ninherently unsafe as it may be used to access arbitrary memory.\n\n@param address the raw memory address base\n@param size the size of the slice\n@return the unsafe slice", "role": "user" }, { "content": "public Slice newSlice...
[ { "content": "Creates a slice for directly a raw memory address. This is\ninherently unsafe as it may be used to access arbitrary memory.\nThe slice will hold the specified object reference to prevent the\ngarbage collector from freeing it while it is in use by the slice.\n\n@param address the raw memory addres...
[ { "content": "Special-purpose version for hashing a single int value. Value is treated as little-endian", "role": "user" }, { "content": "public static int hash(int input)\n {\n int k1 = mixK1(input);\n int h1 = mixH1(DEFAULT_SEED, k1);\n\n return fmix(h1, SizeOf.SIZE_OF_INT)...
[ { "content": "Does the slice contain only 7-bit ASCII characters.", "role": "user" }, { "content": "public static boolean isAscii(Slice utf8)\n {\n int length = utf8.length();\n int offset = 0;\n\n // Length rounded to 8 bytes\n int length8 = length & 0x7FFF_FFF8;\n ...
[ { "content": "Gets the UTF-8 sequence length of the code point.\n\n@throws InvalidCodePointException if code point is not within a valid range", "role": "user" }, { "content": "public static int lengthOfCodePoint(int codePoint)\n {\n if (codePoint < 0) {\n throw new InvalidCodeP...