id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
153,500 | jbundle/jbundle | main/calendar/src/main/java/org/jbundle/main/calendar/db/CalendarControl.java | CalendarControl.updateCalendar | public void updateCalendar(Calendar calStart, Calendar calEnd)
{
Anniversary recAnniversary = new Anniversary(this.getRecordOwner());
AnnivMaster recAnnivMaster = new AnnivMaster(this.getRecordOwner());
recAnniversary.setKeyArea(Anniversary.START_DATE_TIME_KEY);
try {
whi... | java | public void updateCalendar(Calendar calStart, Calendar calEnd)
{
Anniversary recAnniversary = new Anniversary(this.getRecordOwner());
AnnivMaster recAnnivMaster = new AnnivMaster(this.getRecordOwner());
recAnniversary.setKeyArea(Anniversary.START_DATE_TIME_KEY);
try {
whi... | [
"public",
"void",
"updateCalendar",
"(",
"Calendar",
"calStart",
",",
"Calendar",
"calEnd",
")",
"{",
"Anniversary",
"recAnniversary",
"=",
"new",
"Anniversary",
"(",
"this",
".",
"getRecordOwner",
"(",
")",
")",
";",
"AnnivMaster",
"recAnnivMaster",
"=",
"new",... | UpdateCalendar Method. | [
"UpdateCalendar",
"Method",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/calendar/src/main/java/org/jbundle/main/calendar/db/CalendarControl.java#L199-L225 |
153,501 | jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageReceiver.java | BaseMessageReceiver.createDefaultFilter | public BaseMessageFilter createDefaultFilter(JMessageListener listener)
{
BaseMessageFilter messageFilter = null;
String strQueueName = MessageConstants.RECORD_QUEUE_NAME; // Default queue name=
String strQueueType = MessageConstants.INTRANET_QUEUE; // Default queue type
if (m_bas... | java | public BaseMessageFilter createDefaultFilter(JMessageListener listener)
{
BaseMessageFilter messageFilter = null;
String strQueueName = MessageConstants.RECORD_QUEUE_NAME; // Default queue name=
String strQueueType = MessageConstants.INTRANET_QUEUE; // Default queue type
if (m_bas... | [
"public",
"BaseMessageFilter",
"createDefaultFilter",
"(",
"JMessageListener",
"listener",
")",
"{",
"BaseMessageFilter",
"messageFilter",
"=",
"null",
";",
"String",
"strQueueName",
"=",
"MessageConstants",
".",
"RECORD_QUEUE_NAME",
";",
"// Default queue name=",
"String",... | Create a message filter that will send all messages to this listener.
@param listener The listener to create a filter for.
@return The new filter for this listener. | [
"Create",
"a",
"message",
"filter",
"that",
"will",
"send",
"all",
"messages",
"to",
"this",
"listener",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageReceiver.java#L201-L216 |
153,502 | jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageReceiver.java | BaseMessageReceiver.run | public void run()
{
m_thread = this;
while (m_thread != null)
{
int iErrorCode = Constant.NORMAL_RETURN;
BaseMessage message = (BaseMessage)this.receiveMessage(); // Hang until a message comes through
if ((message == null) || (m_thread == null))
... | java | public void run()
{
m_thread = this;
while (m_thread != null)
{
int iErrorCode = Constant.NORMAL_RETURN;
BaseMessage message = (BaseMessage)this.receiveMessage(); // Hang until a message comes through
if ((message == null) || (m_thread == null))
... | [
"public",
"void",
"run",
"(",
")",
"{",
"m_thread",
"=",
"this",
";",
"while",
"(",
"m_thread",
"!=",
"null",
")",
"{",
"int",
"iErrorCode",
"=",
"Constant",
".",
"NORMAL_RETURN",
";",
"BaseMessage",
"message",
"=",
"(",
"BaseMessage",
")",
"this",
".",
... | Start running this thread.
This method hangs on receiveMessage, then processes the message if it matches
the filter and continues with the next message. | [
"Start",
"running",
"this",
"thread",
".",
"This",
"method",
"hangs",
"on",
"receiveMessage",
"then",
"processes",
"the",
"message",
"if",
"it",
"matches",
"the",
"filter",
"and",
"continues",
"with",
"the",
"next",
"message",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/BaseMessageReceiver.java#L222-L281 |
153,503 | Multifarious/MacroManager | src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java | BalancingPolicy.getUnclaimed | public Set<String> getUnclaimed() {
synchronized (cluster.allWorkUnits) {
LinkedHashSet<String> result = new LinkedHashSet<String>(cluster.allWorkUnits.keySet());
result.removeAll(cluster.workUnitMap.keySet());
result.addAll(cluster.getHandoffWorkUnits());
result.... | java | public Set<String> getUnclaimed() {
synchronized (cluster.allWorkUnits) {
LinkedHashSet<String> result = new LinkedHashSet<String>(cluster.allWorkUnits.keySet());
result.removeAll(cluster.workUnitMap.keySet());
result.addAll(cluster.getHandoffWorkUnits());
result.... | [
"public",
"Set",
"<",
"String",
">",
"getUnclaimed",
"(",
")",
"{",
"synchronized",
"(",
"cluster",
".",
"allWorkUnits",
")",
"{",
"LinkedHashSet",
"<",
"String",
">",
"result",
"=",
"new",
"LinkedHashSet",
"<",
"String",
">",
"(",
"cluster",
".",
"allWork... | Returns a set of work units which are unclaimed throughout the cluster. | [
"Returns",
"a",
"set",
"of",
"work",
"units",
"which",
"are",
"unclaimed",
"throughout",
"the",
"cluster",
"."
] | 559785839981f460aaeba3c3fddff7fb667d9581 | https://github.com/Multifarious/MacroManager/blob/559785839981f460aaeba3c3fddff7fb667d9581/src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java#L56-L65 |
153,504 | Multifarious/MacroManager | src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java | BalancingPolicy.isFairGame | public boolean isFairGame(String workUnit)
{
ObjectNode workUnitData = cluster.allWorkUnits.get(workUnit);
if (workUnitData == null || workUnitData.size() == 0) {
return true;
}
try {
JsonNode pegged = workUnitData.get(cluster.name);
if (pegged == null) {... | java | public boolean isFairGame(String workUnit)
{
ObjectNode workUnitData = cluster.allWorkUnits.get(workUnit);
if (workUnitData == null || workUnitData.size() == 0) {
return true;
}
try {
JsonNode pegged = workUnitData.get(cluster.name);
if (pegged == null) {... | [
"public",
"boolean",
"isFairGame",
"(",
"String",
"workUnit",
")",
"{",
"ObjectNode",
"workUnitData",
"=",
"cluster",
".",
"allWorkUnits",
".",
"get",
"(",
"workUnit",
")",
";",
"if",
"(",
"workUnitData",
"==",
"null",
"||",
"workUnitData",
".",
"size",
"(",... | Determines whether or not a given work unit is designated "claimable" by this node.
If the ZNode for this work unit is empty, or contains JSON mapping this node to that
work unit, it's considered "claimable." | [
"Determines",
"whether",
"or",
"not",
"a",
"given",
"work",
"unit",
"is",
"designated",
"claimable",
"by",
"this",
"node",
".",
"If",
"the",
"ZNode",
"for",
"this",
"work",
"unit",
"is",
"empty",
"or",
"contains",
"JSON",
"mapping",
"this",
"node",
"to",
... | 559785839981f460aaeba3c3fddff7fb667d9581 | https://github.com/Multifarious/MacroManager/blob/559785839981f460aaeba3c3fddff7fb667d9581/src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java#L72-L90 |
153,505 | Multifarious/MacroManager | src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java | BalancingPolicy.isPeggedToMe | public boolean isPeggedToMe(String workUnitId)
{
ObjectNode zkWorkData = cluster.allWorkUnits.get(workUnitId);
if (zkWorkData == null || zkWorkData.size() == 0) {
cluster.workUnitsPeggedToMe.remove(workUnitId);
return false;
}
try {
JsonNode pegged = zkWorkDa... | java | public boolean isPeggedToMe(String workUnitId)
{
ObjectNode zkWorkData = cluster.allWorkUnits.get(workUnitId);
if (zkWorkData == null || zkWorkData.size() == 0) {
cluster.workUnitsPeggedToMe.remove(workUnitId);
return false;
}
try {
JsonNode pegged = zkWorkDa... | [
"public",
"boolean",
"isPeggedToMe",
"(",
"String",
"workUnitId",
")",
"{",
"ObjectNode",
"zkWorkData",
"=",
"cluster",
".",
"allWorkUnits",
".",
"get",
"(",
"workUnitId",
")",
";",
"if",
"(",
"zkWorkData",
"==",
"null",
"||",
"zkWorkData",
".",
"size",
"(",... | Determines whether or not a given work unit is pegged to this instance. | [
"Determines",
"whether",
"or",
"not",
"a",
"given",
"work",
"unit",
"is",
"pegged",
"to",
"this",
"instance",
"."
] | 559785839981f460aaeba3c3fddff7fb667d9581 | https://github.com/Multifarious/MacroManager/blob/559785839981f460aaeba3c3fddff7fb667d9581/src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java#L95-L117 |
153,506 | Multifarious/MacroManager | src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java | BalancingPolicy.attemptToClaim | boolean attemptToClaim(String workUnit, boolean claimForHandoff)
throws InterruptedException
{
LOG.debug("Attempting to claim {}. For handoff? {}", workUnit, claimForHandoff);
String path = claimForHandoff
? String.format("/%s/handoff-result/%s", cluster.name, workUnit)
... | java | boolean attemptToClaim(String workUnit, boolean claimForHandoff)
throws InterruptedException
{
LOG.debug("Attempting to claim {}. For handoff? {}", workUnit, claimForHandoff);
String path = claimForHandoff
? String.format("/%s/handoff-result/%s", cluster.name, workUnit)
... | [
"boolean",
"attemptToClaim",
"(",
"String",
"workUnit",
",",
"boolean",
"claimForHandoff",
")",
"throws",
"InterruptedException",
"{",
"LOG",
".",
"debug",
"(",
"\"Attempting to claim {}. For handoff? {}\"",
",",
"workUnit",
",",
"claimForHandoff",
")",
";",
"String",
... | Attempts to claim a given work unit by creating an ephemeral node in ZooKeeper
with this node's ID. If the claim succeeds, start work. If not, move on.
@throws ZooKeeperConnectionException
@throws KeeperException | [
"Attempts",
"to",
"claim",
"a",
"given",
"work",
"unit",
"by",
"creating",
"an",
"ephemeral",
"node",
"in",
"ZooKeeper",
"with",
"this",
"node",
"s",
"ID",
".",
"If",
"the",
"claim",
"succeeds",
"start",
"work",
".",
"If",
"not",
"move",
"on",
"."
] | 559785839981f460aaeba3c3fddff7fb667d9581 | https://github.com/Multifarious/MacroManager/blob/559785839981f460aaeba3c3fddff7fb667d9581/src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java#L130-L153 |
153,507 | Multifarious/MacroManager | src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java | BalancingPolicy.drainToCount | protected void drainToCount(final int targetCount, final boolean doShutdown, /* Boolean = false */
final boolean useHandoff, /* : Boolean = config.useSoftHandoff */
final CountDownLatch latch)
{
String msg = useHandoff ? " with handoff" : "";
LOG.info(String.for... | java | protected void drainToCount(final int targetCount, final boolean doShutdown, /* Boolean = false */
final boolean useHandoff, /* : Boolean = config.useSoftHandoff */
final CountDownLatch latch)
{
String msg = useHandoff ? " with handoff" : "";
LOG.info(String.for... | [
"protected",
"void",
"drainToCount",
"(",
"final",
"int",
"targetCount",
",",
"final",
"boolean",
"doShutdown",
",",
"/* Boolean = false */",
"final",
"boolean",
"useHandoff",
",",
"/* : Boolean = config.useSoftHandoff */",
"final",
"CountDownLatch",
"latch",
")",
"{",
... | Drains this node's share of the cluster workload down to a specific number
of work units over a period of time specified in the configuration with
soft handoff if enabled.. | [
"Drains",
"this",
"node",
"s",
"share",
"of",
"the",
"cluster",
"workload",
"down",
"to",
"a",
"specific",
"number",
"of",
"work",
"units",
"over",
"a",
"period",
"of",
"time",
"specified",
"in",
"the",
"configuration",
"with",
"soft",
"handoff",
"if",
"en... | 559785839981f460aaeba3c3fddff7fb667d9581 | https://github.com/Multifarious/MacroManager/blob/559785839981f460aaeba3c3fddff7fb667d9581/src/main/java/com/fasterxml/mama/balancing/BalancingPolicy.java#L186-L254 |
153,508 | jbundle/jbundle | main/schedule/src/main/java/org/jbundle/main/schedule/app/JobSchedulerProcess.java | JobSchedulerProcess.runCalendarEntry | public void runCalendarEntry(Map<String,Object> properties)
{
ProcessRunnerTask task = new ProcessRunnerTask(null, null, properties);
((Application)this.getTask().getApplication()).getTaskScheduler().addTask(task);
} | java | public void runCalendarEntry(Map<String,Object> properties)
{
ProcessRunnerTask task = new ProcessRunnerTask(null, null, properties);
((Application)this.getTask().getApplication()).getTaskScheduler().addTask(task);
} | [
"public",
"void",
"runCalendarEntry",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"ProcessRunnerTask",
"task",
"=",
"new",
"ProcessRunnerTask",
"(",
"null",
",",
"null",
",",
"properties",
")",
";",
"(",
"(",
"Application",
")",
... | RunCalendarEntry Method. | [
"RunCalendarEntry",
"Method",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/schedule/src/main/java/org/jbundle/main/schedule/app/JobSchedulerProcess.java#L122-L126 |
153,509 | jbundle/jbundle | app/program/script/src/main/java/org/jbundle/app/program/script/scan/CalendarScanListener.java | CalendarScanListener.getNewCalendarPath | public String getNewCalendarPath(File file)
{
StringTokenizer st = new StringTokenizer(file.getName());
int iPlace = 0, iMonth = 0, iYear = 0;
while (st.hasMoreTokens())
{
String strToken = st.nextToken();
if (strToken.length() > 2)
break; // ... | java | public String getNewCalendarPath(File file)
{
StringTokenizer st = new StringTokenizer(file.getName());
int iPlace = 0, iMonth = 0, iYear = 0;
while (st.hasMoreTokens())
{
String strToken = st.nextToken();
if (strToken.length() > 2)
break; // ... | [
"public",
"String",
"getNewCalendarPath",
"(",
"File",
"file",
")",
"{",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
"(",
"file",
".",
"getName",
"(",
")",
")",
";",
"int",
"iPlace",
"=",
"0",
",",
"iMonth",
"=",
"0",
",",
"iYear",
"=",
"0"... | GetNewCalendarPath Method. | [
"GetNewCalendarPath",
"Method",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/script/src/main/java/org/jbundle/app/program/script/scan/CalendarScanListener.java#L108-L145 |
153,510 | jbundle/jbundle | main/db/src/main/java/org/jbundle/main/user/db/UserContactHandler.java | UserContactHandler.getContactType | public ContactType getContactType(Person recPerson)
{
if (m_recContactType == null)
{
m_recContactType = (ContactType)Record.makeRecordFromClassName(ContactTypeModel.CONTACT_TYPE_FILE, this.getOwner().getRecord().findRecordOwner());
if (((Record)m_recContactType).getRecordOwn... | java | public ContactType getContactType(Person recPerson)
{
if (m_recContactType == null)
{
m_recContactType = (ContactType)Record.makeRecordFromClassName(ContactTypeModel.CONTACT_TYPE_FILE, this.getOwner().getRecord().findRecordOwner());
if (((Record)m_recContactType).getRecordOwn... | [
"public",
"ContactType",
"getContactType",
"(",
"Person",
"recPerson",
")",
"{",
"if",
"(",
"m_recContactType",
"==",
"null",
")",
"{",
"m_recContactType",
"=",
"(",
"ContactType",
")",
"Record",
".",
"makeRecordFromClassName",
"(",
"ContactTypeModel",
".",
"CONTA... | GetContactType Method. | [
"GetContactType",
"Method",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/db/src/main/java/org/jbundle/main/user/db/UserContactHandler.java#L107-L116 |
153,511 | jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/BaseTaskSession.java | BaseTaskSession.init | public void init(BaseSession parentSessionObject, Record record, Map<String, Object> objectID)
{
if (m_application == null)
m_application = new MainApplication(null, null, null);
this.addToApplication();
super.init(parentSessionObject, record, objectID);
} | java | public void init(BaseSession parentSessionObject, Record record, Map<String, Object> objectID)
{
if (m_application == null)
m_application = new MainApplication(null, null, null);
this.addToApplication();
super.init(parentSessionObject, record, objectID);
} | [
"public",
"void",
"init",
"(",
"BaseSession",
"parentSessionObject",
",",
"Record",
"record",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"objectID",
")",
"{",
"if",
"(",
"m_application",
"==",
"null",
")",
"m_application",
"=",
"new",
"MainApplication",
... | Build a new task session.
@param parentSessionObject Parent that created this session object (usually null for task sessions).
@param record Main record for this session (always null for task sessions).
@param objectID ObjectID of the object that this SessionObject represents (usually null for task sessions). | [
"Build",
"a",
"new",
"task",
"session",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/BaseTaskSession.java#L92-L98 |
153,512 | jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/BaseTaskSession.java | BaseTaskSession.removeFromApplication | public void removeFromApplication(boolean bFreeIfDone)
{
if (m_application == null)
return; // In free.
Application app = m_application;
m_application = null;
boolean bEmptyTaskList = app.removeTask(this); // Remove this session from the list
if (bFreeIfDone)
... | java | public void removeFromApplication(boolean bFreeIfDone)
{
if (m_application == null)
return; // In free.
Application app = m_application;
m_application = null;
boolean bEmptyTaskList = app.removeTask(this); // Remove this session from the list
if (bFreeIfDone)
... | [
"public",
"void",
"removeFromApplication",
"(",
"boolean",
"bFreeIfDone",
")",
"{",
"if",
"(",
"m_application",
"==",
"null",
")",
"return",
";",
"// In free.",
"Application",
"app",
"=",
"m_application",
";",
"m_application",
"=",
"null",
";",
"boolean",
"bEmpt... | Remove this task or session to my parent application.
@param bFreeIfDone If true and the application is empty, free the application. | [
"Remove",
"this",
"task",
"or",
"session",
"to",
"my",
"parent",
"application",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/BaseTaskSession.java#L119-L129 |
153,513 | jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/AbstractThinTableModel.java | AbstractThinTableModel.getFieldInfo | public Convert getFieldInfo(int iColumnIndex)
{
Converter converter = m_table.getRecord().getField(iColumnIndex);
if (converter != null)
converter = converter.getFieldConverter(); // Make sure you have the front converter.
return converter;
} | java | public Convert getFieldInfo(int iColumnIndex)
{
Converter converter = m_table.getRecord().getField(iColumnIndex);
if (converter != null)
converter = converter.getFieldConverter(); // Make sure you have the front converter.
return converter;
} | [
"public",
"Convert",
"getFieldInfo",
"(",
"int",
"iColumnIndex",
")",
"{",
"Converter",
"converter",
"=",
"m_table",
".",
"getRecord",
"(",
")",
".",
"getField",
"(",
"iColumnIndex",
")",
";",
"if",
"(",
"converter",
"!=",
"null",
")",
"converter",
"=",
"c... | Returns the field at columnIndex.
This should be overidden if don't want to just return the corresponding field in the record.
@param iColumn The column to get the field from.
@return The field in this column. | [
"Returns",
"the",
"field",
"at",
"columnIndex",
".",
"This",
"should",
"be",
"overidden",
"if",
"don",
"t",
"want",
"to",
"just",
"return",
"the",
"corresponding",
"field",
"in",
"the",
"record",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/AbstractThinTableModel.java#L108-L114 |
153,514 | jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/AbstractThinTableModel.java | AbstractThinTableModel.getColumnName | public String getColumnName(int iColumnIndex)
{
Convert fieldInfo = this.getFieldInfo(iColumnIndex);
if (fieldInfo != null)
return fieldInfo.getFieldDesc();
return Constants.BLANK;
} | java | public String getColumnName(int iColumnIndex)
{
Convert fieldInfo = this.getFieldInfo(iColumnIndex);
if (fieldInfo != null)
return fieldInfo.getFieldDesc();
return Constants.BLANK;
} | [
"public",
"String",
"getColumnName",
"(",
"int",
"iColumnIndex",
")",
"{",
"Convert",
"fieldInfo",
"=",
"this",
".",
"getFieldInfo",
"(",
"iColumnIndex",
")",
";",
"if",
"(",
"fieldInfo",
"!=",
"null",
")",
"return",
"fieldInfo",
".",
"getFieldDesc",
"(",
")... | Returns the name of the column at columnIndex.
@param The column to get the name of.
@return The column's field description. | [
"Returns",
"the",
"name",
"of",
"the",
"column",
"at",
"columnIndex",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/AbstractThinTableModel.java#L226-L232 |
153,515 | jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/TreeMessage.java | TreeMessage.keySet | public Iterator<String> keySet()
{
Node node = getNode(true);
NodeList nodeList = node.getChildNodes();
return new NodeIterator(nodeList);
} | java | public Iterator<String> keySet()
{
Node node = getNode(true);
NodeList nodeList = node.getChildNodes();
return new NodeIterator(nodeList);
} | [
"public",
"Iterator",
"<",
"String",
">",
"keySet",
"(",
")",
"{",
"Node",
"node",
"=",
"getNode",
"(",
"true",
")",
";",
"NodeList",
"nodeList",
"=",
"node",
".",
"getChildNodes",
"(",
")",
";",
"return",
"new",
"NodeIterator",
"(",
"nodeList",
")",
"... | Get a Iterator of the keys in this message.
@return An iterator of the keys in this message. | [
"Get",
"a",
"Iterator",
"of",
"the",
"keys",
"in",
"this",
"message",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/TreeMessage.java#L139-L144 |
153,516 | jbundle/jbundle | thin/base/message/src/main/java/org/jbundle/thin/base/message/TreeMessage.java | TreeMessage.getNodeCount | public int getNodeCount(String strKey)
{
int iCount = 0;
Node node = this.getNode(null, strKey, CreateMode.DONT_CREATE, false);
if (node != null)
{
String key = strKey;
if (key.lastIndexOf('/') != -1)
key = key.substring(key.lastIndexOf('/') + ... | java | public int getNodeCount(String strKey)
{
int iCount = 0;
Node node = this.getNode(null, strKey, CreateMode.DONT_CREATE, false);
if (node != null)
{
String key = strKey;
if (key.lastIndexOf('/') != -1)
key = key.substring(key.lastIndexOf('/') + ... | [
"public",
"int",
"getNodeCount",
"(",
"String",
"strKey",
")",
"{",
"int",
"iCount",
"=",
"0",
";",
"Node",
"node",
"=",
"this",
".",
"getNode",
"(",
"null",
",",
"strKey",
",",
"CreateMode",
".",
"DONT_CREATE",
",",
"false",
")",
";",
"if",
"(",
"no... | Get the number of data nodes at this path in the data.
@param strKey The xpath key to the data.
@return The number of data nodes at this location. | [
"Get",
"the",
"number",
"of",
"data",
"nodes",
"at",
"this",
"path",
"in",
"the",
"data",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/message/src/main/java/org/jbundle/thin/base/message/TreeMessage.java#L186-L207 |
153,517 | kirgor/enklib | common/src/main/java/com/kirgor/enklib/common/AsyncRunner.java | AsyncRunner.start | public void start(boolean isDaemon) {
synchronized (this) {
if (!isUsed) {
isUsed = true;
isRunning = true;
Thread thread = new Thread(new RunnableImpl());
thread.setDaemon(isDaemon);
thread.start();
} else {... | java | public void start(boolean isDaemon) {
synchronized (this) {
if (!isUsed) {
isUsed = true;
isRunning = true;
Thread thread = new Thread(new RunnableImpl());
thread.setDaemon(isDaemon);
thread.start();
} else {... | [
"public",
"void",
"start",
"(",
"boolean",
"isDaemon",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"!",
"isUsed",
")",
"{",
"isUsed",
"=",
"true",
";",
"isRunning",
"=",
"true",
";",
"Thread",
"thread",
"=",
"new",
"Thread",
"(",
"new... | Starts processing the items queue. This method can be called only once.
@param isDaemon Specifies whether underlying thread will be daemon thread. | [
"Starts",
"processing",
"the",
"items",
"queue",
".",
"This",
"method",
"can",
"be",
"called",
"only",
"once",
"."
] | 8a24db296dc43db5d8fe509cf64ace0a0c7be8f2 | https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/common/src/main/java/com/kirgor/enklib/common/AsyncRunner.java#L22-L34 |
153,518 | kirgor/enklib | common/src/main/java/com/kirgor/enklib/common/AsyncRunner.java | AsyncRunner.addItems | public void addItems(Iterable<T> items) {
synchronized (this) {
for (T i : items) {
this.items.add(i);
}
semaphore.release();
}
} | java | public void addItems(Iterable<T> items) {
synchronized (this) {
for (T i : items) {
this.items.add(i);
}
semaphore.release();
}
} | [
"public",
"void",
"addItems",
"(",
"Iterable",
"<",
"T",
">",
"items",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"for",
"(",
"T",
"i",
":",
"items",
")",
"{",
"this",
".",
"items",
".",
"add",
"(",
"i",
")",
";",
"}",
"semaphore",
".",
"... | Adds multiple items to the processing queue. Can be called even before the start.
This method is preferred to calling addItem multiple times in row, because it will
make synchronization only once.
@param items Items to add. | [
"Adds",
"multiple",
"items",
"to",
"the",
"processing",
"queue",
".",
"Can",
"be",
"called",
"even",
"before",
"the",
"start",
".",
"This",
"method",
"is",
"preferred",
"to",
"calling",
"addItem",
"multiple",
"times",
"in",
"row",
"because",
"it",
"will",
... | 8a24db296dc43db5d8fe509cf64ace0a0c7be8f2 | https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/common/src/main/java/com/kirgor/enklib/common/AsyncRunner.java#L66-L73 |
153,519 | lightblueseas/file-worker | src/main/java/de/alpharogroup/file/csv/CsvToSqlExtensions.java | CsvToSqlExtensions.extractSqlColumns | public static String extractSqlColumns(final String[] headers)
{
final StringBuffer sqlColumns = new StringBuffer();
sqlColumns.append("");
for (int i = 0; i < headers.length; i++)
{
sqlColumns.append(headers[i]);
if (i < headers.length - 1)
{
sqlColumns.append(", ");
}
else
{
sqlColu... | java | public static String extractSqlColumns(final String[] headers)
{
final StringBuffer sqlColumns = new StringBuffer();
sqlColumns.append("");
for (int i = 0; i < headers.length; i++)
{
sqlColumns.append(headers[i]);
if (i < headers.length - 1)
{
sqlColumns.append(", ");
}
else
{
sqlColu... | [
"public",
"static",
"String",
"extractSqlColumns",
"(",
"final",
"String",
"[",
"]",
"headers",
")",
"{",
"final",
"StringBuffer",
"sqlColumns",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sqlColumns",
".",
"append",
"(",
"\"\"",
")",
";",
"for",
"(",
"int... | Extract sql columns.
@param headers
the headers
@return the string | [
"Extract",
"sql",
"columns",
"."
] | 2c81de10fb5d68de64c1abc3ed64ca681ce76da8 | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/csv/CsvToSqlExtensions.java#L47-L64 |
153,520 | AlexLandau/gdl-validation | src/main/java/net/alloyggp/griddle/indentation/GameIndenter.java | GameIndenter.reindentGameDescription | public static String reindentGameDescription(String gameRules) throws Exception {
List<Symbol> tokens = ParserHelper.scan(gameRules, true);
tokens = collapseWhitespaceTokens(tokens);
StringBuilder result = new StringBuilder();
int parensLevel = 0; // "( so far" minus ") so far"
... | java | public static String reindentGameDescription(String gameRules) throws Exception {
List<Symbol> tokens = ParserHelper.scan(gameRules, true);
tokens = collapseWhitespaceTokens(tokens);
StringBuilder result = new StringBuilder();
int parensLevel = 0; // "( so far" minus ") so far"
... | [
"public",
"static",
"String",
"reindentGameDescription",
"(",
"String",
"gameRules",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Symbol",
">",
"tokens",
"=",
"ParserHelper",
".",
"scan",
"(",
"gameRules",
",",
"true",
")",
";",
"tokens",
"=",
"collapseWhite... | Returns null if the indentation fails. | [
"Returns",
"null",
"if",
"the",
"indentation",
"fails",
"."
] | ec87cc9fdd8af32d79aa7d130b7cb062f29834fb | https://github.com/AlexLandau/gdl-validation/blob/ec87cc9fdd8af32d79aa7d130b7cb062f29834fb/src/main/java/net/alloyggp/griddle/indentation/GameIndenter.java#L17-L70 |
153,521 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/RecordReferenceField.java | RecordReferenceField.getReferenceRecord | public Record getReferenceRecord()
{
Record recordReference = this.getReferenceRecord(null);
if (recordReference != null)
if (recordReference.getRecordOwner() == null) // Only add it if it doesn't belong to any other screen.
{
RecordOwner recordOwner = null;
... | java | public Record getReferenceRecord()
{
Record recordReference = this.getReferenceRecord(null);
if (recordReference != null)
if (recordReference.getRecordOwner() == null) // Only add it if it doesn't belong to any other screen.
{
RecordOwner recordOwner = null;
... | [
"public",
"Record",
"getReferenceRecord",
"(",
")",
"{",
"Record",
"recordReference",
"=",
"this",
".",
"getReferenceRecord",
"(",
"null",
")",
";",
"if",
"(",
"recordReference",
"!=",
"null",
")",
"if",
"(",
"recordReference",
".",
"getRecordOwner",
"(",
")",... | Get the record that this field references.
This is the default method, so if a record by this name doesn't belong to this screen, add this one!
@return tour.db.Record | [
"Get",
"the",
"record",
"that",
"this",
"field",
"references",
".",
"This",
"is",
"the",
"default",
"method",
"so",
"if",
"a",
"record",
"by",
"this",
"name",
"doesn",
"t",
"belong",
"to",
"this",
"screen",
"add",
"this",
"one!"
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/RecordReferenceField.java#L69-L94 |
153,522 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/RecordReferenceField.java | RecordReferenceField.getReferenceRecord | public Record getReferenceRecord(RecordOwner screen, boolean bCreateIfNotFound)
{
if ((m_recordReference == null)
&& (bCreateIfNotFound))
{
RecordOwner recordOwner = screen;
if (recordOwner == null)
if (this.getRecord() != null)
... | java | public Record getReferenceRecord(RecordOwner screen, boolean bCreateIfNotFound)
{
if ((m_recordReference == null)
&& (bCreateIfNotFound))
{
RecordOwner recordOwner = screen;
if (recordOwner == null)
if (this.getRecord() != null)
... | [
"public",
"Record",
"getReferenceRecord",
"(",
"RecordOwner",
"screen",
",",
"boolean",
"bCreateIfNotFound",
")",
"{",
"if",
"(",
"(",
"m_recordReference",
"==",
"null",
")",
"&&",
"(",
"bCreateIfNotFound",
")",
")",
"{",
"RecordOwner",
"recordOwner",
"=",
"scre... | Get the record that this field references.
@param recordOwner The recordowner to initialize the reference record to if it doesn't already exist.
@param bCreateIfNotFound Create the record reference if it isn't set up yet.
@return tour.db.Record The record this field references. | [
"Get",
"the",
"record",
"that",
"this",
"field",
"references",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/RecordReferenceField.java#L110-L150 |
153,523 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/RecordReferenceField.java | RecordReferenceField.setReferenceRecord | public void setReferenceRecord(Record record)
{
if (m_recordReference != record)
{
if (m_recordReference != null)
{ // Take behaviors off old references
// You only want to disconnect the referenced record (not free it).
if (this.getRecord() != ... | java | public void setReferenceRecord(Record record)
{
if (m_recordReference != record)
{
if (m_recordReference != null)
{ // Take behaviors off old references
// You only want to disconnect the referenced record (not free it).
if (this.getRecord() != ... | [
"public",
"void",
"setReferenceRecord",
"(",
"Record",
"record",
")",
"{",
"if",
"(",
"m_recordReference",
"!=",
"record",
")",
"{",
"if",
"(",
"m_recordReference",
"!=",
"null",
")",
"{",
"// Take behaviors off old references",
"// You only want to disconnect the refer... | Set the record that this field references.
@param record The record to set as the record reference. | [
"Set",
"the",
"record",
"that",
"this",
"field",
"references",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/RecordReferenceField.java#L189-L231 |
153,524 | the-fascinator/plugin-subscriber-solrEventLog | src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java | SolrEventLogSubscriber.init | @Override
public void init(File jsonFile) throws SubscriberException {
try {
setConfig(new JsonSimpleConfig(jsonFile));
} catch (IOException ioe) {
throw new SubscriberException(ioe);
}
} | java | @Override
public void init(File jsonFile) throws SubscriberException {
try {
setConfig(new JsonSimpleConfig(jsonFile));
} catch (IOException ioe) {
throw new SubscriberException(ioe);
}
} | [
"@",
"Override",
"public",
"void",
"init",
"(",
"File",
"jsonFile",
")",
"throws",
"SubscriberException",
"{",
"try",
"{",
"setConfig",
"(",
"new",
"JsonSimpleConfig",
"(",
"jsonFile",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"ioe",
")",
"{",
"thro... | Initializes the plugin using the specified JSON configuration
@param jsonFile JSON configuration file
@throws SubscriberException if there was an error in initialization | [
"Initializes",
"the",
"plugin",
"using",
"the",
"specified",
"JSON",
"configuration"
] | 2c9da188887a622a6d43d33ea9099aff53a0516d | https://github.com/the-fascinator/plugin-subscriber-solrEventLog/blob/2c9da188887a622a6d43d33ea9099aff53a0516d/src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java#L223-L230 |
153,525 | the-fascinator/plugin-subscriber-solrEventLog | src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java | SolrEventLogSubscriber.setConfig | private void setConfig(JsonSimpleConfig config) throws SubscriberException {
try {
// Find our solr index
uri = new URI(config.getString(null, "subscriber", getId(), "uri"));
if (uri == null) {
throw new SubscriberException("No Solr URI provided");
... | java | private void setConfig(JsonSimpleConfig config) throws SubscriberException {
try {
// Find our solr index
uri = new URI(config.getString(null, "subscriber", getId(), "uri"));
if (uri == null) {
throw new SubscriberException("No Solr URI provided");
... | [
"private",
"void",
"setConfig",
"(",
"JsonSimpleConfig",
"config",
")",
"throws",
"SubscriberException",
"{",
"try",
"{",
"// Find our solr index",
"uri",
"=",
"new",
"URI",
"(",
"config",
".",
"getString",
"(",
"null",
",",
"\"subscriber\"",
",",
"getId",
"(",
... | Initialization of Solr Access Control plugin
@param config The configuration to use
@throws AuthenticationException if fails to initialize | [
"Initialization",
"of",
"Solr",
"Access",
"Control",
"plugin"
] | 2c9da188887a622a6d43d33ea9099aff53a0516d | https://github.com/the-fascinator/plugin-subscriber-solrEventLog/blob/2c9da188887a622a6d43d33ea9099aff53a0516d/src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java#L238-L289 |
153,526 | the-fascinator/plugin-subscriber-solrEventLog | src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java | SolrEventLogSubscriber.checkBuffer | private void checkBuffer() {
// Doc count limit
if (docBuffer.size() >= bufferDocLimit) {
log.debug("=== Buffer check: Doc limit reached '{}'", docBuffer.size());
submitBuffer(false);
return;
}
// Size limit
if (bufferSize > bufferSizeLimit) {
... | java | private void checkBuffer() {
// Doc count limit
if (docBuffer.size() >= bufferDocLimit) {
log.debug("=== Buffer check: Doc limit reached '{}'", docBuffer.size());
submitBuffer(false);
return;
}
// Size limit
if (bufferSize > bufferSizeLimit) {
... | [
"private",
"void",
"checkBuffer",
"(",
")",
"{",
"// Doc count limit",
"if",
"(",
"docBuffer",
".",
"size",
"(",
")",
">=",
"bufferDocLimit",
")",
"{",
"log",
".",
"debug",
"(",
"\"=== Buffer check: Doc limit reached '{}'\"",
",",
"docBuffer",
".",
"size",
"(",
... | Assess the document buffer and decide is it is ready to submit | [
"Assess",
"the",
"document",
"buffer",
"and",
"decide",
"is",
"it",
"is",
"ready",
"to",
"submit"
] | 2c9da188887a622a6d43d33ea9099aff53a0516d | https://github.com/the-fascinator/plugin-subscriber-solrEventLog/blob/2c9da188887a622a6d43d33ea9099aff53a0516d/src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java#L340-L360 |
153,527 | the-fascinator/plugin-subscriber-solrEventLog | src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java | SolrEventLogSubscriber.addToIndex | private void addToIndex(Map<String, String> param) throws Exception {
String doc = writeUpdateString(param);
addToBuffer(doc);
} | java | private void addToIndex(Map<String, String> param) throws Exception {
String doc = writeUpdateString(param);
addToBuffer(doc);
} | [
"private",
"void",
"addToIndex",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"param",
")",
"throws",
"Exception",
"{",
"String",
"doc",
"=",
"writeUpdateString",
"(",
"param",
")",
";",
"addToBuffer",
"(",
"doc",
")",
";",
"}"
] | Add the event to the index
@param param : Map of key/value pairs to add to the index
@throws Exception if there was an error | [
"Add",
"the",
"event",
"to",
"the",
"index"
] | 2c9da188887a622a6d43d33ea9099aff53a0516d | https://github.com/the-fascinator/plugin-subscriber-solrEventLog/blob/2c9da188887a622a6d43d33ea9099aff53a0516d/src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java#L437-L440 |
153,528 | the-fascinator/plugin-subscriber-solrEventLog | src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java | SolrEventLogSubscriber.writeUpdateString | private String writeUpdateString(Map<String, String> param) {
StringBuffer fieldStringBuffer = new StringBuffer();
for(Entry<String, String> entry : param.entrySet()){
fieldStringBuffer.append("<field name=\"").append(entry.getKey()).append("\">")
.append(StringEscapeUtils.escapeXml(... | java | private String writeUpdateString(Map<String, String> param) {
StringBuffer fieldStringBuffer = new StringBuffer();
for(Entry<String, String> entry : param.entrySet()){
fieldStringBuffer.append("<field name=\"").append(entry.getKey()).append("\">")
.append(StringEscapeUtils.escapeXml(... | [
"private",
"String",
"writeUpdateString",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"param",
")",
"{",
"StringBuffer",
"fieldStringBuffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
"entry",
":"... | Turn a a message into a Solr document
@param param : Map of key/value pairs to add to the index | [
"Turn",
"a",
"a",
"message",
"into",
"a",
"Solr",
"document"
] | 2c9da188887a622a6d43d33ea9099aff53a0516d | https://github.com/the-fascinator/plugin-subscriber-solrEventLog/blob/2c9da188887a622a6d43d33ea9099aff53a0516d/src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java#L447-L456 |
153,529 | the-fascinator/plugin-subscriber-solrEventLog | src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java | SolrEventLogSubscriber.onEvent | @Override
public void onEvent(Map<String, String> param) throws SubscriberException {
try {
addToIndex(param);
} catch (Exception e) {
throw new SubscriberException("Fail to add log to solr"
+ e.getMessage());
}
} | java | @Override
public void onEvent(Map<String, String> param) throws SubscriberException {
try {
addToIndex(param);
} catch (Exception e) {
throw new SubscriberException("Fail to add log to solr"
+ e.getMessage());
}
} | [
"@",
"Override",
"public",
"void",
"onEvent",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"param",
")",
"throws",
"SubscriberException",
"{",
"try",
"{",
"addToIndex",
"(",
"param",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"... | Method to fire for incoming events
@param param : Map of key/value pairs to add to the index
@throws SubscriberException if there was an error | [
"Method",
"to",
"fire",
"for",
"incoming",
"events"
] | 2c9da188887a622a6d43d33ea9099aff53a0516d | https://github.com/the-fascinator/plugin-subscriber-solrEventLog/blob/2c9da188887a622a6d43d33ea9099aff53a0516d/src/main/java/com/googlecode/fascinator/subscriber/solrEventLog/SolrEventLogSubscriber.java#L464-L472 |
153,530 | tvesalainen/util | util/src/main/java/org/vesalainen/util/concurrent/ConcurrentArraySet.java | ConcurrentArraySet.iterator | @Override
public Iterator<T> iterator()
{
writeLock.lock();
if (iterator == null)
{
iterator = new Iter();
}
else
{
iterator.reset();
}
return iterator;
} | java | @Override
public Iterator<T> iterator()
{
writeLock.lock();
if (iterator == null)
{
iterator = new Iter();
}
else
{
iterator.reset();
}
return iterator;
} | [
"@",
"Override",
"public",
"Iterator",
"<",
"T",
">",
"iterator",
"(",
")",
"{",
"writeLock",
".",
"lock",
"(",
")",
";",
"if",
"(",
"iterator",
"==",
"null",
")",
"{",
"iterator",
"=",
"new",
"Iter",
"(",
")",
";",
"}",
"else",
"{",
"iterator",
... | Returned iterator is write-locked until hasNext returns false or unlock
method is called.
@return | [
"Returned",
"iterator",
"is",
"write",
"-",
"locked",
"until",
"hasNext",
"returns",
"false",
"or",
"unlock",
"method",
"is",
"called",
"."
] | bba7a44689f638ffabc8be40a75bdc9a33676433 | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/concurrent/ConcurrentArraySet.java#L73-L86 |
153,531 | jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/XMLParser.java | XMLParser.printHtmlData | public void printHtmlData(PrintWriter out, InputStream streamIn)
{
String str = null;
if (streamIn != null)
str = Utility.transferURLStream(null, null, new InputStreamReader(streamIn));
if ((str == null) || (str.length() == 0))
str = this.getDefaultXML();
this... | java | public void printHtmlData(PrintWriter out, InputStream streamIn)
{
String str = null;
if (streamIn != null)
str = Utility.transferURLStream(null, null, new InputStreamReader(streamIn));
if ((str == null) || (str.length() == 0))
str = this.getDefaultXML();
this... | [
"public",
"void",
"printHtmlData",
"(",
"PrintWriter",
"out",
",",
"InputStream",
"streamIn",
")",
"{",
"String",
"str",
"=",
"null",
";",
"if",
"(",
"streamIn",
"!=",
"null",
")",
"str",
"=",
"Utility",
".",
"transferURLStream",
"(",
"null",
",",
"null",
... | Output this screen using HTML.
Override this to print your XML. | [
"Output",
"this",
"screen",
"using",
"HTML",
".",
"Override",
"this",
"to",
"print",
"your",
"XML",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/XMLParser.java#L60-L68 |
153,532 | jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/XMLParser.java | XMLParser.getTagData | public String getTagData(String strData, String strTag)
{
int iStartData = strData.indexOf('<' + strTag + '>');
if (iStartData == -1)
return null;
iStartData = iStartData + strTag.length() + 2;
int iEndData = strData.indexOf("</" + strTag + '>');
if (iStartData ==... | java | public String getTagData(String strData, String strTag)
{
int iStartData = strData.indexOf('<' + strTag + '>');
if (iStartData == -1)
return null;
iStartData = iStartData + strTag.length() + 2;
int iEndData = strData.indexOf("</" + strTag + '>');
if (iStartData ==... | [
"public",
"String",
"getTagData",
"(",
"String",
"strData",
",",
"String",
"strTag",
")",
"{",
"int",
"iStartData",
"=",
"strData",
".",
"indexOf",
"(",
"'",
"'",
"+",
"strTag",
"+",
"'",
"'",
")",
";",
"if",
"(",
"iStartData",
"==",
"-",
"1",
")",
... | Find the data between these XML tags.
@param strData The XML code to find the tags in.
@param strTag The tag to find. | [
"Find",
"the",
"data",
"between",
"these",
"XML",
"tags",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/XMLParser.java#L81-L91 |
153,533 | jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/XMLParser.java | XMLParser.getProperty | public String getProperty(String strProperty, String strParams)
{
String strValue = null;
strValue = this.parseArg(strProperty, strParams);
if (strValue == null)
strValue = this.getRecordOwner().getProperty(strProperty);
return strValue;
} | java | public String getProperty(String strProperty, String strParams)
{
String strValue = null;
strValue = this.parseArg(strProperty, strParams);
if (strValue == null)
strValue = this.getRecordOwner().getProperty(strProperty);
return strValue;
} | [
"public",
"String",
"getProperty",
"(",
"String",
"strProperty",
",",
"String",
"strParams",
")",
"{",
"String",
"strValue",
"=",
"null",
";",
"strValue",
"=",
"this",
".",
"parseArg",
"(",
"strProperty",
",",
"strParams",
")",
";",
"if",
"(",
"strValue",
... | Get this property.
First, see if it's in the param tag, then work your way up the hierarchy. | [
"Get",
"this",
"property",
".",
"First",
"see",
"if",
"it",
"s",
"in",
"the",
"param",
"tag",
"then",
"work",
"your",
"way",
"up",
"the",
"hierarchy",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/XMLParser.java#L206-L213 |
153,534 | jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/XMLParser.java | XMLParser.parseArg | public String parseArg(String strProperty, String strURL)
{
if ((strURL == null) || (strProperty == null))
return null;
int iStartIndex = strURL.toUpperCase().indexOf(strProperty.toUpperCase() + '='); // Start of first param (0 if no ?)
if (iStartIndex == -1)
retur... | java | public String parseArg(String strProperty, String strURL)
{
if ((strURL == null) || (strProperty == null))
return null;
int iStartIndex = strURL.toUpperCase().indexOf(strProperty.toUpperCase() + '='); // Start of first param (0 if no ?)
if (iStartIndex == -1)
retur... | [
"public",
"String",
"parseArg",
"(",
"String",
"strProperty",
",",
"String",
"strURL",
")",
"{",
"if",
"(",
"(",
"strURL",
"==",
"null",
")",
"||",
"(",
"strProperty",
"==",
"null",
")",
")",
"return",
"null",
";",
"int",
"iStartIndex",
"=",
"strURL",
... | Parse this URL formatted string into properties. | [
"Parse",
"this",
"URL",
"formatted",
"string",
"into",
"properties",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/XMLParser.java#L217-L234 |
153,535 | mijecu25/dsa | src/main/java/com/mijecu25/dsa/algorithms/sort/quadratic/Bubble.java | Bubble.sort | public static <E extends Comparable<E>> void sort(List<E> list) {
boolean swapped = true;
while(swapped) {
swapped = false;
for(int i = 0; i < (list.size() - 1); i++) {
if(list.get(i).compareTo(list.get(i + 1)) > 0) {
Triv... | java | public static <E extends Comparable<E>> void sort(List<E> list) {
boolean swapped = true;
while(swapped) {
swapped = false;
for(int i = 0; i < (list.size() - 1); i++) {
if(list.get(i).compareTo(list.get(i + 1)) > 0) {
Triv... | [
"public",
"static",
"<",
"E",
"extends",
"Comparable",
"<",
"E",
">",
">",
"void",
"sort",
"(",
"List",
"<",
"E",
">",
"list",
")",
"{",
"boolean",
"swapped",
"=",
"true",
";",
"while",
"(",
"swapped",
")",
"{",
"swapped",
"=",
"false",
";",
"for",... | Sort the list in ascending order using this algorithm. The run time of this algorithm depends on the
implementation of the list since it has elements added and removed from it.
@param <E> the type of elements in this list.
@param list the list that we want to sort | [
"Sort",
"the",
"list",
"in",
"ascending",
"order",
"using",
"this",
"algorithm",
".",
"The",
"run",
"time",
"of",
"this",
"algorithm",
"depends",
"on",
"the",
"implementation",
"of",
"the",
"list",
"since",
"it",
"has",
"elements",
"added",
"and",
"removed",... | a22971b746833e78a3939ae4de65e8f6bf2e3fd4 | https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/sort/quadratic/Bubble.java#L62-L76 |
153,536 | tvesalainen/util | util/src/main/java/org/vesalainen/util/stream/ObserverSpliterator.java | ObserverSpliterator.offer | public boolean offer(T t)
{
try
{
return queue.offer(t, offerTimeout, timeUnit);
}
catch (InterruptedException ex)
{
throw new IllegalArgumentException(ex);
}
} | java | public boolean offer(T t)
{
try
{
return queue.offer(t, offerTimeout, timeUnit);
}
catch (InterruptedException ex)
{
throw new IllegalArgumentException(ex);
}
} | [
"public",
"boolean",
"offer",
"(",
"T",
"t",
")",
"{",
"try",
"{",
"return",
"queue",
".",
"offer",
"(",
"t",
",",
"offerTimeout",
",",
"timeUnit",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"ex",
")",
"{",
"throw",
"new",
"IllegalArgumentExcep... | Offers new item. Return true if item was consumed.
False if another thread was not waiting for the item.
@param t
@return | [
"Offers",
"new",
"item",
".",
"Return",
"true",
"if",
"item",
"was",
"consumed",
".",
"False",
"if",
"another",
"thread",
"was",
"not",
"waiting",
"for",
"the",
"item",
"."
] | bba7a44689f638ffabc8be40a75bdc9a33676433 | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/stream/ObserverSpliterator.java#L75-L85 |
153,537 | lightblueseas/file-worker | src/main/java/de/alpharogroup/file/zip/Zipper.java | Zipper.zip | public Optional<ZipErrorCodes> zip()
{
try (FileOutputStream fos = new FileOutputStream(this.zipFile);
ZipOutputStream zos = new ZipOutputStream(fos);)
{
if (!this.directoryToZip.exists())
{
return Optional.of(ZipErrorCodes.DIRECTORY_TO_ZIP_DOES_NOT_EXIST);
}
if (!this.zipFile.exists())
{
... | java | public Optional<ZipErrorCodes> zip()
{
try (FileOutputStream fos = new FileOutputStream(this.zipFile);
ZipOutputStream zos = new ZipOutputStream(fos);)
{
if (!this.directoryToZip.exists())
{
return Optional.of(ZipErrorCodes.DIRECTORY_TO_ZIP_DOES_NOT_EXIST);
}
if (!this.zipFile.exists())
{
... | [
"public",
"Optional",
"<",
"ZipErrorCodes",
">",
"zip",
"(",
")",
"{",
"try",
"(",
"FileOutputStream",
"fos",
"=",
"new",
"FileOutputStream",
"(",
"this",
".",
"zipFile",
")",
";",
"ZipOutputStream",
"zos",
"=",
"new",
"ZipOutputStream",
"(",
"fos",
")",
"... | Zip the given files of this objects
@return the optional with the possibles errors | [
"Zip",
"the",
"given",
"files",
"of",
"this",
"objects"
] | 2c81de10fb5d68de64c1abc3ed64ca681ce76da8 | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/zip/Zipper.java#L142-L183 |
153,538 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.setConnector | protected boolean setConnector() {
if (this.host == null) {
log.error("No host value set, cannot set up socket connector.");
return false;
}
if (this.port < 0 || this.port > 65535) {
log.error("Port value is invalid {}.", Integer.valueOf(this.port));
return false;
}
if (this.executors == null) {
... | java | protected boolean setConnector() {
if (this.host == null) {
log.error("No host value set, cannot set up socket connector.");
return false;
}
if (this.port < 0 || this.port > 65535) {
log.error("Port value is invalid {}.", Integer.valueOf(this.port));
return false;
}
if (this.executors == null) {
... | [
"protected",
"boolean",
"setConnector",
"(",
")",
"{",
"if",
"(",
"this",
".",
"host",
"==",
"null",
")",
"{",
"log",
".",
"error",
"(",
"\"No host value set, cannot set up socket connector.\"",
")",
";",
"return",
"false",
";",
"}",
"if",
"(",
"this",
".",
... | Sets the MINA connector and establishes the connection to the world
model. Adds protocol filters.
@return {@code true} if connection is set-up correctly, else
{@code false}. | [
"Sets",
"the",
"MINA",
"connector",
"and",
"establishes",
"the",
"connection",
"to",
"the",
"world",
"model",
".",
"Adds",
"protocol",
"filters",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L276-L304 |
153,539 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.announceAttributes | protected void announceAttributes() {
if (this.originString == null) {
log.error("Unable to announce solution types, no Origin String set.");
return;
}
this.sentAttrSpecifications = true;
if (this.attributes.size() > 0) {
AttributeAnnounceMessage message = new AttributeAnnounceMessage();
message.se... | java | protected void announceAttributes() {
if (this.originString == null) {
log.error("Unable to announce solution types, no Origin String set.");
return;
}
this.sentAttrSpecifications = true;
if (this.attributes.size() > 0) {
AttributeAnnounceMessage message = new AttributeAnnounceMessage();
message.se... | [
"protected",
"void",
"announceAttributes",
"(",
")",
"{",
"if",
"(",
"this",
".",
"originString",
"==",
"null",
")",
"{",
"log",
".",
"error",
"(",
"\"Unable to announce solution types, no Origin String set.\"",
")",
";",
"return",
";",
"}",
"this",
".",
"sentAt... | Sends the Attribute aliases to the world model. | [
"Sends",
"the",
"Attribute",
"aliases",
"to",
"the",
"world",
"model",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L560-L586 |
153,540 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.updateAttribute | public boolean updateAttribute(final Attribute attribute) {
if (!this.sentAttrSpecifications) {
log.error("Haven't sent type specifications yet, can't send solutions.");
return false;
}
AttributeUpdateMessage message = new AttributeUpdateMessage();
message.setCreateId(this.createIds);
message.setAttri... | java | public boolean updateAttribute(final Attribute attribute) {
if (!this.sentAttrSpecifications) {
log.error("Haven't sent type specifications yet, can't send solutions.");
return false;
}
AttributeUpdateMessage message = new AttributeUpdateMessage();
message.setCreateId(this.createIds);
message.setAttri... | [
"public",
"boolean",
"updateAttribute",
"(",
"final",
"Attribute",
"attribute",
")",
"{",
"if",
"(",
"!",
"this",
".",
"sentAttrSpecifications",
")",
"{",
"log",
".",
"error",
"(",
"\"Haven't sent type specifications yet, can't send solutions.\"",
")",
";",
"return",
... | Sends a single Attribute update message to the world model.
@param attribute
the new Attribute value.
@return {@code true} if the message was sent successfully, else
{@code false}. | [
"Sends",
"a",
"single",
"Attribute",
"update",
"message",
"to",
"the",
"world",
"model",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L746-L773 |
153,541 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.updateAttributes | public boolean updateAttributes(final Collection<Attribute> attrToSend) {
if (!this.sentAttrSpecifications) {
log.error("Haven't sent type specifications yet, can't send solutions.");
return false;
}
for (Iterator<Attribute> iter = attrToSend.iterator(); iter.hasNext();) {
Attribute soln = iter.next();
... | java | public boolean updateAttributes(final Collection<Attribute> attrToSend) {
if (!this.sentAttrSpecifications) {
log.error("Haven't sent type specifications yet, can't send solutions.");
return false;
}
for (Iterator<Attribute> iter = attrToSend.iterator(); iter.hasNext();) {
Attribute soln = iter.next();
... | [
"public",
"boolean",
"updateAttributes",
"(",
"final",
"Collection",
"<",
"Attribute",
">",
"attrToSend",
")",
"{",
"if",
"(",
"!",
"this",
".",
"sentAttrSpecifications",
")",
"{",
"log",
".",
"error",
"(",
"\"Haven't sent type specifications yet, can't send solutions... | Sends a multiple Attribute update messages to the world model.
@param attrToSend
the Attribute values to update
@return {@code true} if the messages were written, or {@code false} if
one or more messages failed to send. | [
"Sends",
"a",
"multiple",
"Attribute",
"update",
"messages",
"to",
"the",
"world",
"model",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L783-L812 |
153,542 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.addAttribute | public void addAttribute(AttributeSpecification specification) {
synchronized (this.attributes) {
if (!this.attributes.contains(specification)) {
this.attributes.add(specification);
if (this.sentAttrSpecifications) {
this.announceAttributes();
}
}
}
} | java | public void addAttribute(AttributeSpecification specification) {
synchronized (this.attributes) {
if (!this.attributes.contains(specification)) {
this.attributes.add(specification);
if (this.sentAttrSpecifications) {
this.announceAttributes();
}
}
}
} | [
"public",
"void",
"addAttribute",
"(",
"AttributeSpecification",
"specification",
")",
"{",
"synchronized",
"(",
"this",
".",
"attributes",
")",
"{",
"if",
"(",
"!",
"this",
".",
"attributes",
".",
"contains",
"(",
"specification",
")",
")",
"{",
"this",
"."... | Adds an attribute specification to the world model session.
@param specification
the Attribute that will be sent later. | [
"Adds",
"an",
"attribute",
"specification",
"to",
"the",
"world",
"model",
"session",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L820-L830 |
153,543 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.setOriginString | public void setOriginString(String originString) {
this.originString = originString;
if (this.sentAttrSpecifications) {
AttributeAnnounceMessage msg = new AttributeAnnounceMessage();
msg.setOrigin(originString);
this.session.write(msg);
}
} | java | public void setOriginString(String originString) {
this.originString = originString;
if (this.sentAttrSpecifications) {
AttributeAnnounceMessage msg = new AttributeAnnounceMessage();
msg.setOrigin(originString);
this.session.write(msg);
}
} | [
"public",
"void",
"setOriginString",
"(",
"String",
"originString",
")",
"{",
"this",
".",
"originString",
"=",
"originString",
";",
"if",
"(",
"this",
".",
"sentAttrSpecifications",
")",
"{",
"AttributeAnnounceMessage",
"msg",
"=",
"new",
"AttributeAnnounceMessage"... | Sets the origin value for this connection.
@param originString
the new origin value. | [
"Sets",
"the",
"origin",
"value",
"for",
"this",
"connection",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L972-L979 |
153,544 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.expireId | public boolean expireId(final String identifier, final long expirationTime) {
if (identifier == null) {
log.error("Unable to expire a null Identifier value.");
return false;
}
if (this.originString == null) {
log.error("Origin has not been set. Cannot expire Ids without a valid origin.");
return fa... | java | public boolean expireId(final String identifier, final long expirationTime) {
if (identifier == null) {
log.error("Unable to expire a null Identifier value.");
return false;
}
if (this.originString == null) {
log.error("Origin has not been set. Cannot expire Ids without a valid origin.");
return fa... | [
"public",
"boolean",
"expireId",
"(",
"final",
"String",
"identifier",
",",
"final",
"long",
"expirationTime",
")",
"{",
"if",
"(",
"identifier",
"==",
"null",
")",
"{",
"log",
".",
"error",
"(",
"\"Unable to expire a null Identifier value.\"",
")",
";",
"return... | Expires all Attributes for an Identifier in the world model.
@param identifier
the identifier to expire.
@param expirationTime
the expiration timestamp.
@return {@code true} if the message is sent successfully, else
{@code false}. | [
"Expires",
"all",
"Attributes",
"for",
"an",
"Identifier",
"in",
"the",
"world",
"model",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L1005-L1025 |
153,545 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.expireAttribute | public boolean expireAttribute(final String identifier,
final String attribute, final long expirationTime) {
if (identifier == null) {
log.error("Unable to expire an attribute with a null Identifier value.");
return false;
}
if (attribute == null) {
log.error("Unable to expire a null attribute.");
... | java | public boolean expireAttribute(final String identifier,
final String attribute, final long expirationTime) {
if (identifier == null) {
log.error("Unable to expire an attribute with a null Identifier value.");
return false;
}
if (attribute == null) {
log.error("Unable to expire a null attribute.");
... | [
"public",
"boolean",
"expireAttribute",
"(",
"final",
"String",
"identifier",
",",
"final",
"String",
"attribute",
",",
"final",
"long",
"expirationTime",
")",
"{",
"if",
"(",
"identifier",
"==",
"null",
")",
"{",
"log",
".",
"error",
"(",
"\"Unable to expire ... | Expire a particular Attribute for an Identifier in the world model.
@param identifier
the Identifier to expire.
@param attribute
the Attribute to expire.
@param expirationTime
the expiration timestamp.
@return {@code true} if the message was sent successfully, else
{@code false}. | [
"Expire",
"a",
"particular",
"Attribute",
"for",
"an",
"Identifier",
"in",
"the",
"world",
"model",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L1039-L1067 |
153,546 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.deleteId | public boolean deleteId(final String identifier) {
if (identifier == null) {
log.error("Unable to delete a null Identifier value.");
return false;
}
if (this.originString == null) {
log.error("Origin has not been set. Cannot delete Identifiers without a valid origin.");
return false;
}
DeleteId... | java | public boolean deleteId(final String identifier) {
if (identifier == null) {
log.error("Unable to delete a null Identifier value.");
return false;
}
if (this.originString == null) {
log.error("Origin has not been set. Cannot delete Identifiers without a valid origin.");
return false;
}
DeleteId... | [
"public",
"boolean",
"deleteId",
"(",
"final",
"String",
"identifier",
")",
"{",
"if",
"(",
"identifier",
"==",
"null",
")",
"{",
"log",
".",
"error",
"(",
"\"Unable to delete a null Identifier value.\"",
")",
";",
"return",
"false",
";",
"}",
"if",
"(",
"th... | Deletes an Identifier and all of its Attributes from the world model. All
data for the Identifier will be removed permanently. Callers may also
wish to consider expiring the Identifier instead.
@param identifier
the Identifier to delete
@return {@code true} if the message was sent successfully | [
"Deletes",
"an",
"Identifier",
"and",
"all",
"of",
"its",
"Attributes",
"from",
"the",
"world",
"model",
".",
"All",
"data",
"for",
"the",
"Identifier",
"will",
"be",
"removed",
"permanently",
".",
"Callers",
"may",
"also",
"wish",
"to",
"consider",
"expirin... | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L1078-L1097 |
153,547 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.deleteAttribute | public boolean deleteAttribute(final String identifier,
final String attribute) {
if (identifier == null) {
log.error("Unable to delete an attribute with a null Identifier value.");
return false;
}
if (attribute == null) {
log.error("Unable to delete a null attribute.");
return false;
}
if (t... | java | public boolean deleteAttribute(final String identifier,
final String attribute) {
if (identifier == null) {
log.error("Unable to delete an attribute with a null Identifier value.");
return false;
}
if (attribute == null) {
log.error("Unable to delete a null attribute.");
return false;
}
if (t... | [
"public",
"boolean",
"deleteAttribute",
"(",
"final",
"String",
"identifier",
",",
"final",
"String",
"attribute",
")",
"{",
"if",
"(",
"identifier",
"==",
"null",
")",
"{",
"log",
".",
"error",
"(",
"\"Unable to delete an attribute with a null Identifier value.\"",
... | Deletes an Attribute and its entire history from the world model. Callers
may wish to expire the Attribute value instead.
@param identifier
the Identifier of the Attribute to expire.
@param attribute
the Attribute to expire.
@return {@code true} if the message was sent successfully. | [
"Deletes",
"an",
"Attribute",
"and",
"its",
"entire",
"history",
"from",
"the",
"world",
"model",
".",
"Callers",
"may",
"wish",
"to",
"expire",
"the",
"Attribute",
"value",
"instead",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L1109-L1135 |
153,548 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java | SolverWorldModelInterface.createId | public boolean createId(final String identifier) {
if (identifier == null) {
log.error("Unable to create a null Identifier.");
return false;
}
if (this.originString == null) {
log.error("Origin has not been set. Cannot create Identifiers without a valid origin.");
return false;
}
CreateIdentif... | java | public boolean createId(final String identifier) {
if (identifier == null) {
log.error("Unable to create a null Identifier.");
return false;
}
if (this.originString == null) {
log.error("Origin has not been set. Cannot create Identifiers without a valid origin.");
return false;
}
CreateIdentif... | [
"public",
"boolean",
"createId",
"(",
"final",
"String",
"identifier",
")",
"{",
"if",
"(",
"identifier",
"==",
"null",
")",
"{",
"log",
".",
"error",
"(",
"\"Unable to create a null Identifier.\"",
")",
";",
"return",
"false",
";",
"}",
"if",
"(",
"this",
... | Creates a new Identifier in the world model.
@param identifier
the Identifier to create
@return {@code true} if the message was sent successfully. | [
"Creates",
"a",
"new",
"Identifier",
"in",
"the",
"world",
"model",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/solver/SolverWorldModelInterface.java#L1144-L1165 |
153,549 | jbundle/jbundle | thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/util/JMainScreen.java | JMainScreen.getModel | public AbstractThinTableModel getModel(JTable table)
{
AbstractThinTableModel model = null;
if (table != null)
model = (AbstractThinTableModel)table.getModel();
return model;
} | java | public AbstractThinTableModel getModel(JTable table)
{
AbstractThinTableModel model = null;
if (table != null)
model = (AbstractThinTableModel)table.getModel();
return model;
} | [
"public",
"AbstractThinTableModel",
"getModel",
"(",
"JTable",
"table",
")",
"{",
"AbstractThinTableModel",
"model",
"=",
"null",
";",
"if",
"(",
"table",
"!=",
"null",
")",
"model",
"=",
"(",
"AbstractThinTableModel",
")",
"table",
".",
"getModel",
"(",
")",
... | Get the model in this screen's sub-screen.
Override if the model is not in the sub-screen.
@param table
@return | [
"Get",
"the",
"model",
"in",
"this",
"screen",
"s",
"sub",
"-",
"screen",
".",
"Override",
"if",
"the",
"model",
"is",
"not",
"in",
"the",
"sub",
"-",
"screen",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util/src/main/java/org/jbundle/thin/base/screen/util/JMainScreen.java#L173-L179 |
153,550 | wigforss/Ka-Commons-Reflection | src/main/java/org/kasource/commons/reflection/util/MethodUtils.java | MethodUtils.getMethod | public static Method getMethod(Class<?> target, MethodFilter methodFilter) {
Set<Method> methods = getMethods(target, methodFilter);
if (!methods.isEmpty()) {
return methods.iterator().next();
}
return null;
} | java | public static Method getMethod(Class<?> target, MethodFilter methodFilter) {
Set<Method> methods = getMethods(target, methodFilter);
if (!methods.isEmpty()) {
return methods.iterator().next();
}
return null;
} | [
"public",
"static",
"Method",
"getMethod",
"(",
"Class",
"<",
"?",
">",
"target",
",",
"MethodFilter",
"methodFilter",
")",
"{",
"Set",
"<",
"Method",
">",
"methods",
"=",
"getMethods",
"(",
"target",
",",
"methodFilter",
")",
";",
"if",
"(",
"!",
"metho... | Returns the method declared by the target class and any of its super classes, which matches the supplied
methodFilter, if method is found null is returned. If more than one method is found the
first in the resulting set iterator is returned.
@param methodFilter
The method filter to apply.
@return method that match th... | [
"Returns",
"the",
"method",
"declared",
"by",
"the",
"target",
"class",
"and",
"any",
"of",
"its",
"super",
"classes",
"which",
"matches",
"the",
"supplied",
"methodFilter",
"if",
"method",
"is",
"found",
"null",
"is",
"returned",
".",
"If",
"more",
"than",
... | a80f7a164cd800089e4f4dd948ca6f0e7badcf33 | https://github.com/wigforss/Ka-Commons-Reflection/blob/a80f7a164cd800089e4f4dd948ca6f0e7badcf33/src/main/java/org/kasource/commons/reflection/util/MethodUtils.java#L130-L136 |
153,551 | wigforss/Ka-Commons-Reflection | src/main/java/org/kasource/commons/reflection/util/MethodUtils.java | MethodUtils.verifyMethodSignature | public static void verifyMethodSignature(Method method, Class<?> returnType, Class<?>... parameters) {
if(method == null) {
throw new IllegalArgumentException("Method is null");
}
if (!method.getReturnType().equals(returnType)) {
throw new IllegalArgumentException... | java | public static void verifyMethodSignature(Method method, Class<?> returnType, Class<?>... parameters) {
if(method == null) {
throw new IllegalArgumentException("Method is null");
}
if (!method.getReturnType().equals(returnType)) {
throw new IllegalArgumentException... | [
"public",
"static",
"void",
"verifyMethodSignature",
"(",
"Method",
"method",
",",
"Class",
"<",
"?",
">",
"returnType",
",",
"Class",
"<",
"?",
">",
"...",
"parameters",
")",
"{",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgu... | Verify that the supplied method's signature matches return type and
parameters types
@param method
Method to inspect
@param returnType
Return type to match
@param parameters
Parameter types to match
@throws IllegalArgumentException
if method fails to match return type or parameters types | [
"Verify",
"that",
"the",
"supplied",
"method",
"s",
"signature",
"matches",
"return",
"type",
"and",
"parameters",
"types"
] | a80f7a164cd800089e4f4dd948ca6f0e7badcf33 | https://github.com/wigforss/Ka-Commons-Reflection/blob/a80f7a164cd800089e4f4dd948ca6f0e7badcf33/src/main/java/org/kasource/commons/reflection/util/MethodUtils.java#L188-L205 |
153,552 | jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreenToolbar.java | JScreenToolbar.addButtons | public void addButtons()
{
this.addButton(Constants.BACK);
this.addButton(Constants.GRID);
this.addButton(Constants.SUBMIT);
this.addButton(Constants.RESET);
this.addButton(Constants.DELETE);
this.addButton(Constants.HELP);
} | java | public void addButtons()
{
this.addButton(Constants.BACK);
this.addButton(Constants.GRID);
this.addButton(Constants.SUBMIT);
this.addButton(Constants.RESET);
this.addButton(Constants.DELETE);
this.addButton(Constants.HELP);
} | [
"public",
"void",
"addButtons",
"(",
")",
"{",
"this",
".",
"addButton",
"(",
"Constants",
".",
"BACK",
")",
";",
"this",
".",
"addButton",
"(",
"Constants",
".",
"GRID",
")",
";",
"this",
".",
"addButton",
"(",
"Constants",
".",
"SUBMIT",
")",
";",
... | Add the buttons to this window. | [
"Add",
"the",
"buttons",
"to",
"this",
"window",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/JScreenToolbar.java#L50-L58 |
153,553 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/filter/SubCurrentFilter.java | SubCurrentFilter.setOwner | public void setOwner(ListenerOwner owner)
{
if (owner != null)
if (m_buffer == null)
{ // Save the current key
KeyArea keyArea = ((Record)owner).getKeyArea(-1);
m_buffer = new VectorBuffer(null);
keyArea.setupKeyBuffer(m_buffer, DBConstants.FILE_KEY_... | java | public void setOwner(ListenerOwner owner)
{
if (owner != null)
if (m_buffer == null)
{ // Save the current key
KeyArea keyArea = ((Record)owner).getKeyArea(-1);
m_buffer = new VectorBuffer(null);
keyArea.setupKeyBuffer(m_buffer, DBConstants.FILE_KEY_... | [
"public",
"void",
"setOwner",
"(",
"ListenerOwner",
"owner",
")",
"{",
"if",
"(",
"owner",
"!=",
"null",
")",
"if",
"(",
"m_buffer",
"==",
"null",
")",
"{",
"// Save the current key",
"KeyArea",
"keyArea",
"=",
"(",
"(",
"Record",
")",
"owner",
")",
".",... | Set the record that owns this listener.
This method caches the current key values.
@param owner My owner. | [
"Set",
"the",
"record",
"that",
"owns",
"this",
"listener",
".",
"This",
"method",
"caches",
"the",
"current",
"key",
"values",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/filter/SubCurrentFilter.java#L112-L122 |
153,554 | tvesalainen/util | util/src/main/java/org/vesalainen/ui/AreaFiller.java | AreaFiller.fill | public void fill(IntBiPredicate isInside, int replacement)
{
fill(0, 0, width, height, isInside, (x,y)->replacement);
} | java | public void fill(IntBiPredicate isInside, int replacement)
{
fill(0, 0, width, height, isInside, (x,y)->replacement);
} | [
"public",
"void",
"fill",
"(",
"IntBiPredicate",
"isInside",
",",
"int",
"replacement",
")",
"{",
"fill",
"(",
"0",
",",
"0",
",",
"width",
",",
"height",
",",
"isInside",
",",
"(",
"x",
",",
"y",
")",
"->",
"replacement",
")",
";",
"}"
] | Fills area . Pixels fullfilling target are replaced with
replacement color.
@param isInside
@param replacement | [
"Fills",
"area",
".",
"Pixels",
"fullfilling",
"target",
"are",
"replaced",
"with",
"replacement",
"color",
"."
] | bba7a44689f638ffabc8be40a75bdc9a33676433 | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/ui/AreaFiller.java#L50-L53 |
153,555 | DDTH/ddth-dlock | ddth-dlock-core/src/main/java/com/github/ddth/dlock/impl/AbstractDLockFactory.java | AbstractDLockFactory.getLockProperties | protected Properties getLockProperties(String name) {
return lockProperties != null ? lockProperties.get(name) : null;
} | java | protected Properties getLockProperties(String name) {
return lockProperties != null ? lockProperties.get(name) : null;
} | [
"protected",
"Properties",
"getLockProperties",
"(",
"String",
"name",
")",
"{",
"return",
"lockProperties",
"!=",
"null",
"?",
"lockProperties",
".",
"get",
"(",
"name",
")",
":",
"null",
";",
"}"
] | Get a lock's properties
@param name
@return | [
"Get",
"a",
"lock",
"s",
"properties"
] | 56786c61a04fe505556a834133b3de36562c6cb6 | https://github.com/DDTH/ddth-dlock/blob/56786c61a04fe505556a834133b3de36562c6cb6/ddth-dlock-core/src/main/java/com/github/ddth/dlock/impl/AbstractDLockFactory.java#L108-L110 |
153,556 | caspervg/SC4D-LEX4J | lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java | UserRoute.getUser | public User getUser() {
ClientResource resource = new ClientResource(Route.ME.url());
resource.setChallengeResponse(this.auth.toChallenge());
try {
Representation repr = resource.get();
return mapper.readValue(repr.getText(), User.class);
} catch (IOException ex)... | java | public User getUser() {
ClientResource resource = new ClientResource(Route.ME.url());
resource.setChallengeResponse(this.auth.toChallenge());
try {
Representation repr = resource.get();
return mapper.readValue(repr.getText(), User.class);
} catch (IOException ex)... | [
"public",
"User",
"getUser",
"(",
")",
"{",
"ClientResource",
"resource",
"=",
"new",
"ClientResource",
"(",
"Route",
".",
"ME",
".",
"url",
"(",
")",
")",
";",
"resource",
".",
"setChallengeResponse",
"(",
"this",
".",
"auth",
".",
"toChallenge",
"(",
"... | Returns the current user
@return the current user
@custom.require Authentication | [
"Returns",
"the",
"current",
"user"
] | 3d086ec70c817119a88573c2e23af27276cdb1d6 | https://github.com/caspervg/SC4D-LEX4J/blob/3d086ec70c817119a88573c2e23af27276cdb1d6/lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java#L56-L67 |
153,557 | caspervg/SC4D-LEX4J | lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java | UserRoute.getUserList | public List<User> getUserList(boolean concise, int start, int amount) {
ClientResource resource = new ClientResource(Route.ALL_USER.url());
Reference ref = resource.getReference();
Map<String, Object> param = new HashMap<>();
param.put("concise", concise);
param.put("start", sta... | java | public List<User> getUserList(boolean concise, int start, int amount) {
ClientResource resource = new ClientResource(Route.ALL_USER.url());
Reference ref = resource.getReference();
Map<String, Object> param = new HashMap<>();
param.put("concise", concise);
param.put("start", sta... | [
"public",
"List",
"<",
"User",
">",
"getUserList",
"(",
"boolean",
"concise",
",",
"int",
"start",
",",
"int",
"amount",
")",
"{",
"ClientResource",
"resource",
"=",
"new",
"ClientResource",
"(",
"Route",
".",
"ALL_USER",
".",
"url",
"(",
")",
")",
";",
... | Returns all users
@param concise <code>true</code> if you only want the primary key and the username;
<code>false</code> otherwise
@param start start number of results
@param amount number of results to return
@return all users
@custom.require Authentication and Administrator | [
"Returns",
"all",
"users"
] | 3d086ec70c817119a88573c2e23af27276cdb1d6 | https://github.com/caspervg/SC4D-LEX4J/blob/3d086ec70c817119a88573c2e23af27276cdb1d6/lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java#L99-L119 |
153,558 | caspervg/SC4D-LEX4J | lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java | UserRoute.getDownloadList | public List<DownloadListItem> getDownloadList() {
ClientResource resource = new ClientResource(Route.DOWNLOAD_LIST.url());
resource.setChallengeResponse(this.auth.toChallenge());
try {
Representation repr = resource.get();
return mapper.readValue(repr.getText(), new Type... | java | public List<DownloadListItem> getDownloadList() {
ClientResource resource = new ClientResource(Route.DOWNLOAD_LIST.url());
resource.setChallengeResponse(this.auth.toChallenge());
try {
Representation repr = resource.get();
return mapper.readValue(repr.getText(), new Type... | [
"public",
"List",
"<",
"DownloadListItem",
">",
"getDownloadList",
"(",
")",
"{",
"ClientResource",
"resource",
"=",
"new",
"ClientResource",
"(",
"Route",
".",
"DOWNLOAD_LIST",
".",
"url",
"(",
")",
")",
";",
"resource",
".",
"setChallengeResponse",
"(",
"thi... | Returns the download list of the current user
@return the download list of the current user
@custom.require Authentication | [
"Returns",
"the",
"download",
"list",
"of",
"the",
"current",
"user"
] | 3d086ec70c817119a88573c2e23af27276cdb1d6 | https://github.com/caspervg/SC4D-LEX4J/blob/3d086ec70c817119a88573c2e23af27276cdb1d6/lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java#L127-L138 |
153,559 | caspervg/SC4D-LEX4J | lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java | UserRoute.getDownloadHistory | public List<DownloadHistoryItem> getDownloadHistory() {
ClientResource resource = new ClientResource(Route.DOWNLOAD_HISTORY.url());
resource.setChallengeResponse(this.auth.toChallenge());
try {
String result = resource.get().getText();
return mapper.readValue(result, ne... | java | public List<DownloadHistoryItem> getDownloadHistory() {
ClientResource resource = new ClientResource(Route.DOWNLOAD_HISTORY.url());
resource.setChallengeResponse(this.auth.toChallenge());
try {
String result = resource.get().getText();
return mapper.readValue(result, ne... | [
"public",
"List",
"<",
"DownloadHistoryItem",
">",
"getDownloadHistory",
"(",
")",
"{",
"ClientResource",
"resource",
"=",
"new",
"ClientResource",
"(",
"Route",
".",
"DOWNLOAD_HISTORY",
".",
"url",
"(",
")",
")",
";",
"resource",
".",
"setChallengeResponse",
"(... | Returns the download history of the current user
@return the download list of the current user
@custom.require Authentication | [
"Returns",
"the",
"download",
"history",
"of",
"the",
"current",
"user"
] | 3d086ec70c817119a88573c2e23af27276cdb1d6 | https://github.com/caspervg/SC4D-LEX4J/blob/3d086ec70c817119a88573c2e23af27276cdb1d6/lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java#L146-L158 |
153,560 | caspervg/SC4D-LEX4J | lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java | UserRoute.postRegistration | public void postRegistration(String username, String password, String email, String fullname) {
ClientResource resource = new ClientResource(Route.REGISTER.url());
Form form = new Form();
form.add("username", username);
form.add("password_1", password);
form.add("password_2", pa... | java | public void postRegistration(String username, String password, String email, String fullname) {
ClientResource resource = new ClientResource(Route.REGISTER.url());
Form form = new Form();
form.add("username", username);
form.add("password_1", password);
form.add("password_2", pa... | [
"public",
"void",
"postRegistration",
"(",
"String",
"username",
",",
"String",
"password",
",",
"String",
"email",
",",
"String",
"fullname",
")",
"{",
"ClientResource",
"resource",
"=",
"new",
"ClientResource",
"(",
"Route",
".",
"REGISTER",
".",
"url",
"(",... | Registers a new user for the SC4D LEX
@param username the username for the new user
@param password the password for the new user
@param email the e-mail for the new user
@param fullname the name for the new user (can be blank) | [
"Registers",
"a",
"new",
"user",
"for",
"the",
"SC4D",
"LEX"
] | 3d086ec70c817119a88573c2e23af27276cdb1d6 | https://github.com/caspervg/SC4D-LEX4J/blob/3d086ec70c817119a88573c2e23af27276cdb1d6/lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java#L168-L179 |
153,561 | caspervg/SC4D-LEX4J | lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java | UserRoute.getActivation | public void getActivation(String key) {
ClientResource resource = new ClientResource(Route.ACTIVATE.url());
Reference ref = resource.getReference();
Map<String, Object> param = new HashMap<>();
param.put("activation_key", key);
Route.addParameters(ref, param);
resource... | java | public void getActivation(String key) {
ClientResource resource = new ClientResource(Route.ACTIVATE.url());
Reference ref = resource.getReference();
Map<String, Object> param = new HashMap<>();
param.put("activation_key", key);
Route.addParameters(ref, param);
resource... | [
"public",
"void",
"getActivation",
"(",
"String",
"key",
")",
"{",
"ClientResource",
"resource",
"=",
"new",
"ClientResource",
"(",
"Route",
".",
"ACTIVATE",
".",
"url",
"(",
")",
")",
";",
"Reference",
"ref",
"=",
"resource",
".",
"getReference",
"(",
")"... | Activates a user on the SC4D LEX
@param key the activation key to use | [
"Activates",
"a",
"user",
"on",
"the",
"SC4D",
"LEX"
] | 3d086ec70c817119a88573c2e23af27276cdb1d6 | https://github.com/caspervg/SC4D-LEX4J/blob/3d086ec70c817119a88573c2e23af27276cdb1d6/lex4j/src/main/java/net/caspervg/lex4j/route/UserRoute.java#L186-L196 |
153,562 | avaje-common/avaje-jetty-runner | src/main/java/org/avaje/jettyrunner/BaseRunner.java | BaseRunner.createWebAppContext | protected void createWebAppContext() {
webapp = new WebAppContext();
webapp.setThrowUnavailableOnStartupException(true);
webapp.setServerClasses(getServerClasses());
webapp.setContextPath(getContextPath());
webapp.setTempDirectory(createTempDir("jetty-app-"));
setSecureCookies();
} | java | protected void createWebAppContext() {
webapp = new WebAppContext();
webapp.setThrowUnavailableOnStartupException(true);
webapp.setServerClasses(getServerClasses());
webapp.setContextPath(getContextPath());
webapp.setTempDirectory(createTempDir("jetty-app-"));
setSecureCookies();
} | [
"protected",
"void",
"createWebAppContext",
"(",
")",
"{",
"webapp",
"=",
"new",
"WebAppContext",
"(",
")",
";",
"webapp",
".",
"setThrowUnavailableOnStartupException",
"(",
"true",
")",
";",
"webapp",
".",
"setServerClasses",
"(",
"getServerClasses",
"(",
")",
... | Create the WebAppContext with basic configurations set like context path
etc. | [
"Create",
"the",
"WebAppContext",
"with",
"basic",
"configurations",
"set",
"like",
"context",
"path",
"etc",
"."
] | acddc23754facc339233fa0b9736e94abc8ae842 | https://github.com/avaje-common/avaje-jetty-runner/blob/acddc23754facc339233fa0b9736e94abc8ae842/src/main/java/org/avaje/jettyrunner/BaseRunner.java#L95-L102 |
153,563 | avaje-common/avaje-jetty-runner | src/main/java/org/avaje/jettyrunner/BaseRunner.java | BaseRunner.startServer | public void startServer() {
server = new Server(httpPort);
server.setHandler(wrapHandlers());
if (isWebSocketInClassPath()) {
setupForWebSocket();
}
try {
server.start();
log().info("server started");
Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownRunnable()))... | java | public void startServer() {
server = new Server(httpPort);
server.setHandler(wrapHandlers());
if (isWebSocketInClassPath()) {
setupForWebSocket();
}
try {
server.start();
log().info("server started");
Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownRunnable()))... | [
"public",
"void",
"startServer",
"(",
")",
"{",
"server",
"=",
"new",
"Server",
"(",
"httpPort",
")",
";",
"server",
".",
"setHandler",
"(",
"wrapHandlers",
"(",
")",
")",
";",
"if",
"(",
"isWebSocketInClassPath",
"(",
")",
")",
"{",
"setupForWebSocket",
... | Start the Jetty server. | [
"Start",
"the",
"Jetty",
"server",
"."
] | acddc23754facc339233fa0b9736e94abc8ae842 | https://github.com/avaje-common/avaje-jetty-runner/blob/acddc23754facc339233fa0b9736e94abc8ae842/src/main/java/org/avaje/jettyrunner/BaseRunner.java#L161-L189 |
153,564 | avaje-common/avaje-jetty-runner | src/main/java/org/avaje/jettyrunner/BaseRunner.java | BaseRunner.setSecureCookies | protected void setSecureCookies() {
SessionManager sessionManager = webapp.getSessionHandler().getSessionManager();
if (!(sessionManager instanceof AbstractSessionManager)) {
throw new RuntimeException("Cannot set secure cookies on session manager.");
}
AbstractSessionManager abstractSessionMana... | java | protected void setSecureCookies() {
SessionManager sessionManager = webapp.getSessionHandler().getSessionManager();
if (!(sessionManager instanceof AbstractSessionManager)) {
throw new RuntimeException("Cannot set secure cookies on session manager.");
}
AbstractSessionManager abstractSessionMana... | [
"protected",
"void",
"setSecureCookies",
"(",
")",
"{",
"SessionManager",
"sessionManager",
"=",
"webapp",
".",
"getSessionHandler",
"(",
")",
".",
"getSessionManager",
"(",
")",
";",
"if",
"(",
"!",
"(",
"sessionManager",
"instanceof",
"AbstractSessionManager",
"... | Set the secure cookies setting on the jetty session manager. | [
"Set",
"the",
"secure",
"cookies",
"setting",
"on",
"the",
"jetty",
"session",
"manager",
"."
] | acddc23754facc339233fa0b9736e94abc8ae842 | https://github.com/avaje-common/avaje-jetty-runner/blob/acddc23754facc339233fa0b9736e94abc8ae842/src/main/java/org/avaje/jettyrunner/BaseRunner.java#L218-L229 |
153,565 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.copy | public static File copy(InputStream stream) throws IOException
{
File file = createTempFile();
copy(stream, new FileOutputStream(file));
return file;
} | java | public static File copy(InputStream stream) throws IOException
{
File file = createTempFile();
copy(stream, new FileOutputStream(file));
return file;
} | [
"public",
"static",
"File",
"copy",
"(",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"createTempFile",
"(",
")",
";",
"copy",
"(",
"stream",
",",
"new",
"FileOutputStream",
"(",
"file",
")",
")",
";",
"return",
"file",
... | Binary copy to temporary file. Be aware that temporary file is removed at JVM exit.
@param stream source stream.
@return temporarily created file.
@throws IOException if copy operation fails. | [
"Binary",
"copy",
"to",
"temporary",
"file",
".",
"Be",
"aware",
"that",
"temporary",
"file",
"is",
"removed",
"at",
"JVM",
"exit",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L136-L141 |
153,566 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.copy | public static File copy(URL url, String encoding) throws IOException, IllegalArgumentException
{
Params.notNull(url, "Source URL");
URLConnection connection = url.openConnection();
connection.setDoInput(true);
return copy(connection.getInputStream(), encoding);
} | java | public static File copy(URL url, String encoding) throws IOException, IllegalArgumentException
{
Params.notNull(url, "Source URL");
URLConnection connection = url.openConnection();
connection.setDoInput(true);
return copy(connection.getInputStream(), encoding);
} | [
"public",
"static",
"File",
"copy",
"(",
"URL",
"url",
",",
"String",
"encoding",
")",
"throws",
"IOException",
",",
"IllegalArgumentException",
"{",
"Params",
".",
"notNull",
"(",
"url",
",",
"\"Source URL\"",
")",
";",
"URLConnection",
"connection",
"=",
"ur... | Copy text from URL using specified encoding to local temporary file then close both URL input stream and temporary
file.
@param url source file URL,
@param encoding character encoding to use.
@return temporarily created file.
@throws IOException if copy operation fails.
@throws IllegalArgumentException if <code>url</c... | [
"Copy",
"text",
"from",
"URL",
"using",
"specified",
"encoding",
"to",
"local",
"temporary",
"file",
"then",
"close",
"both",
"URL",
"input",
"stream",
"and",
"temporary",
"file",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L153-L159 |
153,567 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.copy | public static File copy(InputStream stream, String encoding) throws IOException
{
File file = createTempFile();
copy(new InputStreamReader(stream, encoding), new OutputStreamWriter(new FileOutputStream(file), encoding));
return file;
} | java | public static File copy(InputStream stream, String encoding) throws IOException
{
File file = createTempFile();
copy(new InputStreamReader(stream, encoding), new OutputStreamWriter(new FileOutputStream(file), encoding));
return file;
} | [
"public",
"static",
"File",
"copy",
"(",
"InputStream",
"stream",
",",
"String",
"encoding",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"createTempFile",
"(",
")",
";",
"copy",
"(",
"new",
"InputStreamReader",
"(",
"stream",
",",
"encoding",
")"... | Copy text from byte stream using specified encoding to temporary file then close both input stream and temporary
file. Be aware that temporary file is removed at JVM exit.
@param stream input stream to read from,
@param encoding used character encoding.
@return temporarily created file.
@throws IOException if copy ope... | [
"Copy",
"text",
"from",
"byte",
"stream",
"using",
"specified",
"encoding",
"to",
"temporary",
"file",
"then",
"close",
"both",
"input",
"stream",
"and",
"temporary",
"file",
".",
"Be",
"aware",
"that",
"temporary",
"file",
"is",
"removed",
"at",
"JVM",
"exi... | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L170-L175 |
153,568 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.copy | public static File copy(Reader reader) throws IOException
{
File file = createTempFile();
copy(reader, new FileWriter(file));
return file;
} | java | public static File copy(Reader reader) throws IOException
{
File file = createTempFile();
copy(reader, new FileWriter(file));
return file;
} | [
"public",
"static",
"File",
"copy",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"createTempFile",
"(",
")",
";",
"copy",
"(",
"reader",
",",
"new",
"FileWriter",
"(",
"file",
")",
")",
";",
"return",
"file",
";",
"}... | Copy text from character stream to temporary file then close both the source reader and temporary file. Be aware
that temporary file is removed at JVM exit.
@param reader source character reader.
@return the newly created temporarily file.
@throws IOException if copy operation fails. | [
"Copy",
"text",
"from",
"character",
"stream",
"to",
"temporary",
"file",
"then",
"close",
"both",
"the",
"source",
"reader",
"and",
"temporary",
"file",
".",
"Be",
"aware",
"that",
"temporary",
"file",
"is",
"removed",
"at",
"JVM",
"exit",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L185-L190 |
153,569 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.copy | public static long copy(File source, File target) throws FileNotFoundException, IOException
{
return copy(new FileInputStream(source), new FileOutputStream(target));
} | java | public static long copy(File source, File target) throws FileNotFoundException, IOException
{
return copy(new FileInputStream(source), new FileOutputStream(target));
} | [
"public",
"static",
"long",
"copy",
"(",
"File",
"source",
",",
"File",
"target",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"copy",
"(",
"new",
"FileInputStream",
"(",
"source",
")",
",",
"new",
"FileOutputStream",
"(",
"target... | Copy source file to target. Copy destination should be a file and this method throws access denied if attempt to
write to a directory. Source file should exist but target is created by this method, but if not already exist.
@param source file to read from, should exist,
@param target file to write to.
@return the numb... | [
"Copy",
"source",
"file",
"to",
"target",
".",
"Copy",
"destination",
"should",
"be",
"a",
"file",
"and",
"this",
"method",
"throws",
"access",
"denied",
"if",
"attempt",
"to",
"write",
"to",
"a",
"directory",
".",
"Source",
"file",
"should",
"exist",
"but... | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L202-L205 |
153,570 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.copy | public static int copy(Reader reader, Writer writer) throws IOException
{
Params.notNull(reader, "Reader");
Params.notNull(writer, "Writer");
if(!(reader instanceof BufferedReader)) {
reader = new BufferedReader(reader);
}
if(!(writer instanceof BufferedWriter)) {
writer = ne... | java | public static int copy(Reader reader, Writer writer) throws IOException
{
Params.notNull(reader, "Reader");
Params.notNull(writer, "Writer");
if(!(reader instanceof BufferedReader)) {
reader = new BufferedReader(reader);
}
if(!(writer instanceof BufferedWriter)) {
writer = ne... | [
"public",
"static",
"int",
"copy",
"(",
"Reader",
"reader",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"Params",
".",
"notNull",
"(",
"reader",
",",
"\"Reader\"",
")",
";",
"Params",
".",
"notNull",
"(",
"writer",
",",
"\"Writer\"",
")",
... | Copy characters from a reader to a given writer then close both character streams.
@param reader character stream to read from,
@param writer character stream to write to.
@return the number of characters processed.
@throws IOException if read or write operation fails.
@throws IllegalArgumentException if reader or wri... | [
"Copy",
"characters",
"from",
"a",
"reader",
"to",
"a",
"given",
"writer",
"then",
"close",
"both",
"character",
"streams",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L216-L245 |
153,571 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.copy | public static long copy(InputStream inputStream, File file) throws FileNotFoundException, IOException
{
return copy(inputStream, new FileOutputStream(file));
} | java | public static long copy(InputStream inputStream, File file) throws FileNotFoundException, IOException
{
return copy(inputStream, new FileOutputStream(file));
} | [
"public",
"static",
"long",
"copy",
"(",
"InputStream",
"inputStream",
",",
"File",
"file",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"copy",
"(",
"inputStream",
",",
"new",
"FileOutputStream",
"(",
"file",
")",
")",
";",
"}"
] | Copy bytes from requested input stream to given target file. This method creates the target file if does not
already exist.
@param inputStream source input stream,
@param file target file.
@return the number of bytes processed.
@throws FileNotFoundException if given <code>file</code> does not exist and cannot be creat... | [
"Copy",
"bytes",
"from",
"requested",
"input",
"stream",
"to",
"given",
"target",
"file",
".",
"This",
"method",
"creates",
"the",
"target",
"file",
"if",
"does",
"not",
"already",
"exist",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L296-L299 |
153,572 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.copy | public static long copy(URL url, File file) throws FileNotFoundException, IOException
{
return copy(url, new FileOutputStream(file));
} | java | public static long copy(URL url, File file) throws FileNotFoundException, IOException
{
return copy(url, new FileOutputStream(file));
} | [
"public",
"static",
"long",
"copy",
"(",
"URL",
"url",
",",
"File",
"file",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"return",
"copy",
"(",
"url",
",",
"new",
"FileOutputStream",
"(",
"file",
")",
")",
";",
"}"
] | Copy bytes from remote file denoted by given URL to specified local file. This method creates local file if not
already exists.
@param url source remote file URL,
@param file target local file.
@return the number of bytes transfered.
@throws FileNotFoundException if given <code>file</code> does not exist and cannot be... | [
"Copy",
"bytes",
"from",
"remote",
"file",
"denoted",
"by",
"given",
"URL",
"to",
"specified",
"local",
"file",
".",
"This",
"method",
"creates",
"local",
"file",
"if",
"not",
"already",
"exists",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L311-L314 |
153,573 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.copy | public static long copy(File file, OutputStream outputStream) throws IOException
{
Params.notNull(file, "Input file");
return copy(new FileInputStream(file), outputStream);
} | java | public static long copy(File file, OutputStream outputStream) throws IOException
{
Params.notNull(file, "Input file");
return copy(new FileInputStream(file), outputStream);
} | [
"public",
"static",
"long",
"copy",
"(",
"File",
"file",
",",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"Params",
".",
"notNull",
"(",
"file",
",",
"\"Input file\"",
")",
";",
"return",
"copy",
"(",
"new",
"FileInputStream",
"(",
"fi... | Copy source file bytes to requested output stream. Note that output stream is closed after transfer completes,
including on error.
@param file source file,
@param outputStream destination output stream.
@return the number of bytes processed.
@throws FileNotFoundException if <code>file</code> does not exist.
@throws IO... | [
"Copy",
"source",
"file",
"bytes",
"to",
"requested",
"output",
"stream",
".",
"Note",
"that",
"output",
"stream",
"is",
"closed",
"after",
"transfer",
"completes",
"including",
"on",
"error",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L346-L350 |
153,574 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.dump | public static void dump(InputStream inputStream) throws IOException
{
if(!(inputStream instanceof BufferedInputStream)) {
inputStream = new BufferedInputStream(inputStream);
}
try {
byte[] buffer = new byte[BUFFER_SIZE];
int length;
while((length = inputStream.read(buffer))... | java | public static void dump(InputStream inputStream) throws IOException
{
if(!(inputStream instanceof BufferedInputStream)) {
inputStream = new BufferedInputStream(inputStream);
}
try {
byte[] buffer = new byte[BUFFER_SIZE];
int length;
while((length = inputStream.read(buffer))... | [
"public",
"static",
"void",
"dump",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"(",
"inputStream",
"instanceof",
"BufferedInputStream",
")",
")",
"{",
"inputStream",
"=",
"new",
"BufferedInputStream",
"(",
"inputStream",
... | Dump byte input stream content to standard output till end of input stream. Input stream is closed.
@param inputStream source byte input stream.
@throws IOException if reading from input stream fails. | [
"Dump",
"byte",
"input",
"stream",
"content",
"to",
"standard",
"output",
"till",
"end",
"of",
"input",
"stream",
".",
"Input",
"stream",
"is",
"closed",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L425-L440 |
153,575 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.move | public static boolean move(String sourcePath, String targetPath) throws IllegalArgumentException
{
Params.notNull(sourcePath, "Source path");
Params.notNull(targetPath, "Target path");
File sourceFile = new File(sourcePath);
if(!sourceFile.exists()) {
log.error("Missing file to move |%s|... | java | public static boolean move(String sourcePath, String targetPath) throws IllegalArgumentException
{
Params.notNull(sourcePath, "Source path");
Params.notNull(targetPath, "Target path");
File sourceFile = new File(sourcePath);
if(!sourceFile.exists()) {
log.error("Missing file to move |%s|... | [
"public",
"static",
"boolean",
"move",
"(",
"String",
"sourcePath",
",",
"String",
"targetPath",
")",
"throws",
"IllegalArgumentException",
"{",
"Params",
".",
"notNull",
"(",
"sourcePath",
",",
"\"Source path\"",
")",
";",
"Params",
".",
"notNull",
"(",
"target... | Move source file to requested destination but do not overwrite. This method takes care to not overwrite destination
file and returns false if it already exists. Note that this method does not throw exceptions if move fails and
caller should always test returned boolean to determine if operation completes.
@param sourc... | [
"Move",
"source",
"file",
"to",
"requested",
"destination",
"but",
"do",
"not",
"overwrite",
".",
"This",
"method",
"takes",
"care",
"to",
"not",
"overwrite",
"destination",
"file",
"and",
"returns",
"false",
"if",
"it",
"already",
"exists",
".",
"Note",
"th... | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L517-L533 |
153,576 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.getPathComponents | public static List<String> getPathComponents(File file)
{
if(file == null) {
return Collections.emptyList();
}
List<String> pathComponents = new ArrayList<String>();
do {
pathComponents.add(0, file.getName());
file = file.getParentFile();
}
while(file != null);
... | java | public static List<String> getPathComponents(File file)
{
if(file == null) {
return Collections.emptyList();
}
List<String> pathComponents = new ArrayList<String>();
do {
pathComponents.add(0, file.getName());
file = file.getParentFile();
}
while(file != null);
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getPathComponents",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"List",
"<",
"String",
">",
"pathComponents",
... | Get file path components. Return a list of path components in their natural order. List first item is path root
stored as an empty string; if file argument is empty returned list contains only root. If file argument is null
returns empty list.
@param file file to retrieve path components.
@return file path components. | [
"Get",
"file",
"path",
"components",
".",
"Return",
"a",
"list",
"of",
"path",
"components",
"in",
"their",
"natural",
"order",
".",
"List",
"first",
"item",
"is",
"path",
"root",
"stored",
"as",
"an",
"empty",
"string",
";",
"if",
"file",
"argument",
"i... | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L599-L611 |
153,577 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.removeExtension | public static String removeExtension(String path) throws IllegalArgumentException
{
Params.notNull(path, "Path");
int extensionIndex = path.lastIndexOf('.');
return extensionIndex != -1 ? path.substring(0, extensionIndex) : path;
} | java | public static String removeExtension(String path) throws IllegalArgumentException
{
Params.notNull(path, "Path");
int extensionIndex = path.lastIndexOf('.');
return extensionIndex != -1 ? path.substring(0, extensionIndex) : path;
} | [
"public",
"static",
"String",
"removeExtension",
"(",
"String",
"path",
")",
"throws",
"IllegalArgumentException",
"{",
"Params",
".",
"notNull",
"(",
"path",
",",
"\"Path\"",
")",
";",
"int",
"extensionIndex",
"=",
"path",
".",
"lastIndexOf",
"(",
"'",
"'",
... | Remove extension from given file path and return resulting path.
@param path file path to remove extension from.
@return newly created path without extension.
@throws IllegalArgumentException if <code>path</code> parameter is null. | [
"Remove",
"extension",
"from",
"given",
"file",
"path",
"and",
"return",
"resulting",
"path",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L620-L625 |
153,578 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.removeExtension | public static File removeExtension(File file) throws IllegalArgumentException
{
Params.notNull(file, "File");
return new File(removeExtension(file.getPath()));
} | java | public static File removeExtension(File file) throws IllegalArgumentException
{
Params.notNull(file, "File");
return new File(removeExtension(file.getPath()));
} | [
"public",
"static",
"File",
"removeExtension",
"(",
"File",
"file",
")",
"throws",
"IllegalArgumentException",
"{",
"Params",
".",
"notNull",
"(",
"file",
",",
"\"File\"",
")",
";",
"return",
"new",
"File",
"(",
"removeExtension",
"(",
"file",
".",
"getPath",
... | Remove extension from given file and create a new one with resulting path.
@param file file to remove extension from.
@return newly created file without extension.
@throws IllegalArgumentException if <code>file</code> parameter is null. | [
"Remove",
"extension",
"from",
"given",
"file",
"and",
"create",
"a",
"new",
"one",
"with",
"resulting",
"path",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L634-L638 |
153,579 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.replaceExtension | public static String replaceExtension(String path, String newExtension) throws IllegalArgumentException
{
Params.notNull(path, "Path");
Params.notNull(newExtension, "New extension");
if(newExtension.charAt(0) == '.') {
newExtension = newExtension.substring(1);
}
int extensionDotIn... | java | public static String replaceExtension(String path, String newExtension) throws IllegalArgumentException
{
Params.notNull(path, "Path");
Params.notNull(newExtension, "New extension");
if(newExtension.charAt(0) == '.') {
newExtension = newExtension.substring(1);
}
int extensionDotIn... | [
"public",
"static",
"String",
"replaceExtension",
"(",
"String",
"path",
",",
"String",
"newExtension",
")",
"throws",
"IllegalArgumentException",
"{",
"Params",
".",
"notNull",
"(",
"path",
",",
"\"Path\"",
")",
";",
"Params",
".",
"notNull",
"(",
"newExtension... | Replace extension on given file path and return resulting path. Is legal for new extension parameter to start with
dot extension separator, but is not mandatory.
@param path file path to replace extension,
@param newExtension newly extension, with optional dot separator prefix.
@return newly created file path.
@throws... | [
"Replace",
"extension",
"on",
"given",
"file",
"path",
"and",
"return",
"resulting",
"path",
".",
"Is",
"legal",
"for",
"new",
"extension",
"parameter",
"to",
"start",
"with",
"dot",
"extension",
"separator",
"but",
"is",
"not",
"mandatory",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L649-L666 |
153,580 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.replaceExtension | public static File replaceExtension(File file, String newExtension) throws IllegalArgumentException
{
Params.notNull(file, "File");
return new File(replaceExtension(file.getPath(), newExtension));
} | java | public static File replaceExtension(File file, String newExtension) throws IllegalArgumentException
{
Params.notNull(file, "File");
return new File(replaceExtension(file.getPath(), newExtension));
} | [
"public",
"static",
"File",
"replaceExtension",
"(",
"File",
"file",
",",
"String",
"newExtension",
")",
"throws",
"IllegalArgumentException",
"{",
"Params",
".",
"notNull",
"(",
"file",
",",
"\"File\"",
")",
";",
"return",
"new",
"File",
"(",
"replaceExtension"... | Replace extension on given file and return resulting file.
@param file file to replace extension,
@param newExtension newly extension.
@return newly created file.
@throws IllegalArgumentException if file parameter is null. | [
"Replace",
"extension",
"on",
"given",
"file",
"and",
"return",
"resulting",
"file",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L676-L680 |
153,581 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.dot2path | public static String dot2path(String qualifiedName)
{
return qualifiedName != null ? DOT_PATTERN.matcher(qualifiedName).replaceAll(Matcher.quoteReplacement(File.separator)) : null;
} | java | public static String dot2path(String qualifiedName)
{
return qualifiedName != null ? DOT_PATTERN.matcher(qualifiedName).replaceAll(Matcher.quoteReplacement(File.separator)) : null;
} | [
"public",
"static",
"String",
"dot2path",
"(",
"String",
"qualifiedName",
")",
"{",
"return",
"qualifiedName",
"!=",
"null",
"?",
"DOT_PATTERN",
".",
"matcher",
"(",
"qualifiedName",
")",
".",
"replaceAll",
"(",
"Matcher",
".",
"quoteReplacement",
"(",
"File",
... | Replace all dots from given qualified name with platform specific path separator.
<pre>
js.net.Transaction -> js/net/Transaction or js\net\Transaction
</pre>
Returns null if <code>qualifiedName</code> parameter is null.
@param qualifiedName qualified name.
@return resulting path or null. | [
"Replace",
"all",
"dots",
"from",
"given",
"qualified",
"name",
"with",
"platform",
"specific",
"path",
"separator",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L750-L753 |
153,582 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.basename | public static String basename(String path)
{
return path != null ? basename(new File(path)) : null;
} | java | public static String basename(String path)
{
return path != null ? basename(new File(path)) : null;
} | [
"public",
"static",
"String",
"basename",
"(",
"String",
"path",
")",
"{",
"return",
"path",
"!=",
"null",
"?",
"basename",
"(",
"new",
"File",
"(",
"path",
")",
")",
":",
"null",
";",
"}"
] | Return base name for given file path. Returns null if given path parameter is null.
@param path file path string.
@return file name without extension or null. | [
"Return",
"base",
"name",
"for",
"given",
"file",
"path",
".",
"Returns",
"null",
"if",
"given",
"path",
"parameter",
"is",
"null",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L883-L886 |
153,583 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.createTempFile | private static File createTempFile() throws IOException
{
File file = File.createTempFile(TMP_FILE_PREFIX, TMP_FILE_EXTENSION);
file.deleteOnExit();
return file;
} | java | private static File createTempFile() throws IOException
{
File file = File.createTempFile(TMP_FILE_PREFIX, TMP_FILE_EXTENSION);
file.deleteOnExit();
return file;
} | [
"private",
"static",
"File",
"createTempFile",
"(",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"File",
".",
"createTempFile",
"(",
"TMP_FILE_PREFIX",
",",
"TMP_FILE_EXTENSION",
")",
";",
"file",
".",
"deleteOnExit",
"(",
")",
";",
"return",
"file"... | Create temporary file using library specific prefix and extension. Created file is removed at JVM exit.
@return newly create temporary file.
@throws IOException if file creation fails. | [
"Create",
"temporary",
"file",
"using",
"library",
"specific",
"prefix",
"and",
"extension",
".",
"Created",
"file",
"is",
"removed",
"at",
"JVM",
"exit",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L899-L904 |
153,584 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.isImage | public static boolean isImage(File file)
{
return file != null ? IMAGE_FILE_EXTENSIONS.contains(Files.getExtension(file)) : false;
} | java | public static boolean isImage(File file)
{
return file != null ? IMAGE_FILE_EXTENSIONS.contains(Files.getExtension(file)) : false;
} | [
"public",
"static",
"boolean",
"isImage",
"(",
"File",
"file",
")",
"{",
"return",
"file",
"!=",
"null",
"?",
"IMAGE_FILE_EXTENSIONS",
".",
"contains",
"(",
"Files",
".",
"getExtension",
"(",
"file",
")",
")",
":",
"false",
";",
"}"
] | Guess if file is an image file based on file extension. This is a very trivial test relying on file extension and
obviously cannot guarantee correct results.
@param file file to test.
@return true if given file is an image file. | [
"Guess",
"if",
"file",
"is",
"an",
"image",
"file",
"based",
"on",
"file",
"extension",
".",
"This",
"is",
"a",
"very",
"trivial",
"test",
"relying",
"on",
"file",
"extension",
"and",
"obviously",
"cannot",
"guarantee",
"correct",
"results",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L924-L927 |
153,585 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.getFileDigest | public static byte[] getFileDigest(InputStream inputStream) throws IOException
{
if(!(inputStream instanceof BufferedInputStream)) {
inputStream = new BufferedInputStream(inputStream);
}
MessageDigest messageDigest = null;
try {
byte[] buffer = new byte[1024];
messageDigest... | java | public static byte[] getFileDigest(InputStream inputStream) throws IOException
{
if(!(inputStream instanceof BufferedInputStream)) {
inputStream = new BufferedInputStream(inputStream);
}
MessageDigest messageDigest = null;
try {
byte[] buffer = new byte[1024];
messageDigest... | [
"public",
"static",
"byte",
"[",
"]",
"getFileDigest",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"(",
"inputStream",
"instanceof",
"BufferedInputStream",
")",
")",
"{",
"inputStream",
"=",
"new",
"BufferedInputStream",
... | Create MD5 message digest for bytes produced by given input stream till its end. This method returns a 16-bytes
array with computed MD5 message digest value. Note that input stream is read till its end and is closed before this
method returning, including on stream read error.
@param inputStream input stream for sourc... | [
"Create",
"MD5",
"message",
"digest",
"for",
"bytes",
"produced",
"by",
"given",
"input",
"stream",
"till",
"its",
"end",
".",
"This",
"method",
"returns",
"a",
"16",
"-",
"bytes",
"array",
"with",
"computed",
"MD5",
"message",
"digest",
"value",
".",
"Not... | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L963-L989 |
153,586 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.delete | public static void delete(File file) throws IOException
{
Params.notNull(file, "File");
if(file.exists() && !file.delete()) {
throw new IOException(Strings.format("Fail to delete file |%s|.", file));
}
} | java | public static void delete(File file) throws IOException
{
Params.notNull(file, "File");
if(file.exists() && !file.delete()) {
throw new IOException(Strings.format("Fail to delete file |%s|.", file));
}
} | [
"public",
"static",
"void",
"delete",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"Params",
".",
"notNull",
"(",
"file",
",",
"\"File\"",
")",
";",
"if",
"(",
"file",
".",
"exists",
"(",
")",
"&&",
"!",
"file",
".",
"delete",
"(",
")",
... | Delete file if exists throwing exception if delete fails. Note that this method does nothing if file does not
exist; anyway, null parameter sanity check is still performed.
@param file file path.
@throws IOException if delete operation fails.
@throws IllegalArgumentException if <code>file</code> parameter is null. | [
"Delete",
"file",
"if",
"exists",
"throwing",
"exception",
"if",
"delete",
"fails",
".",
"Note",
"that",
"this",
"method",
"does",
"nothing",
"if",
"file",
"does",
"not",
"exist",
";",
"anyway",
"null",
"parameter",
"sanity",
"check",
"is",
"still",
"perform... | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L1025-L1031 |
153,587 | js-lib-com/commons | src/main/java/js/util/Files.java | Files.normalizePath | public static String normalizePath(String path)
{
if(File.separatorChar == '/') {
return path.replace('\\', '/');
}
return path.replace('/', '\\');
} | java | public static String normalizePath(String path)
{
if(File.separatorChar == '/') {
return path.replace('\\', '/');
}
return path.replace('/', '\\');
} | [
"public",
"static",
"String",
"normalizePath",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"File",
".",
"separatorChar",
"==",
"'",
"'",
")",
"{",
"return",
"path",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
";",
"}",
"return",
"path",
".",... | Ensure that path separators are compatible with current operating system.
@param path path to normalize.
@return normalized path. | [
"Ensure",
"that",
"path",
"separators",
"are",
"compatible",
"with",
"current",
"operating",
"system",
"."
] | f8c64482142b163487745da74feb106f0765c16b | https://github.com/js-lib-com/commons/blob/f8c64482142b163487745da74feb106f0765c16b/src/main/java/js/util/Files.java#L1159-L1165 |
153,588 | jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/SCannedBox.java | SCannedBox.getProperties | public String getProperties(String strCommand, Map<String,Object> properties)
{
int iIndex = strCommand.indexOf('=');
if (iIndex != -1)
{
if (this.getParentScreen().getTask() != null)
Util.parseArgs(properties, strCommand);
if (properties.get(DBParams.COM... | java | public String getProperties(String strCommand, Map<String,Object> properties)
{
int iIndex = strCommand.indexOf('=');
if (iIndex != -1)
{
if (this.getParentScreen().getTask() != null)
Util.parseArgs(properties, strCommand);
if (properties.get(DBParams.COM... | [
"public",
"String",
"getProperties",
"(",
"String",
"strCommand",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"int",
"iIndex",
"=",
"strCommand",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"iIndex",
"!=",
"-",
"1",
... | Parse the command string into properties.
@param strCommand
@param properties
@return | [
"Parse",
"the",
"command",
"string",
"into",
"properties",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/SCannedBox.java#L418-L429 |
153,589 | nwillc/almost-functional | src/main/java/almost/functional/utils/Predicates.java | Predicates.notEmptyString | public static Predicate<String> notEmptyString() {
return new Predicate<String>() {
@Override
public boolean test(String testValue) {
if (notNull().test(testValue)) {
for (Character c : testValue.toCharArray()) {
if (!Character.... | java | public static Predicate<String> notEmptyString() {
return new Predicate<String>() {
@Override
public boolean test(String testValue) {
if (notNull().test(testValue)) {
for (Character c : testValue.toCharArray()) {
if (!Character.... | [
"public",
"static",
"Predicate",
"<",
"String",
">",
"notEmptyString",
"(",
")",
"{",
"return",
"new",
"Predicate",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"test",
"(",
"String",
"testValue",
")",
"{",
"if",
"(",
"notNull... | Predicate to check that a String is not empty, i.e. not null and contains other than whitespace characters.
@return true if the tested string is not empty. | [
"Predicate",
"to",
"check",
"that",
"a",
"String",
"is",
"not",
"empty",
"i",
".",
"e",
".",
"not",
"null",
"and",
"contains",
"other",
"than",
"whitespace",
"characters",
"."
] | a6cc7c73b2be475ed1bce5128c24b2eb9c27d666 | https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/utils/Predicates.java#L35-L49 |
153,590 | nwillc/almost-functional | src/main/java/almost/functional/utils/Predicates.java | Predicates.notNull | public static <T> Predicate<T> notNull() {
return new Predicate<T>() {
@Override
public boolean test(T testValue) {
return testValue != null;
}
};
} | java | public static <T> Predicate<T> notNull() {
return new Predicate<T>() {
@Override
public boolean test(T testValue) {
return testValue != null;
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"notNull",
"(",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"test",
"(",
"T",
"testValue",
")",
"{",
"return",
"testValue",... | Predicate to check that a value is not null.
@param <T> Type of the value
@return true if the value is not null | [
"Predicate",
"to",
"check",
"that",
"a",
"value",
"is",
"not",
"null",
"."
] | a6cc7c73b2be475ed1bce5128c24b2eb9c27d666 | https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/utils/Predicates.java#L57-L64 |
153,591 | nwillc/almost-functional | src/main/java/almost/functional/utils/Predicates.java | Predicates.contains | public static <T> Predicate<T> contains(final Iterable<T> iterable) {
return new Predicate<T>() {
@Override
public boolean test(final T testValue) {
return Iterables.contains(iterable, testValue);
}
};
} | java | public static <T> Predicate<T> contains(final Iterable<T> iterable) {
return new Predicate<T>() {
@Override
public boolean test(final T testValue) {
return Iterables.contains(iterable, testValue);
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"contains",
"(",
"final",
"Iterable",
"<",
"T",
">",
"iterable",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"test",
"(",
... | Returns a predicate that that tests if an iterable contains an argument.
@param iterable the iterable, may not be null
@param <T> the type of the argument to the predicate
@return a predicate that that tests if an iterable contains an argument | [
"Returns",
"a",
"predicate",
"that",
"that",
"tests",
"if",
"an",
"iterable",
"contains",
"an",
"argument",
"."
] | a6cc7c73b2be475ed1bce5128c24b2eb9c27d666 | https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/utils/Predicates.java#L89-L96 |
153,592 | nwillc/almost-functional | src/main/java/almost/functional/utils/Predicates.java | Predicates.negate | public static <T> Predicate<T> negate(final Predicate<? super T> predicate) {
return new Predicate<T>() {
@Override
public boolean test(final T testValue) {
return !predicate.test(testValue);
}
};
} | java | public static <T> Predicate<T> negate(final Predicate<? super T> predicate) {
return new Predicate<T>() {
@Override
public boolean test(final T testValue) {
return !predicate.test(testValue);
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"negate",
"(",
"final",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
... | Negate an existing predicate's test result.
@param predicate An existing predicate.
@param <T> type of the predicate.
@return new predicate.
@since 1.5 | [
"Negate",
"an",
"existing",
"predicate",
"s",
"test",
"result",
"."
] | a6cc7c73b2be475ed1bce5128c24b2eb9c27d666 | https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/utils/Predicates.java#L106-L113 |
153,593 | nwillc/almost-functional | src/main/java/almost/functional/utils/Predicates.java | Predicates.and | public static <T> Predicate<T> and(final Predicate<? super T> first, final Predicate<? super T> second) {
return new Predicate<T>() {
@Override
public boolean test(final T testValue) {
return first.test(testValue) && second.test(testValue);
}
};
} | java | public static <T> Predicate<T> and(final Predicate<? super T> first, final Predicate<? super T> second) {
return new Predicate<T>() {
@Override
public boolean test(final T testValue) {
return first.test(testValue) && second.test(testValue);
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"and",
"(",
"final",
"Predicate",
"<",
"?",
"super",
"T",
">",
"first",
",",
"final",
"Predicate",
"<",
"?",
"super",
"T",
">",
"second",
")",
"{",
"return",
"new",
"Predicate",
"<",
"T... | Create a predicate which is a logical and of two existing predicate.
@param first first predicate.
@param second second predicate.
@param <T> type of the predicates
@return resultant predicate
@since 1.5 | [
"Create",
"a",
"predicate",
"which",
"is",
"a",
"logical",
"and",
"of",
"two",
"existing",
"predicate",
"."
] | a6cc7c73b2be475ed1bce5128c24b2eb9c27d666 | https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/utils/Predicates.java#L124-L131 |
153,594 | nwillc/almost-functional | src/main/java/almost/functional/utils/Predicates.java | Predicates.or | public static <T> Predicate<T> or(final Predicate<? super T> first, final Predicate<? super T> second) { //NOPMD
return new Predicate<T>() {
@Override
public boolean test(final T testValue) {
return first.test(testValue) || second.test(testValue);
}
... | java | public static <T> Predicate<T> or(final Predicate<? super T> first, final Predicate<? super T> second) { //NOPMD
return new Predicate<T>() {
@Override
public boolean test(final T testValue) {
return first.test(testValue) || second.test(testValue);
}
... | [
"public",
"static",
"<",
"T",
">",
"Predicate",
"<",
"T",
">",
"or",
"(",
"final",
"Predicate",
"<",
"?",
"super",
"T",
">",
"first",
",",
"final",
"Predicate",
"<",
"?",
"super",
"T",
">",
"second",
")",
"{",
"//NOPMD",
"return",
"new",
"Predicate",... | Create a predicate which is a logical or of two existing predicate.
@param first first predicate.
@param second second predicate.
@param <T> type of the predicates
@return resultant predicate
@since 1.5 | [
"Create",
"a",
"predicate",
"which",
"is",
"a",
"logical",
"or",
"of",
"two",
"existing",
"predicate",
"."
] | a6cc7c73b2be475ed1bce5128c24b2eb9c27d666 | https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/utils/Predicates.java#L142-L149 |
153,595 | thorinii/lct | src/main/java/me/lachlanap/lct/LCTManager.java | LCTManager.addConstant | public void addConstant(ConstantField field) {
constantList.add(field);
constants.put(field.name, field);
} | java | public void addConstant(ConstantField field) {
constantList.add(field);
constants.put(field.name, field);
} | [
"public",
"void",
"addConstant",
"(",
"ConstantField",
"field",
")",
"{",
"constantList",
".",
"add",
"(",
"field",
")",
";",
"constants",
".",
"put",
"(",
"field",
".",
"name",
",",
"field",
")",
";",
"}"
] | Manually add a field to the list of constants.
@param field the field | [
"Manually",
"add",
"a",
"field",
"to",
"the",
"list",
"of",
"constants",
"."
] | 83d9dd94aac1efec4815b5658faa395a081592dc | https://github.com/thorinii/lct/blob/83d9dd94aac1efec4815b5658faa395a081592dc/src/main/java/me/lachlanap/lct/LCTManager.java#L65-L68 |
153,596 | thorinii/lct | src/main/java/me/lachlanap/lct/LCTManager.java | LCTManager.register | public void register(Class<?> aClass) {
List<ConstantField> tmp = inspector.getConstants(aClass);
constantList.addAll(tmp);
for (ConstantField constant : tmp)
constants.put(constant.name, constant);
} | java | public void register(Class<?> aClass) {
List<ConstantField> tmp = inspector.getConstants(aClass);
constantList.addAll(tmp);
for (ConstantField constant : tmp)
constants.put(constant.name, constant);
} | [
"public",
"void",
"register",
"(",
"Class",
"<",
"?",
">",
"aClass",
")",
"{",
"List",
"<",
"ConstantField",
">",
"tmp",
"=",
"inspector",
".",
"getConstants",
"(",
"aClass",
")",
";",
"constantList",
".",
"addAll",
"(",
"tmp",
")",
";",
"for",
"(",
... | Extracts the constant fields from the specified class using the ClassInspector. | [
"Extracts",
"the",
"constant",
"fields",
"from",
"the",
"specified",
"class",
"using",
"the",
"ClassInspector",
"."
] | 83d9dd94aac1efec4815b5658faa395a081592dc | https://github.com/thorinii/lct/blob/83d9dd94aac1efec4815b5658faa395a081592dc/src/main/java/me/lachlanap/lct/LCTManager.java#L81-L87 |
153,597 | thorinii/lct | src/main/java/me/lachlanap/lct/LCTManager.java | LCTManager.loadSettings | public void loadSettings(String file) throws IOException {
Path path = Paths.get(file);
try (BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8)) {
Properties props = new Properties();
props.load(reader);
loadSettings(props);
}
} | java | public void loadSettings(String file) throws IOException {
Path path = Paths.get(file);
try (BufferedReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8)) {
Properties props = new Properties();
props.load(reader);
loadSettings(props);
}
} | [
"public",
"void",
"loadSettings",
"(",
"String",
"file",
")",
"throws",
"IOException",
"{",
"Path",
"path",
"=",
"Paths",
".",
"get",
"(",
"file",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"Files",
".",
"newBufferedReader",
"(",
"path",
",",
... | Loads constant settings from a file in Properties format.
@param file the path to the file to read from
@throws IOException when file reading fails | [
"Loads",
"constant",
"settings",
"from",
"a",
"file",
"in",
"Properties",
"format",
"."
] | 83d9dd94aac1efec4815b5658faa395a081592dc | https://github.com/thorinii/lct/blob/83d9dd94aac1efec4815b5658faa395a081592dc/src/main/java/me/lachlanap/lct/LCTManager.java#L103-L111 |
153,598 | thorinii/lct | src/main/java/me/lachlanap/lct/LCTManager.java | LCTManager.saveSettings | public void saveSettings(String file) throws IOException {
Path path = Paths.get(file);
try (BufferedWriter reader = Files.newBufferedWriter(path, StandardCharsets.UTF_8)) {
Properties props = new Properties();
saveSettings(props);
props.store(reader, "Saved by LiveC... | java | public void saveSettings(String file) throws IOException {
Path path = Paths.get(file);
try (BufferedWriter reader = Files.newBufferedWriter(path, StandardCharsets.UTF_8)) {
Properties props = new Properties();
saveSettings(props);
props.store(reader, "Saved by LiveC... | [
"public",
"void",
"saveSettings",
"(",
"String",
"file",
")",
"throws",
"IOException",
"{",
"Path",
"path",
"=",
"Paths",
".",
"get",
"(",
"file",
")",
";",
"try",
"(",
"BufferedWriter",
"reader",
"=",
"Files",
".",
"newBufferedWriter",
"(",
"path",
",",
... | Saves constant settings to a file in Properties format.
@param file the path to the file to write tp
@throws IOException if writing fails | [
"Saves",
"constant",
"settings",
"to",
"a",
"file",
"in",
"Properties",
"format",
"."
] | 83d9dd94aac1efec4815b5658faa395a081592dc | https://github.com/thorinii/lct/blob/83d9dd94aac1efec4815b5658faa395a081592dc/src/main/java/me/lachlanap/lct/LCTManager.java#L127-L135 |
153,599 | thorinii/lct | src/main/java/me/lachlanap/lct/LCTManager.java | LCTManager.set | @Deprecated
public void set(String name, int i) {
ConstantField constant = constants.get(name);
((IntConstantField) constant).set(i);
} | java | @Deprecated
public void set(String name, int i) {
ConstantField constant = constants.get(name);
((IntConstantField) constant).set(i);
} | [
"@",
"Deprecated",
"public",
"void",
"set",
"(",
"String",
"name",
",",
"int",
"i",
")",
"{",
"ConstantField",
"constant",
"=",
"constants",
".",
"get",
"(",
"name",
")",
";",
"(",
"(",
"IntConstantField",
")",
"constant",
")",
".",
"set",
"(",
"i",
... | Set an integer field with name given.
@deprecated design flaw - cannot support all types of fields like this. Get the field from the list of fields and set it from there. | [
"Set",
"an",
"integer",
"field",
"with",
"name",
"given",
"."
] | 83d9dd94aac1efec4815b5658faa395a081592dc | https://github.com/thorinii/lct/blob/83d9dd94aac1efec4815b5658faa395a081592dc/src/main/java/me/lachlanap/lct/LCTManager.java#L141-L145 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.