conversation
listlengths
2
2
[ { "content": "Support the subscript operator for CharSequence.\n\n@param text a CharSequence\n@param index the index of the Character to get\n@return the Character at the given index\n@since 1.0", "role": "user" }, { "content": "public static CharSequence getAt(CharSequence text, int index) {\n ...
[ { "content": "Support the subscript operator for GString.\n\n@param text a GString\n@param index the index of the Character to get\n@return the Character at the given index\n@since 2.3.7", "role": "user" }, { "content": "public static String getAt(GString text, int index) {\n return (String)...
[ { "content": "Support the range subscript operator for CharSequence with IntRange\n\n@param text a CharSequence\n@param range an IntRange\n@return the subsequence CharSequence\n@since 1.0", "role": "user" }, { "content": "public static CharSequence getAt(CharSequence text, IntRange range) {\n ...
[ { "content": "Support the range subscript operator for CharSequence\n\n@param text a CharSequence\n@param range a Range\n@return the subsequence CharSequence\n@since 1.0", "role": "user" }, { "content": "public static CharSequence getAt(CharSequence text, Range range) {\n RangeInfo info = su...
[ { "content": "Support the range subscript operator for GString\n\n@param text a GString\n@param range a Range\n@return the String of characters corresponding to the provided range\n@since 2.3.7", "role": "user" }, { "content": "public static String getAt(GString text, Range range) {\n return...
[ { "content": "Select a List of values from a Matcher using a Collection\nto identify the indices to be selected.\n\n@param self a Matcher\n@param indices a Collection of indices\n@return a String of the values at the given indices\n@since 1.6.0", "role": "user" }, { "content": "public static List...
[ { "content": "Support the subscript operator for String.\n\n@param text a String\n@param index the index of the Character to get\n@return the Character at the given index\n@since 1.0", "role": "user" }, { "content": "public static String getAt(String text, int index) {\n index = normaliseInd...
[ { "content": "Support the range subscript operator for String with IntRange\n\n@param text a String\n@param range an IntRange\n@return the resulting String\n@since 1.0", "role": "user" }, { "content": "public static String getAt(String text, IntRange range) {\n return getAt(text, (Range) ran...
[ { "content": "Support the range subscript operator for String\n\n@param text a String\n@param range a Range\n@return a substring corresponding to the Range\n@since 1.0", "role": "user" }, { "content": "public static String getAt(String text, Range range) {\n RangeInfo info = subListBorders(t...
[ { "content": "Find the number of Strings matched to the given Matcher.\n\n@param matcher a Matcher\n@return int the number of Strings matched to the given matcher.\n@since 1.0", "role": "user" }, { "content": "public static int getCount(Matcher matcher) {\n int counter = 0;\n matcher....
[ { "content": "True if a CharSequence only contains whitespace characters.\n\n@param self The CharSequence to check the characters in\n@return true If all characters are whitespace characters\n@see #isAllWhitespace(String)\n@since 1.8.2", "role": "user" }, { "content": "public static boolean isAllWhi...
[ { "content": "Determine if a CharSequence can be parsed as a BigDecimal.\n\n@param self a CharSequence\n@return true if the CharSequence can be parsed\n@see #isBigDecimal(String)\n@since 1.8.2", "role": "user" }, { "content": "public static boolean isBigDecimal(CharSequence self) {\n try {\n ...
[ { "content": "Determine if a CharSequence can be parsed as a BigInteger.\n\n@param self a CharSequence\n@return true if the CharSequence can be parsed\n@see #isBigInteger(String)\n@since 1.8.2", "role": "user" }, { "content": "public static boolean isBigInteger(CharSequence self) {\n try {\n ...
[ { "content": "Determine if a CharSequence can be parsed as a Double.\n\n@param self a CharSequence\n@return true if the CharSequence can be parsed\n@see #isDouble(String)\n@since 1.8.2", "role": "user" }, { "content": "public static boolean isDouble(CharSequence self) {\n try {\n D...
[ { "content": "Determine if a CharSequence can be parsed as a Float.\n\n@param self a CharSequence\n@return true if the CharSequence can be parsed\n@see #isFloat(String)\n@since 1.8.2", "role": "user" }, { "content": "public static boolean isFloat(CharSequence self) {\n try {\n Floa...
[ { "content": "Determine if a CharSequence can be parsed as an Integer.\n\n@param self a CharSequence\n@return true if the CharSequence can be parsed\n@see #isInteger(String)\n@since 1.8.2", "role": "user" }, { "content": "public static boolean isInteger(CharSequence self) {\n try {\n ...
[ { "content": "Determine if a CharSequence can be parsed as a Long.\n\n@param self a CharSequence\n@return true if the CharSequence can be parsed\n@see #isLong(String)\n@since 1.8.2", "role": "user" }, { "content": "public static boolean isLong(CharSequence self) {\n try {\n Long.va...
[ { "content": "Overloads the left shift operator to provide an easy way to append multiple\nobjects as string representations to a String.\n\n@param self a String\n@param value an Object\n@return a StringBuffer built from this string\n@since 1.0", "role": "user" }, { "content": "public static String...
[ { "content": "Overloads the left shift operator to provide syntactic sugar for appending to a StringBuilder.\n\n@param self a StringBuilder\n@param value an Object\n@return the original StringBuilder\n@since 1.8.2", "role": "user" }, { "content": "public static StringBuilder leftShift(StringBuilder...
[ { "content": "Remove a part of a CharSequence by replacing the first occurrence\nof target within self with '' and returns the result.\n\n@param self a CharSequence\n@param target an object representing the part to remove\n@return a String containing the original minus the part to be removed\n@see #minus(Stri...
[ { "content": "Remove a part of a CharSequence. This replaces the first occurrence\nof the pattern within self with '' and returns the result.\n\n@param self a String\n@param pattern a Pattern representing the part to remove\n@return a String minus the part to be removed\n@since 2.2.0", "role": "user" },...
[ { "content": "Repeat a CharSequence a certain number of times.\n\n@param self a CharSequence to be repeated\n@param factor the number of times the CharSequence should be repeated\n@return a String composed of a repetition\n@throws IllegalArgumentException if the number of repetitions is < 0\n@since 1.8.2",...
[ { "content": "This method is called by the ++ operator for the class CharSequence.\nIt increments the last character in the given CharSequence. If the last\ncharacter in the CharSequence is Character.MAX_VALUE a Character.MIN_VALUE\nwill be appended. The empty CharSequence is incremented to a string\nconsisting...
[ { "content": "Return a String with linefeeds and carriage returns normalized to linefeeds.\n\n@param self a CharSequence object\n@return the normalized toString() for the CharSequence\n@see #normalize(String)\n@since 1.8.2", "role": "user" }, { "content": "public static String normalize(final CharSe...
[ { "content": "Appends the String representation of the given operand to this CharSequence.\n\n@param left a CharSequence\n@param value any Object\n@return the original toString() of the CharSequence with the object appended\n@since 1.8.2", "role": "user" }, { "content": "public static String plus(C...
[ { "content": "Appends a String to the string representation of this number.\n\n@param value a Number\n@param right a String\n@return a String\n@since 1.0", "role": "user" }, { "content": "public static String plus(Number value, String right) {\n return DefaultGroovyMethods.toString(value) + r...
[ { "content": "Return the lines of a CharSequence as a List of String.\n\n@param self a CharSequence object\n@return a list of lines\n@throws java.io.IOException if an error occurs\n@since 1.8.2", "role": "user" }, { "content": "public static List<String> readLines(CharSequence self) throws IOExcepti...
[ { "content": "Replaces each substring of this CharSequence that matches the given\nregular expression with the given replacement.\n\n@param self a CharSequence\n@param regex the capturing regex\n@param replacement the string to be substituted for each match\n@return the toString() of the CharSequen...
[ { "content": "Replaces the first substring of this CharSequence that matches the given\nregular expression with the given replacement.\n\n@param self a CharSequence\n@param regex the capturing regex\n@param replacement the CharSequence to be substituted for each match\n@return a CharSequence with r...
[ { "content": "Set the position of the given Matcher to the given index.\n\n@param matcher a Matcher\n@param idx the index number\n@since 1.0", "role": "user" }, { "content": "public static void setIndex(Matcher matcher, int idx) {\n int count = getCount(matcher);\n if (idx < -count...
[ { "content": "Iterates through the given CharSequence line by line, splitting each line using\nthe given regex delimiter. The list of tokens for each line is then passed to\nthe given closure.\n\n@param self a CharSequence\n@param regex the delimiting regular expression\n@param closure a closure\n@return ...
[ { "content": "Iterates through the given CharSequence line by line, splitting each line using\nthe given separator Pattern. The list of tokens for each line is then passed to\nthe given closure.\n\n@param self a CharSequence\n@param pattern the regular expression Pattern for the delimiter\n@param closure a ...
[ { "content": "A GString variant of the equivalent GString method.\n\n@param self the original GString\n@param condition the closure that must evaluate to true to continue taking elements\n@return a prefix of elements in the GString where each\nelement passed to the given closure evaluates to true\n@since 2...
[ { "content": "Converts the given CharSequence into a List of Strings of one character.\n\n@param self a CharSequence\n@return a List of characters (a 1-character String)\n@see #toSet(String)\n@since 1.8.2", "role": "user" }, { "content": "public static List<String> toList(CharSequence self) {\n ...
[ { "content": "Replaces sequences of whitespaces with tabs.\n\n@param self A CharSequence to unexpand\n@param tabStop The number of spaces a tab represents\n@return an unexpanded String\n@since 1.8.2", "role": "user" }, { "content": "public static String unexpand(CharSequence self, int tabStop) {\n ...
[ { "content": "Replaces sequences of whitespaces with tabs within a line.\n\n@param self A line to unexpand\n@param tabStop The number of spaces a tab represents\n@return an unexpanded String\n@since 1.8.2", "role": "user" }, { "content": "public static String unexpandLine(CharSequence self, int tabS...
[ { "content": "Returns true if the given method has a possibly matching instance method with the given name and arguments.\n\n@param name the name of the method of interest\n@param arguments the arguments to match against\n@return true if a matching method was found", "role": "user" }, { "conten...
[ { "content": "Given a field node, checks if we are calling a private field from an inner class.", "role": "user" }, { "content": "private void checkOrMarkPrivateAccess(Expression source, FieldNode fn) {\n if (fn!=null && Modifier.isPrivate(fn.getModifiers()) &&\n (fn.getDeclaringCl...
[ { "content": "Given a method node, checks if we are calling a private method from an inner class.", "role": "user" }, { "content": "private void checkOrMarkPrivateAccess(Expression source, MethodNode mn) {\n if (mn==null) {\n return;\n }\n ClassNode declaringClass = m...
[ { "content": "Given a binary expression corresponding to an assignment, will check that the type of the RHS matches one\nof the possible setters and if not, throw a type checking error.\n@param expression the assignment expression\n@param leftExpression left expression of the assignment\n@param rightExpression ...
[ { "content": "add various getAt and setAt methods for primitive arrays\n@param receiver the receiver class\n@param name the name of the method\n@param args the argument classes", "role": "user" }, { "content": "private void addArrayMethods(List<MethodNode> methods, ClassNode receiver, String name, ...
[ { "content": "resolves a Field or Property node generics by using the current class and\nthe declaring class to extract the right meaning of the generics symbols\n@param an a FieldNode or PropertyNode\n@param type the origin type\n@return the new ClassNode with corrected generics", "role": "user" }, { ...
[ { "content": "Decode the String from Base64 into a byte array.\n\n@param value the string to be decoded\n@return the decoded bytes as an array\n@since 1.0", "role": "user" }, { "content": "public static byte[] decodeBase64(String value) {\n int byteShift = 4;\n int tmp = 0;\n bo...
[ { "content": "Read in lines and execute them.\n\n@param reader the reader from which to get the groovy source to exec\n@param out the outputstream to use\n@throws java.io.IOException if something goes wrong", "role": "user" }, { "content": "protected void runStatements(Reader reader, PrintStream ...
[ { "content": "Format a date that is parseable from JavaScript, according to ISO-8601.\n\n@param date the date to format to a JSON string\n@return a formatted date in the form of a string", "role": "user" }, { "content": "public static String toJson(Date date) {\n if (date == null) {\n ...
[ { "content": "Format a calendar instance that is parseable from JavaScript, according to ISO-8601.\n\n@param cal the calendar to format to a JSON string\n@return a formatted date in the form of a string", "role": "user" }, { "content": "public static String toJson(Calendar cal) {\n if (cal ==...
[ { "content": "Serializes Number value and writes it into specified buffer.", "role": "user" }, { "content": "private static void writeNumber(Class<?> numberClass, Number value, CharBuf buffer) {\n if (numberClass == Integer.class) {\n buffer.addInt((Integer) value);\n } else...
[ { "content": "Serializes any char sequence and writes it into specified buffer.", "role": "user" }, { "content": "private static void writeCharSequence(CharSequence seq, CharBuf buffer) {\n if (seq.length() > 0) {\n buffer.addJsonEscapedString(seq.toString());\n } else {\n ...
[ { "content": "this class requires that the supplied enum is not fitting a\nCollection case for casting", "role": "user" }, { "content": "public static Enum castToEnum(Object object, Class<? extends Enum> type) {\n if (object==null) return null;\n if (type.isInstance(object)) return (En...
[ { "content": "Sets the bytecode compatibility mode\n\n@param version the bytecode compatibility mode", "role": "user" }, { "content": "public void setTargetBytecode(String version) {\n if (CompilerConfiguration.PRE_JDK5.equals(version) || CompilerConfiguration.POST_JDK5.equals(version)) {\n ...
[ { "content": "Provides a collection of all the nodes in the tree\nusing a depth first traversal.\n\n@return the list of (depth-first) ordered nodes", "role": "user" }, { "content": "public List depthFirst() {\n List answer = new NodeList();\n answer.add(this);\n answer.addAll(de...
[ { "content": "Gets the name for the getter for this property\n\n@return The name of the property. The name is \"get\"+ the capitalized propertyName\nor, in the case of boolean values, \"is\" + the capitalized propertyName", "role": "user" }, { "content": "public static String getGetterName(String pr...
[ { "content": "convenience factory method for the most usual case.", "role": "user" }, { "content": "public static ProxyMetaClass getInstance(Class theClass) throws IntrospectionException {\n MetaClassRegistry metaRegistry = GroovySystem.getMetaClassRegistry();\n MetaClass meta = metaRe...
[ { "content": "and class as property", "role": "user" }, { "content": "private Expression correctClassClassChain(PropertyExpression pe) {\n LinkedList<Expression> stack = new LinkedList<Expression>();\n ClassExpression found = null;\n for (Expression it = pe; it != null; it = ((P...
[ { "content": "Close the Closeable. Logging a warning if any problems occur.\n\n@param c the thing to close", "role": "user" }, { "content": "public static void closeWithWarning(Closeable c) {\n if (c != null) {\n try {\n c.close();\n } catch (IOException e...
[ { "content": "Returns the value stored for the given key at the point of call.\n@param key a non null key\n@return the value stored in the map for the given key", "role": "user" }, { "content": "public V get(K key) {\n ManagedReference<V> ref = internalMap.get(key);\n if (ref!=null) re...
[ { "content": "Sets a new value for a given key. an older value is overwritten.\n@param key a non null key\n@param value the new value", "role": "user" }, { "content": "public void put(final K key, V value) {\n ManagedReference<V> ref = new ManagedReference<V>(bundle, value) {\n @Ov...
[ { "content": "Returns a sampling of the source at the specified line and column,\nof null if it is unavailable.", "role": "user" }, { "content": "public String getSample(int line, int column, Janitor janitor) {\n String sample = null;\n String text = source.getLine(line, janitor);\n\n ...
[ { "content": "Invokes a closure passing it a new Sql instance created from the given JDBC connection URL.\nThe created connection will be closed if required.\n\n@param url a database url of the form\n<code>jdbc:<em>subprotocol</em>:<em>subname</em></code>\n@param c the Closure to call\n@see #newInstance(String)...
[ { "content": "Performs the closure within a transaction using a cached connection.\nIf the closure takes a single argument, it will be called\nwith the connection, otherwise it will be called with no arguments.\n\n@param closure the given closure\n@throws SQLException if a database error occurs", "role": "u...
[ { "content": "Invoke a method through reflection.\nFalls through to using the Invoker to call the method in case the reflection call fails..\n\n@param object the object on which to invoke a method\n@param methodName the name of the method to invoke\n@param parameters the parameters of the method call\n@return t...
[ { "content": "This method tokenizes a string by space characters,\nbut ignores spaces in quoted parts,that are parts in\n'' or \"\". The method does allows the usage of \"\" in ''\nand '' in \"\". The space character between tokens is not\nreturned.\n\n@param s the string to tokenize\n@return the tokens", "...
[ { "content": "Adds special accessors for private constants so that inner classes can retrieve them.", "role": "user" }, { "content": "@SuppressWarnings(\"unchecked\")\n private void addPrivateFieldsAccessors(ClassNode node) {\n Set<ASTNode> accessedFields = (Set<ASTNode>) node.getNodeMetaD...
[ { "content": "Checks if the specified bytecode version string represents a JDK 1.5+ compatible\nbytecode version.\n@param bytecodeVersion the bytecode version string (1.4, 1.5, 1.6, 1.7 or 1.8)\n@return true if the bytecode version is JDK 1.5+", "role": "user" }, { "content": "public static boolean ...
[ { "content": "Sets the target directory.", "role": "user" }, { "content": "public void setTargetDirectory(String directory) {\n if (directory != null && directory.length() > 0) {\n this.targetDirectory = new File(directory);\n } else {\n this.targetDirectory = nul...
[ { "content": "loads a class using the name of the class", "role": "user" }, { "content": "protected synchronized Class loadClass(final String name, boolean resolve) throws ClassNotFoundException {\n Class c = this.findLoadedClass(name);\n if (c != null) return c;\n c = (Class) c...
[ { "content": "Provides lookup of elements by non-namespaced name.\n\n@param name the name or shortcut key for nodes of interest\n@return the nodes of interest which match name", "role": "user" }, { "content": "public NodeList getAt(String name) {\n NodeList answer = new NodeList();\n f...
[ { "content": "Returns the text value of all of the elements in the collection.\n\n@return the text value of all the elements in the collection or null", "role": "user" }, { "content": "public String text() {\n String previousText = null;\n StringBuilder buffer = null;\n for (Obj...
[ { "content": "Determines if a token stream contains only numeric tokens\n@param stream\n@return true if all tokens in the given stream can be parsed as an integer", "role": "user" }, { "content": "private boolean isAllNumeric(TokenStream stream) {\n List<Token> tokens = ((NattyTokenSource) stream...
[ { "content": "Scans the given token global token stream for a list of sub-token\nstreams representing those portions of the global stream that\nmay contain date time information\n\n@param stream\n@return", "role": "user" }, { "content": "private List<TokenStream> collectTokenStreams(TokenStream stre...
[ { "content": "Cleans up the given group and adds it to the list of groups if still valid\n@param group\n@param groups", "role": "user" }, { "content": "private void addGroup(List<Token> group, List<List<Token>> groups) {\n\n if(group.isEmpty()) return;\n\n // remove trailing tokens that should...
[ { "content": "seeks to a specified day of the week in the past or future.\n\n@param direction the direction to seek: two possibilities\n'<' go backward\n'>' go forward\n\n@param seekType the type of seek to perform (by_day or by_week)\nby_day means we seek to the very next occurrence of the given day\nby_week m...
[ { "content": "Seeks to the given day within the current month\n@param dayOfMonth the day of the month to seek to, represented as an integer\nfrom 1 to 31. Must be guaranteed to parse as an Integer. If this day is\nbeyond the last day of the current month, the actual last day of the month\nwill be used.", "...
[ { "content": "Seeks to the given day within the current year\n@param dayOfYear the day of the year to seek to, represented as an integer\nfrom 1 to 366. Must be guaranteed to parse as an Integer. If this day is\nbeyond the last day of the current year, the actual last day of the year\nwill be used.", "role...
[ { "content": "seeks to a particular month\n\n@param direction the direction to seek: two possibilities\n'<' go backward\n'>' go forward\n\n@param seekAmount the amount to seek. Must be guaranteed to parse as an integer\n\n@param month the month to seek to. Must be guaranteed to parse as an integer\nbetween 1 ...
[ { "content": "Sets the the time of day\n\n@param hours the hours to set. Must be guaranteed to parse as an\ninteger between 0 and 23\n\n@param minutes the minutes to set. Must be guaranteed to parse as\nan integer between 0 and 59\n\n@param seconds the optional seconds to set. Must be guaranteed to parse as\...
[ { "content": "Seeks forward or backwards to a particular holiday based on the current date\n\n@param holidayString The holiday to seek to\n@param direction The direction to seek\n@param seekAmount The number of years to seek", "role": "user" }, { "content": "public void seekToHoliday(String h...
[ { "content": "Seeks to the given holiday within the given year\n\n@param holidayString\n@param yearString", "role": "user" }, { "content": "public void seekToHolidayYear(String holidayString, String yearString) {\n Holiday holiday = Holiday.valueOf(holidayString);\n assert(holiday != null);\n ...
[ { "content": "Seeks forward or backwards to a particular season based on the current date\n\n@param seasonString The season to seek to\n@param direction The direction to seek\n@param seekAmount The number of years to seek", "role": "user" }, { "content": "public void seekToSeason(String seaso...
[ { "content": "Seeks to the given season within the given year\n\n@param seasonString\n@param yearString", "role": "user" }, { "content": "public void seekToSeasonYear(String seasonString, String yearString) {\n Season season = Season.valueOf(seasonString);\n assert(season != null);\n \n ...
[ { "content": "Resets the calendar", "role": "user" }, { "content": "private void resetCalendar() {\n _calendar = getCalendar();\n if (_defaultTimeZone != null) {\n _calendar.setTimeZone(_defaultTimeZone);\n }\n _currentYear = _calendar.get(Calendar.YEAR);\n }", "role": "assista...
[ { "content": "Finds and returns the date for the given event summary and year within the given ics file,\nor null if not present.", "role": "user" }, { "content": "private Date seasonalDateFromIcs(String icsFileName, String eventSummary, int year) {\n Map<Integer, Date> dates = getDatesFromIcs(ic...
[ { "content": "ensures that the first invocation of a date seeking\nrule is captured", "role": "user" }, { "content": "private void markDateInvocation() {\n\n _updatePreviousDates = !_dateGivenInGroup;\n _dateGivenInGroup = true;\n _dateGroup.setDateInferred(false);\n\n if(_firstDateInvoc...
[ { "content": "Put everything smaller than days at 0\n@param cal calendar to be cleaned", "role": "user" }, { "content": "private Calendar cleanHistCalendar(Calendar cal) {\n cal.set(Calendar.MILLISECOND, 0);\n cal.set(Calendar.SECOND, 0);\n cal.set(Calendar.MINUTE, 0);\n ...
[ { "content": "Used to parse the dividend dates. Returns null if the date cannot be\nparsed.\n\n@param date String received that represents the date\n@return Calendar object representing the parsed date", "role": "user" }, { "content": "public static Calendar parseDividendDate(String date) {\n ...
[ { "content": "Get the time zone for a specific exchange suffix\n\n@param suffix suffix for the exchange in YahooFinance\n@return time zone of the exchange", "role": "user" }, { "content": "public static TimeZone get(String suffix) {\n if(SUFFIX_TIMEZONES.containsKey(suffix)) {\n re...
[ { "content": "Get the time zone for a specific stock or index.\nFor stocks, the exchange suffix is extracted from the stock symbol to retrieve the time zone.\n\n@param symbol stock symbol in YahooFinance\n@return time zone of the exchange on which this stock is traded", "role": "user" }, { "content"...
[ { "content": "Method to declare Video-VideoRenderer mapping.\nFavorite videos will be rendered using FavoriteVideoRenderer.\nLive videos will be rendered using LiveVideoRenderer.\nLiked videos will be rendered using LikeVideoRenderer.\n\n@param content used to map object-renderers.\n@return VideoRenderer subtyp...
[ { "content": "Indicate to the RecyclerView the type of Renderer used to one position using a numeric value.\n\n@param position to analyze.\n@return the id associated to the Renderer used to render the content given a position.", "role": "user" }, { "content": "@Override public int getItemViewType(in...
[ { "content": "One of the two main methods in this class. Creates a RendererViewHolder instance with a\nRenderer inside ready to be used. The RendererBuilder to create a RendererViewHolder using the\ninformation given as parameter.\n\n@param viewGroup used to create the ViewHolder.\n@param viewType associated to...
[ { "content": "Given a RendererViewHolder passed as argument and a position renders the view using the\nRenderer previously stored into the RendererViewHolder.\n\n@param viewHolder with a Renderer class inside.\n@param position to render.", "role": "user" }, { "content": "@Override public void onBind...
[ { "content": "Provides a ready to use diff update for our adapter based on the implementation of the\nstandard equals method from Object.\n\n@param newList to refresh our content", "role": "user" }, { "content": "public void diffUpdate(List<T> newList) {\n if (getCollection().size() == 0) {\n ...
[ { "content": "Add a Renderer instance as prototype.\n\n@param renderer to use as prototype.\n@return the current RendererBuilder instance.", "role": "user" }, { "content": "public RendererBuilder<T> withPrototype(Renderer<? extends T> renderer) {\n if (renderer == null) {\n throw new NeedsPr...
[ { "content": "Given a class configures the binding between a class and a Renderer class.\n\n@param clazz to bind.\n@param prototype used as Renderer.\n@return the current RendererBuilder instance.", "role": "user" }, { "content": "public <G extends T> RendererBuilder<T> bind(Class<G> clazz, Renderer...
[ { "content": "Return the item view type used by the adapter to implement recycle mechanism.\n\n@param content to be rendered.\n@return an integer that represents the renderer inside the adapter.", "role": "user" }, { "content": "int getItemViewType(T content) {\n Class prototypeClass = getPrototy...
[ { "content": "Main method of this class related to ListView widget. This method is the responsible of\nrecycle or create a new Renderer instance with all the needed information to implement the\nrendering. This method will validate all the attributes passed in the builder constructor and\nwill check if can recy...
[ { "content": "Main method of this class related to RecyclerView widget. This method is the responsible of\ncreate a new Renderer instance with all the needed information to implement the rendering.\nThis method will validate all the attributes passed in the builder constructor and will create\na RendererViewHol...
[ { "content": "Recycles the Renderer getting it from the tag associated to the renderer root view. This view\nis not used with RecyclerView widget.\n\n@param convertView that contains the tag.\n@param content to be updated in the recycled renderer.\n@return a recycled renderer.", "role": "user" }, { ...
[ { "content": "Create a Renderer getting a copy from the prototypes collection.\n\n@param content to render.\n@param parent used to inflate the view.\n@return a new renderer.", "role": "user" }, { "content": "private Renderer createRenderer(T content, ViewGroup parent) {\n int prototypeIndex = get...
[ { "content": "Search one prototype using the prototype index which is equals to the view type. This method\nhas to be implemented because prototypes member is declared with Collection and that interface\ndoesn't allow the client code to get one element by index.\n\n@param prototypeIndex used to search.\n@return...