id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
39,100 | ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/widget/LienzoPanel.java | LienzoPanel.setCursor | public LienzoPanel setCursor(final Cursor cursor)
{
if ((cursor != null) && (cursor != m_active_cursor))
{
m_active_cursor = cursor;
// Need to defer this, sometimes, if the browser is busy, etc, changing cursors does not take effect till events are done processing
... | java | public LienzoPanel setCursor(final Cursor cursor)
{
if ((cursor != null) && (cursor != m_active_cursor))
{
m_active_cursor = cursor;
// Need to defer this, sometimes, if the browser is busy, etc, changing cursors does not take effect till events are done processing
... | [
"public",
"LienzoPanel",
"setCursor",
"(",
"final",
"Cursor",
"cursor",
")",
"{",
"if",
"(",
"(",
"cursor",
"!=",
"null",
")",
"&&",
"(",
"cursor",
"!=",
"m_active_cursor",
")",
")",
"{",
"m_active_cursor",
"=",
"cursor",
";",
"// Need to defer this, sometimes... | Sets the type of cursor to be used when hovering above the element.
@param cursor | [
"Sets",
"the",
"type",
"of",
"cursor",
"to",
"be",
"used",
"when",
"hovering",
"above",
"the",
"element",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/widget/LienzoPanel.java#L300-L318 |
39,101 | ahome-it/lienzo-core | src/main/java/com/ait/lienzo/client/widget/LienzoPanel.java | LienzoPanel.setBackgroundColor | public LienzoPanel setBackgroundColor(final String color)
{
if (null != color)
{
getElement().getStyle().setBackgroundColor(color);
}
return this;
} | java | public LienzoPanel setBackgroundColor(final String color)
{
if (null != color)
{
getElement().getStyle().setBackgroundColor(color);
}
return this;
} | [
"public",
"LienzoPanel",
"setBackgroundColor",
"(",
"final",
"String",
"color",
")",
"{",
"if",
"(",
"null",
"!=",
"color",
")",
"{",
"getElement",
"(",
")",
".",
"getStyle",
"(",
")",
".",
"setBackgroundColor",
"(",
"color",
")",
";",
"}",
"return",
"th... | Sets the background color of the LienzoPanel.
@param color String
@return this LienzoPanel | [
"Sets",
"the",
"background",
"color",
"of",
"the",
"LienzoPanel",
"."
] | 8e03723700dec366f77064d12fb8676d8cd6be99 | https://github.com/ahome-it/lienzo-core/blob/8e03723700dec366f77064d12fb8676d8cd6be99/src/main/java/com/ait/lienzo/client/widget/LienzoPanel.java#L459-L466 |
39,102 | samskivert/samskivert | src/main/java/com/samskivert/util/ProcessLogger.java | ProcessLogger.copyOutput | public static void copyOutput (Logger target, String name, Process process)
{
new StreamReader(target, name + " stdout", process.getInputStream()).start();
new StreamReader(target, name + " stderr", process.getErrorStream()).start();
} | java | public static void copyOutput (Logger target, String name, Process process)
{
new StreamReader(target, name + " stdout", process.getInputStream()).start();
new StreamReader(target, name + " stderr", process.getErrorStream()).start();
} | [
"public",
"static",
"void",
"copyOutput",
"(",
"Logger",
"target",
",",
"String",
"name",
",",
"Process",
"process",
")",
"{",
"new",
"StreamReader",
"(",
"target",
",",
"name",
"+",
"\" stdout\"",
",",
"process",
".",
"getInputStream",
"(",
")",
")",
".",... | Starts threads that copy the output of the supplied process's stdout and stderr streams to
the supplied target logger. When the streams reach EOF, the threads will exit. The threads
will be set to daemon so that they do not prevent the VM from exiting.
@param target the logger to which to copy the output.
@param name ... | [
"Starts",
"threads",
"that",
"copy",
"the",
"output",
"of",
"the",
"supplied",
"process",
"s",
"stdout",
"and",
"stderr",
"streams",
"to",
"the",
"supplied",
"target",
"logger",
".",
"When",
"the",
"streams",
"reach",
"EOF",
"the",
"threads",
"will",
"exit",... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ProcessLogger.java#L29-L33 |
39,103 | samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.configureDatabaseIdent | protected void configureDatabaseIdent (String dbident)
{
_dbident = dbident;
// give the repository a chance to do any schema migration before things get further
// underway
try {
executeUpdate(new Operation<Object>() {
public Object invoke (Connection co... | java | protected void configureDatabaseIdent (String dbident)
{
_dbident = dbident;
// give the repository a chance to do any schema migration before things get further
// underway
try {
executeUpdate(new Operation<Object>() {
public Object invoke (Connection co... | [
"protected",
"void",
"configureDatabaseIdent",
"(",
"String",
"dbident",
")",
"{",
"_dbident",
"=",
"dbident",
";",
"// give the repository a chance to do any schema migration before things get further",
"// underway",
"try",
"{",
"executeUpdate",
"(",
"new",
"Operation",
"<"... | This is called automatically if a dbident is provided at construct time, but a derived class
can pass null to its constructor and then call this method itself later if it wishes to
obtain its database identifier from an overridable method which could not otherwise be
called at construct time. | [
"This",
"is",
"called",
"automatically",
"if",
"a",
"dbident",
"is",
"provided",
"at",
"construct",
"time",
"but",
"a",
"derived",
"class",
"can",
"pass",
"null",
"to",
"its",
"constructor",
"and",
"then",
"call",
"this",
"method",
"itself",
"later",
"if",
... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L63-L81 |
39,104 | samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.execute | protected <V> V execute (Operation<V> op)
throws PersistenceException
{
return execute(op, true, true);
} | java | protected <V> V execute (Operation<V> op)
throws PersistenceException
{
return execute(op, true, true);
} | [
"protected",
"<",
"V",
">",
"V",
"execute",
"(",
"Operation",
"<",
"V",
">",
"op",
")",
"throws",
"PersistenceException",
"{",
"return",
"execute",
"(",
"op",
",",
"true",
",",
"true",
")",
";",
"}"
] | Executes the supplied read-only operation. In the event of a transient failure, the
repository will attempt to reestablish the database connection and try the operation again.
@return whatever value is returned by the invoked operation. | [
"Executes",
"the",
"supplied",
"read",
"-",
"only",
"operation",
".",
"In",
"the",
"event",
"of",
"a",
"transient",
"failure",
"the",
"repository",
"will",
"attempt",
"to",
"reestablish",
"the",
"database",
"connection",
"and",
"try",
"the",
"operation",
"agai... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L89-L93 |
39,105 | samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.executeUpdate | protected <V> V executeUpdate (Operation<V> op)
throws PersistenceException
{
return execute(op, true, false);
} | java | protected <V> V executeUpdate (Operation<V> op)
throws PersistenceException
{
return execute(op, true, false);
} | [
"protected",
"<",
"V",
">",
"V",
"executeUpdate",
"(",
"Operation",
"<",
"V",
">",
"op",
")",
"throws",
"PersistenceException",
"{",
"return",
"execute",
"(",
"op",
",",
"true",
",",
"false",
")",
";",
"}"
] | Executes the supplied read-write operation. In the event of a transient failure, the
repository will attempt to reestablish the database connection and try the operation again.
@return whatever value is returned by the invoked operation. | [
"Executes",
"the",
"supplied",
"read",
"-",
"write",
"operation",
".",
"In",
"the",
"event",
"of",
"a",
"transient",
"failure",
"the",
"repository",
"will",
"attempt",
"to",
"reestablish",
"the",
"database",
"connection",
"and",
"try",
"the",
"operation",
"aga... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L101-L105 |
39,106 | samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.update | protected int update (final String query)
throws PersistenceException
{
return executeUpdate(new Operation<Integer>() {
public Integer invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
Statement stmt ... | java | protected int update (final String query)
throws PersistenceException
{
return executeUpdate(new Operation<Integer>() {
public Integer invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
Statement stmt ... | [
"protected",
"int",
"update",
"(",
"final",
"String",
"query",
")",
"throws",
"PersistenceException",
"{",
"return",
"executeUpdate",
"(",
"new",
"Operation",
"<",
"Integer",
">",
"(",
")",
"{",
"public",
"Integer",
"invoke",
"(",
"Connection",
"conn",
",",
... | Executes the supplied update query in this repository, returning the number of rows
modified. | [
"Executes",
"the",
"supplied",
"update",
"query",
"in",
"this",
"repository",
"returning",
"the",
"number",
"of",
"rows",
"modified",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L251-L267 |
39,107 | samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.checkedUpdate | protected void checkedUpdate (final String query, final int count)
throws PersistenceException
{
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
... | java | protected void checkedUpdate (final String query, final int count)
throws PersistenceException
{
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
... | [
"protected",
"void",
"checkedUpdate",
"(",
"final",
"String",
"query",
",",
"final",
"int",
"count",
")",
"throws",
"PersistenceException",
"{",
"executeUpdate",
"(",
"new",
"Operation",
"<",
"Object",
">",
"(",
")",
"{",
"public",
"Object",
"invoke",
"(",
"... | Executes the supplied update query in this repository, throwing an exception if the
modification count is not equal to the specified count. | [
"Executes",
"the",
"supplied",
"update",
"query",
"in",
"this",
"repository",
"throwing",
"an",
"exception",
"if",
"the",
"modification",
"count",
"is",
"not",
"equal",
"to",
"the",
"specified",
"count",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L273-L290 |
39,108 | samskivert/samskivert | src/main/java/com/samskivert/jdbc/SimpleRepository.java | SimpleRepository.maintenance | protected void maintenance (final String action, final String table)
throws PersistenceException
{
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
... | java | protected void maintenance (final String action, final String table)
throws PersistenceException
{
executeUpdate(new Operation<Object>() {
public Object invoke (Connection conn, DatabaseLiaison liaison)
throws SQLException, PersistenceException
{
... | [
"protected",
"void",
"maintenance",
"(",
"final",
"String",
"action",
",",
"final",
"String",
"table",
")",
"throws",
"PersistenceException",
"{",
"executeUpdate",
"(",
"new",
"Operation",
"<",
"Object",
">",
"(",
")",
"{",
"public",
"Object",
"invoke",
"(",
... | Instructs MySQL to perform table maintenance on the specified table.
@param action <code>analyze</code> recomputes the distribution of the keys for the specified
table. This can help certain joins to be performed more efficiently. <code>optimize</code>
instructs MySQL to coalesce fragmented records and reclaim space l... | [
"Instructs",
"MySQL",
"to",
"perform",
"table",
"maintenance",
"on",
"the",
"specified",
"table",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/SimpleRepository.java#L323-L348 |
39,109 | samskivert/samskivert | src/main/java/com/samskivert/util/PropertiesUtil.java | PropertiesUtil.loadAndGet | public static String loadAndGet (File propFile, String key)
{
try {
return load(propFile).getProperty(key);
} catch (IOException ioe) {
return null;
}
} | java | public static String loadAndGet (File propFile, String key)
{
try {
return load(propFile).getProperty(key);
} catch (IOException ioe) {
return null;
}
} | [
"public",
"static",
"String",
"loadAndGet",
"(",
"File",
"propFile",
",",
"String",
"key",
")",
"{",
"try",
"{",
"return",
"load",
"(",
"propFile",
")",
".",
"getProperty",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"IOException",
"ioe",
")",
"{",
"retur... | Loads up the supplied properties file and returns the specified key. Clearly this is an
expensive operation and you should load a properties file separately if you plan to retrieve
multiple keys from it. This method, however, is convenient for, say, extracting a value from
a properties file that contains only one key, ... | [
"Loads",
"up",
"the",
"supplied",
"properties",
"file",
"and",
"returns",
"the",
"specified",
"key",
".",
"Clearly",
"this",
"is",
"an",
"expensive",
"operation",
"and",
"you",
"should",
"load",
"a",
"properties",
"file",
"separately",
"if",
"you",
"plan",
"... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/PropertiesUtil.java#L182-L189 |
39,110 | samskivert/samskivert | src/main/java/com/samskivert/util/AbstractIntSet.java | AbstractIntSet.add | public boolean add (int[] values)
{
boolean modified = false;
int vlength = values.length;
for (int i = 0; i < vlength; i++) {
modified = (add(values[i]) || modified);
}
return modified;
} | java | public boolean add (int[] values)
{
boolean modified = false;
int vlength = values.length;
for (int i = 0; i < vlength; i++) {
modified = (add(values[i]) || modified);
}
return modified;
} | [
"public",
"boolean",
"add",
"(",
"int",
"[",
"]",
"values",
")",
"{",
"boolean",
"modified",
"=",
"false",
";",
"int",
"vlength",
"=",
"values",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"vlength",
";",
"i",
"++",
")",
... | Add all of the values in the supplied array to the set.
@param values elements to be added to this set.
@return <tt>true</tt> if this set did not already contain all of the specified elements. | [
"Add",
"all",
"of",
"the",
"values",
"in",
"the",
"supplied",
"array",
"to",
"the",
"set",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/AbstractIntSet.java#L32-L40 |
39,111 | samskivert/samskivert | src/main/java/com/samskivert/util/AbstractIntSet.java | AbstractIntSet.remove | public boolean remove (int[] values)
{
boolean modified = false;
int vcount = values.length;
for (int i = 0; i < vcount; i++) {
modified = (remove(values[i]) || modified);
}
return modified;
} | java | public boolean remove (int[] values)
{
boolean modified = false;
int vcount = values.length;
for (int i = 0; i < vcount; i++) {
modified = (remove(values[i]) || modified);
}
return modified;
} | [
"public",
"boolean",
"remove",
"(",
"int",
"[",
"]",
"values",
")",
"{",
"boolean",
"modified",
"=",
"false",
";",
"int",
"vcount",
"=",
"values",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"vcount",
";",
"i",
"++",
")",... | Removes all values in the supplied array from the set. Any values that are in the array but
not in the set are simply ignored.
@param values elements to be removed from the set.
@return <tt>true</tt> if this set contained any of the specified elements (which will have
been removed). | [
"Removes",
"all",
"values",
"in",
"the",
"supplied",
"array",
"from",
"the",
"set",
".",
"Any",
"values",
"that",
"are",
"in",
"the",
"array",
"but",
"not",
"in",
"the",
"set",
"are",
"simply",
"ignored",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/AbstractIntSet.java#L51-L59 |
39,112 | samskivert/samskivert | src/main/java/com/samskivert/swing/ComboButtonBox.java | ComboButtonBox.setSelectedIndex | public void setSelectedIndex (int selidx)
{
// update the display
updateSelection(selidx);
// let the model know what's up
Object item = (selidx == -1) ? null : _model.getElementAt(selidx);
_model.setSelectedItem(item);
} | java | public void setSelectedIndex (int selidx)
{
// update the display
updateSelection(selidx);
// let the model know what's up
Object item = (selidx == -1) ? null : _model.getElementAt(selidx);
_model.setSelectedItem(item);
} | [
"public",
"void",
"setSelectedIndex",
"(",
"int",
"selidx",
")",
"{",
"// update the display",
"updateSelection",
"(",
"selidx",
")",
";",
"// let the model know what's up",
"Object",
"item",
"=",
"(",
"selidx",
"==",
"-",
"1",
")",
"?",
"null",
":",
"_model",
... | Sets the index of the selected component. A value of -1 will clear
the selection. | [
"Sets",
"the",
"index",
"of",
"the",
"selected",
"component",
".",
"A",
"value",
"of",
"-",
"1",
"will",
"clear",
"the",
"selection",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/ComboButtonBox.java#L118-L126 |
39,113 | samskivert/samskivert | src/main/java/com/samskivert/swing/ComboButtonBox.java | ComboButtonBox.fireActionPerformed | protected void fireActionPerformed ()
{
// guaranteed to return a non-null array
Object[] listeners = listenerList.getListenerList();
// process the listeners last to first, notifying those that are
// interested in this event
for (int i = listeners.length-2; i >= 0; i -= 2) ... | java | protected void fireActionPerformed ()
{
// guaranteed to return a non-null array
Object[] listeners = listenerList.getListenerList();
// process the listeners last to first, notifying those that are
// interested in this event
for (int i = listeners.length-2; i >= 0; i -= 2) ... | [
"protected",
"void",
"fireActionPerformed",
"(",
")",
"{",
"// guaranteed to return a non-null array",
"Object",
"[",
"]",
"listeners",
"=",
"listenerList",
".",
"getListenerList",
"(",
")",
";",
"// process the listeners last to first, notifying those that are",
"// interested... | Notifies our listeners when the selection changed. | [
"Notifies",
"our",
"listeners",
"when",
"the",
"selection",
"changed",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/ComboButtonBox.java#L165-L181 |
39,114 | samskivert/samskivert | src/main/java/com/samskivert/swing/ComboButtonBox.java | ComboButtonBox.addButtons | protected void addButtons (int start, int count)
{
Object selobj = _model.getSelectedItem();
for (int i = start; i < count; i++) {
Object elem = _model.getElementAt(i);
if (selobj == elem) {
_selectedIndex = i;
}
JLabel ibut = null;
... | java | protected void addButtons (int start, int count)
{
Object selobj = _model.getSelectedItem();
for (int i = start; i < count; i++) {
Object elem = _model.getElementAt(i);
if (selobj == elem) {
_selectedIndex = i;
}
JLabel ibut = null;
... | [
"protected",
"void",
"addButtons",
"(",
"int",
"start",
",",
"int",
"count",
")",
"{",
"Object",
"selobj",
"=",
"_model",
".",
"getSelectedItem",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",... | Adds buttons for the specified range of model elements. | [
"Adds",
"buttons",
"for",
"the",
"specified",
"range",
"of",
"model",
"elements",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/ComboButtonBox.java#L295-L317 |
39,115 | samskivert/samskivert | src/main/java/com/samskivert/swing/ComboButtonBox.java | ComboButtonBox.removeButtons | protected void removeButtons (int start, int count)
{
while (count-- > 0) {
remove(start);
}
// adjust the selected index
if (_selectedIndex >= start) {
if (start + count > _selectedIndex) {
_selectedIndex = -1;
} else {
... | java | protected void removeButtons (int start, int count)
{
while (count-- > 0) {
remove(start);
}
// adjust the selected index
if (_selectedIndex >= start) {
if (start + count > _selectedIndex) {
_selectedIndex = -1;
} else {
... | [
"protected",
"void",
"removeButtons",
"(",
"int",
"start",
",",
"int",
"count",
")",
"{",
"while",
"(",
"count",
"--",
">",
"0",
")",
"{",
"remove",
"(",
"start",
")",
";",
"}",
"// adjust the selected index",
"if",
"(",
"_selectedIndex",
">=",
"start",
... | Removes the buttons in the specified interval. | [
"Removes",
"the",
"buttons",
"in",
"the",
"specified",
"interval",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/ComboButtonBox.java#L322-L336 |
39,116 | samskivert/samskivert | src/main/java/com/samskivert/swing/ComboButtonBox.java | ComboButtonBox.updateSelection | protected void updateSelection (int selidx)
{
// do nothing if this element is already selected
if (selidx == _selectedIndex) {
return;
}
// unhighlight the old component
if (_selectedIndex != -1) {
JLabel but = (JLabel)getComponent(_selectedIndex);
... | java | protected void updateSelection (int selidx)
{
// do nothing if this element is already selected
if (selidx == _selectedIndex) {
return;
}
// unhighlight the old component
if (_selectedIndex != -1) {
JLabel but = (JLabel)getComponent(_selectedIndex);
... | [
"protected",
"void",
"updateSelection",
"(",
"int",
"selidx",
")",
"{",
"// do nothing if this element is already selected",
"if",
"(",
"selidx",
"==",
"_selectedIndex",
")",
"{",
"return",
";",
"}",
"// unhighlight the old component",
"if",
"(",
"_selectedIndex",
"!=",... | Sets the selection to the specified index and updates the buttons
to reflect the change. This does not update the model. | [
"Sets",
"the",
"selection",
"to",
"the",
"specified",
"index",
"and",
"updates",
"the",
"buttons",
"to",
"reflect",
"the",
"change",
".",
"This",
"does",
"not",
"update",
"the",
"model",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/ComboButtonBox.java#L342-L369 |
39,117 | samskivert/samskivert | src/main/java/com/samskivert/swing/LabelSausage.java | LabelSausage.layout | protected void layout (Graphics2D gfx, int iconPadding, int extraPadding)
{
// if we have an icon, let that dictate our size; otherwise just lay out our label all on
// one line
int sqwid, sqhei;
if (_icon == null) {
sqwid = sqhei = 0;
} else {
sqwid =... | java | protected void layout (Graphics2D gfx, int iconPadding, int extraPadding)
{
// if we have an icon, let that dictate our size; otherwise just lay out our label all on
// one line
int sqwid, sqhei;
if (_icon == null) {
sqwid = sqhei = 0;
} else {
sqwid =... | [
"protected",
"void",
"layout",
"(",
"Graphics2D",
"gfx",
",",
"int",
"iconPadding",
",",
"int",
"extraPadding",
")",
"{",
"// if we have an icon, let that dictate our size; otherwise just lay out our label all on",
"// one line",
"int",
"sqwid",
",",
"sqhei",
";",
"if",
"... | Lays out the label sausage. It is assumed that the desired label font is already set in the
label.
@param iconPadding the number of pixels in the x direction to pad around the icon. | [
"Lays",
"out",
"the",
"label",
"sausage",
".",
"It",
"is",
"assumed",
"that",
"the",
"desired",
"label",
"font",
"is",
"already",
"set",
"in",
"the",
"label",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/LabelSausage.java#L46-L98 |
39,118 | samskivert/samskivert | src/main/java/com/samskivert/swing/LabelSausage.java | LabelSausage.paint | protected void paint (Graphics2D gfx, int x, int y, Color background, Object cliData)
{
// turn on anti-aliasing (for our sausage lines)
Object oalias = SwingUtil.activateAntiAliasing(gfx);
// draw the base sausage
gfx.setColor(background);
drawBase(gfx, x, y);
// r... | java | protected void paint (Graphics2D gfx, int x, int y, Color background, Object cliData)
{
// turn on anti-aliasing (for our sausage lines)
Object oalias = SwingUtil.activateAntiAliasing(gfx);
// draw the base sausage
gfx.setColor(background);
drawBase(gfx, x, y);
// r... | [
"protected",
"void",
"paint",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
",",
"Color",
"background",
",",
"Object",
"cliData",
")",
"{",
"// turn on anti-aliasing (for our sausage lines)",
"Object",
"oalias",
"=",
"SwingUtil",
".",
"activateAntiAl... | Paints the label sausage. | [
"Paints",
"the",
"label",
"sausage",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/LabelSausage.java#L103-L122 |
39,119 | samskivert/samskivert | src/main/java/com/samskivert/swing/LabelSausage.java | LabelSausage.drawBase | protected void drawBase (Graphics2D gfx, int x, int y)
{
gfx.fillRoundRect(
x, y, _size.width - 1, _size.height - 1, _dia, _dia);
} | java | protected void drawBase (Graphics2D gfx, int x, int y)
{
gfx.fillRoundRect(
x, y, _size.width - 1, _size.height - 1, _dia, _dia);
} | [
"protected",
"void",
"drawBase",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"gfx",
".",
"fillRoundRect",
"(",
"x",
",",
"y",
",",
"_size",
".",
"width",
"-",
"1",
",",
"_size",
".",
"height",
"-",
"1",
",",
"_dia",
",",... | Draws the base sausage within which all the other decorations are added. | [
"Draws",
"the",
"base",
"sausage",
"within",
"which",
"all",
"the",
"other",
"decorations",
"are",
"added",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/LabelSausage.java#L127-L131 |
39,120 | samskivert/samskivert | src/main/java/com/samskivert/swing/LabelSausage.java | LabelSausage.drawIcon | protected void drawIcon (Graphics2D gfx, int x, int y, Object cliData)
{
if (_icon != null) {
_icon.paintIcon(null, gfx, x + _xoff, y + _yoff);
}
} | java | protected void drawIcon (Graphics2D gfx, int x, int y, Object cliData)
{
if (_icon != null) {
_icon.paintIcon(null, gfx, x + _xoff, y + _yoff);
}
} | [
"protected",
"void",
"drawIcon",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
",",
"Object",
"cliData",
")",
"{",
"if",
"(",
"_icon",
"!=",
"null",
")",
"{",
"_icon",
".",
"paintIcon",
"(",
"null",
",",
"gfx",
",",
"x",
"+",
"_xoff",... | Draws the icon, if applicable. | [
"Draws",
"the",
"icon",
"if",
"applicable",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/LabelSausage.java#L136-L141 |
39,121 | samskivert/samskivert | src/main/java/com/samskivert/swing/LabelSausage.java | LabelSausage.drawLabel | protected void drawLabel (Graphics2D gfx, int x, int y)
{
_label.render(gfx, x + _lxoff, y + _lyoff);
} | java | protected void drawLabel (Graphics2D gfx, int x, int y)
{
_label.render(gfx, x + _lxoff, y + _lyoff);
} | [
"protected",
"void",
"drawLabel",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"_label",
".",
"render",
"(",
"gfx",
",",
"x",
"+",
"_lxoff",
",",
"y",
"+",
"_lyoff",
")",
";",
"}"
] | Draws the label. | [
"Draws",
"the",
"label",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/LabelSausage.java#L146-L149 |
39,122 | samskivert/samskivert | src/main/java/com/samskivert/swing/LabelSausage.java | LabelSausage.drawBorder | protected void drawBorder (Graphics2D gfx, int x, int y)
{
// draw the black outer border
gfx.setColor(Color.black);
gfx.drawRoundRect(x, y, _size.width - 1, _size.height - 1, _dia, _dia);
} | java | protected void drawBorder (Graphics2D gfx, int x, int y)
{
// draw the black outer border
gfx.setColor(Color.black);
gfx.drawRoundRect(x, y, _size.width - 1, _size.height - 1, _dia, _dia);
} | [
"protected",
"void",
"drawBorder",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"// draw the black outer border",
"gfx",
".",
"setColor",
"(",
"Color",
".",
"black",
")",
";",
"gfx",
".",
"drawRoundRect",
"(",
"x",
",",
"y",
",",... | Draws the black outer border. | [
"Draws",
"the",
"black",
"outer",
"border",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/LabelSausage.java#L154-L159 |
39,123 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DialectUtil.java | DialectUtil.getFullColumnClassName | public static String getFullColumnClassName(String className) {
if (className.startsWith("java.")) {
return className;
}
if ("String".equals(className)) {
return "java.lang.String";
} else if ("Int".equals(className)) {
return "java.lang.Integer";
} else if ("Double".equals(className)) {
... | java | public static String getFullColumnClassName(String className) {
if (className.startsWith("java.")) {
return className;
}
if ("String".equals(className)) {
return "java.lang.String";
} else if ("Int".equals(className)) {
return "java.lang.Integer";
} else if ("Double".equals(className)) {
... | [
"public",
"static",
"String",
"getFullColumnClassName",
"(",
"String",
"className",
")",
"{",
"if",
"(",
"className",
".",
"startsWith",
"(",
"\"java.\"",
")",
")",
"{",
"return",
"className",
";",
"}",
"if",
"(",
"\"String\"",
".",
"equals",
"(",
"className... | CsvJdbc driver className is not a full java class name | [
"CsvJdbc",
"driver",
"className",
"is",
"not",
"a",
"full",
"java",
"class",
"name"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DialectUtil.java#L49-L70 |
39,124 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.centerWindow | public static void centerWindow (Window window)
{
Rectangle bounds;
try {
bounds = GraphicsEnvironment.getLocalGraphicsEnvironment().
getDefaultScreenDevice().getDefaultConfiguration().getBounds();
} catch (Throwable t) {
Toolkit tk = window.getToolkit... | java | public static void centerWindow (Window window)
{
Rectangle bounds;
try {
bounds = GraphicsEnvironment.getLocalGraphicsEnvironment().
getDefaultScreenDevice().getDefaultConfiguration().getBounds();
} catch (Throwable t) {
Toolkit tk = window.getToolkit... | [
"public",
"static",
"void",
"centerWindow",
"(",
"Window",
"window",
")",
"{",
"Rectangle",
"bounds",
";",
"try",
"{",
"bounds",
"=",
"GraphicsEnvironment",
".",
"getLocalGraphicsEnvironment",
"(",
")",
".",
"getDefaultScreenDevice",
"(",
")",
".",
"getDefaultConf... | Center the given window within the screen boundaries.
@param window the window to be centered. | [
"Center",
"the",
"given",
"window",
"within",
"the",
"screen",
"boundaries",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L95-L110 |
39,125 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.drawStringCentered | public static void drawStringCentered (
Graphics g, String str, int x, int y, int width, int height)
{
FontMetrics fm = g.getFontMetrics(g.getFont());
int xpos = x + ((width - fm.stringWidth(str)) / 2);
int ypos = y + ((height + fm.getAscent()) / 2);
g.drawString(str, xpos, y... | java | public static void drawStringCentered (
Graphics g, String str, int x, int y, int width, int height)
{
FontMetrics fm = g.getFontMetrics(g.getFont());
int xpos = x + ((width - fm.stringWidth(str)) / 2);
int ypos = y + ((height + fm.getAscent()) / 2);
g.drawString(str, xpos, y... | [
"public",
"static",
"void",
"drawStringCentered",
"(",
"Graphics",
"g",
",",
"String",
"str",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"FontMetrics",
"fm",
"=",
"g",
".",
"getFontMetrics",
"(",
"g",
".",
... | Draw a string centered within a rectangle. The string is drawn using the graphics context's
current font and color.
@param g the graphics context.
@param str the string.
@param x the bounding x position.
@param y the bounding y position.
@param width the bounding width.
@param height the bounding height. | [
"Draw",
"a",
"string",
"centered",
"within",
"a",
"rectangle",
".",
"The",
"string",
"is",
"drawn",
"using",
"the",
"graphics",
"context",
"s",
"current",
"font",
"and",
"color",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L132-L139 |
39,126 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.fitRectInRect | public static Point fitRectInRect (Rectangle rect, Rectangle bounds)
{
// Guarantee that the right and bottom edges will be contained and do our best for the top
// and left edges.
return new Point(Math.min(bounds.x + bounds.width - rect.width,
Math.max(rect... | java | public static Point fitRectInRect (Rectangle rect, Rectangle bounds)
{
// Guarantee that the right and bottom edges will be contained and do our best for the top
// and left edges.
return new Point(Math.min(bounds.x + bounds.width - rect.width,
Math.max(rect... | [
"public",
"static",
"Point",
"fitRectInRect",
"(",
"Rectangle",
"rect",
",",
"Rectangle",
"bounds",
")",
"{",
"// Guarantee that the right and bottom edges will be contained and do our best for the top",
"// and left edges.",
"return",
"new",
"Point",
"(",
"Math",
".",
"min",... | Returns the most reasonable position for the specified rectangle to be placed at so as to
maximize its containment by the specified bounding rectangle while still placing it as near
its original coordinates as possible.
@param rect the rectangle to be positioned.
@param bounds the containing rectangle. | [
"Returns",
"the",
"most",
"reasonable",
"position",
"for",
"the",
"specified",
"rectangle",
"to",
"be",
"placed",
"at",
"so",
"as",
"to",
"maximize",
"its",
"containment",
"by",
"the",
"specified",
"bounding",
"rectangle",
"while",
"still",
"placing",
"it",
"a... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L149-L157 |
39,127 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.positionRect | public static boolean positionRect (
Rectangle r, Rectangle bounds, Collection<? extends Shape> avoidShapes)
{
Point origPos = r.getLocation();
Comparator<Point> comp = createPointComparator(origPos);
SortableArrayList<Point> possibles = new SortableArrayList<Point>();
// sta... | java | public static boolean positionRect (
Rectangle r, Rectangle bounds, Collection<? extends Shape> avoidShapes)
{
Point origPos = r.getLocation();
Comparator<Point> comp = createPointComparator(origPos);
SortableArrayList<Point> possibles = new SortableArrayList<Point>();
// sta... | [
"public",
"static",
"boolean",
"positionRect",
"(",
"Rectangle",
"r",
",",
"Rectangle",
"bounds",
",",
"Collection",
"<",
"?",
"extends",
"Shape",
">",
"avoidShapes",
")",
"{",
"Point",
"origPos",
"=",
"r",
".",
"getLocation",
"(",
")",
";",
"Comparator",
... | Position the specified rectangle as closely as possible to its current position, but make
sure it is within the specified bounds and that it does not overlap any of the Shapes
contained in the avoid list.
@param r the rectangle to attempt to position.
@param bounds the bounding box within which the rectangle must be p... | [
"Position",
"the",
"specified",
"rectangle",
"as",
"closely",
"as",
"possible",
"to",
"its",
"current",
"position",
"but",
"make",
"sure",
"it",
"is",
"within",
"the",
"specified",
"bounds",
"and",
"that",
"it",
"does",
"not",
"overlap",
"any",
"of",
"the",
... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L172-L222 |
39,128 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.createPointComparator | public static <P extends Point2D> Comparator<P> createPointComparator (final P origin)
{
return new Comparator<P>() {
public int compare (P p1, P p2)
{
double dist1 = origin.distance(p1);
double dist2 = origin.distance(p2);
return (dist... | java | public static <P extends Point2D> Comparator<P> createPointComparator (final P origin)
{
return new Comparator<P>() {
public int compare (P p1, P p2)
{
double dist1 = origin.distance(p1);
double dist2 = origin.distance(p2);
return (dist... | [
"public",
"static",
"<",
"P",
"extends",
"Point2D",
">",
"Comparator",
"<",
"P",
">",
"createPointComparator",
"(",
"final",
"P",
"origin",
")",
"{",
"return",
"new",
"Comparator",
"<",
"P",
">",
"(",
")",
"{",
"public",
"int",
"compare",
"(",
"P",
"p1... | Create a comparator that compares against the distance from the specified point.
Note: The comparator will continue to sort by distance from the origin point, even if the
origin point's coordinates are modified after the comparator is created.
Used by positionRect(). | [
"Create",
"a",
"comparator",
"that",
"compares",
"against",
"the",
"distance",
"from",
"the",
"specified",
"point",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L232-L242 |
39,129 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.applyToHierarchy | public static void applyToHierarchy (Component comp, ComponentOp op)
{
applyToHierarchy(comp, Integer.MAX_VALUE, op);
} | java | public static void applyToHierarchy (Component comp, ComponentOp op)
{
applyToHierarchy(comp, Integer.MAX_VALUE, op);
} | [
"public",
"static",
"void",
"applyToHierarchy",
"(",
"Component",
"comp",
",",
"ComponentOp",
"op",
")",
"{",
"applyToHierarchy",
"(",
"comp",
",",
"Integer",
".",
"MAX_VALUE",
",",
"op",
")",
";",
"}"
] | Apply the specified ComponentOp to the supplied component and then all its descendants. | [
"Apply",
"the",
"specified",
"ComponentOp",
"to",
"the",
"supplied",
"component",
"and",
"then",
"all",
"its",
"descendants",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L276-L279 |
39,130 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.applyToHierarchy | public static void applyToHierarchy (Component comp, int depth, ComponentOp op)
{
if (comp == null) {
return;
}
op.apply(comp);
if (comp instanceof Container && --depth >= 0) {
Container c = (Container) comp;
int ccount = c.getComponentCount();
... | java | public static void applyToHierarchy (Component comp, int depth, ComponentOp op)
{
if (comp == null) {
return;
}
op.apply(comp);
if (comp instanceof Container && --depth >= 0) {
Container c = (Container) comp;
int ccount = c.getComponentCount();
... | [
"public",
"static",
"void",
"applyToHierarchy",
"(",
"Component",
"comp",
",",
"int",
"depth",
",",
"ComponentOp",
"op",
")",
"{",
"if",
"(",
"comp",
"==",
"null",
")",
"{",
"return",
";",
"}",
"op",
".",
"apply",
"(",
"comp",
")",
";",
"if",
"(",
... | Apply the specified ComponentOp to the supplied component and then all its descendants, up
to the specified maximum depth. | [
"Apply",
"the",
"specified",
"ComponentOp",
"to",
"the",
"supplied",
"component",
"and",
"then",
"all",
"its",
"descendants",
"up",
"to",
"the",
"specified",
"maximum",
"depth",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L285-L299 |
39,131 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.activateAntiAliasing | public static Object activateAntiAliasing (Graphics2D gfx)
{
RenderingHints ohints = gfx.getRenderingHints(), nhints = new RenderingHints(null);
nhints.add(ohints);
nhints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
nhints.put(RenderingHints.KEY_TEXT_ANTI... | java | public static Object activateAntiAliasing (Graphics2D gfx)
{
RenderingHints ohints = gfx.getRenderingHints(), nhints = new RenderingHints(null);
nhints.add(ohints);
nhints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
nhints.put(RenderingHints.KEY_TEXT_ANTI... | [
"public",
"static",
"Object",
"activateAntiAliasing",
"(",
"Graphics2D",
"gfx",
")",
"{",
"RenderingHints",
"ohints",
"=",
"gfx",
".",
"getRenderingHints",
"(",
")",
",",
"nhints",
"=",
"new",
"RenderingHints",
"(",
"null",
")",
";",
"nhints",
".",
"add",
"(... | Activates anti-aliasing in the supplied graphics context on both text and 2D drawing
primitives.
@return an object that should be passed to {@link #restoreAntiAliasing} to restore the
graphics context to its original settings. | [
"Activates",
"anti",
"-",
"aliasing",
"in",
"the",
"supplied",
"graphics",
"context",
"on",
"both",
"text",
"and",
"2D",
"drawing",
"primitives",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L412-L420 |
39,132 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.restoreAntiAliasing | public static void restoreAntiAliasing (Graphics2D gfx, Object rock)
{
if (rock != null) {
gfx.setRenderingHints((RenderingHints)rock);
}
} | java | public static void restoreAntiAliasing (Graphics2D gfx, Object rock)
{
if (rock != null) {
gfx.setRenderingHints((RenderingHints)rock);
}
} | [
"public",
"static",
"void",
"restoreAntiAliasing",
"(",
"Graphics2D",
"gfx",
",",
"Object",
"rock",
")",
"{",
"if",
"(",
"rock",
"!=",
"null",
")",
"{",
"gfx",
".",
"setRenderingHints",
"(",
"(",
"RenderingHints",
")",
"rock",
")",
";",
"}",
"}"
] | Restores anti-aliasing in the supplied graphics context to its original setting.
@param rock the results of a previous call to {@link #activateAntiAliasing} or null, in
which case this method will NOOP. This alleviates every caller having to conditionally avoid
calling restore if they chose not to activate earlier. | [
"Restores",
"anti",
"-",
"aliasing",
"in",
"the",
"supplied",
"graphics",
"context",
"to",
"its",
"original",
"setting",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L429-L434 |
39,133 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.sizeToContents | public static void sizeToContents (JTable table)
{
TableModel model = table.getModel();
TableColumn column = null;
Component comp = null;
int ccount = table.getColumnModel().getColumnCount(),
rcount = model.getRowCount(), cellHeight = 0;
for (int cc = 0; cc < cco... | java | public static void sizeToContents (JTable table)
{
TableModel model = table.getModel();
TableColumn column = null;
Component comp = null;
int ccount = table.getColumnModel().getColumnCount(),
rcount = model.getRowCount(), cellHeight = 0;
for (int cc = 0; cc < cco... | [
"public",
"static",
"void",
"sizeToContents",
"(",
"JTable",
"table",
")",
"{",
"TableModel",
"model",
"=",
"table",
".",
"getModel",
"(",
")",
";",
"TableColumn",
"column",
"=",
"null",
";",
"Component",
"comp",
"=",
"null",
";",
"int",
"ccount",
"=",
"... | Adjusts the widths and heights of the cells of the supplied table to fit their contents. | [
"Adjusts",
"the",
"widths",
"and",
"heights",
"of",
"the",
"cells",
"of",
"the",
"supplied",
"table",
"to",
"fit",
"their",
"contents",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L449-L482 |
39,134 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.createImageCursor | public static Cursor createImageCursor (Image img, Point hotspot)
{
Toolkit tk = Toolkit.getDefaultToolkit();
// for now, just report the cursor restrictions, then blindly create
int w = img.getWidth(null);
int h = img.getHeight(null);
Dimension d = tk.getBestCursorSize(w, h... | java | public static Cursor createImageCursor (Image img, Point hotspot)
{
Toolkit tk = Toolkit.getDefaultToolkit();
// for now, just report the cursor restrictions, then blindly create
int w = img.getWidth(null);
int h = img.getHeight(null);
Dimension d = tk.getBestCursorSize(w, h... | [
"public",
"static",
"Cursor",
"createImageCursor",
"(",
"Image",
"img",
",",
"Point",
"hotspot",
")",
"{",
"Toolkit",
"tk",
"=",
"Toolkit",
".",
"getDefaultToolkit",
"(",
")",
";",
"// for now, just report the cursor restrictions, then blindly create",
"int",
"w",
"="... | Create a custom cursor out of the specified image, with the specified hotspot. | [
"Create",
"a",
"custom",
"cursor",
"out",
"of",
"the",
"specified",
"image",
"with",
"the",
"specified",
"hotspot",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L508-L549 |
39,135 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.addDebugBorders | public static void addDebugBorders (JPanel panel)
{
Color bcolor = new Color(_rando.nextInt(256), _rando.nextInt(256), _rando.nextInt(256));
panel.setBorder(BorderFactory.createLineBorder(bcolor));
for (int ii = 0; ii < panel.getComponentCount(); ii++) {
Object child = panel.get... | java | public static void addDebugBorders (JPanel panel)
{
Color bcolor = new Color(_rando.nextInt(256), _rando.nextInt(256), _rando.nextInt(256));
panel.setBorder(BorderFactory.createLineBorder(bcolor));
for (int ii = 0; ii < panel.getComponentCount(); ii++) {
Object child = panel.get... | [
"public",
"static",
"void",
"addDebugBorders",
"(",
"JPanel",
"panel",
")",
"{",
"Color",
"bcolor",
"=",
"new",
"Color",
"(",
"_rando",
".",
"nextInt",
"(",
"256",
")",
",",
"_rando",
".",
"nextInt",
"(",
"256",
")",
",",
"_rando",
".",
"nextInt",
"(",... | Adds a one pixel border of random color to this and all panels contained in this panel's
child hierarchy. | [
"Adds",
"a",
"one",
"pixel",
"border",
"of",
"random",
"color",
"to",
"this",
"and",
"all",
"panels",
"contained",
"in",
"this",
"panel",
"s",
"child",
"hierarchy",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L555-L566 |
39,136 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.setFrameIcons | public static void setFrameIcons (Frame frame, List<? extends Image> icons)
{
try {
Method m = frame.getClass().getMethod("setIconImages", List.class);
m.invoke(frame, icons);
return;
} catch (SecurityException e) {
// Fine, fine, no reflection for us
... | java | public static void setFrameIcons (Frame frame, List<? extends Image> icons)
{
try {
Method m = frame.getClass().getMethod("setIconImages", List.class);
m.invoke(frame, icons);
return;
} catch (SecurityException e) {
// Fine, fine, no reflection for us
... | [
"public",
"static",
"void",
"setFrameIcons",
"(",
"Frame",
"frame",
",",
"List",
"<",
"?",
"extends",
"Image",
">",
"icons",
")",
"{",
"try",
"{",
"Method",
"m",
"=",
"frame",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"\"setIconImages\"",
",",
... | Sets the frame's icons. Unfortunately, the ability to pass multiple icons so the OS can
choose the most size-appropriate one was added in 1.6; before that, you can only set one
icon.
This method attempts to find and use setIconImages, but if it can't, sets the frame's icon
to the first image in the list passed in. | [
"Sets",
"the",
"frame",
"s",
"icons",
".",
"Unfortunately",
"the",
"ability",
"to",
"pass",
"multiple",
"icons",
"so",
"the",
"OS",
"can",
"choose",
"the",
"most",
"size",
"-",
"appropriate",
"one",
"was",
"added",
"in",
"1",
".",
"6",
";",
"before",
"... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L576-L594 |
39,137 | samskivert/samskivert | src/main/java/com/samskivert/swing/RuntimeAdjust.java | RuntimeAdjust.createAdjustEditor | public static JComponent createAdjustEditor ()
{
VGroupLayout layout = new VGroupLayout(
VGroupLayout.NONE, VGroupLayout.STRETCH,
3, VGroupLayout.TOP);
layout.setOffAxisJustification(VGroupLayout.LEFT);
JTabbedPane editor = new EditorPane();
Font font = edito... | java | public static JComponent createAdjustEditor ()
{
VGroupLayout layout = new VGroupLayout(
VGroupLayout.NONE, VGroupLayout.STRETCH,
3, VGroupLayout.TOP);
layout.setOffAxisJustification(VGroupLayout.LEFT);
JTabbedPane editor = new EditorPane();
Font font = edito... | [
"public",
"static",
"JComponent",
"createAdjustEditor",
"(",
")",
"{",
"VGroupLayout",
"layout",
"=",
"new",
"VGroupLayout",
"(",
"VGroupLayout",
".",
"NONE",
",",
"VGroupLayout",
".",
"STRETCH",
",",
"3",
",",
"VGroupLayout",
".",
"TOP",
")",
";",
"layout",
... | Creates a Swing user interface that can be used to adjust all
registered runtime adjustments. | [
"Creates",
"a",
"Swing",
"user",
"interface",
"that",
"can",
"be",
"used",
"to",
"adjust",
"all",
"registered",
"runtime",
"adjustments",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RuntimeAdjust.java#L66-L116 |
39,138 | samskivert/samskivert | src/main/java/com/samskivert/velocity/DataTool.java | DataTool.get | public Object get (Object array, int index)
{
return (array == null) ? null : Array.get(array, index);
} | java | public Object get (Object array, int index)
{
return (array == null) ? null : Array.get(array, index);
} | [
"public",
"Object",
"get",
"(",
"Object",
"array",
",",
"int",
"index",
")",
"{",
"return",
"(",
"array",
"==",
"null",
")",
"?",
"null",
":",
"Array",
".",
"get",
"(",
"array",
",",
"index",
")",
";",
"}"
] | Returns the object in the array at index. Wrapped as an object if
it is a primitive. | [
"Returns",
"the",
"object",
"in",
"the",
"array",
"at",
"index",
".",
"Wrapped",
"as",
"an",
"object",
"if",
"it",
"is",
"a",
"primitive",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/DataTool.java#L37-L40 |
39,139 | samskivert/samskivert | src/main/java/com/samskivert/net/HttpPostUtil.java | HttpPostUtil.httpPost | public static String httpPost (
final URL url, final String submission, int timeout, final Map<String, String> requestProps)
throws IOException, ServiceWaiter.TimeoutException
{
final ServiceWaiter<String> waiter = new ServiceWaiter<String>(
(timeout < 0) ? ServiceWaiter.NO_TIMEO... | java | public static String httpPost (
final URL url, final String submission, int timeout, final Map<String, String> requestProps)
throws IOException, ServiceWaiter.TimeoutException
{
final ServiceWaiter<String> waiter = new ServiceWaiter<String>(
(timeout < 0) ? ServiceWaiter.NO_TIMEO... | [
"public",
"static",
"String",
"httpPost",
"(",
"final",
"URL",
"url",
",",
"final",
"String",
"submission",
",",
"int",
"timeout",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"requestProps",
")",
"throws",
"IOException",
",",
"ServiceWaiter",
"."... | Return the results of a form post. Note that the http request takes place on another
thread, but this thread blocks until the results are returned or it times out.
@param url from which to make the request.
@param submission the entire submission eg {@code foo=bar&baz=boo&futz=foo}.
@param timeout time to wait for the... | [
"Return",
"the",
"results",
"of",
"a",
"form",
"post",
".",
"Note",
"that",
"the",
"http",
"request",
"takes",
"place",
"on",
"another",
"thread",
"but",
"this",
"thread",
"blocks",
"until",
"the",
"results",
"are",
"returned",
"or",
"it",
"times",
"out",
... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/net/HttpPostUtil.java#L52-L98 |
39,140 | samskivert/samskivert | src/main/java/com/samskivert/util/JDK14Logger.java | JDK14Logger.inferCaller | protected String[] inferCaller ()
{
String self = getClass().getName();
// locate ourselves in the call stack
StackTraceElement[] stack = (new Throwable()).getStackTrace();
int ii = 0;
for (; ii < stack.length; ii++) {
if (self.equals(stack[ii].getClassName())) {... | java | protected String[] inferCaller ()
{
String self = getClass().getName();
// locate ourselves in the call stack
StackTraceElement[] stack = (new Throwable()).getStackTrace();
int ii = 0;
for (; ii < stack.length; ii++) {
if (self.equals(stack[ii].getClassName())) {... | [
"protected",
"String",
"[",
"]",
"inferCaller",
"(",
")",
"{",
"String",
"self",
"=",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"// locate ourselves in the call stack",
"StackTraceElement",
"[",
"]",
"stack",
"=",
"(",
"new",
"Throwable",
"(",
")"... | Infers the caller of a Logger method from the current stack trace. This can be used by
wrappers to provide the correct calling class and method information to their underlying log
implementation.
@return a two element array containing { class name, method name } or { null, null } if the
caller could not be inferred. | [
"Infers",
"the",
"caller",
"of",
"a",
"Logger",
"method",
"from",
"the",
"current",
"stack",
"trace",
".",
"This",
"can",
"be",
"used",
"by",
"wrappers",
"to",
"provide",
"the",
"correct",
"calling",
"class",
"and",
"method",
"information",
"to",
"their",
... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/JDK14Logger.java#L65-L88 |
39,141 | samskivert/samskivert | src/main/java/com/samskivert/velocity/SiteJarResourceLoader.java | SiteJarResourceLoader.isSourceModified | @Override
public boolean isSourceModified (Resource resource)
{
SiteKey skey = new SiteKey(resource.getName());
// if the resource is for the default site, it is never considered to
// be modified
if (skey.siteId == SiteIdentifier.DEFAULT_SITE_ID) {
return false;
... | java | @Override
public boolean isSourceModified (Resource resource)
{
SiteKey skey = new SiteKey(resource.getName());
// if the resource is for the default site, it is never considered to
// be modified
if (skey.siteId == SiteIdentifier.DEFAULT_SITE_ID) {
return false;
... | [
"@",
"Override",
"public",
"boolean",
"isSourceModified",
"(",
"Resource",
"resource",
")",
"{",
"SiteKey",
"skey",
"=",
"new",
"SiteKey",
"(",
"resource",
".",
"getName",
"(",
")",
")",
";",
"// if the resource is for the default site, it is never considered to",
"//... | Things won't ever be modified when loaded from the servlet context
because they came from the webapp .war file and if that is reloaded,
everything will be thrown away and started afresh. | [
"Things",
"won",
"t",
"ever",
"be",
"modified",
"when",
"loaded",
"from",
"the",
"servlet",
"context",
"because",
"they",
"came",
"from",
"the",
"webapp",
".",
"war",
"file",
"and",
"if",
"that",
"is",
"reloaded",
"everything",
"will",
"be",
"thrown",
"awa... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/SiteJarResourceLoader.java#L86-L108 |
39,142 | geckoboard-java-api/highchart-java-api | src/main/java/nl/pvanassen/highchart/api/Series.java | Series.setType | public Series setType(SeriesType type) {
if(type != null) {
this.type = type.name().toLowerCase();
} else {
this.type = null;
}
return this;
} | java | public Series setType(SeriesType type) {
if(type != null) {
this.type = type.name().toLowerCase();
} else {
this.type = null;
}
return this;
} | [
"public",
"Series",
"setType",
"(",
"SeriesType",
"type",
")",
"{",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"this",
".",
"type",
"=",
"type",
".",
"name",
"(",
")",
".",
"toLowerCase",
"(",
")",
";",
"}",
"else",
"{",
"this",
".",
"type",
"=",... | The type of series
@param type the type to set
@return | [
"The",
"type",
"of",
"series"
] | 66776cbd3c85380bb3dd21a942e0c5a2be6135a7 | https://github.com/geckoboard-java-api/highchart-java-api/blob/66776cbd3c85380bb3dd21a942e0c5a2be6135a7/src/main/java/nl/pvanassen/highchart/api/Series.java#L126-L133 |
39,143 | nextreports/nextreports-engine | src/ro/nextreports/integration/RuntimeParametersPanel.java | RuntimeParametersPanel.populateDependentParameters | private void populateDependentParameters(Report nextReport, QueryParameter parameter) {
Map<String, QueryParameter> childParams = ParameterUtil.getChildDependentParameters(nextReport, parameter);
// update model parameter values for every child parameter
for (QueryParameter childParam : childPa... | java | private void populateDependentParameters(Report nextReport, QueryParameter parameter) {
Map<String, QueryParameter> childParams = ParameterUtil.getChildDependentParameters(nextReport, parameter);
// update model parameter values for every child parameter
for (QueryParameter childParam : childPa... | [
"private",
"void",
"populateDependentParameters",
"(",
"Report",
"nextReport",
",",
"QueryParameter",
"parameter",
")",
"{",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"childParams",
"=",
"ParameterUtil",
".",
"getChildDependentParameters",
"(",
"nextReport",
"... | and set their values too | [
"and",
"set",
"their",
"values",
"too"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/integration/RuntimeParametersPanel.java#L295-L333 |
39,144 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/StringUtil.java | StringUtil.equalsText | public static boolean equalsText(String s1, String s2) {
if (s1 == null) {
if (s2 != null) {
return false;
}
} else {
if (s2 == null) {
return false;
}
}
if ((s1 != null) && (s2 != null)) {
s1 = s1.replaceAll("\\s", "").toLowerCase();
s2 = s2.replaceAll("\\s", "").toLowerCase();
if ... | java | public static boolean equalsText(String s1, String s2) {
if (s1 == null) {
if (s2 != null) {
return false;
}
} else {
if (s2 == null) {
return false;
}
}
if ((s1 != null) && (s2 != null)) {
s1 = s1.replaceAll("\\s", "").toLowerCase();
s2 = s2.replaceAll("\\s", "").toLowerCase();
if ... | [
"public",
"static",
"boolean",
"equalsText",
"(",
"String",
"s1",
",",
"String",
"s2",
")",
"{",
"if",
"(",
"s1",
"==",
"null",
")",
"{",
"if",
"(",
"s2",
"!=",
"null",
")",
"{",
"return",
"false",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"s2",
"... | functional compare for two strings as ignore-case text | [
"functional",
"compare",
"for",
"two",
"strings",
"as",
"ignore",
"-",
"case",
"text"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/StringUtil.java#L345-L363 |
39,145 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/StringUtil.java | StringUtil.isImage | private static boolean isImage(String hexString) {
boolean isImage = false;
//png
if (hexString.startsWith("89504e470d0a1a0a")) {
isImage = true;
//gif
} else if (hexString.startsWith("474946383761") || hexString.startsWith("474946383961")) {
isImage = true;
// jpe... | java | private static boolean isImage(String hexString) {
boolean isImage = false;
//png
if (hexString.startsWith("89504e470d0a1a0a")) {
isImage = true;
//gif
} else if (hexString.startsWith("474946383761") || hexString.startsWith("474946383961")) {
isImage = true;
// jpe... | [
"private",
"static",
"boolean",
"isImage",
"(",
"String",
"hexString",
")",
"{",
"boolean",
"isImage",
"=",
"false",
";",
"//png",
"if",
"(",
"hexString",
".",
"startsWith",
"(",
"\"89504e470d0a1a0a\"",
")",
")",
"{",
"isImage",
"=",
"true",
";",
"//gif\t",
... | JPEGs start with FF D8 FF E0 xx xx 4A 46 49 46 00 | [
"JPEGs",
"start",
"with",
"FF",
"D8",
"FF",
"E0",
"xx",
"xx",
"4A",
"46",
"49",
"46",
"00"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/StringUtil.java#L407-L420 |
39,146 | samskivert/samskivert | src/main/java/com/samskivert/swing/RadialLabelSausage.java | RadialLabelSausage.layout | public void layout (Graphics2D gfx, Font font)
{
_label.setFont(font);
layout(gfx, BORDER_THICKNESS);
openBounds.width = _size.width;
openBounds.height = _size.height;
// and closed up, we're just a circle
closedBounds.height = closedBounds.width = _size.height;
... | java | public void layout (Graphics2D gfx, Font font)
{
_label.setFont(font);
layout(gfx, BORDER_THICKNESS);
openBounds.width = _size.width;
openBounds.height = _size.height;
// and closed up, we're just a circle
closedBounds.height = closedBounds.width = _size.height;
... | [
"public",
"void",
"layout",
"(",
"Graphics2D",
"gfx",
",",
"Font",
"font",
")",
"{",
"_label",
".",
"setFont",
"(",
"font",
")",
";",
"layout",
"(",
"gfx",
",",
"BORDER_THICKNESS",
")",
";",
"openBounds",
".",
"width",
"=",
"_size",
".",
"width",
";",
... | Computes the dimensions of this label based on the specified font
and in the specified graphics context. | [
"Computes",
"the",
"dimensions",
"of",
"this",
"label",
"based",
"on",
"the",
"specified",
"font",
"and",
"in",
"the",
"specified",
"graphics",
"context",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialLabelSausage.java#L89-L99 |
39,147 | samskivert/samskivert | src/main/java/com/samskivert/swing/RadialLabelSausage.java | RadialLabelSausage.drawBase | @Override
protected void drawBase (Graphics2D gfx, int x, int y)
{
if (_active) {
// render the sausage
super.drawBase(gfx, x, y);
} else {
// render the circle
gfx.fillOval(x, y, closedBounds.width - 1, closedBounds.height - 1);
}
} | java | @Override
protected void drawBase (Graphics2D gfx, int x, int y)
{
if (_active) {
// render the sausage
super.drawBase(gfx, x, y);
} else {
// render the circle
gfx.fillOval(x, y, closedBounds.width - 1, closedBounds.height - 1);
}
} | [
"@",
"Override",
"protected",
"void",
"drawBase",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"if",
"(",
"_active",
")",
"{",
"// render the sausage",
"super",
".",
"drawBase",
"(",
"gfx",
",",
"x",
",",
"y",
")",
";",
"}",
... | Draw the base circle or sausage within which all the other
decorations are added. | [
"Draw",
"the",
"base",
"circle",
"or",
"sausage",
"within",
"which",
"all",
"the",
"other",
"decorations",
"are",
"added",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialLabelSausage.java#L162-L173 |
39,148 | samskivert/samskivert | src/main/java/com/samskivert/swing/RadialLabelSausage.java | RadialLabelSausage.paint | protected void paint (Graphics2D gfx, int x, int y, RadialMenu menu)
{
paint(gfx, x, y, UIManager.getColor("RadialLabelSausage.background"), menu);
} | java | protected void paint (Graphics2D gfx, int x, int y, RadialMenu menu)
{
paint(gfx, x, y, UIManager.getColor("RadialLabelSausage.background"), menu);
} | [
"protected",
"void",
"paint",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
",",
"RadialMenu",
"menu",
")",
"{",
"paint",
"(",
"gfx",
",",
"x",
",",
"y",
",",
"UIManager",
".",
"getColor",
"(",
"\"RadialLabelSausage.background\"",
")",
",",... | Paints the radial label sausage. | [
"Paints",
"the",
"radial",
"label",
"sausage",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/RadialLabelSausage.java#L178-L181 |
39,149 | samskivert/samskivert | src/main/java/com/samskivert/util/ListUtil.java | ListUtil.nextPowerOfTwo | public static int nextPowerOfTwo (int value)
{
return (int)Math.pow(2, Math.ceil(Math.log(value) / Math.log(2)));
} | java | public static int nextPowerOfTwo (int value)
{
return (int)Math.pow(2, Math.ceil(Math.log(value) / Math.log(2)));
} | [
"public",
"static",
"int",
"nextPowerOfTwo",
"(",
"int",
"value",
")",
"{",
"return",
"(",
"int",
")",
"Math",
".",
"pow",
"(",
"2",
",",
"Math",
".",
"ceil",
"(",
"Math",
".",
"log",
"(",
"value",
")",
"/",
"Math",
".",
"log",
"(",
"2",
")",
"... | Rounds the specified value up to the next nearest power of two. | [
"Rounds",
"the",
"specified",
"value",
"up",
"to",
"the",
"next",
"nearest",
"power",
"of",
"two",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ListUtil.java#L55-L58 |
39,150 | samskivert/samskivert | src/main/java/com/samskivert/util/ListUtil.java | ListUtil.add | public static Object[] add (Object[] list, int startIdx, Object element)
{
requireNotNull(element);
// make sure we've got a list to work with
if (list == null) {
list = new Object[DEFAULT_LIST_SIZE];
}
// search for a spot to insert yon element; assuming we'll ... | java | public static Object[] add (Object[] list, int startIdx, Object element)
{
requireNotNull(element);
// make sure we've got a list to work with
if (list == null) {
list = new Object[DEFAULT_LIST_SIZE];
}
// search for a spot to insert yon element; assuming we'll ... | [
"public",
"static",
"Object",
"[",
"]",
"add",
"(",
"Object",
"[",
"]",
"list",
",",
"int",
"startIdx",
",",
"Object",
"element",
")",
"{",
"requireNotNull",
"(",
"element",
")",
";",
"// make sure we've got a list to work with",
"if",
"(",
"list",
"==",
"nu... | Adds the specified element to the next empty slot in the specified
list. Begins searching for empty slots at the specified index. This
can be used to quickly add elements to a list that preserves
consecutivity by calling it with the size of the list as the first
index to check.
@param list the list to which to add the... | [
"Adds",
"the",
"specified",
"element",
"to",
"the",
"next",
"empty",
"slot",
"in",
"the",
"specified",
"list",
".",
"Begins",
"searching",
"for",
"empty",
"slots",
"at",
"the",
"specified",
"index",
".",
"This",
"can",
"be",
"used",
"to",
"quickly",
"add",... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ListUtil.java#L89-L118 |
39,151 | samskivert/samskivert | src/main/java/com/samskivert/util/ListUtil.java | ListUtil.insert | public static Object[] insert (Object[] list, int index, Object element)
{
requireNotNull(element);
// make sure we've got a list to work with
if (list == null) {
list = new Object[DEFAULT_LIST_SIZE];
}
// make a note of the size of the array
int size = ... | java | public static Object[] insert (Object[] list, int index, Object element)
{
requireNotNull(element);
// make sure we've got a list to work with
if (list == null) {
list = new Object[DEFAULT_LIST_SIZE];
}
// make a note of the size of the array
int size = ... | [
"public",
"static",
"Object",
"[",
"]",
"insert",
"(",
"Object",
"[",
"]",
"list",
",",
"int",
"index",
",",
"Object",
"element",
")",
"{",
"requireNotNull",
"(",
"element",
")",
";",
"// make sure we've got a list to work with",
"if",
"(",
"list",
"==",
"nu... | Inserts the supplied element at the specified position in the
array, shifting the remaining elements down. The array will be
expanded if necessary.
@param list the list in which to insert the element. Can be null.
@param index the index at which to insert the element.
@param element the element to insert.
@return a r... | [
"Inserts",
"the",
"supplied",
"element",
"at",
"the",
"specified",
"position",
"in",
"the",
"array",
"shifting",
"the",
"remaining",
"elements",
"down",
".",
"The",
"array",
"will",
"be",
"expanded",
"if",
"necessary",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ListUtil.java#L132-L161 |
39,152 | samskivert/samskivert | src/main/java/com/samskivert/util/ListUtil.java | ListUtil.indexOfNull | public static int indexOfNull (Object[] list)
{
if (list != null) {
for (int ii=0, nn = list.length; ii < nn; ii++) {
if (list[ii] == null) {
return ii;
}
}
}
return -1;
} | java | public static int indexOfNull (Object[] list)
{
if (list != null) {
for (int ii=0, nn = list.length; ii < nn; ii++) {
if (list[ii] == null) {
return ii;
}
}
}
return -1;
} | [
"public",
"static",
"int",
"indexOfNull",
"(",
"Object",
"[",
"]",
"list",
")",
"{",
"if",
"(",
"list",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"nn",
"=",
"list",
".",
"length",
";",
"ii",
"<",
"nn",
";",
"ii",
"++",
"... | Returns the lowest index in the array that contains null,
or -1 if there is no room to add elements without expanding the array. | [
"Returns",
"the",
"lowest",
"index",
"in",
"the",
"array",
"that",
"contains",
"null",
"or",
"-",
"1",
"if",
"there",
"is",
"no",
"room",
"to",
"add",
"elements",
"without",
"expanding",
"the",
"array",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ListUtil.java#L271-L281 |
39,153 | samskivert/samskivert | src/main/java/com/samskivert/util/ListUtil.java | ListUtil.remove | public static Object remove (Object[] list, int index)
{
if (list == null) {
return null;
}
int llength = list.length;
if (llength <= index || index < 0) {
return null;
}
Object elem = list[index];
System.arraycopy(list, index+1, list... | java | public static Object remove (Object[] list, int index)
{
if (list == null) {
return null;
}
int llength = list.length;
if (llength <= index || index < 0) {
return null;
}
Object elem = list[index];
System.arraycopy(list, index+1, list... | [
"public",
"static",
"Object",
"remove",
"(",
"Object",
"[",
"]",
"list",
",",
"int",
"index",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"llength",
"=",
"list",
".",
"length",
";",
"if",
"(",
"llength",
... | Removes the element at the specified index. The elements after the
removed element will be slid down the array one spot to fill the
place of the removed element. If a null array is supplied or one
that is not large enough to accomodate this index, null is
returned.
@return the object that was removed from the array or... | [
"Removes",
"the",
"element",
"at",
"the",
"specified",
"index",
".",
"The",
"elements",
"after",
"the",
"removed",
"element",
"will",
"be",
"slid",
"down",
"the",
"array",
"one",
"spot",
"to",
"fill",
"the",
"place",
"of",
"the",
"removed",
"element",
".",... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ListUtil.java#L404-L419 |
39,154 | samskivert/samskivert | src/main/java/com/samskivert/util/ListUtil.java | ListUtil.size | @Deprecated public static int size (Object[] list)
{
if (list == null) {
return 0;
}
int llength = list.length;
for (int ii = 0; ii < llength; ii++) {
if (list[ii] == null) {
return ii;
}
}
return llength;
} | java | @Deprecated public static int size (Object[] list)
{
if (list == null) {
return 0;
}
int llength = list.length;
for (int ii = 0; ii < llength; ii++) {
if (list[ii] == null) {
return ii;
}
}
return llength;
} | [
"@",
"Deprecated",
"public",
"static",
"int",
"size",
"(",
"Object",
"[",
"]",
"list",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"int",
"llength",
"=",
"list",
".",
"length",
";",
"for",
"(",
"int",
"ii",
"=",
... | Returns the number of elements prior to the first null in the supplied list.
@deprecated This is incompatible with things like clearRef(), which leave a null space. | [
"Returns",
"the",
"number",
"of",
"elements",
"prior",
"to",
"the",
"first",
"null",
"in",
"the",
"supplied",
"list",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ListUtil.java#L425-L437 |
39,155 | samskivert/samskivert | src/main/java/com/samskivert/util/ListUtil.java | ListUtil.getSize | public static int getSize (Object[] list)
{
int size = 0;
for (int ii = 0, nn = (list == null) ? 0 : list.length; ii < nn; ii++) {
if (list[ii] != null) {
size++;
}
}
return size;
} | java | public static int getSize (Object[] list)
{
int size = 0;
for (int ii = 0, nn = (list == null) ? 0 : list.length; ii < nn; ii++) {
if (list[ii] != null) {
size++;
}
}
return size;
} | [
"public",
"static",
"int",
"getSize",
"(",
"Object",
"[",
"]",
"list",
")",
"{",
"int",
"size",
"=",
"0",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"nn",
"=",
"(",
"list",
"==",
"null",
")",
"?",
"0",
":",
"list",
".",
"length",
";",
"ii",... | Returns the number of non-null elements in the supplied list. | [
"Returns",
"the",
"number",
"of",
"non",
"-",
"null",
"elements",
"in",
"the",
"supplied",
"list",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ListUtil.java#L442-L451 |
39,156 | samskivert/samskivert | src/main/java/com/samskivert/util/ListUtil.java | ListUtil.main | public static void main (String[] args)
{
Object[] list = null;
String foo = "foo";
String bar = "bar";
list = ListUtil.add(list, foo);
System.out.println("add(foo): " + StringUtil.toString(list));
list = ListUtil.add(list, bar);
System.out.println("add(bar)... | java | public static void main (String[] args)
{
Object[] list = null;
String foo = "foo";
String bar = "bar";
list = ListUtil.add(list, foo);
System.out.println("add(foo): " + StringUtil.toString(list));
list = ListUtil.add(list, bar);
System.out.println("add(bar)... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"Object",
"[",
"]",
"list",
"=",
"null",
";",
"String",
"foo",
"=",
"\"foo\"",
";",
"String",
"bar",
"=",
"\"bar\"",
";",
"list",
"=",
"ListUtil",
".",
"add",
"(",
"list... | Run some tests. | [
"Run",
"some",
"tests",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ListUtil.java#L484-L547 |
39,157 | samskivert/samskivert | src/main/java/com/samskivert/util/IntIntMap.java | IntIntMap.getOrElse | public int getOrElse (int key, int defval)
{
Record rec = locateRecord(key);
return (rec == null) ? defval : rec.value;
} | java | public int getOrElse (int key, int defval)
{
Record rec = locateRecord(key);
return (rec == null) ? defval : rec.value;
} | [
"public",
"int",
"getOrElse",
"(",
"int",
"key",
",",
"int",
"defval",
")",
"{",
"Record",
"rec",
"=",
"locateRecord",
"(",
"key",
")",
";",
"return",
"(",
"rec",
"==",
"null",
")",
"?",
"defval",
":",
"rec",
".",
"value",
";",
"}"
] | Returns the value mapped to the specified key or the supplied default value if there is no
mapping. | [
"Returns",
"the",
"value",
"mapped",
"to",
"the",
"specified",
"key",
"or",
"the",
"supplied",
"default",
"value",
"if",
"there",
"is",
"no",
"mapping",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntIntMap.java#L120-L124 |
39,158 | samskivert/samskivert | src/main/java/com/samskivert/util/IntIntMap.java | IntIntMap.removeOrElse | public int removeOrElse (int key, int defval)
{
_modCount++;
int removed = removeImpl(key, defval);
checkShrink();
return removed;
} | java | public int removeOrElse (int key, int defval)
{
_modCount++;
int removed = removeImpl(key, defval);
checkShrink();
return removed;
} | [
"public",
"int",
"removeOrElse",
"(",
"int",
"key",
",",
"int",
"defval",
")",
"{",
"_modCount",
"++",
";",
"int",
"removed",
"=",
"removeImpl",
"(",
"key",
",",
"defval",
")",
";",
"checkShrink",
"(",
")",
";",
"return",
"removed",
";",
"}"
] | Removes the value mapped for the specified key.
@return the value to which the key was mapped or the supplied default value if there was no
mapping for that key. | [
"Removes",
"the",
"value",
"mapped",
"for",
"the",
"specified",
"key",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntIntMap.java#L179-L185 |
39,159 | samskivert/samskivert | src/main/java/com/samskivert/util/IntIntMap.java | IntIntMap.clear | public void clear ()
{
_modCount++;
// abandon all of our hash chains (the joy of garbage collection)
for (int i = 0; i < _buckets.length; i++) {
_buckets[i] = null;
}
// zero out our size
_size = 0;
} | java | public void clear ()
{
_modCount++;
// abandon all of our hash chains (the joy of garbage collection)
for (int i = 0; i < _buckets.length; i++) {
_buckets[i] = null;
}
// zero out our size
_size = 0;
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"_modCount",
"++",
";",
"// abandon all of our hash chains (the joy of garbage collection)",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"_buckets",
".",
"length",
";",
"i",
"++",
")",
"{",
"_buckets",
"[",
"i",... | Clears all mappings. | [
"Clears",
"all",
"mappings",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntIntMap.java#L190-L200 |
39,160 | samskivert/samskivert | src/main/java/com/samskivert/util/IntIntMap.java | IntIntMap.ensureCapacity | public void ensureCapacity (int minCapacity)
{
int size = _buckets.length;
while (minCapacity > (int) (size * _loadFactor)) {
size *= 2;
}
if (size != _buckets.length) {
resizeBuckets(size);
}
} | java | public void ensureCapacity (int minCapacity)
{
int size = _buckets.length;
while (minCapacity > (int) (size * _loadFactor)) {
size *= 2;
}
if (size != _buckets.length) {
resizeBuckets(size);
}
} | [
"public",
"void",
"ensureCapacity",
"(",
"int",
"minCapacity",
")",
"{",
"int",
"size",
"=",
"_buckets",
".",
"length",
";",
"while",
"(",
"minCapacity",
">",
"(",
"int",
")",
"(",
"size",
"*",
"_loadFactor",
")",
")",
"{",
"size",
"*=",
"2",
";",
"}... | Ensure that the hash can comfortably hold the specified number of elements. Calling this
method is not necessary, but can improve performance if done prior to adding many elements. | [
"Ensure",
"that",
"the",
"hash",
"can",
"comfortably",
"hold",
"the",
"specified",
"number",
"of",
"elements",
".",
"Calling",
"this",
"method",
"is",
"not",
"necessary",
"but",
"can",
"improve",
"performance",
"if",
"done",
"prior",
"to",
"adding",
"many",
... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntIntMap.java#L206-L215 |
39,161 | samskivert/samskivert | src/main/java/com/samskivert/util/IntIntMap.java | IntIntMap.locateRecord | protected Record locateRecord (int key)
{
int index = Math.abs(key)%_buckets.length;
for (Record rec = _buckets[index]; rec != null; rec = rec.next) {
if (rec.key == key) {
return rec;
}
}
return null;
} | java | protected Record locateRecord (int key)
{
int index = Math.abs(key)%_buckets.length;
for (Record rec = _buckets[index]; rec != null; rec = rec.next) {
if (rec.key == key) {
return rec;
}
}
return null;
} | [
"protected",
"Record",
"locateRecord",
"(",
"int",
"key",
")",
"{",
"int",
"index",
"=",
"Math",
".",
"abs",
"(",
"key",
")",
"%",
"_buckets",
".",
"length",
";",
"for",
"(",
"Record",
"rec",
"=",
"_buckets",
"[",
"index",
"]",
";",
"rec",
"!=",
"n... | Internal method to locate the record for the specified key. | [
"Internal",
"method",
"to",
"locate",
"the",
"record",
"for",
"the",
"specified",
"key",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntIntMap.java#L220-L229 |
39,162 | samskivert/samskivert | src/main/java/com/samskivert/util/IntIntMap.java | IntIntMap.removeImpl | protected int removeImpl (int key, int defval)
{
int index = Math.abs(key)%_buckets.length;
Record prev = null;
// go through the chain looking for a match
for (Record rec = _buckets[index]; rec != null; rec = rec.next) {
if (rec.key == key) {
if (prev ==... | java | protected int removeImpl (int key, int defval)
{
int index = Math.abs(key)%_buckets.length;
Record prev = null;
// go through the chain looking for a match
for (Record rec = _buckets[index]; rec != null; rec = rec.next) {
if (rec.key == key) {
if (prev ==... | [
"protected",
"int",
"removeImpl",
"(",
"int",
"key",
",",
"int",
"defval",
")",
"{",
"int",
"index",
"=",
"Math",
".",
"abs",
"(",
"key",
")",
"%",
"_buckets",
".",
"length",
";",
"Record",
"prev",
"=",
"null",
";",
"// go through the chain looking for a m... | Internal method for removing a mapping. | [
"Internal",
"method",
"for",
"removing",
"a",
"mapping",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntIntMap.java#L234-L254 |
39,163 | samskivert/samskivert | src/main/java/com/samskivert/util/IntIntMap.java | IntIntMap.checkShrink | protected void checkShrink ()
{
if ((_buckets.length > DEFAULT_BUCKETS) &&
(_size < (int) (_buckets.length * _loadFactor * .125))) {
resizeBuckets(Math.max(DEFAULT_BUCKETS, _buckets.length >> 1));
}
} | java | protected void checkShrink ()
{
if ((_buckets.length > DEFAULT_BUCKETS) &&
(_size < (int) (_buckets.length * _loadFactor * .125))) {
resizeBuckets(Math.max(DEFAULT_BUCKETS, _buckets.length >> 1));
}
} | [
"protected",
"void",
"checkShrink",
"(",
")",
"{",
"if",
"(",
"(",
"_buckets",
".",
"length",
">",
"DEFAULT_BUCKETS",
")",
"&&",
"(",
"_size",
"<",
"(",
"int",
")",
"(",
"_buckets",
".",
"length",
"*",
"_loadFactor",
"*",
".125",
")",
")",
")",
"{",
... | Check to see if we want to shrink the table. | [
"Check",
"to",
"see",
"if",
"we",
"want",
"to",
"shrink",
"the",
"table",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntIntMap.java#L259-L265 |
39,164 | samskivert/samskivert | src/main/java/com/samskivert/util/IntIntMap.java | IntIntMap.entrySet | public Set<IntIntEntry> entrySet ()
{
return new AbstractSet<IntIntEntry>() {
@Override public int size () {
return _size;
}
@Override public Iterator<IntIntEntry> iterator() {
return new IntEntryIterator();
}
};
} | java | public Set<IntIntEntry> entrySet ()
{
return new AbstractSet<IntIntEntry>() {
@Override public int size () {
return _size;
}
@Override public Iterator<IntIntEntry> iterator() {
return new IntEntryIterator();
}
};
} | [
"public",
"Set",
"<",
"IntIntEntry",
">",
"entrySet",
"(",
")",
"{",
"return",
"new",
"AbstractSet",
"<",
"IntIntEntry",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"size",
"(",
")",
"{",
"return",
"_size",
";",
"}",
"@",
"Override",
"public"... | Get a set of all the entries in this map. | [
"Get",
"a",
"set",
"of",
"all",
"the",
"entries",
"in",
"this",
"map",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntIntMap.java#L378-L389 |
39,165 | samskivert/samskivert | src/main/java/com/samskivert/util/Lifecycle.java | Lifecycle.addComponent | public void addComponent (BaseComponent comp)
{
if (comp instanceof InitComponent) {
if (_initers == null) {
throw new IllegalStateException("Too late to register InitComponent.");
}
_initers.add((InitComponent)comp);
}
if (comp instanceof ... | java | public void addComponent (BaseComponent comp)
{
if (comp instanceof InitComponent) {
if (_initers == null) {
throw new IllegalStateException("Too late to register InitComponent.");
}
_initers.add((InitComponent)comp);
}
if (comp instanceof ... | [
"public",
"void",
"addComponent",
"(",
"BaseComponent",
"comp",
")",
"{",
"if",
"(",
"comp",
"instanceof",
"InitComponent",
")",
"{",
"if",
"(",
"_initers",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Too late to register InitComponent... | Registers a component with the lifecycle. This should be done during dependency resolution
by injecting the Lifecycle into your constructor and calling this method there. | [
"Registers",
"a",
"component",
"with",
"the",
"lifecycle",
".",
"This",
"should",
"be",
"done",
"during",
"dependency",
"resolution",
"by",
"injecting",
"the",
"Lifecycle",
"into",
"your",
"constructor",
"and",
"calling",
"this",
"method",
"there",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Lifecycle.java#L46-L60 |
39,166 | samskivert/samskivert | src/main/java/com/samskivert/util/Lifecycle.java | Lifecycle.removeComponent | public void removeComponent (BaseComponent comp)
{
if (_initers != null && comp instanceof InitComponent) {
_initers.remove((InitComponent)comp);
}
if (_downers != null && comp instanceof ShutdownComponent) {
_downers.remove((ShutdownComponent)comp);
}
} | java | public void removeComponent (BaseComponent comp)
{
if (_initers != null && comp instanceof InitComponent) {
_initers.remove((InitComponent)comp);
}
if (_downers != null && comp instanceof ShutdownComponent) {
_downers.remove((ShutdownComponent)comp);
}
} | [
"public",
"void",
"removeComponent",
"(",
"BaseComponent",
"comp",
")",
"{",
"if",
"(",
"_initers",
"!=",
"null",
"&&",
"comp",
"instanceof",
"InitComponent",
")",
"{",
"_initers",
".",
"remove",
"(",
"(",
"InitComponent",
")",
"comp",
")",
";",
"}",
"if",... | Removes a component from the lifecycle. This is generally not used. | [
"Removes",
"a",
"component",
"from",
"the",
"lifecycle",
".",
"This",
"is",
"generally",
"not",
"used",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Lifecycle.java#L65-L73 |
39,167 | samskivert/samskivert | src/main/java/com/samskivert/util/Lifecycle.java | Lifecycle.addInitConstraint | public void addInitConstraint (InitComponent lhs, Constraint constraint, InitComponent rhs)
{
if (lhs == null || rhs == null) {
throw new IllegalArgumentException("Cannot add constraint about null component.");
}
InitComponent before = (constraint == Constraint.RUNS_BEFORE) ? lhs... | java | public void addInitConstraint (InitComponent lhs, Constraint constraint, InitComponent rhs)
{
if (lhs == null || rhs == null) {
throw new IllegalArgumentException("Cannot add constraint about null component.");
}
InitComponent before = (constraint == Constraint.RUNS_BEFORE) ? lhs... | [
"public",
"void",
"addInitConstraint",
"(",
"InitComponent",
"lhs",
",",
"Constraint",
"constraint",
",",
"InitComponent",
"rhs",
")",
"{",
"if",
"(",
"lhs",
"==",
"null",
"||",
"rhs",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
... | Adds a constraint that a certain component must be initialized before another. | [
"Adds",
"a",
"constraint",
"that",
"a",
"certain",
"component",
"must",
"be",
"initialized",
"before",
"another",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Lifecycle.java#L78-L86 |
39,168 | samskivert/samskivert | src/main/java/com/samskivert/util/Lifecycle.java | Lifecycle.addShutdownConstraint | public void addShutdownConstraint (ShutdownComponent lhs, Constraint constraint,
ShutdownComponent rhs)
{
if (lhs == null || rhs == null) {
throw new IllegalArgumentException("Cannot add constraint about null component.");
}
ShutdownComponen... | java | public void addShutdownConstraint (ShutdownComponent lhs, Constraint constraint,
ShutdownComponent rhs)
{
if (lhs == null || rhs == null) {
throw new IllegalArgumentException("Cannot add constraint about null component.");
}
ShutdownComponen... | [
"public",
"void",
"addShutdownConstraint",
"(",
"ShutdownComponent",
"lhs",
",",
"Constraint",
"constraint",
",",
"ShutdownComponent",
"rhs",
")",
"{",
"if",
"(",
"lhs",
"==",
"null",
"||",
"rhs",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException... | Adds a constraint that a certain component must be shutdown before another. | [
"Adds",
"a",
"constraint",
"that",
"a",
"certain",
"component",
"must",
"be",
"shutdown",
"before",
"another",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Lifecycle.java#L91-L100 |
39,169 | samskivert/samskivert | src/main/java/com/samskivert/util/Lifecycle.java | Lifecycle.init | public void init ()
{
if (_initers == null) {
log.warning("Refusing repeat init() request.");
return;
}
ObserverList<InitComponent> list = _initers.toObserverList();
_initers = null;
list.apply(new ObserverList.ObserverOp<InitComponent>() {
... | java | public void init ()
{
if (_initers == null) {
log.warning("Refusing repeat init() request.");
return;
}
ObserverList<InitComponent> list = _initers.toObserverList();
_initers = null;
list.apply(new ObserverList.ObserverOp<InitComponent>() {
... | [
"public",
"void",
"init",
"(",
")",
"{",
"if",
"(",
"_initers",
"==",
"null",
")",
"{",
"log",
".",
"warning",
"(",
"\"Refusing repeat init() request.\"",
")",
";",
"return",
";",
"}",
"ObserverList",
"<",
"InitComponent",
">",
"list",
"=",
"_initers",
"."... | Initializes all components immediately on the caller's thread. | [
"Initializes",
"all",
"components",
"immediately",
"on",
"the",
"caller",
"s",
"thread",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Lifecycle.java#L113-L129 |
39,170 | samskivert/samskivert | src/main/java/com/samskivert/util/Lifecycle.java | Lifecycle.shutdown | public void shutdown ()
{
if (_downers == null) {
log.warning("Refusing repeat shutdown() request.");
return;
}
ObserverList<ShutdownComponent> list = _downers.toObserverList();
_downers = null;
list.apply(new ObserverList.ObserverOp<ShutdownComponent... | java | public void shutdown ()
{
if (_downers == null) {
log.warning("Refusing repeat shutdown() request.");
return;
}
ObserverList<ShutdownComponent> list = _downers.toObserverList();
_downers = null;
list.apply(new ObserverList.ObserverOp<ShutdownComponent... | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"if",
"(",
"_downers",
"==",
"null",
")",
"{",
"log",
".",
"warning",
"(",
"\"Refusing repeat shutdown() request.\"",
")",
";",
"return",
";",
"}",
"ObserverList",
"<",
"ShutdownComponent",
">",
"list",
"=",
"_dow... | Shuts down all components immediately on the caller's thread. | [
"Shuts",
"down",
"all",
"components",
"immediately",
"on",
"the",
"caller",
"s",
"thread",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Lifecycle.java#L134-L150 |
39,171 | samskivert/samskivert | src/main/java/com/samskivert/util/HashIntMap.java | HashIntMap.getImpl | protected Record<V> getImpl (int key)
{
for (Record<V> rec = _buckets[keyToIndex(key)]; rec != null; rec = rec.next) {
if (rec.key == key) {
return rec;
}
}
return null;
} | java | protected Record<V> getImpl (int key)
{
for (Record<V> rec = _buckets[keyToIndex(key)]; rec != null; rec = rec.next) {
if (rec.key == key) {
return rec;
}
}
return null;
} | [
"protected",
"Record",
"<",
"V",
">",
"getImpl",
"(",
"int",
"key",
")",
"{",
"for",
"(",
"Record",
"<",
"V",
">",
"rec",
"=",
"_buckets",
"[",
"keyToIndex",
"(",
"key",
")",
"]",
";",
"rec",
"!=",
"null",
";",
"rec",
"=",
"rec",
".",
"next",
"... | Locate the record with the specified key. | [
"Locate",
"the",
"record",
"with",
"the",
"specified",
"key",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntMap.java#L168-L176 |
39,172 | samskivert/samskivert | src/main/java/com/samskivert/util/HashIntMap.java | HashIntMap.removeImpl | protected Record<V> removeImpl (int key, boolean checkShrink)
{
int index = keyToIndex(key);
// go through the chain looking for a match
for (Record<V> prev = null, rec = _buckets[index]; rec != null; rec = rec.next) {
if (rec.key == key) {
if (prev == null) {
... | java | protected Record<V> removeImpl (int key, boolean checkShrink)
{
int index = keyToIndex(key);
// go through the chain looking for a match
for (Record<V> prev = null, rec = _buckets[index]; rec != null; rec = rec.next) {
if (rec.key == key) {
if (prev == null) {
... | [
"protected",
"Record",
"<",
"V",
">",
"removeImpl",
"(",
"int",
"key",
",",
"boolean",
"checkShrink",
")",
"{",
"int",
"index",
"=",
"keyToIndex",
"(",
"key",
")",
";",
"// go through the chain looking for a match",
"for",
"(",
"Record",
"<",
"V",
">",
"prev... | Remove an element with optional checking to see if we should shrink.
When this is called from our iterator, checkShrink==false to avoid booching the buckets. | [
"Remove",
"an",
"element",
"with",
"optional",
"checking",
"to",
"see",
"if",
"we",
"should",
"shrink",
".",
"When",
"this",
"is",
"called",
"from",
"our",
"iterator",
"checkShrink",
"==",
"false",
"to",
"avoid",
"booching",
"the",
"buckets",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntMap.java#L182-L204 |
39,173 | samskivert/samskivert | src/main/java/com/samskivert/util/HashIntMap.java | HashIntMap.keyToIndex | protected final int keyToIndex (int key)
{
// we lift the hash-fixing function from HashMap because Sun
// wasn't kind enough to make it public
key += ~(key << 9);
key ^= (key >>> 14);
key += (key << 4);
key ^= (key >>> 10);
return key & (_buckets.length - ... | java | protected final int keyToIndex (int key)
{
// we lift the hash-fixing function from HashMap because Sun
// wasn't kind enough to make it public
key += ~(key << 9);
key ^= (key >>> 14);
key += (key << 4);
key ^= (key >>> 10);
return key & (_buckets.length - ... | [
"protected",
"final",
"int",
"keyToIndex",
"(",
"int",
"key",
")",
"{",
"// we lift the hash-fixing function from HashMap because Sun",
"// wasn't kind enough to make it public",
"key",
"+=",
"~",
"(",
"key",
"<<",
"9",
")",
";",
"key",
"^=",
"(",
"key",
">>>",
"14"... | Turn the specified key into an index. | [
"Turn",
"the",
"specified",
"key",
"into",
"an",
"index",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntMap.java#L243-L252 |
39,174 | samskivert/samskivert | src/main/java/com/samskivert/util/HashIntMap.java | HashIntMap.intKeySet | public IntSet intKeySet ()
{
// damn Sun bastards made the 'keySet' variable with default access, so we can't share it
if (_keySet == null) {
_keySet = new AbstractIntSet() {
public Interator interator () {
return new AbstractInterator () {
... | java | public IntSet intKeySet ()
{
// damn Sun bastards made the 'keySet' variable with default access, so we can't share it
if (_keySet == null) {
_keySet = new AbstractIntSet() {
public Interator interator () {
return new AbstractInterator () {
... | [
"public",
"IntSet",
"intKeySet",
"(",
")",
"{",
"// damn Sun bastards made the 'keySet' variable with default access, so we can't share it",
"if",
"(",
"_keySet",
"==",
"null",
")",
"{",
"_keySet",
"=",
"new",
"AbstractIntSet",
"(",
")",
"{",
"public",
"Interator",
"int... | documentation inherited from interface IntMap | [
"documentation",
"inherited",
"from",
"interface",
"IntMap"
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntMap.java#L384-L419 |
39,175 | samskivert/samskivert | src/main/java/com/samskivert/servlet/util/RequestUtils.java | RequestUtils.rehostLocation | public static String rehostLocation (
HttpServletRequest req, String servername)
{
StringBuffer buf = req.getRequestURL();
String csname = req.getServerName();
int csidx = buf.indexOf(csname);
if (csidx != -1) {
buf.delete(csidx, csidx + csname.length());
... | java | public static String rehostLocation (
HttpServletRequest req, String servername)
{
StringBuffer buf = req.getRequestURL();
String csname = req.getServerName();
int csidx = buf.indexOf(csname);
if (csidx != -1) {
buf.delete(csidx, csidx + csname.length());
... | [
"public",
"static",
"String",
"rehostLocation",
"(",
"HttpServletRequest",
"req",
",",
"String",
"servername",
")",
"{",
"StringBuffer",
"buf",
"=",
"req",
".",
"getRequestURL",
"(",
")",
";",
"String",
"csname",
"=",
"req",
".",
"getServerName",
"(",
")",
"... | Recreates the URL used to make the supplied request, replacing the
server part of the URL with the supplied server name. | [
"Recreates",
"the",
"URL",
"used",
"to",
"make",
"the",
"supplied",
"request",
"replacing",
"the",
"server",
"part",
"of",
"the",
"URL",
"with",
"the",
"supplied",
"server",
"name",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/RequestUtils.java#L54-L69 |
39,176 | samskivert/samskivert | src/main/java/com/samskivert/servlet/util/RequestUtils.java | RequestUtils.getServletURL | public static String getServletURL (HttpServletRequest req, String path)
{
StringBuffer buf = req.getRequestURL();
String sname = req.getServletPath();
buf.delete(buf.length() - sname.length(), buf.length());
if (!path.startsWith("/")) {
buf.append("/");
}
... | java | public static String getServletURL (HttpServletRequest req, String path)
{
StringBuffer buf = req.getRequestURL();
String sname = req.getServletPath();
buf.delete(buf.length() - sname.length(), buf.length());
if (!path.startsWith("/")) {
buf.append("/");
}
... | [
"public",
"static",
"String",
"getServletURL",
"(",
"HttpServletRequest",
"req",
",",
"String",
"path",
")",
"{",
"StringBuffer",
"buf",
"=",
"req",
".",
"getRequestURL",
"(",
")",
";",
"String",
"sname",
"=",
"req",
".",
"getServletPath",
"(",
")",
";",
"... | Prepends the server, port and servlet context path to the supplied
path, resulting in a fully-formed URL for requesting a servlet. | [
"Prepends",
"the",
"server",
"port",
"and",
"servlet",
"context",
"path",
"to",
"the",
"supplied",
"path",
"resulting",
"in",
"a",
"fully",
"-",
"formed",
"URL",
"for",
"requesting",
"a",
"servlet",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/RequestUtils.java#L75-L85 |
39,177 | samskivert/samskivert | src/main/java/com/samskivert/swing/ObjectEditorTable.java | ObjectEditorTable.insertDatum | public void insertDatum (Object element, int row)
{
_data.add(row, element);
_model.fireTableRowsInserted(row, row);
} | java | public void insertDatum (Object element, int row)
{
_data.add(row, element);
_model.fireTableRowsInserted(row, row);
} | [
"public",
"void",
"insertDatum",
"(",
"Object",
"element",
",",
"int",
"row",
")",
"{",
"_data",
".",
"add",
"(",
"row",
",",
"element",
")",
";",
"_model",
".",
"fireTableRowsInserted",
"(",
"row",
",",
"row",
")",
";",
"}"
] | Insert the specified element at the specified row. | [
"Insert",
"the",
"specified",
"element",
"at",
"the",
"specified",
"row",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/ObjectEditorTable.java#L217-L221 |
39,178 | samskivert/samskivert | src/main/java/com/samskivert/swing/ObjectEditorTable.java | ObjectEditorTable.updateDatum | public void updateDatum (Object element, int row)
{
_data.set(row, element);
_model.fireTableRowsUpdated(row, row);
} | java | public void updateDatum (Object element, int row)
{
_data.set(row, element);
_model.fireTableRowsUpdated(row, row);
} | [
"public",
"void",
"updateDatum",
"(",
"Object",
"element",
",",
"int",
"row",
")",
"{",
"_data",
".",
"set",
"(",
"row",
",",
"element",
")",
";",
"_model",
".",
"fireTableRowsUpdated",
"(",
"row",
",",
"row",
")",
";",
"}"
] | Change the value of the specified row. | [
"Change",
"the",
"value",
"of",
"the",
"specified",
"row",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/ObjectEditorTable.java#L226-L230 |
39,179 | samskivert/samskivert | src/main/java/com/samskivert/swing/ObjectEditorTable.java | ObjectEditorTable.removeDatum | public void removeDatum (Object element)
{
int dex = _data.indexOf(element);
if (dex != -1) {
removeDatum(dex);
}
} | java | public void removeDatum (Object element)
{
int dex = _data.indexOf(element);
if (dex != -1) {
removeDatum(dex);
}
} | [
"public",
"void",
"removeDatum",
"(",
"Object",
"element",
")",
"{",
"int",
"dex",
"=",
"_data",
".",
"indexOf",
"(",
"element",
")",
";",
"if",
"(",
"dex",
"!=",
"-",
"1",
")",
"{",
"removeDatum",
"(",
"dex",
")",
";",
"}",
"}"
] | Remove the specified element from the set of data. | [
"Remove",
"the",
"specified",
"element",
"from",
"the",
"set",
"of",
"data",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/ObjectEditorTable.java#L235-L241 |
39,180 | samskivert/samskivert | src/main/java/com/samskivert/servlet/HttpErrorException.java | HttpErrorException.getErrorMessage | public String getErrorMessage ()
{
String msg = getMessage();
return String.valueOf(_errorCode).equals(msg) ? null : msg;
} | java | public String getErrorMessage ()
{
String msg = getMessage();
return String.valueOf(_errorCode).equals(msg) ? null : msg;
} | [
"public",
"String",
"getErrorMessage",
"(",
")",
"{",
"String",
"msg",
"=",
"getMessage",
"(",
")",
";",
"return",
"String",
".",
"valueOf",
"(",
"_errorCode",
")",
".",
"equals",
"(",
"msg",
")",
"?",
"null",
":",
"msg",
";",
"}"
] | Returns the textual error message supplied with this exception or null
if only an error code was supplied. | [
"Returns",
"the",
"textual",
"error",
"message",
"supplied",
"with",
"this",
"exception",
"or",
"null",
"if",
"only",
"an",
"error",
"code",
"was",
"supplied",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/HttpErrorException.java#L44-L48 |
39,181 | samskivert/samskivert | src/main/java/com/samskivert/net/PathUtil.java | PathUtil.getCanonicalPathElements | public static String[] getCanonicalPathElements (File file)
throws IOException
{
file = file.getCanonicalFile();
// If we were a file, get its parent
if (!file.isDirectory()) {
file = file.getParentFile();
}
return file.getPath().split(File.separator);
... | java | public static String[] getCanonicalPathElements (File file)
throws IOException
{
file = file.getCanonicalFile();
// If we were a file, get its parent
if (!file.isDirectory()) {
file = file.getParentFile();
}
return file.getPath().split(File.separator);
... | [
"public",
"static",
"String",
"[",
"]",
"getCanonicalPathElements",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"file",
"=",
"file",
".",
"getCanonicalFile",
"(",
")",
";",
"// If we were a file, get its parent",
"if",
"(",
"!",
"file",
".",
"isDirec... | Gets the individual path elements building up the canonical path to the given file. | [
"Gets",
"the",
"individual",
"path",
"elements",
"building",
"up",
"the",
"canonical",
"path",
"to",
"the",
"given",
"file",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/net/PathUtil.java#L63-L74 |
39,182 | samskivert/samskivert | src/main/java/com/samskivert/net/PathUtil.java | PathUtil.computeRelativePath | public static String computeRelativePath (File file, File relativeTo)
throws IOException
{
String[] realDirs = getCanonicalPathElements(file);
String[] relativeToDirs = getCanonicalPathElements(relativeTo);
// Eliminate the common root
int common = 0;
for (; common <... | java | public static String computeRelativePath (File file, File relativeTo)
throws IOException
{
String[] realDirs = getCanonicalPathElements(file);
String[] relativeToDirs = getCanonicalPathElements(relativeTo);
// Eliminate the common root
int common = 0;
for (; common <... | [
"public",
"static",
"String",
"computeRelativePath",
"(",
"File",
"file",
",",
"File",
"relativeTo",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"realDirs",
"=",
"getCanonicalPathElements",
"(",
"file",
")",
";",
"String",
"[",
"]",
"relativeToDirs",
... | Computes a relative path between to Files
@param file the file we're referencing
@param relativeTo the path from which we want to refer to the file | [
"Computes",
"a",
"relative",
"path",
"between",
"to",
"Files"
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/net/PathUtil.java#L82-L109 |
39,183 | nextreports/nextreports-engine | src/ro/nextreports/engine/EngineProperties.java | EngineProperties.getRunPriority | public static int getRunPriority() {
String s = System.getProperty(RUN_PRIORITY_PROPERTY);
int priority = Thread.NORM_PRIORITY;
if (s != null) {
try {
priority = Integer.parseInt(s);
} catch (NumberFormatException ex) {
// priority remains... | java | public static int getRunPriority() {
String s = System.getProperty(RUN_PRIORITY_PROPERTY);
int priority = Thread.NORM_PRIORITY;
if (s != null) {
try {
priority = Integer.parseInt(s);
} catch (NumberFormatException ex) {
// priority remains... | [
"public",
"static",
"int",
"getRunPriority",
"(",
")",
"{",
"String",
"s",
"=",
"System",
".",
"getProperty",
"(",
"RUN_PRIORITY_PROPERTY",
")",
";",
"int",
"priority",
"=",
"Thread",
".",
"NORM_PRIORITY",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"tr... | Get priority for running next reports queries and exporters
@return priority for running next reports queries and exporters | [
"Get",
"priority",
"for",
"running",
"next",
"reports",
"queries",
"and",
"exporters"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/EngineProperties.java#L44-L55 |
39,184 | nextreports/nextreports-engine | src/ro/nextreports/engine/EngineProperties.java | EngineProperties.getRecordsYield | public static int getRecordsYield() {
String s = System.getProperty(RECORDS_YIELD_PROPERTY);
int records = Integer.MAX_VALUE;
if (s != null) {
try {
records = Integer.parseInt(s);
} catch (NumberFormatException ex) {
// records remains Int... | java | public static int getRecordsYield() {
String s = System.getProperty(RECORDS_YIELD_PROPERTY);
int records = Integer.MAX_VALUE;
if (s != null) {
try {
records = Integer.parseInt(s);
} catch (NumberFormatException ex) {
// records remains Int... | [
"public",
"static",
"int",
"getRecordsYield",
"(",
")",
"{",
"String",
"s",
"=",
"System",
".",
"getProperty",
"(",
"RECORDS_YIELD_PROPERTY",
")",
";",
"int",
"records",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"try"... | Get number of query records after the exporter waits a little to degrevate the processor
@return number of query records after the exporter waits a little to degrevate the processor | [
"Get",
"number",
"of",
"query",
"records",
"after",
"the",
"exporter",
"waits",
"a",
"little",
"to",
"degrevate",
"the",
"processor"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/EngineProperties.java#L61-L72 |
39,185 | nextreports/nextreports-engine | src/ro/nextreports/engine/EngineProperties.java | EngineProperties.getMillisYield | public static int getMillisYield() {
String s = System.getProperty(MILLIS_YIELD_PROPERTY);
int millis = DEFAULT_MILLIS_YIELD;
if (s != null) {
try {
millis = Integer.parseInt(s);
} catch (NumberFormatException ex) {
// records remains DEFA... | java | public static int getMillisYield() {
String s = System.getProperty(MILLIS_YIELD_PROPERTY);
int millis = DEFAULT_MILLIS_YIELD;
if (s != null) {
try {
millis = Integer.parseInt(s);
} catch (NumberFormatException ex) {
// records remains DEFA... | [
"public",
"static",
"int",
"getMillisYield",
"(",
")",
"{",
"String",
"s",
"=",
"System",
".",
"getProperty",
"(",
"MILLIS_YIELD_PROPERTY",
")",
";",
"int",
"millis",
"=",
"DEFAULT_MILLIS_YIELD",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"try",
"{",
"... | Get number of milliseconds the exporter will wait after RECORDS_YIELD are exported
@return number of milliseconds the exporter will wait after RECORDS_YIELD are exported | [
"Get",
"number",
"of",
"milliseconds",
"the",
"exporter",
"will",
"wait",
"after",
"RECORDS_YIELD",
"are",
"exported"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/EngineProperties.java#L78-L89 |
39,186 | nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/XlsExporter.java | XlsExporter.createSummaryInformation | public static void createSummaryInformation(String filePath, String title) {
if (filePath == null) {
return;
}
try {
File poiFilesystem = new File(filePath);
InputStream is = new FileInputStream(poiFilesystem);
POIFSFileSystem poifs = new POIFSFil... | java | public static void createSummaryInformation(String filePath, String title) {
if (filePath == null) {
return;
}
try {
File poiFilesystem = new File(filePath);
InputStream is = new FileInputStream(poiFilesystem);
POIFSFileSystem poifs = new POIFSFil... | [
"public",
"static",
"void",
"createSummaryInformation",
"(",
"String",
"filePath",
",",
"String",
"title",
")",
"{",
"if",
"(",
"filePath",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"File",
"poiFilesystem",
"=",
"new",
"File",
"(",
"filePath"... | is called also on the server | [
"is",
"called",
"also",
"on",
"the",
"server"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/XlsExporter.java#L165-L194 |
39,187 | samskivert/samskivert | src/main/java/com/samskivert/servlet/SiteResourceLoader.java | SiteResourceLoader.getSiteClassLoader | public ClassLoader getSiteClassLoader (int siteId)
throws IOException
{
// synchronize on the lock to ensure that only one thread per site
// is concurrently executing
synchronized (getLock(siteId)) {
// see if we've already got one
ClassLoader loader = _loade... | java | public ClassLoader getSiteClassLoader (int siteId)
throws IOException
{
// synchronize on the lock to ensure that only one thread per site
// is concurrently executing
synchronized (getLock(siteId)) {
// see if we've already got one
ClassLoader loader = _loade... | [
"public",
"ClassLoader",
"getSiteClassLoader",
"(",
"int",
"siteId",
")",
"throws",
"IOException",
"{",
"// synchronize on the lock to ensure that only one thread per site",
"// is concurrently executing",
"synchronized",
"(",
"getLock",
"(",
"siteId",
")",
")",
"{",
"// see ... | Returns a class loader that loads resources from the site-specific
jar file for the specified site. If no site-specific jar file
exists for the specified site, null will be returned. | [
"Returns",
"a",
"class",
"loader",
"that",
"loads",
"resources",
"from",
"the",
"site",
"-",
"specific",
"jar",
"file",
"for",
"the",
"specified",
"site",
".",
"If",
"no",
"site",
"-",
"specific",
"jar",
"file",
"exists",
"for",
"the",
"specified",
"site",... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/SiteResourceLoader.java#L139-L166 |
39,188 | samskivert/samskivert | src/main/java/com/samskivert/servlet/SiteResourceLoader.java | SiteResourceLoader.getLock | protected Object getLock (int siteId)
{
Object lock = null;
synchronized (_locks) {
lock = _locks.get(siteId);
// create a lock object if we haven't one already
if (lock == null) {
_locks.put(siteId, lock = new Object());
}
}
... | java | protected Object getLock (int siteId)
{
Object lock = null;
synchronized (_locks) {
lock = _locks.get(siteId);
// create a lock object if we haven't one already
if (lock == null) {
_locks.put(siteId, lock = new Object());
}
}
... | [
"protected",
"Object",
"getLock",
"(",
"int",
"siteId",
")",
"{",
"Object",
"lock",
"=",
"null",
";",
"synchronized",
"(",
"_locks",
")",
"{",
"lock",
"=",
"_locks",
".",
"get",
"(",
"siteId",
")",
";",
"// create a lock object if we haven't one already",
"if"... | We synchronize on a per-site basis, but we use a separate lock
object for each site so that the process of loading a bundle for
the first time does not require blocking access to resources from
other sites. | [
"We",
"synchronize",
"on",
"a",
"per",
"-",
"site",
"basis",
"but",
"we",
"use",
"a",
"separate",
"lock",
"object",
"for",
"each",
"site",
"so",
"that",
"the",
"process",
"of",
"loading",
"a",
"bundle",
"for",
"the",
"first",
"time",
"does",
"not",
"re... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/SiteResourceLoader.java#L180-L194 |
39,189 | samskivert/samskivert | src/main/java/com/samskivert/servlet/SiteResourceLoader.java | SiteResourceLoader.getBundle | protected SiteResourceBundle getBundle (int siteId)
throws IOException
{
// look up the site resource bundle for this site
SiteResourceBundle bundle = _bundles.get(siteId);
// if we haven't got one, create one
if (bundle == null) {
// obtain the string identifier... | java | protected SiteResourceBundle getBundle (int siteId)
throws IOException
{
// look up the site resource bundle for this site
SiteResourceBundle bundle = _bundles.get(siteId);
// if we haven't got one, create one
if (bundle == null) {
// obtain the string identifier... | [
"protected",
"SiteResourceBundle",
"getBundle",
"(",
"int",
"siteId",
")",
"throws",
"IOException",
"{",
"// look up the site resource bundle for this site",
"SiteResourceBundle",
"bundle",
"=",
"_bundles",
".",
"get",
"(",
"siteId",
")",
";",
"// if we haven't got one, cre... | Obtains the site-specific jar file for the specified site. This
should only be called when the lock for this site is held. | [
"Obtains",
"the",
"site",
"-",
"specific",
"jar",
"file",
"for",
"the",
"specified",
"site",
".",
"This",
"should",
"only",
"be",
"called",
"when",
"the",
"lock",
"for",
"this",
"site",
"is",
"held",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/SiteResourceLoader.java#L200-L220 |
39,190 | samskivert/samskivert | src/main/java/com/samskivert/util/Interval.java | Interval.create | public static Interval create (RunQueue runQueue, final Runnable onExpired)
{
// we could probably avoid all the wacky machinations internal to Interval that do the
// runbuddy reposting and whatever and just create a non-runqueue interval that posts the
// supplied runnable to the runqueue ... | java | public static Interval create (RunQueue runQueue, final Runnable onExpired)
{
// we could probably avoid all the wacky machinations internal to Interval that do the
// runbuddy reposting and whatever and just create a non-runqueue interval that posts the
// supplied runnable to the runqueue ... | [
"public",
"static",
"Interval",
"create",
"(",
"RunQueue",
"runQueue",
",",
"final",
"Runnable",
"onExpired",
")",
"{",
"// we could probably avoid all the wacky machinations internal to Interval that do the",
"// runbuddy reposting and whatever and just create a non-runqueue interval th... | Creates an interval that executes the supplied runnable on the specified RunQueue when it
expires. | [
"Creates",
"an",
"interval",
"that",
"executes",
"the",
"supplied",
"runnable",
"on",
"the",
"specified",
"RunQueue",
"when",
"it",
"expires",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Interval.java#L80-L93 |
39,191 | samskivert/samskivert | src/main/java/com/samskivert/util/Interval.java | Interval.cancel | public final void cancel ()
{
IntervalTask task = _task;
if (task != null) {
_task = null;
task.cancel();
}
} | java | public final void cancel ()
{
IntervalTask task = _task;
if (task != null) {
_task = null;
task.cancel();
}
} | [
"public",
"final",
"void",
"cancel",
"(",
")",
"{",
"IntervalTask",
"task",
"=",
"_task",
";",
"if",
"(",
"task",
"!=",
"null",
")",
"{",
"_task",
"=",
"null",
";",
"task",
".",
"cancel",
"(",
")",
";",
"}",
"}"
] | Cancel the current schedule, and ensure that any expirations that are queued up but have not
yet run do not run. | [
"Cancel",
"the",
"current",
"schedule",
"and",
"ensure",
"that",
"any",
"expirations",
"that",
"are",
"queued",
"up",
"but",
"have",
"not",
"yet",
"run",
"do",
"not",
"run",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Interval.java#L214-L221 |
39,192 | samskivert/samskivert | src/main/java/com/samskivert/net/MailUtil.java | MailUtil.deliverMail | public static void deliverMail (String recipient, String sender,
String subject, String body)
throws IOException
{
deliverMail(new String[] { recipient }, sender, subject, body);
} | java | public static void deliverMail (String recipient, String sender,
String subject, String body)
throws IOException
{
deliverMail(new String[] { recipient }, sender, subject, body);
} | [
"public",
"static",
"void",
"deliverMail",
"(",
"String",
"recipient",
",",
"String",
"sender",
",",
"String",
"subject",
",",
"String",
"body",
")",
"throws",
"IOException",
"{",
"deliverMail",
"(",
"new",
"String",
"[",
"]",
"{",
"recipient",
"}",
",",
"... | Delivers the supplied mail message using the machine's local mail
SMTP server which must be listening on port 25.
@exception IOException thrown if an error occurs delivering the
email. See {@link Transport#send} for exceptions that can be thrown
due to response from the SMTP server. | [
"Delivers",
"the",
"supplied",
"mail",
"message",
"using",
"the",
"machine",
"s",
"local",
"mail",
"SMTP",
"server",
"which",
"must",
"be",
"listening",
"on",
"port",
"25",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/net/MailUtil.java#L64-L69 |
39,193 | samskivert/samskivert | src/main/java/com/samskivert/net/MailUtil.java | MailUtil.deliverMail | public static void deliverMail (String[] recipients, String sender,
String subject, String body,
String[] headers, String[] values)
throws IOException
{
if (recipients == null || recipients.length < 1) {
throw new IO... | java | public static void deliverMail (String[] recipients, String sender,
String subject, String body,
String[] headers, String[] values)
throws IOException
{
if (recipients == null || recipients.length < 1) {
throw new IO... | [
"public",
"static",
"void",
"deliverMail",
"(",
"String",
"[",
"]",
"recipients",
",",
"String",
"sender",
",",
"String",
"subject",
",",
"String",
"body",
",",
"String",
"[",
"]",
"headers",
",",
"String",
"[",
"]",
"values",
")",
"throws",
"IOException",... | Delivers the supplied mail, with the specified additional headers. | [
"Delivers",
"the",
"supplied",
"mail",
"with",
"the",
"specified",
"additional",
"headers",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/net/MailUtil.java#L91-L117 |
39,194 | samskivert/samskivert | src/main/java/com/samskivert/net/MailUtil.java | MailUtil.deliverMail | public static void deliverMail (String[] recipients, String sender,
String subject, MimeMessage message)
throws IOException
{
checkCreateSession();
try {
message.setFrom(new InternetAddress(sender));
for (String recipient : recipien... | java | public static void deliverMail (String[] recipients, String sender,
String subject, MimeMessage message)
throws IOException
{
checkCreateSession();
try {
message.setFrom(new InternetAddress(sender));
for (String recipient : recipien... | [
"public",
"static",
"void",
"deliverMail",
"(",
"String",
"[",
"]",
"recipients",
",",
"String",
"sender",
",",
"String",
"subject",
",",
"MimeMessage",
"message",
")",
"throws",
"IOException",
"{",
"checkCreateSession",
"(",
")",
";",
"try",
"{",
"message",
... | Delivers an already-formed message to the specified recipients. This
message can be any mime type including multipart. | [
"Delivers",
"an",
"already",
"-",
"formed",
"message",
"to",
"the",
"specified",
"recipients",
".",
"This",
"message",
"can",
"be",
"any",
"mime",
"type",
"including",
"multipart",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/net/MailUtil.java#L123-L161 |
39,195 | samskivert/samskivert | src/main/java/com/samskivert/net/MailUtil.java | MailUtil.checkCreateSession | protected static void checkCreateSession ()
{
if (_defaultSession == null) { // no need to sync
Properties props = System.getProperties();
if (props.getProperty("mail.smtp.host") == null) {
props.put("mail.smtp.host", "localhost");
}
_defaultSe... | java | protected static void checkCreateSession ()
{
if (_defaultSession == null) { // no need to sync
Properties props = System.getProperties();
if (props.getProperty("mail.smtp.host") == null) {
props.put("mail.smtp.host", "localhost");
}
_defaultSe... | [
"protected",
"static",
"void",
"checkCreateSession",
"(",
")",
"{",
"if",
"(",
"_defaultSession",
"==",
"null",
")",
"{",
"// no need to sync",
"Properties",
"props",
"=",
"System",
".",
"getProperties",
"(",
")",
";",
"if",
"(",
"props",
".",
"getProperty",
... | Create our default session if not already created. | [
"Create",
"our",
"default",
"session",
"if",
"not",
"already",
"created",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/net/MailUtil.java#L175-L184 |
39,196 | samskivert/samskivert | src/main/java/com/samskivert/velocity/InvocationContext.java | InvocationContext.getTemplate | public Template getTemplate (String path, String encoding)
throws Exception
{
Object siteId = get("__siteid__");
if (siteId != null) {
path = siteId + ":" + path;
}
if (encoding == null) {
return RuntimeSingleton.getRuntimeServices().getTemplate(path);... | java | public Template getTemplate (String path, String encoding)
throws Exception
{
Object siteId = get("__siteid__");
if (siteId != null) {
path = siteId + ":" + path;
}
if (encoding == null) {
return RuntimeSingleton.getRuntimeServices().getTemplate(path);... | [
"public",
"Template",
"getTemplate",
"(",
"String",
"path",
",",
"String",
"encoding",
")",
"throws",
"Exception",
"{",
"Object",
"siteId",
"=",
"get",
"(",
"\"__siteid__\"",
")",
";",
"if",
"(",
"siteId",
"!=",
"null",
")",
"{",
"path",
"=",
"siteId",
"... | Fetches a Velocity template that can be used for later formatting. The template is read with
the specified encoding or the default encoding if encoding is null.
@exception Exception thrown if an error occurs loading or parsing the template. | [
"Fetches",
"a",
"Velocity",
"template",
"that",
"can",
"be",
"used",
"for",
"later",
"formatting",
".",
"The",
"template",
"is",
"read",
"with",
"the",
"specified",
"encoding",
"or",
"the",
"default",
"encoding",
"if",
"encoding",
"is",
"null",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/InvocationContext.java#L57-L69 |
39,197 | samskivert/samskivert | src/main/java/com/samskivert/velocity/InvocationContext.java | InvocationContext.putAllParameters | @Deprecated
public void putAllParameters ()
{
Enumeration<?> e = _req.getParameterNames();
while (e.hasMoreElements()) {
String param = (String)e.nextElement();
put(param, _req.getParameter(param));
}
} | java | @Deprecated
public void putAllParameters ()
{
Enumeration<?> e = _req.getParameterNames();
while (e.hasMoreElements()) {
String param = (String)e.nextElement();
put(param, _req.getParameter(param));
}
} | [
"@",
"Deprecated",
"public",
"void",
"putAllParameters",
"(",
")",
"{",
"Enumeration",
"<",
"?",
">",
"e",
"=",
"_req",
".",
"getParameterNames",
"(",
")",
";",
"while",
"(",
"e",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"String",
"param",
"=",
"(",... | Don't use this method. It is terribly unsafe and was written by a lazy engineer. | [
"Don",
"t",
"use",
"this",
"method",
".",
"It",
"is",
"terribly",
"unsafe",
"and",
"was",
"written",
"by",
"a",
"lazy",
"engineer",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/InvocationContext.java#L101-L109 |
39,198 | samskivert/samskivert | src/main/java/com/samskivert/velocity/InvocationContext.java | InvocationContext.encodeAllParameters | public String encodeAllParameters ()
{
StringBuilder buf = new StringBuilder();
Enumeration<?> e = _req.getParameterNames();
while (e.hasMoreElements()) {
if (buf.length() > 0) {
buf.append('&');
}
String param = (String) e.nextElement();
... | java | public String encodeAllParameters ()
{
StringBuilder buf = new StringBuilder();
Enumeration<?> e = _req.getParameterNames();
while (e.hasMoreElements()) {
if (buf.length() > 0) {
buf.append('&');
}
String param = (String) e.nextElement();
... | [
"public",
"String",
"encodeAllParameters",
"(",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Enumeration",
"<",
"?",
">",
"e",
"=",
"_req",
".",
"getParameterNames",
"(",
")",
";",
"while",
"(",
"e",
".",
"hasMoreElements"... | Encodes all the request params so they can be slapped onto a different URL which is useful
when doing redirects. | [
"Encodes",
"all",
"the",
"request",
"params",
"so",
"they",
"can",
"be",
"slapped",
"onto",
"a",
"different",
"URL",
"which",
"is",
"useful",
"when",
"doing",
"redirects",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/InvocationContext.java#L115-L130 |
39,199 | samskivert/samskivert | src/main/java/com/samskivert/jdbc/LiaisonRegistry.java | LiaisonRegistry.getLiaison | public static DatabaseLiaison getLiaison (String url)
{
if (url == null) throw new NullPointerException("URL must not be null");
// see if we already have a liaison mapped for this connection
DatabaseLiaison liaison = _mappings.get(url);
if (liaison == null) {
// scan the... | java | public static DatabaseLiaison getLiaison (String url)
{
if (url == null) throw new NullPointerException("URL must not be null");
// see if we already have a liaison mapped for this connection
DatabaseLiaison liaison = _mappings.get(url);
if (liaison == null) {
// scan the... | [
"public",
"static",
"DatabaseLiaison",
"getLiaison",
"(",
"String",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"URL must not be null\"",
")",
";",
"// see if we already have a liaison mapped for this connection",
... | Fetch the appropriate database liaison for the supplied URL, which should be the same string
that would be used to configure a connection to the database. | [
"Fetch",
"the",
"appropriate",
"database",
"liaison",
"for",
"the",
"supplied",
"URL",
"which",
"should",
"be",
"the",
"same",
"string",
"that",
"would",
"be",
"used",
"to",
"configure",
"a",
"connection",
"to",
"the",
"database",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/LiaisonRegistry.java#L26-L51 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.