repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/AbstractIndex.java | AbstractIndex.storeBuffer | protected void storeBuffer()
{
if (buffer != null && buffer.length() > insertStatement.length()) {
if(!insertStatement.isEmpty()) {
//only do this in SQL/DATABASE MODE
this.buffer.append(";");
}
bufferList.add(buffer);
}
this.buffer = new StringBuilder();
this.buffer.append(insertStatement);... | java | protected void storeBuffer()
{
if (buffer != null && buffer.length() > insertStatement.length()) {
if(!insertStatement.isEmpty()) {
//only do this in SQL/DATABASE MODE
this.buffer.append(";");
}
bufferList.add(buffer);
}
this.buffer = new StringBuilder();
this.buffer.append(insertStatement);... | [
"protected",
"void",
"storeBuffer",
"(",
")",
"{",
"if",
"(",
"buffer",
"!=",
"null",
"&&",
"buffer",
".",
"length",
"(",
")",
">",
"insertStatement",
".",
"length",
"(",
")",
")",
"{",
"if",
"(",
"!",
"insertStatement",
".",
"isEmpty",
"(",
")",
")"... | Finalizes the query in the currently used buffer and creates a new one.
The finalized query will be added to the list of queries. | [
"Finalizes",
"the",
"query",
"in",
"the",
"currently",
"used",
"buffer",
"and",
"creates",
"a",
"new",
"one",
".",
"The",
"finalized",
"query",
"will",
"be",
"added",
"to",
"the",
"list",
"of",
"queries",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/AbstractIndex.java#L126-L139 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/SpanManager.java | SpanManager.enableSrcPosCalculation | public void enableSrcPosCalculation(){
calculateSrcPositions = true;
final int len = sb.length();
ib = new ArrayList<Integer>(len);
for( int i=0; i<len; i++) ib.add( i );
} | java | public void enableSrcPosCalculation(){
calculateSrcPositions = true;
final int len = sb.length();
ib = new ArrayList<Integer>(len);
for( int i=0; i<len; i++) ib.add( i );
} | [
"public",
"void",
"enableSrcPosCalculation",
"(",
")",
"{",
"calculateSrcPositions",
"=",
"true",
";",
"final",
"int",
"len",
"=",
"sb",
".",
"length",
"(",
")",
";",
"ib",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
"len",
")",
";",
"for",
"(",... | Enables the Calculation of Src Position. The base for these position
will be the aktual, not the initial, String wich is uses as Base for
the SpanManager. | [
"Enables",
"the",
"Calculation",
"of",
"Src",
"Position",
".",
"The",
"base",
"for",
"these",
"position",
"will",
"be",
"the",
"aktual",
"not",
"the",
"initial",
"String",
"wich",
"is",
"uses",
"as",
"Base",
"for",
"the",
"SpanManager",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.parser/src/main/java/de/tudarmstadt/ukp/wikipedia/parser/mediawiki/SpanManager.java#L55-L60 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Category.java | Category.getSiblings | public Set<Category> getSiblings() {
Set<Category> siblings = new HashSet<Category>();
// add siblings
for (Category parent : this.getParents()) {
siblings.addAll(parent.getChildren());
}
// remove this category from list
siblings.remove(this);
retu... | java | public Set<Category> getSiblings() {
Set<Category> siblings = new HashSet<Category>();
// add siblings
for (Category parent : this.getParents()) {
siblings.addAll(parent.getChildren());
}
// remove this category from list
siblings.remove(this);
retu... | [
"public",
"Set",
"<",
"Category",
">",
"getSiblings",
"(",
")",
"{",
"Set",
"<",
"Category",
">",
"siblings",
"=",
"new",
"HashSet",
"<",
"Category",
">",
"(",
")",
";",
"// add siblings",
"for",
"(",
"Category",
"parent",
":",
"this",
".",
"getParents",... | Returns the siblings of this category.
@return Returns the siblings of this category or null, if there are none. | [
"Returns",
"the",
"siblings",
"of",
"this",
"category",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Category.java#L356-L368 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/util/WikipediaXMLWriter.java | WikipediaXMLWriter.writeDiff | public void writeDiff(final Task<Diff> diff, final int start)
throws IOException
{
int size = diff.size();
Diff d;
String previousRevision = null, currentRevision = null;
this.writer
.write(WikipediaXMLKeys.KEY_START_PAGE.getKeyword() + "\r\n");
ArticleInformation header = diff.getHeader();
this.... | java | public void writeDiff(final Task<Diff> diff, final int start)
throws IOException
{
int size = diff.size();
Diff d;
String previousRevision = null, currentRevision = null;
this.writer
.write(WikipediaXMLKeys.KEY_START_PAGE.getKeyword() + "\r\n");
ArticleInformation header = diff.getHeader();
this.... | [
"public",
"void",
"writeDiff",
"(",
"final",
"Task",
"<",
"Diff",
">",
"diff",
",",
"final",
"int",
"start",
")",
"throws",
"IOException",
"{",
"int",
"size",
"=",
"diff",
".",
"size",
"(",
")",
";",
"Diff",
"d",
";",
"String",
"previousRevision",
"=",... | Writes a part of the diff task, starting with the given element, to the
output using wikipedia xml notation.
@param diff
Reference to a diff task
@param start
Position of the start element
@throws IOException
if an error occurs while writing the output | [
"Writes",
"a",
"part",
"of",
"the",
"diff",
"task",
"starting",
"with",
"the",
"given",
"element",
"to",
"the",
"output",
"using",
"wikipedia",
"xml",
"notation",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/util/WikipediaXMLWriter.java#L89-L155 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/util/Surrogates.java | Surrogates.scan | public static boolean scan(final char[] input)
{
int surLow = 0xD800;
int surHgh = 0xDFFF;
int end = input.length;
for (int i = 0; i < end; i++) {
if ((int) input[i] >= surLow && input[i] <= surHgh) {
return true;
}
}
return false;
} | java | public static boolean scan(final char[] input)
{
int surLow = 0xD800;
int surHgh = 0xDFFF;
int end = input.length;
for (int i = 0; i < end; i++) {
if ((int) input[i] >= surLow && input[i] <= surHgh) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"scan",
"(",
"final",
"char",
"[",
"]",
"input",
")",
"{",
"int",
"surLow",
"=",
"0xD800",
";",
"int",
"surHgh",
"=",
"0xDFFF",
";",
"int",
"end",
"=",
"input",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Returns whether a surrogate character was contained in the specified
input.
@param input
input
@return if a surrogate character was contained or not | [
"Returns",
"whether",
"a",
"surrogate",
"character",
"was",
"contained",
"in",
"the",
"specified",
"input",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/util/Surrogates.java#L42-L56 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/util/Surrogates.java | Surrogates.replace | public static char[] replace(final char[] input)
{
int surLow = 0xD800;
int surHgh = 0xDFFF;
int end = input.length;
char[] output = new char[end];
for (int i = 0; i < end; i++) {
if ((int) input[i] >= surLow && input[i] <= surHgh) {
output[i] = '?';
}
else {
output[i] = input[i];
}
... | java | public static char[] replace(final char[] input)
{
int surLow = 0xD800;
int surHgh = 0xDFFF;
int end = input.length;
char[] output = new char[end];
for (int i = 0; i < end; i++) {
if ((int) input[i] >= surLow && input[i] <= surHgh) {
output[i] = '?';
}
else {
output[i] = input[i];
}
... | [
"public",
"static",
"char",
"[",
"]",
"replace",
"(",
"final",
"char",
"[",
"]",
"input",
")",
"{",
"int",
"surLow",
"=",
"0xD800",
";",
"int",
"surHgh",
"=",
"0xDFFF",
";",
"int",
"end",
"=",
"input",
".",
"length",
";",
"char",
"[",
"]",
"output"... | Replaces all surrogates characters with '?'.
@param input
input
@return input with '?' instead of surrogates characters | [
"Replaces",
"all",
"surrogates",
"characters",
"with",
"?",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/util/Surrogates.java#L65-L84 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java | ArticleConsumerLogMessages.logArticleRead | public static void logArticleRead(final Logger logger,
final Task<Revision> article, final long time, final long position)
{
logger.logMessage(Level.INFO, "Read article\t" + Time.toClock(time)
+ "\t" + article.toString() + "\t" + position);
} | java | public static void logArticleRead(final Logger logger,
final Task<Revision> article, final long time, final long position)
{
logger.logMessage(Level.INFO, "Read article\t" + Time.toClock(time)
+ "\t" + article.toString() + "\t" + position);
} | [
"public",
"static",
"void",
"logArticleRead",
"(",
"final",
"Logger",
"logger",
",",
"final",
"Task",
"<",
"Revision",
">",
"article",
",",
"final",
"long",
"time",
",",
"final",
"long",
"position",
")",
"{",
"logger",
".",
"logMessage",
"(",
"Level",
".",... | Logs the reading of an revision task.
@param logger
reference to the logger
@param article
reference to the revision task
@param time
time needed for the operation
@param position
input file position | [
"Logs",
"the",
"reading",
"of",
"an",
"revision",
"task",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java#L88-L94 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java | ArticleConsumerLogMessages.logErrorRetrieveArchive | public static void logErrorRetrieveArchive(final Logger logger,
final ArchiveDescription archive, final Error e)
{
logger.logError(Level.ERROR, "Error while accessing archive "
+ archive.toString(), e);
} | java | public static void logErrorRetrieveArchive(final Logger logger,
final ArchiveDescription archive, final Error e)
{
logger.logError(Level.ERROR, "Error while accessing archive "
+ archive.toString(), e);
} | [
"public",
"static",
"void",
"logErrorRetrieveArchive",
"(",
"final",
"Logger",
"logger",
",",
"final",
"ArchiveDescription",
"archive",
",",
"final",
"Error",
"e",
")",
"{",
"logger",
".",
"logError",
"(",
"Level",
".",
"ERROR",
",",
"\"Error while accessing archi... | Logs the occurance of an error while retrieving the input file.
@param logger
reference to the logger
@param archive
reference to the archive
@param e
reference to the error | [
"Logs",
"the",
"occurance",
"of",
"an",
"error",
"while",
"retrieving",
"the",
"input",
"file",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java#L106-L112 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java | ArticleConsumerLogMessages.logExceptionRetrieveArchive | public static void logExceptionRetrieveArchive(final Logger logger,
final ArchiveDescription archive, final Exception e)
{
logger.logException(Level.ERROR, "Exception while accessing archive "
+ archive.toString(), e);
} | java | public static void logExceptionRetrieveArchive(final Logger logger,
final ArchiveDescription archive, final Exception e)
{
logger.logException(Level.ERROR, "Exception while accessing archive "
+ archive.toString(), e);
} | [
"public",
"static",
"void",
"logExceptionRetrieveArchive",
"(",
"final",
"Logger",
"logger",
",",
"final",
"ArchiveDescription",
"archive",
",",
"final",
"Exception",
"e",
")",
"{",
"logger",
".",
"logException",
"(",
"Level",
".",
"ERROR",
",",
"\"Exception while... | Logs the occurance of an exception while retrieving the input file.
@param logger
reference to the logger
@param archive
reference to the archive
@param e
reference to the exception | [
"Logs",
"the",
"occurance",
"of",
"an",
"exception",
"while",
"retrieving",
"the",
"input",
"file",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java#L124-L130 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java | ArticleConsumerLogMessages.logNoMoreArticles | public static void logNoMoreArticles(final Logger logger,
final ArchiveDescription archive)
{
logger.logMessage(Level.INFO, "Archive " + archive.toString()
+ " contains no more articles");
} | java | public static void logNoMoreArticles(final Logger logger,
final ArchiveDescription archive)
{
logger.logMessage(Level.INFO, "Archive " + archive.toString()
+ " contains no more articles");
} | [
"public",
"static",
"void",
"logNoMoreArticles",
"(",
"final",
"Logger",
"logger",
",",
"final",
"ArchiveDescription",
"archive",
")",
"{",
"logger",
".",
"logMessage",
"(",
"Level",
".",
"INFO",
",",
"\"Archive \"",
"+",
"archive",
".",
"toString",
"(",
")",
... | Logs that no more articles are available.
@param logger
reference to the logger
@param archive
reference to the archive descriptor | [
"Logs",
"that",
"no",
"more",
"articles",
"are",
"available",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java#L168-L174 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java | ArticleConsumerLogMessages.logReadTaskException | public static void logReadTaskException(final Logger logger,
final Task<Revision> task, final Exception e)
{
if (task != null) {
logger.logException(Level.ERROR, "Error while reading a task: "
+ task.toString(), e);
}
else {
logger.logException(Level.ERROR,
"Error while reading an unknown tas... | java | public static void logReadTaskException(final Logger logger,
final Task<Revision> task, final Exception e)
{
if (task != null) {
logger.logException(Level.ERROR, "Error while reading a task: "
+ task.toString(), e);
}
else {
logger.logException(Level.ERROR,
"Error while reading an unknown tas... | [
"public",
"static",
"void",
"logReadTaskException",
"(",
"final",
"Logger",
"logger",
",",
"final",
"Task",
"<",
"Revision",
">",
"task",
",",
"final",
"Exception",
"e",
")",
"{",
"if",
"(",
"task",
"!=",
"null",
")",
"{",
"logger",
".",
"logException",
... | Logs an occurance of an exception while reading a task.
@param logger
reference to the logger
@param task
reference to the task
@param e
reference to the exception | [
"Logs",
"an",
"occurance",
"of",
"an",
"exception",
"while",
"reading",
"a",
"task",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java#L186-L198 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java | ArticleConsumerLogMessages.logStatus | public static void logStatus(final Logger logger,
final ArticleReaderInterface articleReader, final long startTime,
final long sleepingTime, final long workingTime)
{
String message = "Consumer-Status-Report ["
+ Time.toClock(System.currentTimeMillis() - startTime) + "]";
if (articleReader != null) {
... | java | public static void logStatus(final Logger logger,
final ArticleReaderInterface articleReader, final long startTime,
final long sleepingTime, final long workingTime)
{
String message = "Consumer-Status-Report ["
+ Time.toClock(System.currentTimeMillis() - startTime) + "]";
if (articleReader != null) {
... | [
"public",
"static",
"void",
"logStatus",
"(",
"final",
"Logger",
"logger",
",",
"final",
"ArticleReaderInterface",
"articleReader",
",",
"final",
"long",
"startTime",
",",
"final",
"long",
"sleepingTime",
",",
"final",
"long",
"workingTime",
")",
"{",
"String",
... | Logs the status of the article consumer.
@param logger
reference to the logger
@param articleReader
reference to the ArticleReader
@param startTime
start time
@param sleepingTime
time the consumer has slept
@param workingTime
time the consumer was working | [
"Logs",
"the",
"status",
"of",
"the",
"article",
"consumer",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java#L250-L268 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java | ArticleConsumerLogMessages.logTaskReaderException | public static void logTaskReaderException(final Logger logger,
final ArticleReaderException e)
{
logger.logException(Level.ERROR, "TaskReaderException", e);
} | java | public static void logTaskReaderException(final Logger logger,
final ArticleReaderException e)
{
logger.logException(Level.ERROR, "TaskReaderException", e);
} | [
"public",
"static",
"void",
"logTaskReaderException",
"(",
"final",
"Logger",
"logger",
",",
"final",
"ArticleReaderException",
"e",
")",
"{",
"logger",
".",
"logException",
"(",
"Level",
".",
"ERROR",
",",
"\"TaskReaderException\"",
",",
"e",
")",
";",
"}"
] | Logs the occurance of an ArticleReaderException.
@param logger
reference to the logger
@param e
reference to the exception | [
"Logs",
"the",
"occurance",
"of",
"an",
"ArticleReaderException",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/ArticleConsumerLogMessages.java#L278-L283 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/SQLConsumerLogMessages.java | SQLConsumerLogMessages.logDiffProcessed | public static void logDiffProcessed(final Logger logger,
final Task<Diff> diff, final long time)
{
logger.logMessage(
Level.INFO,
"Generated Entry\t" + Time.toClock(time) + "\t"
+ diff.toString());
} | java | public static void logDiffProcessed(final Logger logger,
final Task<Diff> diff, final long time)
{
logger.logMessage(
Level.INFO,
"Generated Entry\t" + Time.toClock(time) + "\t"
+ diff.toString());
} | [
"public",
"static",
"void",
"logDiffProcessed",
"(",
"final",
"Logger",
"logger",
",",
"final",
"Task",
"<",
"Diff",
">",
"diff",
",",
"final",
"long",
"time",
")",
"{",
"logger",
".",
"logMessage",
"(",
"Level",
".",
"INFO",
",",
"\"Generated Entry\\t\"",
... | Logs the processing of a diff task.
@param logger
reference to the logger
@param diff
reference to the task
@param time
time | [
"Logs",
"the",
"processing",
"of",
"a",
"diff",
"task",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/SQLConsumerLogMessages.java#L46-L54 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/SQLConsumerLogMessages.java | SQLConsumerLogMessages.logFileCreation | public static void logFileCreation(final Logger logger, final String path)
{
logger.logMessage(Level.INFO, "New File created:\t" + path);
} | java | public static void logFileCreation(final Logger logger, final String path)
{
logger.logMessage(Level.INFO, "New File created:\t" + path);
} | [
"public",
"static",
"void",
"logFileCreation",
"(",
"final",
"Logger",
"logger",
",",
"final",
"String",
"path",
")",
"{",
"logger",
".",
"logMessage",
"(",
"Level",
".",
"INFO",
",",
"\"New File created:\\t\"",
"+",
"path",
")",
";",
"}"
] | Logs the creation of an output file.
@param logger
reference to the logger
@param path
path of the output file | [
"Logs",
"the",
"creation",
"of",
"an",
"output",
"file",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/SQLConsumerLogMessages.java#L64-L68 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/SQLConsumerLogMessages.java | SQLConsumerLogMessages.logReadTaskOutOfMemoryError | public static void logReadTaskOutOfMemoryError(final Logger logger,
final Task<Diff> task, final OutOfMemoryError e)
{
if (task != null) {
logger.logError(Level.WARN, "Error while reading a task: "
+ task.toString(), e);
}
else {
logger.logError(Level.WARN,
"Error while reading an unknown tas... | java | public static void logReadTaskOutOfMemoryError(final Logger logger,
final Task<Diff> task, final OutOfMemoryError e)
{
if (task != null) {
logger.logError(Level.WARN, "Error while reading a task: "
+ task.toString(), e);
}
else {
logger.logError(Level.WARN,
"Error while reading an unknown tas... | [
"public",
"static",
"void",
"logReadTaskOutOfMemoryError",
"(",
"final",
"Logger",
"logger",
",",
"final",
"Task",
"<",
"Diff",
">",
"task",
",",
"final",
"OutOfMemoryError",
"e",
")",
"{",
"if",
"(",
"task",
"!=",
"null",
")",
"{",
"logger",
".",
"logErro... | Logs the occurrence of an OutOfMemoryError while reading a task.
@param logger
reference to the logger
@param task
reference to the revision task
@param e
reference to the error | [
"Logs",
"the",
"occurrence",
"of",
"an",
"OutOfMemoryError",
"while",
"reading",
"a",
"task",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/SQLConsumerLogMessages.java#L80-L92 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/SQLConsumerLogMessages.java | SQLConsumerLogMessages.logSQLConsumerException | public static void logSQLConsumerException(final Logger logger,
final SQLConsumerException e)
{
logger.logException(Level.ERROR, "SQLConsumerException", e);
} | java | public static void logSQLConsumerException(final Logger logger,
final SQLConsumerException e)
{
logger.logException(Level.ERROR, "SQLConsumerException", e);
} | [
"public",
"static",
"void",
"logSQLConsumerException",
"(",
"final",
"Logger",
"logger",
",",
"final",
"SQLConsumerException",
"e",
")",
"{",
"logger",
".",
"logException",
"(",
"Level",
".",
"ERROR",
",",
"\"SQLConsumerException\"",
",",
"e",
")",
";",
"}"
] | Logs the occurrence of an SqlConsumerException.
@param logger
reference to the logger
@param e
reference to the exception | [
"Logs",
"the",
"occurrence",
"of",
"an",
"SqlConsumerException",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/consumer/SQLConsumerLogMessages.java#L102-L107 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/DiffToolLogMessages.java | DiffToolLogMessages.logStatus | public static void logStatus(final Logger logger, final long time,
final int articleConsumer, final int diffConsumer,
final int sqlConsumer, final boolean archiveState,
final boolean articleState, final boolean diffState)
{
logger.logMessage(Level.INFO,
"\r\nDiffTool-Status-Report [" + Time.toClock(tim... | java | public static void logStatus(final Logger logger, final long time,
final int articleConsumer, final int diffConsumer,
final int sqlConsumer, final boolean archiveState,
final boolean articleState, final boolean diffState)
{
logger.logMessage(Level.INFO,
"\r\nDiffTool-Status-Report [" + Time.toClock(tim... | [
"public",
"static",
"void",
"logStatus",
"(",
"final",
"Logger",
"logger",
",",
"final",
"long",
"time",
",",
"final",
"int",
"articleConsumer",
",",
"final",
"int",
"diffConsumer",
",",
"final",
"int",
"sqlConsumer",
",",
"final",
"boolean",
"archiveState",
"... | Logs the status of the diff tool.
@param logger
reference to the logger
@param time
time since start
@param articleConsumer
number of active article consumers
@param diffConsumer
number of active diff consumers
@param sqlConsumer
number of active sql consumers
@param archiveState
state of the arcive producer
@param ar... | [
"Logs",
"the",
"status",
"of",
"the",
"diff",
"tool",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/DiffToolLogMessages.java#L69-L82 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/DiffToolLogMessages.java | DiffToolLogMessages.logShutdown | public static void logShutdown(final Logger logger, final long endTime)
{
logger.logMessage(Level.INFO,
"DiffTool initiates SHUTDOWN\t" + Time.toClock(endTime));
} | java | public static void logShutdown(final Logger logger, final long endTime)
{
logger.logMessage(Level.INFO,
"DiffTool initiates SHUTDOWN\t" + Time.toClock(endTime));
} | [
"public",
"static",
"void",
"logShutdown",
"(",
"final",
"Logger",
"logger",
",",
"final",
"long",
"endTime",
")",
"{",
"logger",
".",
"logMessage",
"(",
"Level",
".",
"INFO",
",",
"\"DiffTool initiates SHUTDOWN\\t\"",
"+",
"Time",
".",
"toClock",
"(",
"endTim... | Logs the shutdown of the logger.
@param logger
reference to the logger
@param endTime
time since start | [
"Logs",
"the",
"shutdown",
"of",
"the",
"logger",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/common/logging/messages/DiffToolLogMessages.java#L118-L122 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.mwdumper/src/main/java/de/tudarmstadt/ukp/wikipedia/mwdumper/importer/SphinxWriter.java | SphinxWriter.writeEndPage | public void writeEndPage() throws IOException {
writer.openElement("document");
writer.textElement("id", Integer.toString(_page.Id));
writer.textElement("group", "0");
writer.textElement("timestamp", formatTimestamp(_rev.Timestamp));
writer.textElement("title", _page.Title.toString());
writer.textElement("b... | java | public void writeEndPage() throws IOException {
writer.openElement("document");
writer.textElement("id", Integer.toString(_page.Id));
writer.textElement("group", "0");
writer.textElement("timestamp", formatTimestamp(_rev.Timestamp));
writer.textElement("title", _page.Title.toString());
writer.textElement("b... | [
"public",
"void",
"writeEndPage",
"(",
")",
"throws",
"IOException",
"{",
"writer",
".",
"openElement",
"(",
"\"document\"",
")",
";",
"writer",
".",
"textElement",
"(",
"\"id\"",
",",
"Integer",
".",
"toString",
"(",
"_page",
".",
"Id",
")",
")",
";",
"... | FIXME What's the "group" number here do?
FIXME preprocess the text to strip some formatting? | [
"FIXME",
"What",
"s",
"the",
"group",
"number",
"here",
"do?",
"FIXME",
"preprocess",
"the",
"text",
"to",
"strip",
"some",
"formatting?"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.mwdumper/src/main/java/de/tudarmstadt/ukp/wikipedia/mwdumper/importer/SphinxWriter.java#L72-L82 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.timemachine/src/main/java/de/tudarmstadt/ukp/wikipedia/timemachine/domain/JWPLTimeMachine.java | JWPLTimeMachine.checkArgs | private static boolean checkArgs(String[] args) {
boolean result = (args.length > 0);
if (!result) {
System.out
.println("Usage: java -jar JWPLTimeMachine.jar <config-file>");
}
return result;
} | java | private static boolean checkArgs(String[] args) {
boolean result = (args.length > 0);
if (!result) {
System.out
.println("Usage: java -jar JWPLTimeMachine.jar <config-file>");
}
return result;
} | [
"private",
"static",
"boolean",
"checkArgs",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"boolean",
"result",
"=",
"(",
"args",
".",
"length",
">",
"0",
")",
";",
"if",
"(",
"!",
"result",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Usag... | Checks given arguments
@param args
<br>
args[0] the settings file like described in
{@link SettingsXML}<br>
@return true if all necessary arguments are given and false otherwise
@see SettingsXML | [
"Checks",
"given",
"arguments"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.timemachine/src/main/java/de/tudarmstadt/ukp/wikipedia/timemachine/domain/JWPLTimeMachine.java#L57-L64 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.getTitle | public Title getTitle(int pageId) throws WikiApiException {
Session session = this.__getHibernateSession();
session.beginTransaction();
Object returnValue = session.createNativeQuery(
"select p.name from PageMapLine as p where p.pageId= :pId").setParameter("pId", pageId, IntegerType.INS... | java | public Title getTitle(int pageId) throws WikiApiException {
Session session = this.__getHibernateSession();
session.beginTransaction();
Object returnValue = session.createNativeQuery(
"select p.name from PageMapLine as p where p.pageId= :pId").setParameter("pId", pageId, IntegerType.INS... | [
"public",
"Title",
"getTitle",
"(",
"int",
"pageId",
")",
"throws",
"WikiApiException",
"{",
"Session",
"session",
"=",
"this",
".",
"__getHibernateSession",
"(",
")",
";",
"session",
".",
"beginTransaction",
"(",
")",
";",
"Object",
"returnValue",
"=",
"sessi... | Gets the title for a given pageId.
@param pageId The id of the page.
@return The title for the given pageId.
@throws WikiApiException Thrown if errors occurred. | [
"Gets",
"the",
"title",
"for",
"a",
"given",
"pageId",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L174-L186 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.getArticleForDiscussionPage | public Page getArticleForDiscussionPage(Page discussionPage) throws WikiApiException {
if(discussionPage.isDiscussion()){
String title = discussionPage.getTitle().getPlainTitle().replaceAll(WikiConstants.DISCUSSION_PREFIX, "");
if(title.contains("/")){
//If we have a discussion archive
... | java | public Page getArticleForDiscussionPage(Page discussionPage) throws WikiApiException {
if(discussionPage.isDiscussion()){
String title = discussionPage.getTitle().getPlainTitle().replaceAll(WikiConstants.DISCUSSION_PREFIX, "");
if(title.contains("/")){
//If we have a discussion archive
... | [
"public",
"Page",
"getArticleForDiscussionPage",
"(",
"Page",
"discussionPage",
")",
"throws",
"WikiApiException",
"{",
"if",
"(",
"discussionPage",
".",
"isDiscussion",
"(",
")",
")",
"{",
"String",
"title",
"=",
"discussionPage",
".",
"getTitle",
"(",
")",
"."... | Returns the article page for a given discussion page.
@param discussionPage
the discussion page object
@return The page object of the article associated with the discussion. If
the parameter already was an article, it is returned directly.
@throws WikiApiException Thrown if errors occurred. | [
"Returns",
"the",
"article",
"page",
"for",
"a",
"given",
"discussion",
"page",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L252-L267 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.getDiscussionPage | public Page getDiscussionPage(Page articlePage) throws WikiApiException{
String articleTitle = articlePage.getTitle().toString();
if(articleTitle.startsWith(WikiConstants.DISCUSSION_PREFIX)){
return articlePage;
}else{
return new Page(this, WikiConstants.DISCUSSION_PREFIX+articleTitle);
... | java | public Page getDiscussionPage(Page articlePage) throws WikiApiException{
String articleTitle = articlePage.getTitle().toString();
if(articleTitle.startsWith(WikiConstants.DISCUSSION_PREFIX)){
return articlePage;
}else{
return new Page(this, WikiConstants.DISCUSSION_PREFIX+articleTitle);
... | [
"public",
"Page",
"getDiscussionPage",
"(",
"Page",
"articlePage",
")",
"throws",
"WikiApiException",
"{",
"String",
"articleTitle",
"=",
"articlePage",
".",
"getTitle",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"articleTitle",
".",
"startsWith",
"(... | Gets the discussion page for the given article page
The provided page must not be a discussion page
@param articlePage the article page for which a discussion page should be retrieved
@return The discussion page object for the given article page object
@throws WikiApiException If no page or redirect with this title ex... | [
"Gets",
"the",
"discussion",
"page",
"for",
"the",
"given",
"article",
"page",
"The",
"provided",
"page",
"must",
"not",
"be",
"a",
"discussion",
"page"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L303-L310 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.getSimilarPages | protected Map<Page, Double> getSimilarPages(String pPattern, int pSize) throws WikiApiException {
Title title = new Title(pPattern);
String pattern = title.getWikiStyleTitle();
// a mapping of the most similar pages and their similarity values
// It is returned by this method.
M... | java | protected Map<Page, Double> getSimilarPages(String pPattern, int pSize) throws WikiApiException {
Title title = new Title(pPattern);
String pattern = title.getWikiStyleTitle();
// a mapping of the most similar pages and their similarity values
// It is returned by this method.
M... | [
"protected",
"Map",
"<",
"Page",
",",
"Double",
">",
"getSimilarPages",
"(",
"String",
"pPattern",
",",
"int",
"pSize",
")",
"throws",
"WikiApiException",
"{",
"Title",
"title",
"=",
"new",
"Title",
"(",
"pPattern",
")",
";",
"String",
"pattern",
"=",
"tit... | Gets the pages or redirects with a name similar to the pattern.
Calling this method is quite costly, as similarity is computed for all names.
@param pPattern The pattern.
@param pSize The maximum size of the result list. Only the most similar results will be included.
@return A map of pages with names similar to the pa... | [
"Gets",
"the",
"pages",
"or",
"redirects",
"with",
"a",
"name",
"similar",
"to",
"the",
"pattern",
".",
"Calling",
"this",
"method",
"is",
"quite",
"costly",
"as",
"similarity",
"is",
"computed",
"for",
"all",
"names",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L392-L447 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.getCategory | public Category getCategory(int pageId) {
long hibernateId = __getCategoryHibernateId(pageId);
if (hibernateId == -1) {
return null;
}
try {
Category cat = new Category(this, hibernateId);
return cat;
} catch (WikiPageNotFoundException e) {
... | java | public Category getCategory(int pageId) {
long hibernateId = __getCategoryHibernateId(pageId);
if (hibernateId == -1) {
return null;
}
try {
Category cat = new Category(this, hibernateId);
return cat;
} catch (WikiPageNotFoundException e) {
... | [
"public",
"Category",
"getCategory",
"(",
"int",
"pageId",
")",
"{",
"long",
"hibernateId",
"=",
"__getCategoryHibernateId",
"(",
"pageId",
")",
";",
"if",
"(",
"hibernateId",
"==",
"-",
"1",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"Category",
... | Gets the category for a given pageId.
@param pageId The id of the {@link Category}.
@return The category object or null if no category with this pageId exists. | [
"Gets",
"the",
"category",
"for",
"a",
"given",
"pageId",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L473-L485 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.__getCategories | protected Set<Integer> __getCategories() {
// TODO this should be replaced with the buffered category iterator, as it might produce an HeapSpace Overflow, if there are too many categories.
Session session = this.__getHibernateSession();
session.beginTransaction();
List<Integer> idList =... | java | protected Set<Integer> __getCategories() {
// TODO this should be replaced with the buffered category iterator, as it might produce an HeapSpace Overflow, if there are too many categories.
Session session = this.__getHibernateSession();
session.beginTransaction();
List<Integer> idList =... | [
"protected",
"Set",
"<",
"Integer",
">",
"__getCategories",
"(",
")",
"{",
"// TODO this should be replaced with the buffered category iterator, as it might produce an HeapSpace Overflow, if there are too many categories.",
"Session",
"session",
"=",
"this",
".",
"__getHibernateSession... | Protected method that is much faster than the public version, but exposes too much implementation details.
Get a set with all category pageIDs. Returning all category objects is much too expensive.
@return A set with all category pageIDs | [
"Protected",
"method",
"that",
"is",
"much",
"faster",
"than",
"the",
"public",
"version",
"but",
"exposes",
"too",
"much",
"implementation",
"details",
".",
"Get",
"a",
"set",
"with",
"all",
"category",
"pageIDs",
".",
"Returning",
"all",
"category",
"objects... | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L542-L553 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.existsPage | public boolean existsPage(String title) {
if (title == null || title.length() == 0) {
return false;
}
Title t;
try {
t = new Title(title);
} catch (WikiTitleParsingException e) {
return false;
}
String encodedTitle = t.getWikiStyleTitle();
Session session ... | java | public boolean existsPage(String title) {
if (title == null || title.length() == 0) {
return false;
}
Title t;
try {
t = new Title(title);
} catch (WikiTitleParsingException e) {
return false;
}
String encodedTitle = t.getWikiStyleTitle();
Session session ... | [
"public",
"boolean",
"existsPage",
"(",
"String",
"title",
")",
"{",
"if",
"(",
"title",
"==",
"null",
"||",
"title",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"Title",
"t",
";",
"try",
"{",
"t",
"=",
"new",
"Titl... | Tests, whether a page or redirect with the given title exists.
Trying to retrieve a page that does not exist in Wikipedia throws an exception.
You may catch the exception or use this test, depending on your task.
@param title The title of the page.
@return {@code True}, if a page or redirect with that title exits, {@co... | [
"Tests",
"whether",
"a",
"page",
"or",
"redirect",
"with",
"the",
"given",
"title",
"exists",
".",
"Trying",
"to",
"retrieve",
"a",
"page",
"that",
"does",
"not",
"exist",
"in",
"Wikipedia",
"throws",
"an",
"exception",
".",
"You",
"may",
"catch",
"the",
... | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L650-L676 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.existsPage | public boolean existsPage(int pageID) {
// This is a hack to provide a much quicker way to test whether a page exists.
// Encoding the title in this way surpasses the normal way of creating a title first.
// Anyway, I do not like this hack :-|
if (pageID < 0) {
return false... | java | public boolean existsPage(int pageID) {
// This is a hack to provide a much quicker way to test whether a page exists.
// Encoding the title in this way surpasses the normal way of creating a title first.
// Anyway, I do not like this hack :-|
if (pageID < 0) {
return false... | [
"public",
"boolean",
"existsPage",
"(",
"int",
"pageID",
")",
"{",
"// This is a hack to provide a much quicker way to test whether a page exists.",
"// Encoding the title in this way surpasses the normal way of creating a title first.",
"// Anyway, I do not like this hack :-|",
"if",
"(",
... | Tests, whether a page with the given pageID exists.
Trying to retrieve a pageID that does not exist in Wikipedia throws an exception.
@param pageID A pageID.
@return {@code True}, if a page with that pageID exits, {@code false} otherwise. | [
"Tests",
"whether",
"a",
"page",
"with",
"the",
"given",
"pageID",
"exists",
".",
"Trying",
"to",
"retrieve",
"a",
"pageID",
"that",
"does",
"not",
"exist",
"in",
"Wikipedia",
"throws",
"an",
"exception",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L685-L704 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.__getPageHibernateId | protected long __getPageHibernateId(int pageID) {
long hibernateID = -1;
// first look in the id mapping cache
if (idMapPages.containsKey(pageID)) {
return idMapPages.get(pageID);
}
// The id was not found in the id mapping cache.
// It may not be in the cah... | java | protected long __getPageHibernateId(int pageID) {
long hibernateID = -1;
// first look in the id mapping cache
if (idMapPages.containsKey(pageID)) {
return idMapPages.get(pageID);
}
// The id was not found in the id mapping cache.
// It may not be in the cah... | [
"protected",
"long",
"__getPageHibernateId",
"(",
"int",
"pageID",
")",
"{",
"long",
"hibernateID",
"=",
"-",
"1",
";",
"// first look in the id mapping cache",
"if",
"(",
"idMapPages",
".",
"containsKey",
"(",
"pageID",
")",
")",
"{",
"return",
"idMapPages",
".... | Get the hibernate ID to a given pageID of a page.
We need different methods for pages and categories here, as a page and a category can have the same ID.
@param pageID A pageID that should be mapped to the corresponding hibernate ID.
@return The hibernateID of the page with pageID or -1, if the pageID is not valid | [
"Get",
"the",
"hibernate",
"ID",
"to",
"a",
"given",
"pageID",
"of",
"a",
"page",
".",
"We",
"need",
"different",
"methods",
"for",
"pages",
"and",
"categories",
"here",
"as",
"a",
"page",
"and",
"a",
"category",
"can",
"have",
"the",
"same",
"ID",
"."... | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L713-L738 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java | Wikipedia.getWikipediaId | public String getWikipediaId() {
StringBuilder sb = new StringBuilder();
sb.append(this.getDatabaseConfiguration().getHost());
sb.append("_");
sb.append(this.getDatabaseConfiguration().getDatabase());
sb.append("_");
sb.append(this.getDatabaseConfiguration().getLanguage()... | java | public String getWikipediaId() {
StringBuilder sb = new StringBuilder();
sb.append(this.getDatabaseConfiguration().getHost());
sb.append("_");
sb.append(this.getDatabaseConfiguration().getDatabase());
sb.append("_");
sb.append(this.getDatabaseConfiguration().getLanguage()... | [
"public",
"String",
"getWikipediaId",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"this",
".",
"getDatabaseConfiguration",
"(",
")",
".",
"getHost",
"(",
")",
")",
";",
"sb",
".",
"append",
... | The ID consists of the host, the database, and the language.
This should be unique in most cases.
@return Returns a unique ID for this Wikipedia object. | [
"The",
"ID",
"consists",
"of",
"the",
"host",
"the",
"database",
"and",
"the",
"language",
".",
"This",
"should",
"be",
"unique",
"in",
"most",
"cases",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.api/src/main/java/de/tudarmstadt/ukp/wikipedia/api/Wikipedia.java#L799-L807 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java | RevisionEncoder.encode | private byte[] encode(final RevisionCodecData codecData, final Diff diff)
throws UnsupportedEncodingException, EncodingException
{
this.data = new BitWriter(codecData.totalSizeInBits());
encodeCodecData(codecData);
DiffPart part;
Iterator<DiffPart> partIt = diff.iterator();
while (partIt.hasNext()) {
... | java | private byte[] encode(final RevisionCodecData codecData, final Diff diff)
throws UnsupportedEncodingException, EncodingException
{
this.data = new BitWriter(codecData.totalSizeInBits());
encodeCodecData(codecData);
DiffPart part;
Iterator<DiffPart> partIt = diff.iterator();
while (partIt.hasNext()) {
... | [
"private",
"byte",
"[",
"]",
"encode",
"(",
"final",
"RevisionCodecData",
"codecData",
",",
"final",
"Diff",
"diff",
")",
"throws",
"UnsupportedEncodingException",
",",
"EncodingException",
"{",
"this",
".",
"data",
"=",
"new",
"BitWriter",
"(",
"codecData",
"."... | Creates the binary encoding of the diff while using the codec
information.
@param codecData
codec
@param diff
diff
@return binary data
@throws UnsupportedEncodingException
if the character encoding is unsupported
@throws EncodingException
if the encoding failed | [
"Creates",
"the",
"binary",
"encoding",
"of",
"the",
"diff",
"while",
"using",
"the",
"codec",
"information",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java#L138-L180 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java | RevisionEncoder.encodeCodecData | private void encodeCodecData(final RevisionCodecData codecData)
throws EncodingException
{
this.codecData = codecData;
// C
data.writeBit(0);
data.writeBit(0);
data.writeBit(0);
// BLOCK SIZES - S E B L
this.data.writeValue(5, codecData.getBlocksizeS());
this.data.writeValue(5, codecData.getBlocks... | java | private void encodeCodecData(final RevisionCodecData codecData)
throws EncodingException
{
this.codecData = codecData;
// C
data.writeBit(0);
data.writeBit(0);
data.writeBit(0);
// BLOCK SIZES - S E B L
this.data.writeValue(5, codecData.getBlocksizeS());
this.data.writeValue(5, codecData.getBlocks... | [
"private",
"void",
"encodeCodecData",
"(",
"final",
"RevisionCodecData",
"codecData",
")",
"throws",
"EncodingException",
"{",
"this",
".",
"codecData",
"=",
"codecData",
";",
"// C",
"data",
".",
"writeBit",
"(",
"0",
")",
";",
"data",
".",
"writeBit",
"(",
... | Encodes the codecData.
@param codecData
Reference to the codec
@throws EncodingException
if the encoding failed | [
"Encodes",
"the",
"codecData",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java#L191-L210 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java | RevisionEncoder.encodeCut | private void encodeCut(final DiffPart part)
throws EncodingException
{
// C
data.writeBit(1);
data.writeBit(0);
data.writeBit(1);
// S
data.writeValue(codecData.getBlocksizeS(), part.getStart());
// E
data.writeValue(codecData.getBlocksizeE(), part.getLength());
// B
data.writeValue(codecData... | java | private void encodeCut(final DiffPart part)
throws EncodingException
{
// C
data.writeBit(1);
data.writeBit(0);
data.writeBit(1);
// S
data.writeValue(codecData.getBlocksizeS(), part.getStart());
// E
data.writeValue(codecData.getBlocksizeE(), part.getLength());
// B
data.writeValue(codecData... | [
"private",
"void",
"encodeCut",
"(",
"final",
"DiffPart",
"part",
")",
"throws",
"EncodingException",
"{",
"// C",
"data",
".",
"writeBit",
"(",
"1",
")",
";",
"data",
".",
"writeBit",
"(",
"0",
")",
";",
"data",
".",
"writeBit",
"(",
"1",
")",
";",
... | Encodes a Cut operation.
@param part
Reference to the Cut operation
@throws EncodingException
if the encoding failed | [
"Encodes",
"a",
"Cut",
"operation",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java#L221-L242 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java | RevisionEncoder.encodeDelete | private void encodeDelete(final DiffPart part)
throws EncodingException
{
// C
data.writeBit(0);
data.writeBit(1);
data.writeBit(1);
// S
data.writeValue(codecData.getBlocksizeS(), part.getStart());
// E
data.writeValue(codecData.getBlocksizeE(), part.getLength());
data.writeFillBits();
} | java | private void encodeDelete(final DiffPart part)
throws EncodingException
{
// C
data.writeBit(0);
data.writeBit(1);
data.writeBit(1);
// S
data.writeValue(codecData.getBlocksizeS(), part.getStart());
// E
data.writeValue(codecData.getBlocksizeE(), part.getLength());
data.writeFillBits();
} | [
"private",
"void",
"encodeDelete",
"(",
"final",
"DiffPart",
"part",
")",
"throws",
"EncodingException",
"{",
"// C",
"data",
".",
"writeBit",
"(",
"0",
")",
";",
"data",
".",
"writeBit",
"(",
"1",
")",
";",
"data",
".",
"writeBit",
"(",
"1",
")",
";",... | Encodes a Delete operation.
@param part
Reference to the Delete operation
@throws EncodingException
if the encoding failed | [
"Encodes",
"a",
"Delete",
"operation",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java#L253-L269 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java | RevisionEncoder.encodeFullRevisionUncompressed | private void encodeFullRevisionUncompressed(final DiffPart part)
throws UnsupportedEncodingException, EncodingException
{
// C
data.writeBit(0);
data.writeBit(0);
data.writeBit(1);
// L T
String text = part.getText();
byte[] bText = text.getBytes(WIKIPEDIA_ENCODING);
data.writeValue(codecData.getB... | java | private void encodeFullRevisionUncompressed(final DiffPart part)
throws UnsupportedEncodingException, EncodingException
{
// C
data.writeBit(0);
data.writeBit(0);
data.writeBit(1);
// L T
String text = part.getText();
byte[] bText = text.getBytes(WIKIPEDIA_ENCODING);
data.writeValue(codecData.getB... | [
"private",
"void",
"encodeFullRevisionUncompressed",
"(",
"final",
"DiffPart",
"part",
")",
"throws",
"UnsupportedEncodingException",
",",
"EncodingException",
"{",
"// C",
"data",
".",
"writeBit",
"(",
"0",
")",
";",
"data",
".",
"writeBit",
"(",
"0",
")",
";",... | Encodes a FullRevision operation.
@param part
Reference to the FullRevision operation
@throws UnsupportedEncodingException
if the character encoding is unsupported
@throws EncodingException
if the encoding failed | [
"Encodes",
"a",
"FullRevision",
"operation",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java#L329-L345 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java | RevisionEncoder.encodePaste | private void encodePaste(final DiffPart part)
throws EncodingException
{
// C
data.writeBit(1);
data.writeBit(1);
data.writeBit(0);
// S
data.writeValue(codecData.getBlocksizeS(), part.getStart());
// B
data.writeValue(codecData.getBlocksizeB(),
Integer.parseInt(part.getText()));
data.write... | java | private void encodePaste(final DiffPart part)
throws EncodingException
{
// C
data.writeBit(1);
data.writeBit(1);
data.writeBit(0);
// S
data.writeValue(codecData.getBlocksizeS(), part.getStart());
// B
data.writeValue(codecData.getBlocksizeB(),
Integer.parseInt(part.getText()));
data.write... | [
"private",
"void",
"encodePaste",
"(",
"final",
"DiffPart",
"part",
")",
"throws",
"EncodingException",
"{",
"// C",
"data",
".",
"writeBit",
"(",
"1",
")",
";",
"data",
".",
"writeBit",
"(",
"1",
")",
";",
"data",
".",
"writeBit",
"(",
"0",
")",
";",
... | Encodes a Paste operation.
@param part
Reference to the Paste operation
@throws EncodingException
if the encoding failed | [
"Encodes",
"a",
"Paste",
"operation",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/data/codec/RevisionEncoder.java#L387-L404 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.mwdumper/src/main/java/de/tudarmstadt/ukp/wikipedia/mwdumper/importer/XmlDumpReader.java | XmlDumpReader.readDump | public void readDump() throws IOException {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
SAXParser parser = factory.newSAXParser();
parser.parse(input, this);
} catch (ParserConfigurationException e) {
throw (IOE... | java | public void readDump() throws IOException {
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
SAXParser parser = factory.newSAXParser();
parser.parse(input, this);
} catch (ParserConfigurationException e) {
throw (IOE... | [
"public",
"void",
"readDump",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"SAXParserFactory",
"factory",
"=",
"SAXParserFactory",
".",
"newInstance",
"(",
")",
";",
"factory",
".",
"setFeature",
"(",
"XMLConstants",
".",
"FEATURE_SECURE_PROCESSING",
",",
... | Reads through the entire XML dump on the input stream, sending
events to the DumpWriter as it goes. May throw exceptions on
invalid input or due to problems with the output.
@throws IOException | [
"Reads",
"through",
"the",
"entire",
"XML",
"dump",
"on",
"the",
"input",
"stream",
"sending",
"events",
"to",
"the",
"DumpWriter",
"as",
"it",
"goes",
".",
"May",
"throw",
"exceptions",
"on",
"invalid",
"input",
"or",
"due",
"to",
"problems",
"with",
"the... | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.mwdumper/src/main/java/de/tudarmstadt/ukp/wikipedia/mwdumper/importer/XmlDumpReader.java#L84-L97 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/ChronoIndexData.java | ChronoIndexData.compareTo | public int compareTo(final ChronoIndexData info)
{
long value;
if (chronoSort) {
value = this.time - info.time;
}
else {
value = this.revisionCounter - info.revisionCounter;
}
if (value == 0) {
return 0;
}
else if (value > 0) {
return 1;
}
else {
return -1;
}
} | java | public int compareTo(final ChronoIndexData info)
{
long value;
if (chronoSort) {
value = this.time - info.time;
}
else {
value = this.revisionCounter - info.revisionCounter;
}
if (value == 0) {
return 0;
}
else if (value > 0) {
return 1;
}
else {
return -1;
}
} | [
"public",
"int",
"compareTo",
"(",
"final",
"ChronoIndexData",
"info",
")",
"{",
"long",
"value",
";",
"if",
"(",
"chronoSort",
")",
"{",
"value",
"=",
"this",
".",
"time",
"-",
"info",
".",
"time",
";",
"}",
"else",
"{",
"value",
"=",
"this",
".",
... | Compares this ChronoInfo to the given info.
@return a negative integer, zero, or a positive integer as this object is
less than, equal to, or greater than the specified object. | [
"Compares",
"this",
"ChronoInfo",
"to",
"the",
"given",
"info",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/index/indices/ChronoIndexData.java#L67-L88 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getPagesContainingTemplateNames | public Iterable<Page> getPagesContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredPages(templateNames, true);
} | java | public Iterable<Page> getPagesContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredPages(templateNames, true);
} | [
"public",
"Iterable",
"<",
"Page",
">",
"getPagesContainingTemplateNames",
"(",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFilteredPages",
"(",
"templateNames",
",",
"true",
")",
";",
"}"
] | Return an iterable containing all pages that contain a template the name
of which equals any of the given Strings.
@param templateNames
the names of the template that we want to match
@return An iterable with the page objects that contain any of the the
specified templates
@throws WikiApiException
If there was any err... | [
"Return",
"an",
"iterable",
"containing",
"all",
"pages",
"that",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"equals",
"any",
"of",
"the",
"given",
"Strings",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L511-L513 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getPagesNotContainingTemplateNames | public Iterable<Page> getPagesNotContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredPages(templateNames, false);
} | java | public Iterable<Page> getPagesNotContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredPages(templateNames, false);
} | [
"public",
"Iterable",
"<",
"Page",
">",
"getPagesNotContainingTemplateNames",
"(",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFilteredPages",
"(",
"templateNames",
",",
"false",
")",
";",
"}"
] | Return an iterable containing all pages that do NOT contain a template
the name of which equals of the given Strings.
@param templateNames
the names of the template that we want to match
@return An iterable with the page objects that do NOT contain any of the
the specified templates
@throws WikiApiException
If there w... | [
"Return",
"an",
"iterable",
"containing",
"all",
"pages",
"that",
"do",
"NOT",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"equals",
"of",
"the",
"given",
"Strings",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L527-L529 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getRevisionsWithFirstTemplateAppearance | public List<Integer> getRevisionsWithFirstTemplateAppearance(String templateName) throws WikiApiException{
/*
* Note: This method does not use any revision-template-index. Each revision has to be parsed until the first revision is found that does not contain a certain template.
* TODO also create versi... | java | public List<Integer> getRevisionsWithFirstTemplateAppearance(String templateName) throws WikiApiException{
/*
* Note: This method does not use any revision-template-index. Each revision has to be parsed until the first revision is found that does not contain a certain template.
* TODO also create versi... | [
"public",
"List",
"<",
"Integer",
">",
"getRevisionsWithFirstTemplateAppearance",
"(",
"String",
"templateName",
")",
"throws",
"WikiApiException",
"{",
"/*\n \t * Note: This method does not use any revision-template-index. Each revision has to be parsed until the first revision is foun... | This method first creates a list of pages containing templates that equal
any of the provided Strings.
It then returns a list of revision ids of the revisions in which the
respective templates first appeared.
@param templateName
the template names that have to be matched
@return An list with the revision ids of the fi... | [
"This",
"method",
"first",
"creates",
"a",
"list",
"of",
"pages",
"containing",
"templates",
"that",
"equal",
"any",
"of",
"the",
"provided",
"Strings",
".",
"It",
"then",
"returns",
"a",
"list",
"of",
"revision",
"ids",
"of",
"the",
"revisions",
"in",
"wh... | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L545-L614 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getIdsOfPagesThatEverContainedTemplateNames | public List<Integer> getIdsOfPagesThatEverContainedTemplateNames(List<String> templateNames) throws WikiApiException{
if(revApi==null){
revApi = new RevisionApi(wiki.getDatabaseConfiguration());
}
Set<Integer> pageIdSet = new HashSet<Integer>();
//TODO instead of getting rev ids and then gett... | java | public List<Integer> getIdsOfPagesThatEverContainedTemplateNames(List<String> templateNames) throws WikiApiException{
if(revApi==null){
revApi = new RevisionApi(wiki.getDatabaseConfiguration());
}
Set<Integer> pageIdSet = new HashSet<Integer>();
//TODO instead of getting rev ids and then gett... | [
"public",
"List",
"<",
"Integer",
">",
"getIdsOfPagesThatEverContainedTemplateNames",
"(",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"if",
"(",
"revApi",
"==",
"null",
")",
"{",
"revApi",
"=",
"new",
"RevisionApi",
"(",... | Returns the ids of all pages that ever contained any of the given template names in the history of their existence.
@param templateNames template names to look for
@return list of page ids of the pages that once contained any of the given template names
@throws WikiApiException If there was any error retrieving the pa... | [
"Returns",
"the",
"ids",
"of",
"all",
"pages",
"that",
"ever",
"contained",
"any",
"of",
"the",
"given",
"template",
"names",
"in",
"the",
"history",
"of",
"their",
"existence",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L844-L860 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getIdsOfPagesThatEverContainedTemplateFragments | public List<Integer> getIdsOfPagesThatEverContainedTemplateFragments(List<String> templateFragments) throws WikiApiException{
if(revApi==null){
revApi = new RevisionApi(wiki.getDatabaseConfiguration());
}
Set<Integer> pageIdSet = new HashSet<Integer>();
//TODO instead of getting rev ids and t... | java | public List<Integer> getIdsOfPagesThatEverContainedTemplateFragments(List<String> templateFragments) throws WikiApiException{
if(revApi==null){
revApi = new RevisionApi(wiki.getDatabaseConfiguration());
}
Set<Integer> pageIdSet = new HashSet<Integer>();
//TODO instead of getting rev ids and t... | [
"public",
"List",
"<",
"Integer",
">",
"getIdsOfPagesThatEverContainedTemplateFragments",
"(",
"List",
"<",
"String",
">",
"templateFragments",
")",
"throws",
"WikiApiException",
"{",
"if",
"(",
"revApi",
"==",
"null",
")",
"{",
"revApi",
"=",
"new",
"RevisionApi"... | Returns the ids of all pages that ever contained any template that started with any of the given template fragments
@param templateFragments template-fragments to look for
@return list of page ids of the pages that once contained any template that started with any of the given template fragments
@throws WikiApiExcepti... | [
"Returns",
"the",
"ids",
"of",
"all",
"pages",
"that",
"ever",
"contained",
"any",
"template",
"that",
"started",
"with",
"any",
"of",
"the",
"given",
"template",
"fragments"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L870-L886 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getPageIdsContainingTemplateNames | public List<Integer> getPageIdsContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredPageIds(templateNames, true);
} | java | public List<Integer> getPageIdsContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredPageIds(templateNames, true);
} | [
"public",
"List",
"<",
"Integer",
">",
"getPageIdsContainingTemplateNames",
"(",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFilteredPageIds",
"(",
"templateNames",
",",
"true",
")",
";",
"}"
] | Returns a list containing the ids of all pages that contain a template
the name of which equals any of the given Strings.
@param templateNames
the names of the template that we want to match
@return A list with the ids of all pages that contain any of the the
specified templates
@throws WikiApiException
If there was a... | [
"Returns",
"a",
"list",
"containing",
"the",
"ids",
"of",
"all",
"pages",
"that",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"equals",
"any",
"of",
"the",
"given",
"Strings",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L975-L977 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getPageIdsNotContainingTemplateNames | public List<Integer> getPageIdsNotContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredPageIds(templateNames, false);
} | java | public List<Integer> getPageIdsNotContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredPageIds(templateNames, false);
} | [
"public",
"List",
"<",
"Integer",
">",
"getPageIdsNotContainingTemplateNames",
"(",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFilteredPageIds",
"(",
"templateNames",
",",
"false",
")",
";",
"}"
] | Returns a list containing the ids of all pages that do not contain a template
the name of which equals any of the given Strings.
@param templateNames
the names of the template that we want to match
@return A list with the ids of all pages that do not contain any of the the
specified templates
@throws WikiApiException
... | [
"Returns",
"a",
"list",
"containing",
"the",
"ids",
"of",
"all",
"pages",
"that",
"do",
"not",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"equals",
"any",
"of",
"the",
"given",
"Strings",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L990-L992 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getRevisionIdsContainingTemplateNames | public List<Integer> getRevisionIdsContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredRevisionIds(templateNames, true);
} | java | public List<Integer> getRevisionIdsContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredRevisionIds(templateNames, true);
} | [
"public",
"List",
"<",
"Integer",
">",
"getRevisionIdsContainingTemplateNames",
"(",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFilteredRevisionIds",
"(",
"templateNames",
",",
"true",
")",
";",
"}"
] | Returns a list containing the ids of all revisions that contain a template
the name of which equals any of the given Strings.
@param templateNames
the names of the template that we want to match
@return A list with the ids of all revisions that contain any of the the
specified templates
@throws WikiApiException
If the... | [
"Returns",
"a",
"list",
"containing",
"the",
"ids",
"of",
"all",
"revisions",
"that",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"equals",
"any",
"of",
"the",
"given",
"Strings",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L1080-L1082 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getRevisionIdsNotContainingTemplateNames | public List<Integer> getRevisionIdsNotContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredRevisionIds(templateNames, false);
} | java | public List<Integer> getRevisionIdsNotContainingTemplateNames(List<String> templateNames) throws WikiApiException{
return getFilteredRevisionIds(templateNames, false);
} | [
"public",
"List",
"<",
"Integer",
">",
"getRevisionIdsNotContainingTemplateNames",
"(",
"List",
"<",
"String",
">",
"templateNames",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFilteredRevisionIds",
"(",
"templateNames",
",",
"false",
")",
";",
"}"
] | Returns a list containing the ids of all revisions that do not contain a template
the name of which equals any of the given Strings.
@param templateNames
the names of the template that we want to match
@return A list with the ids of all revisions that do not contain any of the the
specified templates
@throws WikiApiEx... | [
"Returns",
"a",
"list",
"containing",
"the",
"ids",
"of",
"all",
"revisions",
"that",
"do",
"not",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"equals",
"any",
"of",
"the",
"given",
"Strings",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L1096-L1098 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getTemplateNamesFromRevision | public List<String> getTemplateNamesFromRevision(int revid) throws WikiApiException{
if(revid<1){
throw new WikiApiException("Revision ID must be > 0");
}
try {
PreparedStatement statement = null;
ResultSet result = null;
List<String> templateNames = new LinkedList<String>();
try... | java | public List<String> getTemplateNamesFromRevision(int revid) throws WikiApiException{
if(revid<1){
throw new WikiApiException("Revision ID must be > 0");
}
try {
PreparedStatement statement = null;
ResultSet result = null;
List<String> templateNames = new LinkedList<String>();
try... | [
"public",
"List",
"<",
"String",
">",
"getTemplateNamesFromRevision",
"(",
"int",
"revid",
")",
"throws",
"WikiApiException",
"{",
"if",
"(",
"revid",
"<",
"1",
")",
"{",
"throw",
"new",
"WikiApiException",
"(",
"\"Revision ID must be > 0\"",
")",
";",
"}",
"t... | Returns the names of all templates contained in the specified revision.
@param revid
the revision id
@return A List with the names of the templates contained in the specified
revision
@throws WikiApiException
If there was any error retrieving the page object (most
likely if the templates are corrupted) | [
"Returns",
"the",
"names",
"of",
"all",
"templates",
"contained",
"in",
"the",
"specified",
"revision",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L1204-L1242 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.revisionContainsTemplateFragment | public boolean revisionContainsTemplateFragment(int revId, String templateFragment) throws WikiApiException{
List<String> tplList = getTemplateNamesFromRevision(revId);
for(String tpl:tplList){
if(tpl.toLowerCase().startsWith(templateFragment.toLowerCase())){
return true;
}
}
retu... | java | public boolean revisionContainsTemplateFragment(int revId, String templateFragment) throws WikiApiException{
List<String> tplList = getTemplateNamesFromRevision(revId);
for(String tpl:tplList){
if(tpl.toLowerCase().startsWith(templateFragment.toLowerCase())){
return true;
}
}
retu... | [
"public",
"boolean",
"revisionContainsTemplateFragment",
"(",
"int",
"revId",
",",
"String",
"templateFragment",
")",
"throws",
"WikiApiException",
"{",
"List",
"<",
"String",
">",
"tplList",
"=",
"getTemplateNamesFromRevision",
"(",
"revId",
")",
";",
"for",
"(",
... | Determines whether a given revision contains a template starting witht the given fragment
@param revId
@param templateFragment
@return
@throws WikiApiException | [
"Determines",
"whether",
"a",
"given",
"revision",
"contains",
"a",
"template",
"starting",
"witht",
"the",
"given",
"fragment"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L1285-L1293 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.tableExists | public boolean tableExists(String table)
throws SQLException
{
PreparedStatement statement = null;
ResultSet result = null;
try {
statement = this.connection.prepareStatement("SHOW TABLES;");
result = execute(statement);
if (result == null) {
return false;
}
boolean found = false;
while... | java | public boolean tableExists(String table)
throws SQLException
{
PreparedStatement statement = null;
ResultSet result = null;
try {
statement = this.connection.prepareStatement("SHOW TABLES;");
result = execute(statement);
if (result == null) {
return false;
}
boolean found = false;
while... | [
"public",
"boolean",
"tableExists",
"(",
"String",
"table",
")",
"throws",
"SQLException",
"{",
"PreparedStatement",
"statement",
"=",
"null",
";",
"ResultSet",
"result",
"=",
"null",
";",
"try",
"{",
"statement",
"=",
"this",
".",
"connection",
".",
"prepareS... | Checks if a specific table exists
@param table
the table to check
@return true, if table exists, false else
@throws SQLException
if an error occurs connecting to or querying the db | [
"Checks",
"if",
"a",
"specific",
"table",
"exists"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L1614-L1645 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoFullRevision.java | ChronoFullRevision.add | public void add(final ChronoStorageBlock block)
{
int revCount = block.getRevisionCounter();
this.size += block.length();
if (first == null) {
first = block;
}
else {
ChronoStorageBlock previous = null, current = first;
do {
if (revCount < current.getRevisionCounter()) {
block.setCounte... | java | public void add(final ChronoStorageBlock block)
{
int revCount = block.getRevisionCounter();
this.size += block.length();
if (first == null) {
first = block;
}
else {
ChronoStorageBlock previous = null, current = first;
do {
if (revCount < current.getRevisionCounter()) {
block.setCounte... | [
"public",
"void",
"add",
"(",
"final",
"ChronoStorageBlock",
"block",
")",
"{",
"int",
"revCount",
"=",
"block",
".",
"getRevisionCounter",
"(",
")",
";",
"this",
".",
"size",
"+=",
"block",
".",
"length",
"(",
")",
";",
"if",
"(",
"first",
"==",
"null... | Adds a ChonoStorageBlock to this chrono full revision object.
@param block
reference to the chrono storage block | [
"Adds",
"a",
"ChonoStorageBlock",
"to",
"this",
"chrono",
"full",
"revision",
"object",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoFullRevision.java#L111-L152 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoFullRevision.java | ChronoFullRevision.getNearest | public Revision getNearest(final int revisionCounter)
{
if (first != null) {
ChronoStorageBlock previous = null, current = first;
while (current != null
&& current.getRevisionCounter() <= revisionCounter) {
previous = current;
current = current.getCounterNext();
}
return previous.getRev()... | java | public Revision getNearest(final int revisionCounter)
{
if (first != null) {
ChronoStorageBlock previous = null, current = first;
while (current != null
&& current.getRevisionCounter() <= revisionCounter) {
previous = current;
current = current.getCounterNext();
}
return previous.getRev()... | [
"public",
"Revision",
"getNearest",
"(",
"final",
"int",
"revisionCounter",
")",
"{",
"if",
"(",
"first",
"!=",
"null",
")",
"{",
"ChronoStorageBlock",
"previous",
"=",
"null",
",",
"current",
"=",
"first",
";",
"while",
"(",
"current",
"!=",
"null",
"&&",... | Returns the nearest available revision to the specified revision counter.
@param revisionCounter
revision counter
@return Revision | [
"Returns",
"the",
"nearest",
"available",
"revision",
"to",
"the",
"specified",
"revision",
"counter",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoFullRevision.java#L161-L177 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoFullRevision.java | ChronoFullRevision.clean | public long clean(final int currentRevisionIndex, final int revisionIndex)
{
if (first == null) {
return 0;
}
else if (this.set.isEmpty()) {
this.first = null;
this.size = 0;
return 0;
}
ChronoStorageBlock next, prev, current = first;
boolean remove;
do {
remove = false;
if (current... | java | public long clean(final int currentRevisionIndex, final int revisionIndex)
{
if (first == null) {
return 0;
}
else if (this.set.isEmpty()) {
this.first = null;
this.size = 0;
return 0;
}
ChronoStorageBlock next, prev, current = first;
boolean remove;
do {
remove = false;
if (current... | [
"public",
"long",
"clean",
"(",
"final",
"int",
"currentRevisionIndex",
",",
"final",
"int",
"revisionIndex",
")",
"{",
"if",
"(",
"first",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"else",
"if",
"(",
"this",
".",
"set",
".",
"isEmpty",
"(",
"... | Reduces the storage space.
@param currentRevisionIndex
index of the current revision
@param revisionIndex
index of the revision
@return size of used storage | [
"Reduces",
"the",
"storage",
"space",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/api/chrono/ChronoFullRevision.java#L270-L339 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateInfoGeneratorStarter.java | TemplateInfoGeneratorStarter.createSetFromProperty | public static HashSet<String> createSetFromProperty(String property)
{
HashSet<String> properties = new HashSet<String>();
if (property != null && !property.equals("null")) {
// "([\\w]*)=([\\w]*);"
Pattern params = Pattern.compile("([\\w]+)[;]*");
Matcher matcher = params.matcher(property.trim());
wh... | java | public static HashSet<String> createSetFromProperty(String property)
{
HashSet<String> properties = new HashSet<String>();
if (property != null && !property.equals("null")) {
// "([\\w]*)=([\\w]*);"
Pattern params = Pattern.compile("([\\w]+)[;]*");
Matcher matcher = params.matcher(property.trim());
wh... | [
"public",
"static",
"HashSet",
"<",
"String",
">",
"createSetFromProperty",
"(",
"String",
"property",
")",
"{",
"HashSet",
"<",
"String",
">",
"properties",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"property",
"!=",
"null",
"... | Parses property string into HashSet
@param property
string to parse
@return | [
"Parses",
"property",
"string",
"into",
"HashSet"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/TemplateInfoGeneratorStarter.java#L249-L264 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/dump/xml/AbstractXmlDumpReader.java | AbstractXmlDumpReader.notAllowedStart | private boolean notAllowedStart(String startTag) {
errorState = errorState && startElements.containsKey(startTag)
&& forbiddenIdStartElements.containsKey(startTag);
return errorState;
} | java | private boolean notAllowedStart(String startTag) {
errorState = errorState && startElements.containsKey(startTag)
&& forbiddenIdStartElements.containsKey(startTag);
return errorState;
} | [
"private",
"boolean",
"notAllowedStart",
"(",
"String",
"startTag",
")",
"{",
"errorState",
"=",
"errorState",
"&&",
"startElements",
".",
"containsKey",
"(",
"startTag",
")",
"&&",
"forbiddenIdStartElements",
".",
"containsKey",
"(",
"startTag",
")",
";",
"return... | If error with wrong id tag occurs, the errorState flag will be set. In
this case some start tags have to be ignored.
@param startTag
@return {@code true} if {@code startTag} is not allowed and will be ignored
@see #setupForbiddenStartElements() | [
"If",
"error",
"with",
"wrong",
"id",
"tag",
"occurs",
"the",
"errorState",
"flag",
"will",
"be",
"set",
".",
"In",
"this",
"case",
"some",
"start",
"tags",
"have",
"to",
"be",
"ignored",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/dump/xml/AbstractXmlDumpReader.java#L232-L236 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/dump/xml/AbstractXmlDumpReader.java | AbstractXmlDumpReader.notAllowedEnd | private boolean notAllowedEnd(String endTag) {
errorState = errorState && endElements.containsKey(endTag)
&& forbiddenIdEndElements.containsKey(endTag);
return errorState;
} | java | private boolean notAllowedEnd(String endTag) {
errorState = errorState && endElements.containsKey(endTag)
&& forbiddenIdEndElements.containsKey(endTag);
return errorState;
} | [
"private",
"boolean",
"notAllowedEnd",
"(",
"String",
"endTag",
")",
"{",
"errorState",
"=",
"errorState",
"&&",
"endElements",
".",
"containsKey",
"(",
"endTag",
")",
"&&",
"forbiddenIdEndElements",
".",
"containsKey",
"(",
"endTag",
")",
";",
"return",
"errorS... | If error with wrong id tag occurs, the errorState flag will be set. In
this case some end tags have to be ignored.
@param endTag
@return {@code true} if {@code endTag} is not allowed and will be ignored
@see #setupForbiddenEndElements() | [
"If",
"error",
"with",
"wrong",
"id",
"tag",
"occurs",
"the",
"errorState",
"flag",
"will",
"be",
"set",
".",
"In",
"this",
"case",
"some",
"end",
"tags",
"have",
"to",
"be",
"ignored",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/dump/xml/AbstractXmlDumpReader.java#L246-L251 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/TextPair.java | TextPair.sentenceSplit | private List<String> sentenceSplit(String str) {
BreakIterator iterator = BreakIterator.getSentenceInstance(Locale.US);
iterator.setText(str);
int start = iterator.first();
List<String> sentences = new ArrayList<String>();
for (int end = iterator.next();
end != BreakIterator.DONE;
start = end, end = i... | java | private List<String> sentenceSplit(String str) {
BreakIterator iterator = BreakIterator.getSentenceInstance(Locale.US);
iterator.setText(str);
int start = iterator.first();
List<String> sentences = new ArrayList<String>();
for (int end = iterator.next();
end != BreakIterator.DONE;
start = end, end = i... | [
"private",
"List",
"<",
"String",
">",
"sentenceSplit",
"(",
"String",
"str",
")",
"{",
"BreakIterator",
"iterator",
"=",
"BreakIterator",
".",
"getSentenceInstance",
"(",
"Locale",
".",
"US",
")",
";",
"iterator",
".",
"setText",
"(",
"str",
")",
";",
"in... | Splits a String into sentences using the BreakIterator with
US locale
@param str a String with (multiple) sentences
@return a list of Strings - one sentences per String | [
"Splits",
"a",
"String",
"into",
"sentences",
"using",
"the",
"BreakIterator",
"with",
"US",
"locale"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/TextPair.java#L250-L261 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/TextPair.java | TextPair.listToString | private String listToString(List<String> stringList){
StringBuilder concat = new StringBuilder();
for(String str:stringList){
concat.append(str);
concat.append(System.getProperty("line.separator"));
}
return concat.toString();
} | java | private String listToString(List<String> stringList){
StringBuilder concat = new StringBuilder();
for(String str:stringList){
concat.append(str);
concat.append(System.getProperty("line.separator"));
}
return concat.toString();
} | [
"private",
"String",
"listToString",
"(",
"List",
"<",
"String",
">",
"stringList",
")",
"{",
"StringBuilder",
"concat",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"String",
"str",
":",
"stringList",
")",
"{",
"concat",
".",
"append",
"(",
"... | Concatenates a list of Strings to one line-separated String
@param stringList a list of Strings
@return a single line-separated String containing all Strings from the list | [
"Concatenates",
"a",
"list",
"of",
"Strings",
"to",
"one",
"line",
"-",
"separated",
"String"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/TextPair.java#L269-L276 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/TextPair.java | TextPair.normalize | private String normalize(String str){
str = StringUtils.trimToEmpty(str);
str = StringUtils.normalizeSpace(str);
// remove whitespace before punctuation. not using \p{Punct},
// because it includes to many special characters.
str = str.replaceAll("\\s+(?=[.!,\\?;:])", "");
return str;
} | java | private String normalize(String str){
str = StringUtils.trimToEmpty(str);
str = StringUtils.normalizeSpace(str);
// remove whitespace before punctuation. not using \p{Punct},
// because it includes to many special characters.
str = str.replaceAll("\\s+(?=[.!,\\?;:])", "");
return str;
} | [
"private",
"String",
"normalize",
"(",
"String",
"str",
")",
"{",
"str",
"=",
"StringUtils",
".",
"trimToEmpty",
"(",
"str",
")",
";",
"str",
"=",
"StringUtils",
".",
"normalizeSpace",
"(",
"str",
")",
";",
"// remove whitespace before punctuation. not using \\p{P... | Normalizes the Strings in the TextPair.
This mainly deals with whitespace-issues.
Other normalizations can be included.
@param str
@return | [
"Normalizes",
"the",
"Strings",
"in",
"the",
"TextPair",
".",
"This",
"mainly",
"deals",
"with",
"whitespace",
"-",
"issues",
".",
"Other",
"normalizations",
"can",
"be",
"included",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/TextPair.java#L286-L295 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/revisions/RevisionUtils.java | RevisionUtils.getDiscussionRevisionForArticleRevision | public Revision getDiscussionRevisionForArticleRevision(int revisionId) throws WikiApiException, WikiPageNotFoundException{
//get article revision
Revision rev = revApi.getRevision(revisionId);
Timestamp revTime = rev.getTimeStamp();
//get corresponding discussion page
Page discussion = wiki.getDiscuss... | java | public Revision getDiscussionRevisionForArticleRevision(int revisionId) throws WikiApiException, WikiPageNotFoundException{
//get article revision
Revision rev = revApi.getRevision(revisionId);
Timestamp revTime = rev.getTimeStamp();
//get corresponding discussion page
Page discussion = wiki.getDiscuss... | [
"public",
"Revision",
"getDiscussionRevisionForArticleRevision",
"(",
"int",
"revisionId",
")",
"throws",
"WikiApiException",
",",
"WikiPageNotFoundException",
"{",
"//get article revision\r",
"Revision",
"rev",
"=",
"revApi",
".",
"getRevision",
"(",
"revisionId",
")",
"... | For a given article revision, the method returns the revision of the article discussion
page which was current at the time the revision was created.
@param revisionId revision of the article for which the talk page revision should be retrieved
@return the revision of the talk page that was current at the creation time... | [
"For",
"a",
"given",
"article",
"revision",
"the",
"method",
"returns",
"the",
"revision",
"of",
"the",
"article",
"discussion",
"page",
"which",
"was",
"current",
"at",
"the",
"time",
"the",
"revision",
"was",
"created",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/revisions/RevisionUtils.java#L64-L94 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/revisions/RevisionUtils.java | RevisionUtils.getDiscussionArchiveRevisionsForArticleRevision | public List<Revision> getDiscussionArchiveRevisionsForArticleRevision(int revisionId) throws WikiApiException, WikiPageNotFoundException{
List<Revision> result = new LinkedList<Revision>();
//get article revision
Revision rev = revApi.getRevision(revisionId);
Timestamp revTime = rev.getTimeStamp();
/... | java | public List<Revision> getDiscussionArchiveRevisionsForArticleRevision(int revisionId) throws WikiApiException, WikiPageNotFoundException{
List<Revision> result = new LinkedList<Revision>();
//get article revision
Revision rev = revApi.getRevision(revisionId);
Timestamp revTime = rev.getTimeStamp();
/... | [
"public",
"List",
"<",
"Revision",
">",
"getDiscussionArchiveRevisionsForArticleRevision",
"(",
"int",
"revisionId",
")",
"throws",
"WikiApiException",
",",
"WikiPageNotFoundException",
"{",
"List",
"<",
"Revision",
">",
"result",
"=",
"new",
"LinkedList",
"<",
"Revis... | For a given article revision, the method returns the revisions of the archived article discussion
pages which were available at the time of the article revision
@param revisionId revision of the article for which the talk page archive revisions should be retrieved
@return the revisions of the talk page archives that w... | [
"For",
"a",
"given",
"article",
"revision",
"the",
"method",
"returns",
"the",
"revisions",
"of",
"the",
"archived",
"article",
"discussion",
"pages",
"which",
"were",
"available",
"at",
"the",
"time",
"of",
"the",
"article",
"revision"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/revisions/RevisionUtils.java#L104-L140 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/util/Redirects.java | Redirects.getRedirectDestination | public static String getRedirectDestination(String pageText) {
String redirectString = null;
try {
String regex = "\\[\\[\\s*(.+?)\\s*]]";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(pageText);
// group 0 is the whole match
if (matcher.find()) {
redirectString = m... | java | public static String getRedirectDestination(String pageText) {
String redirectString = null;
try {
String regex = "\\[\\[\\s*(.+?)\\s*]]";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(pageText);
// group 0 is the whole match
if (matcher.find()) {
redirectString = m... | [
"public",
"static",
"String",
"getRedirectDestination",
"(",
"String",
"pageText",
")",
"{",
"String",
"redirectString",
"=",
"null",
";",
"try",
"{",
"String",
"regex",
"=",
"\"\\\\[\\\\[\\\\s*(.+?)\\\\s*]]\"",
";",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"com... | Return the redirect destination of according to wikimedia syntax.
@param pageText Must not be {@code null}.
@return redirect destination | [
"Return",
"the",
"redirect",
"destination",
"of",
"according",
"to",
"wikimedia",
"syntax",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.wikimachine/src/main/java/de/tudarmstadt/ukp/wikipedia/wikimachine/util/Redirects.java#L88-L151 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigVerification.java | ConfigVerification.add | public void add(final ConfigItem item)
{
failed = failed || item.getType() == ConfigItemTypes.ERROR;
this.list.add(item);
} | java | public void add(final ConfigItem item)
{
failed = failed || item.getType() == ConfigItemTypes.ERROR;
this.list.add(item);
} | [
"public",
"void",
"add",
"(",
"final",
"ConfigItem",
"item",
")",
"{",
"failed",
"=",
"failed",
"||",
"item",
".",
"getType",
"(",
")",
"==",
"ConfigItemTypes",
".",
"ERROR",
";",
"this",
".",
"list",
".",
"add",
"(",
"item",
")",
";",
"}"
] | Adds a configuration item to the list.
@param item
configuration item | [
"Adds",
"a",
"configuration",
"item",
"to",
"the",
"list",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigVerification.java#L66-L70 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigVerification.java | ConfigVerification.getValueAt | @Override
public Object getValueAt(final int row, final int column)
{
ConfigItem item = this.list.get(row);
switch (column) {
case 0:
return item.getType();
case 1:
return item.getKey();
case 2:
return item.getMessage();
}
return null;
} | java | @Override
public Object getValueAt(final int row, final int column)
{
ConfigItem item = this.list.get(row);
switch (column) {
case 0:
return item.getType();
case 1:
return item.getKey();
case 2:
return item.getMessage();
}
return null;
} | [
"@",
"Override",
"public",
"Object",
"getValueAt",
"(",
"final",
"int",
"row",
",",
"final",
"int",
"column",
")",
"{",
"ConfigItem",
"item",
"=",
"this",
".",
"list",
".",
"get",
"(",
"row",
")",
";",
"switch",
"(",
"column",
")",
"{",
"case",
"0",
... | Returns the value at the specified column of the specified row.
@return value | [
"Returns",
"the",
"value",
"at",
"the",
"specified",
"column",
"of",
"the",
"specified",
"row",
"."
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.revisionmachine/src/main/java/de/tudarmstadt/ukp/wikipedia/revisionmachine/difftool/config/gui/control/ConfigVerification.java#L110-L125 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoDumpWriter.java | WikipediaTemplateInfoDumpWriter.generatePageSQLStatement | private String generatePageSQLStatement(boolean tableExists,
Map<String, Set<Integer>> dataSourceToUse)
{
StringBuffer output = new StringBuffer();
// Statement creates table for Template Id -> Page Id
output.append("CREATE TABLE IF NOT EXISTS "
+ GeneratorConstants.TABLE_TPLID_PAGEID
+ " ("
+ "t... | java | private String generatePageSQLStatement(boolean tableExists,
Map<String, Set<Integer>> dataSourceToUse)
{
StringBuffer output = new StringBuffer();
// Statement creates table for Template Id -> Page Id
output.append("CREATE TABLE IF NOT EXISTS "
+ GeneratorConstants.TABLE_TPLID_PAGEID
+ " ("
+ "t... | [
"private",
"String",
"generatePageSQLStatement",
"(",
"boolean",
"tableExists",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"Integer",
">",
">",
"dataSourceToUse",
")",
"{",
"StringBuffer",
"output",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// Statement creat... | Generate sql statement for table template id -> page id
@param tableExists
if table does not exists create index for this table
@param dataSourceToUse
data source to use for sql statement generation
@return sql statement string | [
"Generate",
"sql",
"statement",
"for",
"table",
"template",
"id",
"-",
">",
"page",
"id"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoDumpWriter.java#L121-L147 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoDumpWriter.java | WikipediaTemplateInfoDumpWriter.generateTemplateIdSQLStatement | private String generateTemplateIdSQLStatement(boolean tableExists)
{
StringBuffer output = new StringBuffer();
// Statement creates table for Template Id -> Template Name
output.append("CREATE TABLE IF NOT EXISTS "
+ GeneratorConstants.TABLE_TPLID_TPLNAME + " ("
+ "templateId INTEGER NOT NULL AUTO_INCRE... | java | private String generateTemplateIdSQLStatement(boolean tableExists)
{
StringBuffer output = new StringBuffer();
// Statement creates table for Template Id -> Template Name
output.append("CREATE TABLE IF NOT EXISTS "
+ GeneratorConstants.TABLE_TPLID_TPLNAME + " ("
+ "templateId INTEGER NOT NULL AUTO_INCRE... | [
"private",
"String",
"generateTemplateIdSQLStatement",
"(",
"boolean",
"tableExists",
")",
"{",
"StringBuffer",
"output",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// Statement creates table for Template Id -> Template Name",
"output",
".",
"append",
"(",
"\"CREATE TABLE ... | Generate sql statement for table template id -> template name
@param tableExists
if this table does not exists create index
@return sql statement | [
"Generate",
"sql",
"statement",
"for",
"table",
"template",
"id",
"-",
">",
"template",
"name"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoDumpWriter.java#L156-L175 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoDumpWriter.java | WikipediaTemplateInfoDumpWriter.generateRevisionSQLStatement | private String generateRevisionSQLStatement(boolean tableExists,
Map<String, Set<Integer>> dataSourceToUse)
{
StringBuffer output = new StringBuffer();
// Statement creates table for Template Id -> Revision Id
output.append("CREATE TABLE IF NOT EXISTS "
+ GeneratorConstants.TABLE_TPLID_REVISIONID
+ "... | java | private String generateRevisionSQLStatement(boolean tableExists,
Map<String, Set<Integer>> dataSourceToUse)
{
StringBuffer output = new StringBuffer();
// Statement creates table for Template Id -> Revision Id
output.append("CREATE TABLE IF NOT EXISTS "
+ GeneratorConstants.TABLE_TPLID_REVISIONID
+ "... | [
"private",
"String",
"generateRevisionSQLStatement",
"(",
"boolean",
"tableExists",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"Integer",
">",
">",
"dataSourceToUse",
")",
"{",
"StringBuffer",
"output",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// Statement c... | Generate sql statement for table template id -> revision id
@param tableExists
if table does not exists create index for this table
@param dataSourceToUse
data source to use for sql statement generation
@return sql statement string | [
"Generate",
"sql",
"statement",
"for",
"table",
"template",
"id",
"-",
">",
"revision",
"id"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoDumpWriter.java#L186-L211 | train |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoDumpWriter.java | WikipediaTemplateInfoDumpWriter.writeSQL | void writeSQL(boolean revTableExists, boolean pageTableExists, GeneratorMode mode)
{
try (Writer writer = new BufferedWriter(new OutputStreamWriter(
new BufferedOutputStream(new FileOutputStream(outputPath)), charset))){
StringBuilder dataToDump = new StringBuilder();
dataToDump.append(generateTemplateIdS... | java | void writeSQL(boolean revTableExists, boolean pageTableExists, GeneratorMode mode)
{
try (Writer writer = new BufferedWriter(new OutputStreamWriter(
new BufferedOutputStream(new FileOutputStream(outputPath)), charset))){
StringBuilder dataToDump = new StringBuilder();
dataToDump.append(generateTemplateIdS... | [
"void",
"writeSQL",
"(",
"boolean",
"revTableExists",
",",
"boolean",
"pageTableExists",
",",
"GeneratorMode",
"mode",
")",
"{",
"try",
"(",
"Writer",
"writer",
"=",
"new",
"BufferedWriter",
"(",
"new",
"OutputStreamWriter",
"(",
"new",
"BufferedOutputStream",
"("... | Generate and write sql statements to output file
@param revTableExists
if revision table does not exists -> create index
@param pageTableExists
if page table does not exists -> create index
@param mode
generation mode | [
"Generate",
"and",
"write",
"sql",
"statements",
"to",
"output",
"file"
] | 0a0304b6a0aa13acc18838957994e06dd4613a58 | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/generator/simple/WikipediaTemplateInfoDumpWriter.java#L223-L244 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java | SqlModifyBuilder.detectModifyType | public static ModifyType detectModifyType(SQLiteModelMethod method, JQLType jqlType) {
// Elements elementUtils = BaseProcessor.elementUtils;
SQLiteDaoDefinition daoDefinition = method.getParent();
SQLiteEntity entity = method.getEntity();
ModifyType updateResultType = null;
// check type of arguments
int... | java | public static ModifyType detectModifyType(SQLiteModelMethod method, JQLType jqlType) {
// Elements elementUtils = BaseProcessor.elementUtils;
SQLiteDaoDefinition daoDefinition = method.getParent();
SQLiteEntity entity = method.getEntity();
ModifyType updateResultType = null;
// check type of arguments
int... | [
"public",
"static",
"ModifyType",
"detectModifyType",
"(",
"SQLiteModelMethod",
"method",
",",
"JQLType",
"jqlType",
")",
"{",
"// Elements elementUtils = BaseProcessor.elementUtils;",
"SQLiteDaoDefinition",
"daoDefinition",
"=",
"method",
".",
"getParent",
"(",
")",
";",
... | Detect method type.
@param method
the method
@param jqlType
jql type is necessary because method.jql can be not properly initialized
@return the modify type | [
"Detect",
"method",
"type",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java#L224-L289 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java | SqlModifyBuilder.checkContentProviderVarsAndArguments | public static void checkContentProviderVarsAndArguments(final SQLiteModelMethod method,
List<JQLPlaceHolder> placeHolders) {
AssertKripton.assertTrue(placeHolders.size() == method.contentProviderUriVariables.size(),
"In '%s.%s' content provider URI path variables and variables used in where conditions are diff... | java | public static void checkContentProviderVarsAndArguments(final SQLiteModelMethod method,
List<JQLPlaceHolder> placeHolders) {
AssertKripton.assertTrue(placeHolders.size() == method.contentProviderUriVariables.size(),
"In '%s.%s' content provider URI path variables and variables used in where conditions are diff... | [
"public",
"static",
"void",
"checkContentProviderVarsAndArguments",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"List",
"<",
"JQLPlaceHolder",
">",
"placeHolders",
")",
"{",
"AssertKripton",
".",
"assertTrue",
"(",
"placeHolders",
".",
"size",
"(",
")",
"==",
... | Check content provider vars and arguments.
@param method
the method
@param placeHolders
the place holders | [
"Check",
"content",
"provider",
"vars",
"and",
"arguments",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java#L536-L541 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java | SqlModifyBuilder.generateInitForDynamicWhereVariables | static void generateInitForDynamicWhereVariables(SQLiteModelMethod method, MethodSpec.Builder methodBuilder,
String dynamiWhereName, String dynamicWhereArgsName) {
GenerationPartMarks.begin(methodBuilder, GenerationPartMarks.CODE_001);
// where _sqlDynamicWhere and _sqlDynamicWhereArgs
if (method.hasDynamicWhe... | java | static void generateInitForDynamicWhereVariables(SQLiteModelMethod method, MethodSpec.Builder methodBuilder,
String dynamiWhereName, String dynamicWhereArgsName) {
GenerationPartMarks.begin(methodBuilder, GenerationPartMarks.CODE_001);
// where _sqlDynamicWhere and _sqlDynamicWhereArgs
if (method.hasDynamicWhe... | [
"static",
"void",
"generateInitForDynamicWhereVariables",
"(",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"String",
"dynamiWhereName",
",",
"String",
"dynamicWhereArgsName",
")",
"{",
"GenerationPartMarks",
".",
"begin",
"(",
... | Generate init for dynamic where variables.
@param method
the method
@param methodBuilder
the method builder
@param dynamiWhereName
the dynami where name
@param dynamicWhereArgsName
the dynamic where args name | [
"Generate",
"init",
"for",
"dynamic",
"where",
"variables",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java#L555-L569 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java | SqlModifyBuilder.generateLogForModifiers | public static void generateLogForModifiers(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
JQLChecker jqlChecker = JQLChecker.getInstance();
final One<Boolean> usedInWhere = new One<Boolean>(false);
methodBuilder.addCode("\n// display log\n");
String sqlForLog = jqlChecker.replace(method, ... | java | public static void generateLogForModifiers(final SQLiteModelMethod method, MethodSpec.Builder methodBuilder) {
JQLChecker jqlChecker = JQLChecker.getInstance();
final One<Boolean> usedInWhere = new One<Boolean>(false);
methodBuilder.addCode("\n// display log\n");
String sqlForLog = jqlChecker.replace(method, ... | [
"public",
"static",
"void",
"generateLogForModifiers",
"(",
"final",
"SQLiteModelMethod",
"method",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
")",
"{",
"JQLChecker",
"jqlChecker",
"=",
"JQLChecker",
".",
"getInstance",
"(",
")",
";",
"final",
"One",
"<",... | generate sql log.
@param method
the method
@param methodBuilder
the method builder | [
"generate",
"sql",
"log",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/SqlModifyBuilder.java#L579-L640 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindTableGenerator.java | BindTableGenerator.generate | public static void generate(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema,
Set<GeneratedTypeElement> generatedEntities) throws Exception {
BindTableGenerator visitor = new BindTableGenerator(elementUtils, filer, schema);
List<SQLiteEntity> orderedEntities = BindDataSourceBuilder.orderEntitiesL... | java | public static void generate(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema,
Set<GeneratedTypeElement> generatedEntities) throws Exception {
BindTableGenerator visitor = new BindTableGenerator(elementUtils, filer, schema);
List<SQLiteEntity> orderedEntities = BindDataSourceBuilder.orderEntitiesL... | [
"public",
"static",
"void",
"generate",
"(",
"Elements",
"elementUtils",
",",
"Filer",
"filer",
",",
"SQLiteDatabaseSchema",
"schema",
",",
"Set",
"<",
"GeneratedTypeElement",
">",
"generatedEntities",
")",
"throws",
"Exception",
"{",
"BindTableGenerator",
"visitor",
... | Generate table for entities.
@param elementUtils
the element utils
@param filer
the filer
@param schema
the schema
@param generatedEntities
the generated entities
@throws Exception
the exception | [
"Generate",
"table",
"for",
"entities",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindTableGenerator.java#L120-L134 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindTableGenerator.java | BindTableGenerator.tableClassName | public static ClassName tableClassName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName = BindDataSourceSubProcessor.generateEntityQualifiedName(dao, entity);
return TypeUtility.className(entityName + SUFFIX);
} | java | public static ClassName tableClassName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName = BindDataSourceSubProcessor.generateEntityQualifiedName(dao, entity);
return TypeUtility.className(entityName + SUFFIX);
} | [
"public",
"static",
"ClassName",
"tableClassName",
"(",
"SQLiteDaoDefinition",
"dao",
",",
"SQLiteEntity",
"entity",
")",
"{",
"String",
"entityName",
"=",
"BindDataSourceSubProcessor",
".",
"generateEntityQualifiedName",
"(",
"dao",
",",
"entity",
")",
";",
"return",... | Table class name.
@param dao
the dao
@param entity
the entity
@return the class name | [
"Table",
"class",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindTableGenerator.java#L381-L386 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindTableGenerator.java | BindTableGenerator.generateColumnsArray | private void generateColumnsArray(Finder<SQLProperty> entity) {
// generate columns array
Builder sp = FieldSpec.builder(ArrayTypeName.of(String.class), "COLUMNS", Modifier.STATIC, Modifier.PRIVATE,
Modifier.FINAL);
String s = "";
StringBuilder buffer = new StringBuilder();
for (SQLProperty property : ent... | java | private void generateColumnsArray(Finder<SQLProperty> entity) {
// generate columns array
Builder sp = FieldSpec.builder(ArrayTypeName.of(String.class), "COLUMNS", Modifier.STATIC, Modifier.PRIVATE,
Modifier.FINAL);
String s = "";
StringBuilder buffer = new StringBuilder();
for (SQLProperty property : ent... | [
"private",
"void",
"generateColumnsArray",
"(",
"Finder",
"<",
"SQLProperty",
">",
"entity",
")",
"{",
"// generate columns array",
"Builder",
"sp",
"=",
"FieldSpec",
".",
"builder",
"(",
"ArrayTypeName",
".",
"of",
"(",
"String",
".",
"class",
")",
",",
"\"CO... | generate columns array.
@param entity
the entity | [
"generate",
"columns",
"array",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindTableGenerator.java#L645-L663 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindTableGenerator.java | BindTableGenerator.buildIndexes | public static Triple<String, String, String> buildIndexes(final GeneratedTypeElement entity, boolean unique, int counter) {
Triple<String, String, String> result = new Triple<>();
result.value0 = "";
result.value1 = "";
result.value2 = "";
List<String> indexes = entity.index;
String uniqueString;
unique... | java | public static Triple<String, String, String> buildIndexes(final GeneratedTypeElement entity, boolean unique, int counter) {
Triple<String, String, String> result = new Triple<>();
result.value0 = "";
result.value1 = "";
result.value2 = "";
List<String> indexes = entity.index;
String uniqueString;
unique... | [
"public",
"static",
"Triple",
"<",
"String",
",",
"String",
",",
"String",
">",
"buildIndexes",
"(",
"final",
"GeneratedTypeElement",
"entity",
",",
"boolean",
"unique",
",",
"int",
"counter",
")",
"{",
"Triple",
"<",
"String",
",",
"String",
",",
"String",
... | A generated element can have only a primary key and two FK.
@param entity
the entity
@param unique
the unique
@param counter
the counter
@return the pair | [
"A",
"generated",
"element",
"can",
"have",
"only",
"a",
"primary",
"key",
"and",
"two",
"FK",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindTableGenerator.java#L785-L814 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyBeanHelper.java | ModifyBeanHelper.generateModifyQueryCommonPart | static void generateModifyQueryCommonPart(SQLiteModelMethod method, TypeSpec.Builder classBuilder, MethodSpec.Builder methodBuilder) {
boolean updateMode = (method.jql.operationType == JQLType.UPDATE);
SqlModifyBuilder.generateInitForDynamicWhereVariables(method, methodBuilder, method.dynamicWhereParameterName, me... | java | static void generateModifyQueryCommonPart(SQLiteModelMethod method, TypeSpec.Builder classBuilder, MethodSpec.Builder methodBuilder) {
boolean updateMode = (method.jql.operationType == JQLType.UPDATE);
SqlModifyBuilder.generateInitForDynamicWhereVariables(method, methodBuilder, method.dynamicWhereParameterName, me... | [
"static",
"void",
"generateModifyQueryCommonPart",
"(",
"SQLiteModelMethod",
"method",
",",
"TypeSpec",
".",
"Builder",
"classBuilder",
",",
"MethodSpec",
".",
"Builder",
"methodBuilder",
")",
"{",
"boolean",
"updateMode",
"=",
"(",
"method",
".",
"jql",
".",
"ope... | Generate modify query common part.
@param method
the method
@param classBuilder
the class builder
@param methodBuilder
the method builder | [
"Generate",
"modify",
"query",
"common",
"part",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyBeanHelper.java#L142-L195 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyBeanHelper.java | ModifyBeanHelper.buildReturnCode | public void buildReturnCode(MethodSpec.Builder methodBuilder, boolean updateMode, SQLiteModelMethod method, TypeName returnType) {
if (returnType == TypeName.VOID) {
} else if (isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {
methodBuilder.addJavadoc("\n");
if (updateMode)
methodBuilder.addJa... | java | public void buildReturnCode(MethodSpec.Builder methodBuilder, boolean updateMode, SQLiteModelMethod method, TypeName returnType) {
if (returnType == TypeName.VOID) {
} else if (isTypeIncludedIn(returnType, Boolean.TYPE, Boolean.class)) {
methodBuilder.addJavadoc("\n");
if (updateMode)
methodBuilder.addJa... | [
"public",
"void",
"buildReturnCode",
"(",
"MethodSpec",
".",
"Builder",
"methodBuilder",
",",
"boolean",
"updateMode",
",",
"SQLiteModelMethod",
"method",
",",
"TypeName",
"returnType",
")",
"{",
"if",
"(",
"returnType",
"==",
"TypeName",
".",
"VOID",
")",
"{",
... | Builds the return code.
@param methodBuilder
the method builder
@param updateMode
the update mode
@param method
the method
@param returnType
the return type | [
"Builds",
"the",
"return",
"code",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyBeanHelper.java#L256-L282 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyBeanHelper.java | ModifyBeanHelper.extractSQLForJavaDoc | private String extractSQLForJavaDoc(final SQLiteModelMethod method) {
final One<Boolean> usedInWhere = new One<>(false);
String sqlForJavaDoc = JQLChecker.getInstance().replace(method, method.jql, new JQLReplacerListenerImpl(method) {
@Override
public String onColumnNameToUpdate(String columnName) {
retu... | java | private String extractSQLForJavaDoc(final SQLiteModelMethod method) {
final One<Boolean> usedInWhere = new One<>(false);
String sqlForJavaDoc = JQLChecker.getInstance().replace(method, method.jql, new JQLReplacerListenerImpl(method) {
@Override
public String onColumnNameToUpdate(String columnName) {
retu... | [
"private",
"String",
"extractSQLForJavaDoc",
"(",
"final",
"SQLiteModelMethod",
"method",
")",
"{",
"final",
"One",
"<",
"Boolean",
">",
"usedInWhere",
"=",
"new",
"One",
"<>",
"(",
"false",
")",
";",
"String",
"sqlForJavaDoc",
"=",
"JQLChecker",
".",
"getInst... | Extract SQL for java doc.
@param method
the method
@return the string | [
"Extract",
"SQL",
"for",
"java",
"doc",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/ModifyBeanHelper.java#L416-L459 | train |
xcesco/kripton | kripton-android-core/src/main/java/com/abubusoft/kripton/android/Logger.java | Logger.generateTag | protected static String generateTag() {
StackTraceElement[] elements = Thread.currentThread().getStackTrace();
String currentPath = elements[4].getClassName();
String method = elements[4].getMethodName();
int line = elements[4].getLineNumber();
String tag = currentPath + ", " + method + " (line " + line + "... | java | protected static String generateTag() {
StackTraceElement[] elements = Thread.currentThread().getStackTrace();
String currentPath = elements[4].getClassName();
String method = elements[4].getMethodName();
int line = elements[4].getLineNumber();
String tag = currentPath + ", " + method + " (line " + line + "... | [
"protected",
"static",
"String",
"generateTag",
"(",
")",
"{",
"StackTraceElement",
"[",
"]",
"elements",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getStackTrace",
"(",
")",
";",
"String",
"currentPath",
"=",
"elements",
"[",
"4",
"]",
".",
"get... | generate tag.
@return tag of logger | [
"generate",
"tag",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-android-core/src/main/java/com/abubusoft/kripton/android/Logger.java#L36-L47 | train |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/AbstractContext.java | AbstractContext.getMapper | @SuppressWarnings("unchecked")
static <E, M extends BinderMapper<E>> M getMapper(Class<E> cls) {
M mapper = (M) OBJECT_MAPPERS.get(cls);
if (mapper == null) {
// The only way the mapper wouldn't already be loaded into
// OBJECT_MAPPERS is if it was compiled separately, but let's handle
// it anyway
Str... | java | @SuppressWarnings("unchecked")
static <E, M extends BinderMapper<E>> M getMapper(Class<E> cls) {
M mapper = (M) OBJECT_MAPPERS.get(cls);
if (mapper == null) {
// The only way the mapper wouldn't already be loaded into
// OBJECT_MAPPERS is if it was compiled separately, but let's handle
// it anyway
Str... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"<",
"E",
",",
"M",
"extends",
"BinderMapper",
"<",
"E",
">",
">",
"M",
"getMapper",
"(",
"Class",
"<",
"E",
">",
"cls",
")",
"{",
"M",
"mapper",
"=",
"(",
"M",
")",
"OBJECT_MAPPERS",
".",... | Gets the mapper.
@param <E> the element type
@param <M> the generic type
@param cls the cls
@return the mapper | [
"Gets",
"the",
"mapper",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/AbstractContext.java#L96-L120 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.processSecondRound | public boolean processSecondRound(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
for (SQLiteDatabaseSchema schema : schemas) {
// Analyze beans BEFORE daos, because beans are needed for DAO
// definition
for (String daoName : schema.getDaoNameSet()) {
// check dao into bean definit... | java | public boolean processSecondRound(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
for (SQLiteDatabaseSchema schema : schemas) {
// Analyze beans BEFORE daos, because beans are needed for DAO
// definition
for (String daoName : schema.getDaoNameSet()) {
// check dao into bean definit... | [
"public",
"boolean",
"processSecondRound",
"(",
"Set",
"<",
"?",
"extends",
"TypeElement",
">",
"annotations",
",",
"RoundEnvironment",
"roundEnv",
")",
"{",
"for",
"(",
"SQLiteDatabaseSchema",
"schema",
":",
"schemas",
")",
"{",
"// Analyze beans BEFORE daos, because... | Process second round.
@param annotations
the annotations
@param roundEnv
the round env
@return true, if successful | [
"Process",
"second",
"round",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L534-L550 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.analyzeSecondRound | public boolean analyzeSecondRound(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
parseBindType(roundEnv);
// Put all @BindTable elements in beanElements
for (Element item : roundEnv.getElementsAnnotatedWith(BindSqlType.class)) {
if (item.getKind() != ElementKind.CLASS) {
String msg =... | java | public boolean analyzeSecondRound(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
parseBindType(roundEnv);
// Put all @BindTable elements in beanElements
for (Element item : roundEnv.getElementsAnnotatedWith(BindSqlType.class)) {
if (item.getKind() != ElementKind.CLASS) {
String msg =... | [
"public",
"boolean",
"analyzeSecondRound",
"(",
"Set",
"<",
"?",
"extends",
"TypeElement",
">",
"annotations",
",",
"RoundEnvironment",
"roundEnv",
")",
"{",
"parseBindType",
"(",
"roundEnv",
")",
";",
"// Put all @BindTable elements in beanElements",
"for",
"(",
"Ele... | Analyze second round.
@param annotations
the annotations
@param roundEnv
the round env
@return true, if successful | [
"Analyze",
"second",
"round",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L561-L584 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.analyzeRound | public boolean analyzeRound(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
parseBindType(roundEnv);
// Put all @BindSqlType elements in beanElements
for (Element item : roundEnv.getElementsAnnotatedWith(BindSqlType.class)) {
if (item.getKind() != ElementKind.CLASS) {
String msg = Str... | java | public boolean analyzeRound(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
parseBindType(roundEnv);
// Put all @BindSqlType elements in beanElements
for (Element item : roundEnv.getElementsAnnotatedWith(BindSqlType.class)) {
if (item.getKind() != ElementKind.CLASS) {
String msg = Str... | [
"public",
"boolean",
"analyzeRound",
"(",
"Set",
"<",
"?",
"extends",
"TypeElement",
">",
"annotations",
",",
"RoundEnvironment",
"roundEnv",
")",
"{",
"parseBindType",
"(",
"roundEnv",
")",
";",
"// Put all @BindSqlType elements in beanElements",
"for",
"(",
"Element... | Analyze round.
@param annotations
the annotations
@param roundEnv
the round env
@return true, if successful | [
"Analyze",
"round",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L595-L652 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.analyzeForeignKey | private void analyzeForeignKey(SQLiteDatabaseSchema schema) {
for (SQLiteEntity entity : schema.getEntities()) {
for (SQLProperty property : entity.getCollection()) {
if (property.isForeignKey()) {
SQLiteEntity reference = schema.getEntity(property.foreignParentClassName);
AssertKripton.asserTrueOrU... | java | private void analyzeForeignKey(SQLiteDatabaseSchema schema) {
for (SQLiteEntity entity : schema.getEntities()) {
for (SQLProperty property : entity.getCollection()) {
if (property.isForeignKey()) {
SQLiteEntity reference = schema.getEntity(property.foreignParentClassName);
AssertKripton.asserTrueOrU... | [
"private",
"void",
"analyzeForeignKey",
"(",
"SQLiteDatabaseSchema",
"schema",
")",
"{",
"for",
"(",
"SQLiteEntity",
"entity",
":",
"schema",
".",
"getEntities",
"(",
")",
")",
"{",
"for",
"(",
"SQLProperty",
"property",
":",
"entity",
".",
"getCollection",
"(... | Analyze foreign key.
@param schema
the schema | [
"Analyze",
"foreign",
"key",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L660-L692 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.isGeneratedEntity | private boolean isGeneratedEntity(String fullName) {
for (GeneratedTypeElement item : this.generatedEntities) {
if (item.getQualifiedName().equals(fullName)) {
return true;
}
}
return false;
} | java | private boolean isGeneratedEntity(String fullName) {
for (GeneratedTypeElement item : this.generatedEntities) {
if (item.getQualifiedName().equals(fullName)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"isGeneratedEntity",
"(",
"String",
"fullName",
")",
"{",
"for",
"(",
"GeneratedTypeElement",
"item",
":",
"this",
".",
"generatedEntities",
")",
"{",
"if",
"(",
"item",
".",
"getQualifiedName",
"(",
")",
".",
"equals",
"(",
"fullName",
... | Checks if is generated entity.
@param fullName
the full name
@return true, if is generated entity | [
"Checks",
"if",
"is",
"generated",
"entity",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L701-L709 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.checkForeignKeyForM2M | private void checkForeignKeyForM2M(SQLiteDatabaseSchema currentSchema, final SQLiteEntity currentEntity,
ClassName m2mEntity) {
// check for m2m relationship
if (m2mEntity != null) {
SQLiteEntity temp = currentSchema.getEntity(m2mEntity.toString());
AssertKripton.asserTrueOrForeignKeyNotFound(currentEntity... | java | private void checkForeignKeyForM2M(SQLiteDatabaseSchema currentSchema, final SQLiteEntity currentEntity,
ClassName m2mEntity) {
// check for m2m relationship
if (m2mEntity != null) {
SQLiteEntity temp = currentSchema.getEntity(m2mEntity.toString());
AssertKripton.asserTrueOrForeignKeyNotFound(currentEntity... | [
"private",
"void",
"checkForeignKeyForM2M",
"(",
"SQLiteDatabaseSchema",
"currentSchema",
",",
"final",
"SQLiteEntity",
"currentEntity",
",",
"ClassName",
"m2mEntity",
")",
"{",
"// check for m2m relationship",
"if",
"(",
"m2mEntity",
"!=",
"null",
")",
"{",
"SQLiteEnti... | Check foreign key for M 2 M.
@param currentSchema
the current schema
@param currentEntity
the current entity
@param m2mEntity
the m 2 m entity | [
"Check",
"foreign",
"key",
"for",
"M",
"2",
"M",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L986-L994 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.createSQLDaoDefinition | protected void createSQLDaoDefinition(SQLiteDatabaseSchema schema,
final Map<String, TypeElement> globalBeanElements, final Map<String, TypeElement> globalDaoElements,
String daoItem) {
Element daoElement = globalDaoElements.get(daoItem);
if (daoElement.getKind() != ElementKind.INTERFACE) {
String msg = S... | java | protected void createSQLDaoDefinition(SQLiteDatabaseSchema schema,
final Map<String, TypeElement> globalBeanElements, final Map<String, TypeElement> globalDaoElements,
String daoItem) {
Element daoElement = globalDaoElements.get(daoItem);
if (daoElement.getKind() != ElementKind.INTERFACE) {
String msg = S... | [
"protected",
"void",
"createSQLDaoDefinition",
"(",
"SQLiteDatabaseSchema",
"schema",
",",
"final",
"Map",
"<",
"String",
",",
"TypeElement",
">",
"globalBeanElements",
",",
"final",
"Map",
"<",
"String",
",",
"TypeElement",
">",
"globalDaoElements",
",",
"String",
... | Create DAO definition.
@param schema
the schema
@param globalBeanElements
the global bean elements
@param globalDaoElements
the global dao elements
@param daoItem
the dao item | [
"Create",
"DAO",
"definition",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L1048-L1110 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.fillMethods | private void fillMethods(final SQLiteDaoDefinition currentDaoDefinition, Element daoElement) {
final One<Boolean> methodWithAnnotation=new One<Boolean>(false);
// create method for dao
SqlBuilderHelper.forEachMethods((TypeElement) daoElement, new MethodFoundListener() {
@Override
public void onMethod(Ex... | java | private void fillMethods(final SQLiteDaoDefinition currentDaoDefinition, Element daoElement) {
final One<Boolean> methodWithAnnotation=new One<Boolean>(false);
// create method for dao
SqlBuilderHelper.forEachMethods((TypeElement) daoElement, new MethodFoundListener() {
@Override
public void onMethod(Ex... | [
"private",
"void",
"fillMethods",
"(",
"final",
"SQLiteDaoDefinition",
"currentDaoDefinition",
",",
"Element",
"daoElement",
")",
"{",
"final",
"One",
"<",
"Boolean",
">",
"methodWithAnnotation",
"=",
"new",
"One",
"<",
"Boolean",
">",
"(",
"false",
")",
";",
... | Fill methods.
@param currentDaoDefinition
the current dao definition
@param daoElement
the dao element | [
"Fill",
"methods",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L1120-L1201 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.generateEntityName | public static String generateEntityName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName;
if (entity == null) {
M2MEntity m2mEntity = M2MEntity.extractEntityManagedByDAO(dao.getElement());
entityName = m2mEntity.getSimpleName();
} else {
entityName = entity.getSimpleName();
}
return ... | java | public static String generateEntityName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName;
if (entity == null) {
M2MEntity m2mEntity = M2MEntity.extractEntityManagedByDAO(dao.getElement());
entityName = m2mEntity.getSimpleName();
} else {
entityName = entity.getSimpleName();
}
return ... | [
"public",
"static",
"String",
"generateEntityName",
"(",
"SQLiteDaoDefinition",
"dao",
",",
"SQLiteEntity",
"entity",
")",
"{",
"String",
"entityName",
";",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"M2MEntity",
"m2mEntity",
"=",
"M2MEntity",
".",
"extractEnt... | dao or entity can be null.
@param dao
the dao
@param entity
the entity
@return the string | [
"dao",
"or",
"entity",
"can",
"be",
"null",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L1298-L1307 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java | BindDataSourceSubProcessor.generateEntityQualifiedName | public static String generateEntityQualifiedName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName;
if (entity == null) {
M2MEntity m2mEntity = M2MEntity.extractEntityManagedByDAO(dao.getElement());
entityName = m2mEntity.getQualifiedName();
} else {
entityName = entity.getName().toString... | java | public static String generateEntityQualifiedName(SQLiteDaoDefinition dao, SQLiteEntity entity) {
String entityName;
if (entity == null) {
M2MEntity m2mEntity = M2MEntity.extractEntityManagedByDAO(dao.getElement());
entityName = m2mEntity.getQualifiedName();
} else {
entityName = entity.getName().toString... | [
"public",
"static",
"String",
"generateEntityQualifiedName",
"(",
"SQLiteDaoDefinition",
"dao",
",",
"SQLiteEntity",
"entity",
")",
"{",
"String",
"entityName",
";",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"M2MEntity",
"m2mEntity",
"=",
"M2MEntity",
".",
"e... | Generate entity qualified name.
@param dao
the dao
@param entity
the entity
@return the string | [
"Generate",
"entity",
"qualified",
"name",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/BindDataSourceSubProcessor.java#L1318-L1327 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java | BindContentProviderBuilder.generate | public static void generate(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema) throws Exception {
BindContentProviderBuilder visitorDao = new BindContentProviderBuilder(elementUtils, filer, schema);
visitorDao.build(elementUtils, filer, schema);
} | java | public static void generate(Elements elementUtils, Filer filer, SQLiteDatabaseSchema schema) throws Exception {
BindContentProviderBuilder visitorDao = new BindContentProviderBuilder(elementUtils, filer, schema);
visitorDao.build(elementUtils, filer, schema);
} | [
"public",
"static",
"void",
"generate",
"(",
"Elements",
"elementUtils",
",",
"Filer",
"filer",
",",
"SQLiteDatabaseSchema",
"schema",
")",
"throws",
"Exception",
"{",
"BindContentProviderBuilder",
"visitorDao",
"=",
"new",
"BindContentProviderBuilder",
"(",
"elementUti... | Generate content provider.
@param elementUtils
the element utils
@param filer
the filer
@param schema
the schema
@throws Exception
the exception | [
"Generate",
"content",
"provider",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java#L187-L190 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java | BindContentProviderBuilder.generateURIForMethod | private void generateURIForMethod(SQLiteDatabaseSchema schema, List<FieldSpec> listFieldAlias, Set<String> alreadyUsedName, Converter<String, String> format, Pair<String, ContentEntry> entry,
SQLiteModelMethod method) {
if (method == null)
return;
String alias = "URI_" + entry.value1.pathCostant.substring(0, ... | java | private void generateURIForMethod(SQLiteDatabaseSchema schema, List<FieldSpec> listFieldAlias, Set<String> alreadyUsedName, Converter<String, String> format, Pair<String, ContentEntry> entry,
SQLiteModelMethod method) {
if (method == null)
return;
String alias = "URI_" + entry.value1.pathCostant.substring(0, ... | [
"private",
"void",
"generateURIForMethod",
"(",
"SQLiteDatabaseSchema",
"schema",
",",
"List",
"<",
"FieldSpec",
">",
"listFieldAlias",
",",
"Set",
"<",
"String",
">",
"alreadyUsedName",
",",
"Converter",
"<",
"String",
",",
"String",
">",
"format",
",",
"Pair",... | Generate URI for method.
@param schema
the schema
@param listFieldAlias
the list field alias
@param alreadyUsedName
the already used name
@param format
the format
@param entry
the entry
@param method
the method | [
"Generate",
"URI",
"for",
"method",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java#L391-L406 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java | BindContentProviderBuilder.defineJavadocForContentUri | private void defineJavadocForContentUri(MethodSpec.Builder builder, SQLiteModelMethod method) {
String contentUri = method.contentProviderUri().replace("*", "[*]");
classBuilder.addJavadoc("<tr><td><pre>$L</pre></td><td>{@link $LImpl#$L}</td></tr>\n", contentUri, method.getParent().getName(), method.contentProvide... | java | private void defineJavadocForContentUri(MethodSpec.Builder builder, SQLiteModelMethod method) {
String contentUri = method.contentProviderUri().replace("*", "[*]");
classBuilder.addJavadoc("<tr><td><pre>$L</pre></td><td>{@link $LImpl#$L}</td></tr>\n", contentUri, method.getParent().getName(), method.contentProvide... | [
"private",
"void",
"defineJavadocForContentUri",
"(",
"MethodSpec",
".",
"Builder",
"builder",
",",
"SQLiteModelMethod",
"method",
")",
"{",
"String",
"contentUri",
"=",
"method",
".",
"contentProviderUri",
"(",
")",
".",
"replace",
"(",
"\"*\"",
",",
"\"[*]\"",
... | Define javadoc for content uri.
@param builder
the builder
@param method
the method | [
"Define",
"javadoc",
"for",
"content",
"uri",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java#L489-L495 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java | BindContentProviderBuilder.generateDelete | private void generateDelete(SQLiteDatabaseSchema schema) {
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("delete").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(Integer.TYPE);
methodBuilder.addParameter(Uri.class, "uri");
methodBuilder.addParameter(String.class, "selection");
... | java | private void generateDelete(SQLiteDatabaseSchema schema) {
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("delete").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(Integer.TYPE);
methodBuilder.addParameter(Uri.class, "uri");
methodBuilder.addParameter(String.class, "selection");
... | [
"private",
"void",
"generateDelete",
"(",
"SQLiteDatabaseSchema",
"schema",
")",
"{",
"MethodSpec",
".",
"Builder",
"methodBuilder",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"delete\"",
")",
".",
"addModifiers",
"(",
"Modifier",
".",
"PUBLIC",
")",
".",
"... | Generate delete.
@param schema
the schema | [
"Generate",
"delete",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java#L503-L563 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java | BindContentProviderBuilder.defineJavadocHeaderForContentOperation | private void defineJavadocHeaderForContentOperation(MethodSpec.Builder builder, String value) {
builder.addJavadoc("\n<h2>Supported $L operations</h2>\n", value);
builder.addJavadoc("<table>\n");
builder.addJavadoc("<tr><th>URI</th><th>DAO.METHOD</th></tr>\n");
classBuilder.addJavadoc("<h2>Supported $L operati... | java | private void defineJavadocHeaderForContentOperation(MethodSpec.Builder builder, String value) {
builder.addJavadoc("\n<h2>Supported $L operations</h2>\n", value);
builder.addJavadoc("<table>\n");
builder.addJavadoc("<tr><th>URI</th><th>DAO.METHOD</th></tr>\n");
classBuilder.addJavadoc("<h2>Supported $L operati... | [
"private",
"void",
"defineJavadocHeaderForContentOperation",
"(",
"MethodSpec",
".",
"Builder",
"builder",
",",
"String",
"value",
")",
"{",
"builder",
".",
"addJavadoc",
"(",
"\"\\n<h2>Supported $L operations</h2>\\n\"",
",",
"value",
")",
";",
"builder",
".",
"addJa... | Define javadoc header for content operation.
@param builder
the builder
@param value
the value | [
"Define",
"javadoc",
"header",
"for",
"content",
"operation",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java#L655-L664 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java | BindContentProviderBuilder.generateGetType | private void generateGetType(SQLiteDatabaseSchema schema) {
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("getType").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(String.class);
methodBuilder.addParameter(Uri.class, "uri");
methodBuilder.beginControlFlow("switch (sURIMatcher.m... | java | private void generateGetType(SQLiteDatabaseSchema schema) {
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("getType").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(String.class);
methodBuilder.addParameter(Uri.class, "uri");
methodBuilder.beginControlFlow("switch (sURIMatcher.m... | [
"private",
"void",
"generateGetType",
"(",
"SQLiteDatabaseSchema",
"schema",
")",
"{",
"MethodSpec",
".",
"Builder",
"methodBuilder",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"getType\"",
")",
".",
"addModifiers",
"(",
"Modifier",
".",
"PUBLIC",
")",
".",
... | Generate get type.
@param schema
the schema | [
"Generate",
"get",
"type",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java#L707-L723 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java | BindContentProviderBuilder.generateOnShutdown | private void generateOnShutdown(String dataSourceNameClazz) {
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("shutdown").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(Void.TYPE);
methodBuilder.addJavadoc("<p>Close database.</p>\n");
methodBuilder.addJavadoc("\n");
methodBuild... | java | private void generateOnShutdown(String dataSourceNameClazz) {
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("shutdown").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(Void.TYPE);
methodBuilder.addJavadoc("<p>Close database.</p>\n");
methodBuilder.addJavadoc("\n");
methodBuild... | [
"private",
"void",
"generateOnShutdown",
"(",
"String",
"dataSourceNameClazz",
")",
"{",
"MethodSpec",
".",
"Builder",
"methodBuilder",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"shutdown\"",
")",
".",
"addModifiers",
"(",
"Modifier",
".",
"PUBLIC",
")",
"."... | Generate on shutdown.
@param dataSourceNameClazz
the data source name clazz | [
"Generate",
"on",
"shutdown",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java#L755-L766 | train |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java | BindContentProviderBuilder.generateQuery | private void generateQuery(SQLiteDatabaseSchema schema) {
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("query").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(Cursor.class);
methodBuilder.addParameter(Uri.class, "uri");
methodBuilder.addParameter(ParameterSpec.builder(TypeUtili... | java | private void generateQuery(SQLiteDatabaseSchema schema) {
MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("query").addModifiers(Modifier.PUBLIC).addAnnotation(Override.class).returns(Cursor.class);
methodBuilder.addParameter(Uri.class, "uri");
methodBuilder.addParameter(ParameterSpec.builder(TypeUtili... | [
"private",
"void",
"generateQuery",
"(",
"SQLiteDatabaseSchema",
"schema",
")",
"{",
"MethodSpec",
".",
"Builder",
"methodBuilder",
"=",
"MethodSpec",
".",
"methodBuilder",
"(",
"\"query\"",
")",
".",
"addModifiers",
"(",
"Modifier",
".",
"PUBLIC",
")",
".",
"ad... | Generate query.
@param schema
the schema | [
"Generate",
"query",
"."
] | 90de2c0523d39b99e81b8d38aa996898762f594a | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindContentProviderBuilder.java#L774-L832 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.