repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/base/PLPageSetPrepareResult.java | PLPageSetPrepareResult.setFooterHeight | void setFooterHeight (final float fFooterHeight)
{
// Set the maximum value only
if (Float.isNaN (m_fFooterHeight))
m_fFooterHeight = fFooterHeight;
else
m_fFooterHeight = Math.max (m_fFooterHeight, fFooterHeight);
} | java | void setFooterHeight (final float fFooterHeight)
{
// Set the maximum value only
if (Float.isNaN (m_fFooterHeight))
m_fFooterHeight = fFooterHeight;
else
m_fFooterHeight = Math.max (m_fFooterHeight, fFooterHeight);
} | [
"void",
"setFooterHeight",
"(",
"final",
"float",
"fFooterHeight",
")",
"{",
"// Set the maximum value only",
"if",
"(",
"Float",
".",
"isNaN",
"(",
"m_fFooterHeight",
")",
")",
"m_fFooterHeight",
"=",
"fFooterHeight",
";",
"else",
"m_fFooterHeight",
"=",
"Math",
... | Set the page footer height. The maximum height is used.
@param fFooterHeight
Height without padding or margin. | [
"Set",
"the",
"page",
"footer",
"height",
".",
"The",
"maximum",
"height",
"is",
"used",
"."
] | 777d9f3a131cbe8f592c0de1cf554084e541bb54 | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/base/PLPageSetPrepareResult.java#L97-L104 | train |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/base/PLPageSetPrepareResult.java | PLPageSetPrepareResult.addPerPageElements | void addPerPageElements (@Nonnull @Nonempty final ICommonsList <PLElementWithSize> aCurPageElements)
{
ValueEnforcer.notEmptyNoNullValue (aCurPageElements, "CurPageElements");
m_aPerPageElements.add (aCurPageElements);
} | java | void addPerPageElements (@Nonnull @Nonempty final ICommonsList <PLElementWithSize> aCurPageElements)
{
ValueEnforcer.notEmptyNoNullValue (aCurPageElements, "CurPageElements");
m_aPerPageElements.add (aCurPageElements);
} | [
"void",
"addPerPageElements",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"ICommonsList",
"<",
"PLElementWithSize",
">",
"aCurPageElements",
")",
"{",
"ValueEnforcer",
".",
"notEmptyNoNullValue",
"(",
"aCurPageElements",
",",
"\"CurPageElements\"",
")",
";",
"m_aPe... | Add a list of elements for a single page. This implicitly creates a new
page.
@param aCurPageElements
The list to use. May neither be <code>null</code> nor empty. | [
"Add",
"a",
"list",
"of",
"elements",
"for",
"a",
"single",
"page",
".",
"This",
"implicitly",
"creates",
"a",
"new",
"page",
"."
] | 777d9f3a131cbe8f592c0de1cf554084e541bb54 | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/base/PLPageSetPrepareResult.java#L121-L125 | train |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/spec/WidthSpec.java | WidthSpec.getEffectiveValue | @Nonnegative
public float getEffectiveValue (final float fAvailableWidth)
{
switch (m_eType)
{
case ABSOLUTE:
return Math.min (m_fValue, fAvailableWidth);
case PERCENTAGE:
return fAvailableWidth * m_fValue / 100;
default:
throw new IllegalStateException ("Unsupporte... | java | @Nonnegative
public float getEffectiveValue (final float fAvailableWidth)
{
switch (m_eType)
{
case ABSOLUTE:
return Math.min (m_fValue, fAvailableWidth);
case PERCENTAGE:
return fAvailableWidth * m_fValue / 100;
default:
throw new IllegalStateException ("Unsupporte... | [
"@",
"Nonnegative",
"public",
"float",
"getEffectiveValue",
"(",
"final",
"float",
"fAvailableWidth",
")",
"{",
"switch",
"(",
"m_eType",
")",
"{",
"case",
"ABSOLUTE",
":",
"return",
"Math",
".",
"min",
"(",
"m_fValue",
",",
"fAvailableWidth",
")",
";",
"cas... | Get the effective width based on the passed available width. This may not
be called for star or auto width elements.
@param fAvailableWidth
The available width.
@return The effective width to use.
@see #isAbsolute() | [
"Get",
"the",
"effective",
"width",
"based",
"on",
"the",
"passed",
"available",
"width",
".",
"This",
"may",
"not",
"be",
"called",
"for",
"star",
"or",
"auto",
"width",
"elements",
"."
] | 777d9f3a131cbe8f592c0de1cf554084e541bb54 | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/spec/WidthSpec.java#L125-L137 | train |
impinj/itemsense-java | src/main/java/com/impinj/itemsense/client/data/item/ItemController.java | ItemController.getAllItems | @Deprecated
public ArrayList<Item> getAllItems(
EpcFormat epcFormat,
String epcPrefix,
String jobId,
String zoneNames,
PresenceConfidence presenceConfidence,
String facility,
String pageMarker) {
return getAllItems(
epcFormat,
epcPrefix,
jobId,
... | java | @Deprecated
public ArrayList<Item> getAllItems(
EpcFormat epcFormat,
String epcPrefix,
String jobId,
String zoneNames,
PresenceConfidence presenceConfidence,
String facility,
String pageMarker) {
return getAllItems(
epcFormat,
epcPrefix,
jobId,
... | [
"@",
"Deprecated",
"public",
"ArrayList",
"<",
"Item",
">",
"getAllItems",
"(",
"EpcFormat",
"epcFormat",
",",
"String",
"epcPrefix",
",",
"String",
"jobId",
",",
"String",
"zoneNames",
",",
"PresenceConfidence",
"presenceConfidence",
",",
"String",
"facility",
",... | without this parameter | [
"without",
"this",
"parameter"
] | f5a459dfb6687ff95e29f7cf5b6a8bfda112c96b | https://github.com/impinj/itemsense-java/blob/f5a459dfb6687ff95e29f7cf5b6a8bfda112c96b/src/main/java/com/impinj/itemsense/client/data/item/ItemController.java#L142-L160 | train |
allengeorge/libraft | libraft-agent/src/main/java/io/libraft/agent/rpc/Handshakers.java | Handshakers.getServerIdFromHandshake | static String getServerIdFromHandshake(ChannelBuffer handshakeBuffer, ObjectMapper mapper) throws IOException {
Handshake handshake = getHandshakeFromBuffer(handshakeBuffer, mapper);
return handshake.getServerId();
} | java | static String getServerIdFromHandshake(ChannelBuffer handshakeBuffer, ObjectMapper mapper) throws IOException {
Handshake handshake = getHandshakeFromBuffer(handshakeBuffer, mapper);
return handshake.getServerId();
} | [
"static",
"String",
"getServerIdFromHandshake",
"(",
"ChannelBuffer",
"handshakeBuffer",
",",
"ObjectMapper",
"mapper",
")",
"throws",
"IOException",
"{",
"Handshake",
"handshake",
"=",
"getHandshakeFromBuffer",
"(",
"handshakeBuffer",
",",
"mapper",
")",
";",
"return",... | Extract the unique id of the Raft server that sent a handshake
message from its wire representation.
@param handshakeBuffer instance of {@code ChannelBuffer} that contains
the encoded handshake message
@param mapper instance of {@code ObjectMapper} used to map handshake fields
in the encoded message to their correspon... | [
"Extract",
"the",
"unique",
"id",
"of",
"the",
"Raft",
"server",
"that",
"sent",
"a",
"handshake",
"message",
"from",
"its",
"wire",
"representation",
"."
] | 00d68bb5e68d4020af59df3c8a9a14380108ac89 | https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-agent/src/main/java/io/libraft/agent/rpc/Handshakers.java#L121-L124 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/ui/SupportMail.java | SupportMail.setTitle | public void setTitle(CharSequence title){
if(mConstruct != null && !mConstruct.getDesign().isMaterial()){
// Modify the dialog's title element
getDialog().setTitle(title);
}else{
if(mTitle != null){
mTitle.setText(title);
}
}
} | java | public void setTitle(CharSequence title){
if(mConstruct != null && !mConstruct.getDesign().isMaterial()){
// Modify the dialog's title element
getDialog().setTitle(title);
}else{
if(mTitle != null){
mTitle.setText(title);
}
}
} | [
"public",
"void",
"setTitle",
"(",
"CharSequence",
"title",
")",
"{",
"if",
"(",
"mConstruct",
"!=",
"null",
"&&",
"!",
"mConstruct",
".",
"getDesign",
"(",
")",
".",
"isMaterial",
"(",
")",
")",
"{",
"// Modify the dialog's title element",
"getDialog",
"(",
... | Modify the title of the dialog no matter what style it is
@param title the title to update with | [
"Modify",
"the",
"title",
"of",
"the",
"dialog",
"no",
"matter",
"what",
"style",
"it",
"is"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/ui/SupportMail.java#L331-L340 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/ui/SupportMail.java | SupportMail.setMessage | public void setMessage(CharSequence message){
if(mConstruct != null && !mConstruct.getDesign().isMaterial()){
TextView msgView = (TextView) getDialog().findViewById(R.id.message);
msgView.setText(message);
}else{
if(mMessage != null){
mMessage.setText(... | java | public void setMessage(CharSequence message){
if(mConstruct != null && !mConstruct.getDesign().isMaterial()){
TextView msgView = (TextView) getDialog().findViewById(R.id.message);
msgView.setText(message);
}else{
if(mMessage != null){
mMessage.setText(... | [
"public",
"void",
"setMessage",
"(",
"CharSequence",
"message",
")",
"{",
"if",
"(",
"mConstruct",
"!=",
"null",
"&&",
"!",
"mConstruct",
".",
"getDesign",
"(",
")",
".",
"isMaterial",
"(",
")",
")",
"{",
"TextView",
"msgView",
"=",
"(",
"TextView",
")",... | Modify the message of the dialog
@param message the message to update with | [
"Modify",
"the",
"message",
"of",
"the",
"dialog"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/ui/SupportMail.java#L356-L365 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/ui/SupportMail.java | SupportMail.getButtonPriority | private Integer getButtonPriority(Integer button){
switch (button){
case Dialog.BUTTON_POSITIVE:
return 1;
case Dialog.BUTTON_NEUTRAL:
return 2;
case Dialog.BUTTON_NEGATIVE:
return 3;
default:
return ... | java | private Integer getButtonPriority(Integer button){
switch (button){
case Dialog.BUTTON_POSITIVE:
return 1;
case Dialog.BUTTON_NEUTRAL:
return 2;
case Dialog.BUTTON_NEGATIVE:
return 3;
default:
return ... | [
"private",
"Integer",
"getButtonPriority",
"(",
"Integer",
"button",
")",
"{",
"switch",
"(",
"button",
")",
"{",
"case",
"Dialog",
".",
"BUTTON_POSITIVE",
":",
"return",
"1",
";",
"case",
"Dialog",
".",
"BUTTON_NEUTRAL",
":",
"return",
"2",
";",
"case",
"... | Get the proper button sorting priority
@param button the button constant
@return the sorting order | [
"Get",
"the",
"proper",
"button",
"sorting",
"priority"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/ui/SupportMail.java#L537-L548 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/styles/EditTextStyle.java | EditTextStyle.applyDesign | @Override
public void applyDesign(Design design, int themeColor) {
Context ctx = mInputField.getContext();
int smallPadId = design.isMaterial() ? R.dimen.default_margin : R.dimen.default_margin_small;
int largePadId = design.isMaterial() ? R.dimen.material_edittext_spacing : R.dimen.default... | java | @Override
public void applyDesign(Design design, int themeColor) {
Context ctx = mInputField.getContext();
int smallPadId = design.isMaterial() ? R.dimen.default_margin : R.dimen.default_margin_small;
int largePadId = design.isMaterial() ? R.dimen.material_edittext_spacing : R.dimen.default... | [
"@",
"Override",
"public",
"void",
"applyDesign",
"(",
"Design",
"design",
",",
"int",
"themeColor",
")",
"{",
"Context",
"ctx",
"=",
"mInputField",
".",
"getContext",
"(",
")",
";",
"int",
"smallPadId",
"=",
"design",
".",
"isMaterial",
"(",
")",
"?",
"... | Apply a design to the style
@param design the design, i.e. Holo, Material, Light, Dark | [
"Apply",
"a",
"design",
"to",
"the",
"style"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/styles/EditTextStyle.java#L50-L82 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/styles/EditTextStyle.java | EditTextStyle.onButtonClicked | @Override
public void onButtonClicked(int which, DialogInterface dialogInterface) {
switch (which){
case Dialog.BUTTON_POSITIVE:
if(mListener != null) mListener.onAccepted(getText());
break;
case Dialog.BUTTON_NEGATIVE:
// Do nothing fo... | java | @Override
public void onButtonClicked(int which, DialogInterface dialogInterface) {
switch (which){
case Dialog.BUTTON_POSITIVE:
if(mListener != null) mListener.onAccepted(getText());
break;
case Dialog.BUTTON_NEGATIVE:
// Do nothing fo... | [
"@",
"Override",
"public",
"void",
"onButtonClicked",
"(",
"int",
"which",
",",
"DialogInterface",
"dialogInterface",
")",
"{",
"switch",
"(",
"which",
")",
"{",
"case",
"Dialog",
".",
"BUTTON_POSITIVE",
":",
"if",
"(",
"mListener",
"!=",
"null",
")",
"mList... | Called when one of the three available buttons are clicked
so that this style can perform a special action such as calling a content
delivery callback.
@param which which button was pressed
@param dialogInterface | [
"Called",
"when",
"one",
"of",
"the",
"three",
"available",
"buttons",
"are",
"clicked",
"so",
"that",
"this",
"style",
"can",
"perform",
"a",
"special",
"action",
"such",
"as",
"calling",
"a",
"content",
"delivery",
"callback",
"."
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/styles/EditTextStyle.java#L92-L102 | train |
allengeorge/libraft | libraft-samples/kayvee/src/main/java/io/libraft/kayvee/store/LocalStore.java | LocalStore.get | synchronized KeyValue get(long index, String key) throws KayVeeException {
incrementLastAppliedIndex(index);
String value = entries.get(key);
if (value == null) {
throw new KeyNotFoundException(key);
}
return new KeyValue(key, value);
} | java | synchronized KeyValue get(long index, String key) throws KayVeeException {
incrementLastAppliedIndex(index);
String value = entries.get(key);
if (value == null) {
throw new KeyNotFoundException(key);
}
return new KeyValue(key, value);
} | [
"synchronized",
"KeyValue",
"get",
"(",
"long",
"index",
",",
"String",
"key",
")",
"throws",
"KayVeeException",
"{",
"incrementLastAppliedIndex",
"(",
"index",
")",
";",
"String",
"value",
"=",
"entries",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"valu... | Get the value for a key.
@param index log index >= 0 associated with this command
@param key non-null (possibly empty) key for which the value should be retrieved
@return a {@code KeyValue} instance containing the most up-to-date {@code key=>value} pair for {@code key}
@throws KayVeeException if {@code key} does not e... | [
"Get",
"the",
"value",
"for",
"a",
"key",
"."
] | 00d68bb5e68d4020af59df3c8a9a14380108ac89 | https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-samples/kayvee/src/main/java/io/libraft/kayvee/store/LocalStore.java#L113-L123 | train |
allengeorge/libraft | libraft-samples/kayvee/src/main/java/io/libraft/kayvee/store/LocalStore.java | LocalStore.set | synchronized KeyValue set(long index, String key, String value) {
incrementLastAppliedIndex(index);
entries.put(key, value);
return new KeyValue(key, entries.get(key));
} | java | synchronized KeyValue set(long index, String key, String value) {
incrementLastAppliedIndex(index);
entries.put(key, value);
return new KeyValue(key, entries.get(key));
} | [
"synchronized",
"KeyValue",
"set",
"(",
"long",
"index",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"incrementLastAppliedIndex",
"(",
"index",
")",
";",
"entries",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"new",
"KeyValue",
... | Set a key to a value.
@param index log index >= 0 associated with this command
@param key non-null (possibly empty) key for which the value should be set
@param value non-null, non-empty value for this key
@return a {@code KeyValue} instance containing the most up-to-date {@code key=>value} pair for {@code key} | [
"Set",
"a",
"key",
"to",
"a",
"value",
"."
] | 00d68bb5e68d4020af59df3c8a9a14380108ac89 | https://github.com/allengeorge/libraft/blob/00d68bb5e68d4020af59df3c8a9a14380108ac89/libraft-samples/kayvee/src/main/java/io/libraft/kayvee/store/LocalStore.java#L150-L156 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/PostOffice.java | PostOffice.applyDefaults | private static void applyDefaults(Delivery.Builder builder){
Stamp defaults = getPostman().defaultStamp;
if(defaults != null){
builder.setDesign(defaults.getDesign())
.setCancelable(defaults.isCancelable())
.setCanceledOnTouchOutside(defaults.isCanceledO... | java | private static void applyDefaults(Delivery.Builder builder){
Stamp defaults = getPostman().defaultStamp;
if(defaults != null){
builder.setDesign(defaults.getDesign())
.setCancelable(defaults.isCancelable())
.setCanceledOnTouchOutside(defaults.isCanceledO... | [
"private",
"static",
"void",
"applyDefaults",
"(",
"Delivery",
".",
"Builder",
"builder",
")",
"{",
"Stamp",
"defaults",
"=",
"getPostman",
"(",
")",
".",
"defaultStamp",
";",
"if",
"(",
"defaults",
"!=",
"null",
")",
"{",
"builder",
".",
"setDesign",
"(",... | If possible, apply the default stamp to this outgoing delivery
@param builder the delivery builder to apply defaults to | [
"If",
"possible",
"apply",
"the",
"default",
"stamp",
"to",
"this",
"outgoing",
"delivery"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/PostOffice.java#L439-L449 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/widgets/MaterialButtonLayout.java | MaterialButtonLayout.init | private void init(){
MAX_BUTTON_WIDTH = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 124f, getResources().getDisplayMetrics());
MIN_BUTTON_WIDTH = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 88f, getResources().getDisplayMetrics());
} | java | private void init(){
MAX_BUTTON_WIDTH = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 124f, getResources().getDisplayMetrics());
MIN_BUTTON_WIDTH = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 88f, getResources().getDisplayMetrics());
} | [
"private",
"void",
"init",
"(",
")",
"{",
"MAX_BUTTON_WIDTH",
"=",
"TypedValue",
".",
"applyDimension",
"(",
"TypedValue",
".",
"COMPLEX_UNIT_DIP",
",",
"124f",
",",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
")",
";",
"MIN_BUTTON_WIDTH",
"=... | Initialize the view | [
"Initialize",
"the",
"view"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/widgets/MaterialButtonLayout.java#L65-L68 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/model/Delivery.java | Delivery.updateDesign | public void updateDesign(Design design){
mDesign = design;
if(mStyle != null) mStyle.applyDesign(mDesign, mThemeColor);
} | java | public void updateDesign(Design design){
mDesign = design;
if(mStyle != null) mStyle.applyDesign(mDesign, mThemeColor);
} | [
"public",
"void",
"updateDesign",
"(",
"Design",
"design",
")",
"{",
"mDesign",
"=",
"design",
";",
"if",
"(",
"mStyle",
"!=",
"null",
")",
"mStyle",
".",
"applyDesign",
"(",
"mDesign",
",",
"mThemeColor",
")",
";",
"}"
] | Update the design of this delivery
@param design | [
"Update",
"the",
"design",
"of",
"this",
"delivery"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/model/Delivery.java#L298-L301 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/styles/ProgressStyle.java | ProgressStyle.applyDesign | @Override
public void applyDesign(Design design, int themeColor) {
if(mProgressStyle == HORIZONTAL) {
LayerDrawable drawable = (LayerDrawable) mLayout.getResources().getDrawable(R.drawable.progress_material_horizontal);
Drawable bg = drawable.getDrawable(0);
int color ... | java | @Override
public void applyDesign(Design design, int themeColor) {
if(mProgressStyle == HORIZONTAL) {
LayerDrawable drawable = (LayerDrawable) mLayout.getResources().getDrawable(R.drawable.progress_material_horizontal);
Drawable bg = drawable.getDrawable(0);
int color ... | [
"@",
"Override",
"public",
"void",
"applyDesign",
"(",
"Design",
"design",
",",
"int",
"themeColor",
")",
"{",
"if",
"(",
"mProgressStyle",
"==",
"HORIZONTAL",
")",
"{",
"LayerDrawable",
"drawable",
"=",
"(",
"LayerDrawable",
")",
"mLayout",
".",
"getResources... | Apply the design of a delivery to this style
@param design the design, i.e. Holo, Material, Light, Dark
@param themeColor the theme color | [
"Apply",
"the",
"design",
"of",
"a",
"delivery",
"to",
"this",
"style"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/styles/ProgressStyle.java#L102-L168 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/styles/ProgressStyle.java | ProgressStyle.setProgress | public ProgressStyle setProgress(int value){
if(mProgressStyle == HORIZONTAL) {
if (mProgress.isIndeterminate())
mProgress.setIndeterminate(false);
if (mProgress.getMax() <= value)
mProgress.setMax(value);
mProgress.setProgress(value);
... | java | public ProgressStyle setProgress(int value){
if(mProgressStyle == HORIZONTAL) {
if (mProgress.isIndeterminate())
mProgress.setIndeterminate(false);
if (mProgress.getMax() <= value)
mProgress.setMax(value);
mProgress.setProgress(value);
... | [
"public",
"ProgressStyle",
"setProgress",
"(",
"int",
"value",
")",
"{",
"if",
"(",
"mProgressStyle",
"==",
"HORIZONTAL",
")",
"{",
"if",
"(",
"mProgress",
".",
"isIndeterminate",
"(",
")",
")",
"mProgress",
".",
"setIndeterminate",
"(",
"false",
")",
";",
... | Set the progress of the progress bar
@param value the progress out of the max
@return self for chaining | [
"Set",
"the",
"progress",
"of",
"the",
"progress",
"bar"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/styles/ProgressStyle.java#L287-L325 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/styles/ProgressStyle.java | ProgressStyle.setMax | public ProgressStyle setMax(int value){
if(mProgressStyle == HORIZONTAL) {
if (mProgress.isIndeterminate())
mProgress.setIndeterminate(false);
mProgress.setMax(value);
if (!mIsPercentageMode)
mProgressMax.setText(String.format("%d %s", valu... | java | public ProgressStyle setMax(int value){
if(mProgressStyle == HORIZONTAL) {
if (mProgress.isIndeterminate())
mProgress.setIndeterminate(false);
mProgress.setMax(value);
if (!mIsPercentageMode)
mProgressMax.setText(String.format("%d %s", valu... | [
"public",
"ProgressStyle",
"setMax",
"(",
"int",
"value",
")",
"{",
"if",
"(",
"mProgressStyle",
"==",
"HORIZONTAL",
")",
"{",
"if",
"(",
"mProgress",
".",
"isIndeterminate",
"(",
")",
")",
"mProgress",
".",
"setIndeterminate",
"(",
"false",
")",
";",
"mPr... | Set the max total progress of the progress bar
@param value the max value
@return self for chaining | [
"Set",
"the",
"max",
"total",
"progress",
"of",
"the",
"progress",
"bar"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/styles/ProgressStyle.java#L333-L348 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/styles/ProgressStyle.java | ProgressStyle.setIndeterminate | public ProgressStyle setIndeterminate(boolean value){
if(mProgressStyle == HORIZONTAL) {
mProgress.setIndeterminate(value);
mProgressText.setVisibility(value ? View.GONE : View.VISIBLE);
mProgressMax.setVisibility(value ? View.GONE : View.VISIBLE);
}
return th... | java | public ProgressStyle setIndeterminate(boolean value){
if(mProgressStyle == HORIZONTAL) {
mProgress.setIndeterminate(value);
mProgressText.setVisibility(value ? View.GONE : View.VISIBLE);
mProgressMax.setVisibility(value ? View.GONE : View.VISIBLE);
}
return th... | [
"public",
"ProgressStyle",
"setIndeterminate",
"(",
"boolean",
"value",
")",
"{",
"if",
"(",
"mProgressStyle",
"==",
"HORIZONTAL",
")",
"{",
"mProgress",
".",
"setIndeterminate",
"(",
"value",
")",
";",
"mProgressText",
".",
"setVisibility",
"(",
"value",
"?",
... | Set this progress as Indeterminate
@param value indeterminate value
@return self for chaining | [
"Set",
"this",
"progress",
"as",
"Indeterminate"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/styles/ProgressStyle.java#L356-L363 | train |
r0adkll/PostOffice | library/src/main/java/com/r0adkll/postoffice/styles/ProgressStyle.java | ProgressStyle.lighten | private int lighten(int color){
float[] hsv = new float[3];
Color.colorToHSV(color, hsv);
hsv[2] = 1.0f - 0.8f * (1.0f - hsv[2]);
color = Color.HSVToColor(hsv);
return color;
} | java | private int lighten(int color){
float[] hsv = new float[3];
Color.colorToHSV(color, hsv);
hsv[2] = 1.0f - 0.8f * (1.0f - hsv[2]);
color = Color.HSVToColor(hsv);
return color;
} | [
"private",
"int",
"lighten",
"(",
"int",
"color",
")",
"{",
"float",
"[",
"]",
"hsv",
"=",
"new",
"float",
"[",
"3",
"]",
";",
"Color",
".",
"colorToHSV",
"(",
"color",
",",
"hsv",
")",
";",
"hsv",
"[",
"2",
"]",
"=",
"1.0f",
"-",
"0.8f",
"*",
... | Get a lighter color for a given color
@param color the color to lighten
@return the lightened color | [
"Get",
"a",
"lighter",
"color",
"for",
"a",
"given",
"color"
] | f98e365fd66c004ccce64ee87d9f471b97e4e3c2 | https://github.com/r0adkll/PostOffice/blob/f98e365fd66c004ccce64ee87d9f471b97e4e3c2/library/src/main/java/com/r0adkll/postoffice/styles/ProgressStyle.java#L371-L377 | train |
impinj/itemsense-java | src/main/java/com/impinj/itemsense/client/data/itemhistory/ItemHistoryController.java | ItemHistoryController.getItemHistory | @Deprecated
public ItemHistoryResponse getItemHistory(
EpcFormat epcFormat,
String epcPrefix,
String jobId,
String fromZone,
String toZone,
String fromFacility,
String toFacility,
PresenceConfidence presenceConfidence,
String facility,
Integer pageSize, Stri... | java | @Deprecated
public ItemHistoryResponse getItemHistory(
EpcFormat epcFormat,
String epcPrefix,
String jobId,
String fromZone,
String toZone,
String fromFacility,
String toFacility,
PresenceConfidence presenceConfidence,
String facility,
Integer pageSize, Stri... | [
"@",
"Deprecated",
"public",
"ItemHistoryResponse",
"getItemHistory",
"(",
"EpcFormat",
"epcFormat",
",",
"String",
"epcPrefix",
",",
"String",
"jobId",
",",
"String",
"fromZone",
",",
"String",
"toZone",
",",
"String",
"fromFacility",
",",
"String",
"toFacility",
... | This is deprecated because the parameters do not correspond to the itemsense parameters | [
"This",
"is",
"deprecated",
"because",
"the",
"parameters",
"do",
"not",
"correspond",
"to",
"the",
"itemsense",
"parameters"
] | f5a459dfb6687ff95e29f7cf5b6a8bfda112c96b | https://github.com/impinj/itemsense-java/blob/f5a459dfb6687ff95e29f7cf5b6a8bfda112c96b/src/main/java/com/impinj/itemsense/client/data/itemhistory/ItemHistoryController.java#L94-L122 | train |
impinj/itemsense-java | src/main/java/com/impinj/itemsense/client/data/itemhistory/ItemHistoryController.java | ItemHistoryController.getAllItemHistory | @Deprecated
public ArrayList<ItemHistory> getAllItemHistory(
EpcFormat epcFormat,
String epcPrefix,
String jobId,
String fromZone,
String toZone,
String fromFacility,
String toFacility,
PresenceConfidence presenceConfidence,
String facility,
String pageMarke... | java | @Deprecated
public ArrayList<ItemHistory> getAllItemHistory(
EpcFormat epcFormat,
String epcPrefix,
String jobId,
String fromZone,
String toZone,
String fromFacility,
String toFacility,
PresenceConfidence presenceConfidence,
String facility,
String pageMarke... | [
"@",
"Deprecated",
"public",
"ArrayList",
"<",
"ItemHistory",
">",
"getAllItemHistory",
"(",
"EpcFormat",
"epcFormat",
",",
"String",
"epcPrefix",
",",
"String",
"jobId",
",",
"String",
"fromZone",
",",
"String",
"toZone",
",",
"String",
"fromFacility",
",",
"St... | and page marker is redundant | [
"and",
"page",
"marker",
"is",
"redundant"
] | f5a459dfb6687ff95e29f7cf5b6a8bfda112c96b | https://github.com/impinj/itemsense-java/blob/f5a459dfb6687ff95e29f7cf5b6a8bfda112c96b/src/main/java/com/impinj/itemsense/client/data/itemhistory/ItemHistoryController.java#L173-L212 | train |
jruby/jcodings | src/org/jcodings/AbstractEncoding.java | AbstractEncoding.propertyNameToCType | @Override
public int propertyNameToCType(byte[]bytes, int p, int end) {
Integer ctype = PosixBracket.PBSTableUpper.get(bytes, p, end);
if (ctype != null) return ctype;
throw new CharacterPropertyException(EncodingError.ERR_INVALID_CHAR_PROPERTY_NAME, bytes, p, end - p);
} | java | @Override
public int propertyNameToCType(byte[]bytes, int p, int end) {
Integer ctype = PosixBracket.PBSTableUpper.get(bytes, p, end);
if (ctype != null) return ctype;
throw new CharacterPropertyException(EncodingError.ERR_INVALID_CHAR_PROPERTY_NAME, bytes, p, end - p);
} | [
"@",
"Override",
"public",
"int",
"propertyNameToCType",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"p",
",",
"int",
"end",
")",
"{",
"Integer",
"ctype",
"=",
"PosixBracket",
".",
"PBSTableUpper",
".",
"get",
"(",
"bytes",
",",
"p",
",",
"end",
")",
... | onigenc_minimum_property_name_to_ctype
notably overridden by unicode encodings | [
"onigenc_minimum_property_name_to_ctype",
"notably",
"overridden",
"by",
"unicode",
"encodings"
] | 8e09c6caab59f9a0b9760e57d2708eea185c2de1 | https://github.com/jruby/jcodings/blob/8e09c6caab59f9a0b9760e57d2708eea185c2de1/src/org/jcodings/AbstractEncoding.java#L162-L167 | train |
jruby/jcodings | src/org/jcodings/transcode/TranscoderDB.java | TranscoderDB.asciiCompatibleEncoding | static byte[] asciiCompatibleEncoding(byte[] asciiCompatName) {
CaseInsensitiveBytesHash<TranscoderDB.Entry> dTable = TranscoderDB.transcoders.get(asciiCompatName);
if (dTable == null || dTable.size() != 1) return null;
byte[] asciiCN = null;
for (Entry e : dTable) {
if (!EC... | java | static byte[] asciiCompatibleEncoding(byte[] asciiCompatName) {
CaseInsensitiveBytesHash<TranscoderDB.Entry> dTable = TranscoderDB.transcoders.get(asciiCompatName);
if (dTable == null || dTable.size() != 1) return null;
byte[] asciiCN = null;
for (Entry e : dTable) {
if (!EC... | [
"static",
"byte",
"[",
"]",
"asciiCompatibleEncoding",
"(",
"byte",
"[",
"]",
"asciiCompatName",
")",
"{",
"CaseInsensitiveBytesHash",
"<",
"TranscoderDB",
".",
"Entry",
">",
"dTable",
"=",
"TranscoderDB",
".",
"transcoders",
".",
"get",
"(",
"asciiCompatName",
... | ?? to transcoderdb ? | [
"??",
"to",
"transcoderdb",
"?"
] | 8e09c6caab59f9a0b9760e57d2708eea185c2de1 | https://github.com/jruby/jcodings/blob/8e09c6caab59f9a0b9760e57d2708eea185c2de1/src/org/jcodings/transcode/TranscoderDB.java#L296-L311 | train |
jruby/jcodings | src/org/jcodings/util/Hash.java | Hash.checkResize | protected final void checkResize() {
if (size == table.length) { // size / table.length > DENSITY
int forSize = table.length + 1; // size + 1;
for (int i=0, newCapacity = MIN_CAPA; i < PRIMES.length; i++, newCapacity <<= 1) {
if (newCapacity > forSize) {
... | java | protected final void checkResize() {
if (size == table.length) { // size / table.length > DENSITY
int forSize = table.length + 1; // size + 1;
for (int i=0, newCapacity = MIN_CAPA; i < PRIMES.length; i++, newCapacity <<= 1) {
if (newCapacity > forSize) {
... | [
"protected",
"final",
"void",
"checkResize",
"(",
")",
"{",
"if",
"(",
"size",
"==",
"table",
".",
"length",
")",
"{",
"// size / table.length > DENSITY",
"int",
"forSize",
"=",
"table",
".",
"length",
"+",
"1",
";",
"// size + 1;",
"for",
"(",
"int",
"i",... | private static final int DENSITY = 5; | [
"private",
"static",
"final",
"int",
"DENSITY",
"=",
"5",
";"
] | 8e09c6caab59f9a0b9760e57d2708eea185c2de1 | https://github.com/jruby/jcodings/blob/8e09c6caab59f9a0b9760e57d2708eea185c2de1/src/org/jcodings/util/Hash.java#L97-L108 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/index/strtree/STRtreeJGT.java | STRtreeJGT.insert | public void insert( Envelope itemEnv, Object item ) {
if (itemEnv.isNull()) {
return;
}
super.insert(itemEnv, item);
} | java | public void insert( Envelope itemEnv, Object item ) {
if (itemEnv.isNull()) {
return;
}
super.insert(itemEnv, item);
} | [
"public",
"void",
"insert",
"(",
"Envelope",
"itemEnv",
",",
"Object",
"item",
")",
"{",
"if",
"(",
"itemEnv",
".",
"isNull",
"(",
")",
")",
"{",
"return",
";",
"}",
"super",
".",
"insert",
"(",
"itemEnv",
",",
"item",
")",
";",
"}"
] | Inserts an item having the given bounds into the tree. | [
"Inserts",
"an",
"item",
"having",
"the",
"given",
"bounds",
"into",
"the",
"tree",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/index/strtree/STRtreeJGT.java#L180-L185 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/adige/duffy/ADischargeDistributor.java | ADischargeDistributor.calculateSuperficialDischarge | public double calculateSuperficialDischarge( double superficialDischarge,
double saturatedAreaPercentage, long timeInMillis ) {
distributeIncomingSuperficialDischarge(superficialDischarge, saturatedAreaPercentage,
timeInMillis);
return superficialDischargeArray[indexFromTimeI... | java | public double calculateSuperficialDischarge( double superficialDischarge,
double saturatedAreaPercentage, long timeInMillis ) {
distributeIncomingSuperficialDischarge(superficialDischarge, saturatedAreaPercentage,
timeInMillis);
return superficialDischargeArray[indexFromTimeI... | [
"public",
"double",
"calculateSuperficialDischarge",
"(",
"double",
"superficialDischarge",
",",
"double",
"saturatedAreaPercentage",
",",
"long",
"timeInMillis",
")",
"{",
"distributeIncomingSuperficialDischarge",
"(",
"superficialDischarge",
",",
"saturatedAreaPercentage",
",... | Calculates the current superficial discharge.
<p>
The discharge takes into account the distribution
of all the distributed discharge contributions
in the prior timesteps.
</p>
@param superficialDischarge the non distributed discharge value.
@param saturatedAreaPercentage the percentage of saturated area.
@param timeI... | [
"Calculates",
"the",
"current",
"superficial",
"discharge",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/adige/duffy/ADischargeDistributor.java#L141-L146 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/adige/duffy/ADischargeDistributor.java | ADischargeDistributor.calculateSubsuperficialDischarge | public double calculateSubsuperficialDischarge( double subSuperficialDischarge,
double saturatedAreaPercentage, long timeInMillis ) {
distributeIncomingSubSuperficialDischarge(subSuperficialDischarge, saturatedAreaPercentage,
timeInMillis);
return subSuperficialDischargeArray... | java | public double calculateSubsuperficialDischarge( double subSuperficialDischarge,
double saturatedAreaPercentage, long timeInMillis ) {
distributeIncomingSubSuperficialDischarge(subSuperficialDischarge, saturatedAreaPercentage,
timeInMillis);
return subSuperficialDischargeArray... | [
"public",
"double",
"calculateSubsuperficialDischarge",
"(",
"double",
"subSuperficialDischarge",
",",
"double",
"saturatedAreaPercentage",
",",
"long",
"timeInMillis",
")",
"{",
"distributeIncomingSubSuperficialDischarge",
"(",
"subSuperficialDischarge",
",",
"saturatedAreaPerce... | Calculates the current subsuperficial discharge.
<p>
The discharge takes into account the distribution
of all the distributed discharge contributions
in the prior timesteps.
</p>
@param subSuperficialDischarge the non distributed discharge value.
@param saturatedAreaPercentage the percentage of saturated area.
@param... | [
"Calculates",
"the",
"current",
"subsuperficial",
"discharge",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/hydrogeomorphology/adige/duffy/ADischargeDistributor.java#L162-L167 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/postgis/PGDb.java | PGDb.getDatabases | public static List<String> getDatabases( String host, String port, String existingDb, String user, String pwd )
throws Exception {
if (existingDb == null) {
existingDb = "postgres";
}
String url = EDb.POSTGRES.getJdbcPrefix() + host + ":" + port + "/" + existingDb;
... | java | public static List<String> getDatabases( String host, String port, String existingDb, String user, String pwd )
throws Exception {
if (existingDb == null) {
existingDb = "postgres";
}
String url = EDb.POSTGRES.getJdbcPrefix() + host + ":" + port + "/" + existingDb;
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getDatabases",
"(",
"String",
"host",
",",
"String",
"port",
",",
"String",
"existingDb",
",",
"String",
"user",
",",
"String",
"pwd",
")",
"throws",
"Exception",
"{",
"if",
"(",
"existingDb",
"==",
"null",
... | Get the list of databases.
@param host the host.
@param port the port.
@param existingDb an existing db to lean on. If null, "postgres" will be used.
@param user optional user.
@param pwd optional pwd.
@return the list of available databases.
@throws Exception | [
"Get",
"the",
"list",
"of",
"databases",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/postgis/PGDb.java#L434-L453 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/images/ImageUtilities.java | ImageUtilities.scaleImage | public static BufferedImage scaleImage( BufferedImage image, int newSize ) throws Exception {
int imageWidth = image.getWidth();
int imageHeight = image.getHeight();
int width;
int height;
if (imageWidth > imageHeight) {
width = newSize;
height = imageHei... | java | public static BufferedImage scaleImage( BufferedImage image, int newSize ) throws Exception {
int imageWidth = image.getWidth();
int imageHeight = image.getHeight();
int width;
int height;
if (imageWidth > imageHeight) {
width = newSize;
height = imageHei... | [
"public",
"static",
"BufferedImage",
"scaleImage",
"(",
"BufferedImage",
"image",
",",
"int",
"newSize",
")",
"throws",
"Exception",
"{",
"int",
"imageWidth",
"=",
"image",
".",
"getWidth",
"(",
")",
";",
"int",
"imageHeight",
"=",
"image",
".",
"getHeight",
... | Scale an image to a given size maintaining the ratio.
@param image the image to scale.
@param newSize the size of the new image (it will be used for the longer side).
@return the scaled image.
@throws Exception | [
"Scale",
"an",
"image",
"to",
"a",
"given",
"size",
"maintaining",
"the",
"ratio",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/ImageUtilities.java#L65-L85 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/images/ImageUtilities.java | ImageUtilities.imageFromReader | public static BufferedImage imageFromReader( AbstractGridCoverage2DReader reader, int cols, int rows, double w, double e,
double s, double n, CoordinateReferenceSystem resampleCrs ) throws IOException {
CoordinateReferenceSystem sourceCrs = reader.getCoordinateReferenceSystem();
GeneralParam... | java | public static BufferedImage imageFromReader( AbstractGridCoverage2DReader reader, int cols, int rows, double w, double e,
double s, double n, CoordinateReferenceSystem resampleCrs ) throws IOException {
CoordinateReferenceSystem sourceCrs = reader.getCoordinateReferenceSystem();
GeneralParam... | [
"public",
"static",
"BufferedImage",
"imageFromReader",
"(",
"AbstractGridCoverage2DReader",
"reader",
",",
"int",
"cols",
",",
"int",
"rows",
",",
"double",
"w",
",",
"double",
"e",
",",
"double",
"s",
",",
"double",
"n",
",",
"CoordinateReferenceSystem",
"resa... | Read an image from a coverage reader.
@param reader the reader.
@param cols the expected cols.
@param rows the expected rows.
@param w west bound.
@param e east bound.
@param s south bound.
@param n north bound.
@return the image or <code>null</code> if unable to read it.
@throws IOException | [
"Read",
"an",
"image",
"from",
"a",
"coverage",
"reader",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/ImageUtilities.java#L126-L166 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/images/ImageUtilities.java | ImageUtilities.makeColorTransparent | public static BufferedImage makeColorTransparent( BufferedImage bufferedImageToProcess, final Color colorToMakeTransparent ) {
ImageFilter filter = new RGBImageFilter(){
public int markerRGB = colorToMakeTransparent.getRGB() | 0xFF000000;
public final int filterRGB( int x, int y, int rgb... | java | public static BufferedImage makeColorTransparent( BufferedImage bufferedImageToProcess, final Color colorToMakeTransparent ) {
ImageFilter filter = new RGBImageFilter(){
public int markerRGB = colorToMakeTransparent.getRGB() | 0xFF000000;
public final int filterRGB( int x, int y, int rgb... | [
"public",
"static",
"BufferedImage",
"makeColorTransparent",
"(",
"BufferedImage",
"bufferedImageToProcess",
",",
"final",
"Color",
"colorToMakeTransparent",
")",
"{",
"ImageFilter",
"filter",
"=",
"new",
"RGBImageFilter",
"(",
")",
"{",
"public",
"int",
"markerRGB",
... | Make a color of the image transparent.
@param bufferedImageToProcess the image to extract the color from.
@param colorToMakeTransparent the color to make transparent.
@return the new image. | [
"Make",
"a",
"color",
"of",
"the",
"image",
"transparent",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/ImageUtilities.java#L175-L194 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/images/ImageUtilities.java | ImageUtilities.isAllOneColor | public static boolean isAllOneColor( BufferedImage image ) {
int width = image.getWidth();
int height = image.getHeight();
int previousRgb = 0;
boolean isFirst = true;
for( int x = 0; x < width; x++ ) {
for( int y = 0; y < height; y++ ) {
int rgb = ima... | java | public static boolean isAllOneColor( BufferedImage image ) {
int width = image.getWidth();
int height = image.getHeight();
int previousRgb = 0;
boolean isFirst = true;
for( int x = 0; x < width; x++ ) {
for( int y = 0; y < height; y++ ) {
int rgb = ima... | [
"public",
"static",
"boolean",
"isAllOneColor",
"(",
"BufferedImage",
"image",
")",
"{",
"int",
"width",
"=",
"image",
".",
"getWidth",
"(",
")",
";",
"int",
"height",
"=",
"image",
".",
"getHeight",
"(",
")",
";",
"int",
"previousRgb",
"=",
"0",
";",
... | Checks if an image is all of one color.
@param image the image to check.
@return <code>true</code> if the image is all of the same color. | [
"Checks",
"if",
"an",
"image",
"is",
"all",
"of",
"one",
"color",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/images/ImageUtilities.java#L202-L221 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/template/TemplateTokenGroupInfo.java | TemplateTokenGroupInfo.setParentGroups | public void setParentGroups(final List<TemplateTokenInfo> tokenInfos) {
// inefficient, perhaps should look into being provided a map of tokenInfos
// - keep double itterator for now as
// probably irrelevant in the face of speed as a whole
for (final String tokenName : containsString) {... | java | public void setParentGroups(final List<TemplateTokenInfo> tokenInfos) {
// inefficient, perhaps should look into being provided a map of tokenInfos
// - keep double itterator for now as
// probably irrelevant in the face of speed as a whole
for (final String tokenName : containsString) {... | [
"public",
"void",
"setParentGroups",
"(",
"final",
"List",
"<",
"TemplateTokenInfo",
">",
"tokenInfos",
")",
"{",
"// inefficient, perhaps should look into being provided a map of tokenInfos",
"// - keep double itterator for now as",
"// probably irrelevant in the face of speed as a whol... | sets the parent group of all its contained tokens
@param tokenInfos | [
"sets",
"the",
"parent",
"group",
"of",
"all",
"its",
"contained",
"tokens"
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/template/TemplateTokenGroupInfo.java#L72-L84 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/OmsTrentoPProjectFilesGenerator.java | OmsTrentoPProjectFilesGenerator.getCalibrationFeatureType | private SimpleFeatureType getCalibrationFeatureType( CoordinateReferenceSystem crs ) {
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
ITrentoPType[] values = TrentoPFeatureType.PipesTrentoP.values();
String typeName = values[0].getName();
b.setName(typeName);
b.setC... | java | private SimpleFeatureType getCalibrationFeatureType( CoordinateReferenceSystem crs ) {
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
ITrentoPType[] values = TrentoPFeatureType.PipesTrentoP.values();
String typeName = values[0].getName();
b.setName(typeName);
b.setC... | [
"private",
"SimpleFeatureType",
"getCalibrationFeatureType",
"(",
"CoordinateReferenceSystem",
"crs",
")",
"{",
"SimpleFeatureTypeBuilder",
"b",
"=",
"new",
"SimpleFeatureTypeBuilder",
"(",
")",
";",
"ITrentoPType",
"[",
"]",
"values",
"=",
"TrentoPFeatureType",
".",
"P... | Build the Calibration Type.
@param crs
@return the type for the calibration shp. | [
"Build",
"the",
"Calibration",
"Type",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/networktools/trento_p/OmsTrentoPProjectFilesGenerator.java#L229-L257 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java | DbsUtilities.joinByComma | public static String joinByComma( List<String> items ) {
StringBuilder sb = new StringBuilder();
for( String item : items ) {
sb.append(",").append(item);
}
if (sb.length() == 0) {
return "";
}
return sb.substring(1);
} | java | public static String joinByComma( List<String> items ) {
StringBuilder sb = new StringBuilder();
for( String item : items ) {
sb.append(",").append(item);
}
if (sb.length() == 0) {
return "";
}
return sb.substring(1);
} | [
"public",
"static",
"String",
"joinByComma",
"(",
"List",
"<",
"String",
">",
"items",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"String",
"item",
":",
"items",
")",
"{",
"sb",
".",
"append",
"(",
"\",\"",... | Join a list of strings by comma.
@param items the list of strings.
@return the resulting string. | [
"Join",
"a",
"list",
"of",
"strings",
"by",
"comma",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java#L81-L90 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java | DbsUtilities.joinBySeparator | public static String joinBySeparator( List<String> items, String separator ) {
int size = items.size();
if (size == 0) {
return "";
}
StringBuilder sb = new StringBuilder(items.get(0));
for( int i = 1; i < size; i++ ) {
sb.append(separator).append(items.ge... | java | public static String joinBySeparator( List<String> items, String separator ) {
int size = items.size();
if (size == 0) {
return "";
}
StringBuilder sb = new StringBuilder(items.get(0));
for( int i = 1; i < size; i++ ) {
sb.append(separator).append(items.ge... | [
"public",
"static",
"String",
"joinBySeparator",
"(",
"List",
"<",
"String",
">",
"items",
",",
"String",
"separator",
")",
"{",
"int",
"size",
"=",
"items",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"return",
"\"\"",
";",
... | Join a list of strings by string.
@param items the list of strings.
@param separator the separator to use.
@return the resulting string. | [
"Join",
"a",
"list",
"of",
"strings",
"by",
"string",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java#L99-L109 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java | DbsUtilities.createPolygonFromEnvelope | public static Polygon createPolygonFromEnvelope( Envelope env ) {
double minX = env.getMinX();
double minY = env.getMinY();
double maxY = env.getMaxY();
double maxX = env.getMaxX();
Coordinate[] c = new Coordinate[]{new Coordinate(minX, minY), new Coordinate(minX, maxY), new Coor... | java | public static Polygon createPolygonFromEnvelope( Envelope env ) {
double minX = env.getMinX();
double minY = env.getMinY();
double maxY = env.getMaxY();
double maxX = env.getMaxX();
Coordinate[] c = new Coordinate[]{new Coordinate(minX, minY), new Coordinate(minX, maxY), new Coor... | [
"public",
"static",
"Polygon",
"createPolygonFromEnvelope",
"(",
"Envelope",
"env",
")",
"{",
"double",
"minX",
"=",
"env",
".",
"getMinX",
"(",
")",
";",
"double",
"minY",
"=",
"env",
".",
"getMinY",
"(",
")",
";",
"double",
"maxY",
"=",
"env",
".",
"... | Create a polygon using an envelope.
@param env the envelope to use.
@return the created geomerty. | [
"Create",
"a",
"polygon",
"using",
"an",
"envelope",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java#L117-L125 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java | DbsUtilities.createPolygonFromBounds | public static Polygon createPolygonFromBounds( double minX, double minY, double maxX, double maxY ) {
Coordinate[] c = new Coordinate[]{new Coordinate(minX, minY), new Coordinate(minX, maxY), new Coordinate(maxX, maxY),
new Coordinate(maxX, minY), new Coordinate(minX, minY)};
return gf()... | java | public static Polygon createPolygonFromBounds( double minX, double minY, double maxX, double maxY ) {
Coordinate[] c = new Coordinate[]{new Coordinate(minX, minY), new Coordinate(minX, maxY), new Coordinate(maxX, maxY),
new Coordinate(maxX, minY), new Coordinate(minX, minY)};
return gf()... | [
"public",
"static",
"Polygon",
"createPolygonFromBounds",
"(",
"double",
"minX",
",",
"double",
"minY",
",",
"double",
"maxX",
",",
"double",
"maxY",
")",
"{",
"Coordinate",
"[",
"]",
"c",
"=",
"new",
"Coordinate",
"[",
"]",
"{",
"new",
"Coordinate",
"(",
... | Create a polygon using boundaries.
@param minX the min x.
@param minY the min y.
@param maxX the max x.
@param maxY the max y.
@return the created geomerty. | [
"Create",
"a",
"polygon",
"using",
"boundaries",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java#L136-L140 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java | DbsUtilities.getSelectQuery | public static String getSelectQuery( ASpatialDb db, final TableLevel selectedTable, boolean geomFirst ) throws Exception {
String tableName = selectedTable.tableName;
String letter = tableName.substring(0, 1);
List<String[]> tableColumns = db.getTableColumns(tableName);
GeometryColumn ge... | java | public static String getSelectQuery( ASpatialDb db, final TableLevel selectedTable, boolean geomFirst ) throws Exception {
String tableName = selectedTable.tableName;
String letter = tableName.substring(0, 1);
List<String[]> tableColumns = db.getTableColumns(tableName);
GeometryColumn ge... | [
"public",
"static",
"String",
"getSelectQuery",
"(",
"ASpatialDb",
"db",
",",
"final",
"TableLevel",
"selectedTable",
",",
"boolean",
"geomFirst",
")",
"throws",
"Exception",
"{",
"String",
"tableName",
"=",
"selectedTable",
".",
"tableName",
";",
"String",
"lette... | Get a full select query from a table in the db.
@param db the db.
@param selectedTable the table to create the query for.
@param geomFirst if <code>true</code>, the geometry is places first.
@return the query.
@throws Exception | [
"Get",
"a",
"full",
"select",
"query",
"from",
"a",
"table",
"in",
"the",
"db",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java#L160-L198 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java | DbsUtilities.queryToMap | public static Map<String, String> queryToMap( ADb db, String sql, Map<String, String> optionalType ) throws Exception {
Map<String, String> map = optionalType;
if (map == null) {
map = new HashMap<>();
}
Map<String, String> _map = map;
return db.execOnConnection(conne... | java | public static Map<String, String> queryToMap( ADb db, String sql, Map<String, String> optionalType ) throws Exception {
Map<String, String> map = optionalType;
if (map == null) {
map = new HashMap<>();
}
Map<String, String> _map = map;
return db.execOnConnection(conne... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"queryToMap",
"(",
"ADb",
"db",
",",
"String",
"sql",
",",
"Map",
"<",
"String",
",",
"String",
">",
"optionalType",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"String",
">"... | Quick method to convert a query to a map.
@param db the db to use.
@param sql the query to run. It has to have at least 2 parameters. The first will be used as key, the second as value.
@param optionalType can be null. Optional parameter in case one needs a {@link TreeMap} or something the like.
@return the map of val... | [
"Quick",
"method",
"to",
"convert",
"a",
"query",
"to",
"a",
"map",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java#L229-L245 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java | DbsUtilities.queryToGeomMap | public static Map<String, Geometry> queryToGeomMap( ADb db, String sql, Map<String, Geometry> optionalType )
throws Exception {
Map<String, Geometry> map = optionalType;
if (map == null) {
map = new HashMap<>();
}
IGeometryParser gp = db.getType().getGeometryParse... | java | public static Map<String, Geometry> queryToGeomMap( ADb db, String sql, Map<String, Geometry> optionalType )
throws Exception {
Map<String, Geometry> map = optionalType;
if (map == null) {
map = new HashMap<>();
}
IGeometryParser gp = db.getType().getGeometryParse... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Geometry",
">",
"queryToGeomMap",
"(",
"ADb",
"db",
",",
"String",
"sql",
",",
"Map",
"<",
"String",
",",
"Geometry",
">",
"optionalType",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"Geomet... | Quick method to convert a query to a map with geometry values.
@param db the db to use.
@param sql the query to run. It has to have at least 2 parameters, of which the second has to be a geometry field. The first will be used as key, the second as value.
@param optionalType can be null. Optional parameter in case one ... | [
"Quick",
"method",
"to",
"convert",
"a",
"query",
"to",
"a",
"map",
"with",
"geometry",
"values",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/utils/DbsUtilities.java#L256-L274 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/Node.java | Node.getFloatValueFromMap | public float getFloatValueFromMap( RandomIter map ) {
try {
if (map == null) {
return HMConstants.floatNovalue;
}
float value = map.getSampleFloat(col, row, 0);
return value;
} catch (Exception e) {
// ignore and return novalue
... | java | public float getFloatValueFromMap( RandomIter map ) {
try {
if (map == null) {
return HMConstants.floatNovalue;
}
float value = map.getSampleFloat(col, row, 0);
return value;
} catch (Exception e) {
// ignore and return novalue
... | [
"public",
"float",
"getFloatValueFromMap",
"(",
"RandomIter",
"map",
")",
"{",
"try",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"return",
"HMConstants",
".",
"floatNovalue",
";",
"}",
"float",
"value",
"=",
"map",
".",
"getSampleFloat",
"(",
"col",
... | Get the float value of another map in the current node position.
@param map the map from which to get the value.
@return the float value or a novalue. | [
"Get",
"the",
"float",
"value",
"of",
"another",
"map",
"in",
"the",
"current",
"node",
"position",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/Node.java#L63-L74 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/Node.java | Node.getIntValueFromMap | public int getIntValueFromMap( RandomIter map ) {
try {
if (map == null) {
return HMConstants.intNovalue;
}
int value = map.getSample(col, row, 0);
return value;
} catch (Exception e) {
// ignore and return novalue
r... | java | public int getIntValueFromMap( RandomIter map ) {
try {
if (map == null) {
return HMConstants.intNovalue;
}
int value = map.getSample(col, row, 0);
return value;
} catch (Exception e) {
// ignore and return novalue
r... | [
"public",
"int",
"getIntValueFromMap",
"(",
"RandomIter",
"map",
")",
"{",
"try",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"return",
"HMConstants",
".",
"intNovalue",
";",
"}",
"int",
"value",
"=",
"map",
".",
"getSample",
"(",
"col",
",",
"row",... | Get the int value of another map in the current node position.
@param map the map from which to get the value.
@return the int value or a novalue. | [
"Get",
"the",
"int",
"value",
"of",
"another",
"map",
"in",
"the",
"current",
"node",
"position",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/Node.java#L82-L93 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/Node.java | Node.getDoubleValueFromMap | public double getDoubleValueFromMap( RandomIter map ) {
try {
if (map == null) {
return HMConstants.doubleNovalue;
}
double value = map.getSampleDouble(col, row, 0);
return value;
} catch (Exception e) {
// ignore and return nov... | java | public double getDoubleValueFromMap( RandomIter map ) {
try {
if (map == null) {
return HMConstants.doubleNovalue;
}
double value = map.getSampleDouble(col, row, 0);
return value;
} catch (Exception e) {
// ignore and return nov... | [
"public",
"double",
"getDoubleValueFromMap",
"(",
"RandomIter",
"map",
")",
"{",
"try",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"return",
"HMConstants",
".",
"doubleNovalue",
";",
"}",
"double",
"value",
"=",
"map",
".",
"getSampleDouble",
"(",
"col... | Get the double value of another map in the current node position.
@param map the map from which to get the value.
@return the double value or a novalue. | [
"Get",
"the",
"double",
"value",
"of",
"another",
"map",
"in",
"the",
"current",
"node",
"position",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/Node.java#L101-L112 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/Node.java | Node.setFloatValueInMap | public void setFloatValueInMap( WritableRandomIter map, float value ) {
if (map == null) {
return;
}
try {
map.setSample(col, row, 0, value);
} catch (Exception e) {
e.printStackTrace();
}
} | java | public void setFloatValueInMap( WritableRandomIter map, float value ) {
if (map == null) {
return;
}
try {
map.setSample(col, row, 0, value);
} catch (Exception e) {
e.printStackTrace();
}
} | [
"public",
"void",
"setFloatValueInMap",
"(",
"WritableRandomIter",
"map",
",",
"float",
"value",
")",
"{",
"if",
"(",
"map",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"map",
".",
"setSample",
"(",
"col",
",",
"row",
",",
"0",
",",
"valu... | Utility method to set the value of a certain map in the current node position.
@param map the map to set the value in. if <code>null</code>, it is ignored.
@param value the value to set. | [
"Utility",
"method",
"to",
"set",
"the",
"value",
"of",
"a",
"certain",
"map",
"in",
"the",
"current",
"node",
"position",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/Node.java#L124-L133 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java | RegionMap.getNorth | public double getNorth() {
Double n = get(NORTH);
if (n != null) {
return n;
}
return HMConstants.doubleNovalue;
} | java | public double getNorth() {
Double n = get(NORTH);
if (n != null) {
return n;
}
return HMConstants.doubleNovalue;
} | [
"public",
"double",
"getNorth",
"(",
")",
"{",
"Double",
"n",
"=",
"get",
"(",
"NORTH",
")",
";",
"if",
"(",
"n",
"!=",
"null",
")",
"{",
"return",
"n",
";",
"}",
"return",
"HMConstants",
".",
"doubleNovalue",
";",
"}"
] | Getter for the region's north bound.
@return the region north bound or {@link HMConstants#doubleNovalue} | [
"Getter",
"for",
"the",
"region",
"s",
"north",
"bound",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java#L77-L83 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java | RegionMap.getSouth | public double getSouth() {
Double s = get(SOUTH);
if (s != null) {
return s;
}
return HMConstants.doubleNovalue;
} | java | public double getSouth() {
Double s = get(SOUTH);
if (s != null) {
return s;
}
return HMConstants.doubleNovalue;
} | [
"public",
"double",
"getSouth",
"(",
")",
"{",
"Double",
"s",
"=",
"get",
"(",
"SOUTH",
")",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"return",
"s",
";",
"}",
"return",
"HMConstants",
".",
"doubleNovalue",
";",
"}"
] | Getter for the region's south bound.
@return the region south bound or {@link HMConstants#doubleNovalue} | [
"Getter",
"for",
"the",
"region",
"s",
"south",
"bound",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java#L90-L96 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java | RegionMap.getEast | public double getEast() {
Double e = get(EAST);
if (e != null) {
return e;
}
return HMConstants.doubleNovalue;
} | java | public double getEast() {
Double e = get(EAST);
if (e != null) {
return e;
}
return HMConstants.doubleNovalue;
} | [
"public",
"double",
"getEast",
"(",
")",
"{",
"Double",
"e",
"=",
"get",
"(",
"EAST",
")",
";",
"if",
"(",
"e",
"!=",
"null",
")",
"{",
"return",
"e",
";",
"}",
"return",
"HMConstants",
".",
"doubleNovalue",
";",
"}"
] | Getter for the region's east bound.
@return the region east bound or {@link HMConstants#doubleNovalue} | [
"Getter",
"for",
"the",
"region",
"s",
"east",
"bound",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java#L103-L109 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java | RegionMap.getWest | public double getWest() {
Double w = get(WEST);
if (w != null) {
return w;
}
return HMConstants.doubleNovalue;
} | java | public double getWest() {
Double w = get(WEST);
if (w != null) {
return w;
}
return HMConstants.doubleNovalue;
} | [
"public",
"double",
"getWest",
"(",
")",
"{",
"Double",
"w",
"=",
"get",
"(",
"WEST",
")",
";",
"if",
"(",
"w",
"!=",
"null",
")",
"{",
"return",
"w",
";",
"}",
"return",
"HMConstants",
".",
"doubleNovalue",
";",
"}"
] | Getter for the region's west bound.
@return the region west bound or {@link HMConstants#doubleNovalue} | [
"Getter",
"for",
"the",
"region",
"s",
"west",
"bound",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java#L116-L122 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java | RegionMap.getXres | public double getXres() {
Double xres = get(XRES);
if (xres != null) {
return xres;
}
return HMConstants.doubleNovalue;
} | java | public double getXres() {
Double xres = get(XRES);
if (xres != null) {
return xres;
}
return HMConstants.doubleNovalue;
} | [
"public",
"double",
"getXres",
"(",
")",
"{",
"Double",
"xres",
"=",
"get",
"(",
"XRES",
")",
";",
"if",
"(",
"xres",
"!=",
"null",
")",
"{",
"return",
"xres",
";",
"}",
"return",
"HMConstants",
".",
"doubleNovalue",
";",
"}"
] | Getter for the region's X resolution.
@return the region's X resolution or {@link HMConstants#doubleNovalue} | [
"Getter",
"for",
"the",
"region",
"s",
"X",
"resolution",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java#L129-L135 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java | RegionMap.getYres | public double getYres() {
Double yres = get(YRES);
if (yres != null) {
return yres;
}
return HMConstants.doubleNovalue;
} | java | public double getYres() {
Double yres = get(YRES);
if (yres != null) {
return yres;
}
return HMConstants.doubleNovalue;
} | [
"public",
"double",
"getYres",
"(",
")",
"{",
"Double",
"yres",
"=",
"get",
"(",
"YRES",
")",
";",
"if",
"(",
"yres",
"!=",
"null",
")",
"{",
"return",
"yres",
";",
"}",
"return",
"HMConstants",
".",
"doubleNovalue",
";",
"}"
] | Getter for the region's Y resolution.
@return the region's Y resolution or {@link HMConstants#doubleNovalue} | [
"Getter",
"for",
"the",
"region",
"s",
"Y",
"resolution",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java#L142-L148 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java | RegionMap.toEnvelope | public Envelope toEnvelope() {
Envelope env = new Envelope(getWest(), getEast(), getSouth(), getNorth());
return env;
} | java | public Envelope toEnvelope() {
Envelope env = new Envelope(getWest(), getEast(), getSouth(), getNorth());
return env;
} | [
"public",
"Envelope",
"toEnvelope",
"(",
")",
"{",
"Envelope",
"env",
"=",
"new",
"Envelope",
"(",
"getWest",
"(",
")",
",",
"getEast",
"(",
")",
",",
"getSouth",
"(",
")",
",",
"getNorth",
"(",
")",
")",
";",
"return",
"env",
";",
"}"
] | Create the envelope of the region borders.
@return the envelope of the region borders. | [
"Create",
"the",
"envelope",
"of",
"the",
"region",
"borders",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/RegionMap.java#L198-L201 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/GeopaparazziUtilities.java | GeopaparazziUtilities.getProjectMetadata | public static LinkedHashMap<String, String> getProjectMetadata( IHMConnection connection ) throws Exception {
LinkedHashMap<String, String> metadataMap = new LinkedHashMap<>();
try (IHMStatement statement = connection.createStatement()) {
statement.setQueryTimeout(30); // set timeout to 30 s... | java | public static LinkedHashMap<String, String> getProjectMetadata( IHMConnection connection ) throws Exception {
LinkedHashMap<String, String> metadataMap = new LinkedHashMap<>();
try (IHMStatement statement = connection.createStatement()) {
statement.setQueryTimeout(30); // set timeout to 30 s... | [
"public",
"static",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"getProjectMetadata",
"(",
"IHMConnection",
"connection",
")",
"throws",
"Exception",
"{",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"metadataMap",
"=",
"new",
"LinkedHashMap",
"<>",... | Get the map of metadata of the project.
@param connection the db connection.
@return the map of metadata.
@throws SQLException | [
"Get",
"the",
"map",
"of",
"metadata",
"of",
"the",
"project",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/GeopaparazziUtilities.java#L129-L155 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/rasterlite/Rasterlite2Coverage.java | Rasterlite2Coverage.getRL2Image | public byte[] getRL2Image( Geometry geom, String geomEpsg, int width, int height ) throws Exception {
String sql;
String rasterName = getName();
if (geomEpsg != null) {
sql = "select GetMapImageFromRaster('" + rasterName + "', ST_Transform(ST_GeomFromText('" + geom.toText() + "', "
... | java | public byte[] getRL2Image( Geometry geom, String geomEpsg, int width, int height ) throws Exception {
String sql;
String rasterName = getName();
if (geomEpsg != null) {
sql = "select GetMapImageFromRaster('" + rasterName + "', ST_Transform(ST_GeomFromText('" + geom.toText() + "', "
... | [
"public",
"byte",
"[",
"]",
"getRL2Image",
"(",
"Geometry",
"geom",
",",
"String",
"geomEpsg",
",",
"int",
"width",
",",
"int",
"height",
")",
"throws",
"Exception",
"{",
"String",
"sql",
";",
"String",
"rasterName",
"=",
"getName",
"(",
")",
";",
"if",
... | Extract an image from the database.
@param geom the image bounding box geometry.
@param width the pixel width of the expected image.
@param height the pixel height of the expected image.
@return the image bytes.
@throws Exception | [
"Extract",
"an",
"image",
"from",
"the",
"database",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/rasterlite/Rasterlite2Coverage.java#L108-L130 | train |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/cb/OmsCb.java | OmsCb.process | @Execute
public void process() throws Exception {
if (!concatOr(outCb == null, doReset)) {
return;
}
checkNull(inRaster1);
RenderedImage map1RI = inRaster1.getRenderedImage();
RenderedImage map2RI = null;
if (inRaster2 == null) {
map2RI = map1R... | java | @Execute
public void process() throws Exception {
if (!concatOr(outCb == null, doReset)) {
return;
}
checkNull(inRaster1);
RenderedImage map1RI = inRaster1.getRenderedImage();
RenderedImage map2RI = null;
if (inRaster2 == null) {
map2RI = map1R... | [
"@",
"Execute",
"public",
"void",
"process",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"concatOr",
"(",
"outCb",
"==",
"null",
",",
"doReset",
")",
")",
"{",
"return",
";",
"}",
"checkNull",
"(",
"inRaster1",
")",
";",
"RenderedImage",
"map... | private float base; | [
"private",
"float",
"base",
";"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/statistics/cb/OmsCb.java#L91-L106 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java | FileUtilities.readFileToBytes | public static byte[] readFileToBytes( String filePath ) throws IOException {
Path path = Paths.get(filePath);
byte[] bytes = Files.readAllBytes(path);
return bytes;
} | java | public static byte[] readFileToBytes( String filePath ) throws IOException {
Path path = Paths.get(filePath);
byte[] bytes = Files.readAllBytes(path);
return bytes;
} | [
"public",
"static",
"byte",
"[",
"]",
"readFileToBytes",
"(",
"String",
"filePath",
")",
"throws",
"IOException",
"{",
"Path",
"path",
"=",
"Paths",
".",
"get",
"(",
"filePath",
")",
";",
"byte",
"[",
"]",
"bytes",
"=",
"Files",
".",
"readAllBytes",
"(",... | Read a file into a byte array.
@param filePath the path to the file.
@return the array of bytes.
@throws IOException | [
"Read",
"a",
"file",
"into",
"a",
"byte",
"array",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java#L104-L108 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java | FileUtilities.readFile | public static String readFile( File file ) throws IOException {
if (!file.exists()) {
throw new FileNotFoundException("The required projection file is not available: " + file.getAbsolutePath());
}
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
String... | java | public static String readFile( File file ) throws IOException {
if (!file.exists()) {
throw new FileNotFoundException("The required projection file is not available: " + file.getAbsolutePath());
}
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
String... | [
"public",
"static",
"String",
"readFile",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"FileNotFoundException",
"(",
"\"The required projection file is not available: \"",
"+",
... | Read text from a file in one line.
@param file the file to read.
@return the read string.
@throws IOException | [
"Read",
"text",
"from",
"a",
"file",
"in",
"one",
"line",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java#L162-L175 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java | FileUtilities.readFileToLinesList | public static List<String> readFileToLinesList( File file ) throws IOException {
List<String> lines = new ArrayList<>();
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
String line;
while( (line = br.readLine()) != null ) {
lines.add(line);
... | java | public static List<String> readFileToLinesList( File file ) throws IOException {
List<String> lines = new ArrayList<>();
try (BufferedReader br = new BufferedReader(new FileReader(file))) {
String line;
while( (line = br.readLine()) != null ) {
lines.add(line);
... | [
"public",
"static",
"List",
"<",
"String",
">",
"readFileToLinesList",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"lines",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"try",
"(",
"BufferedReader",
"br",
"=",
"ne... | Read text from a file to a list of lines.
@param file the file to read.
@return the list of lines.
@throws IOException | [
"Read",
"text",
"from",
"a",
"file",
"to",
"a",
"list",
"of",
"lines",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java#L199-L208 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java | FileUtilities.writeFile | public static void writeFile( String text, File file ) throws IOException {
try (BufferedWriter bw = new BufferedWriter(new FileWriter(file))) {
bw.write(text);
}
} | java | public static void writeFile( String text, File file ) throws IOException {
try (BufferedWriter bw = new BufferedWriter(new FileWriter(file))) {
bw.write(text);
}
} | [
"public",
"static",
"void",
"writeFile",
"(",
"String",
"text",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"try",
"(",
"BufferedWriter",
"bw",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWriter",
"(",
"file",
")",
")",
")",
"{",
"bw",
"."... | Write text to a file in one line.
@param text the text to write.
@param file the file to write to.
@throws IOException | [
"Write",
"text",
"to",
"a",
"file",
"in",
"one",
"line",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java#L218-L223 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java | FileUtilities.substituteExtention | public static File substituteExtention( File file, String newExtention ) {
String path = file.getAbsolutePath();
int lastDot = path.lastIndexOf("."); //$NON-NLS-1$
if (lastDot == -1) {
path = path + "." + newExtention; //$NON-NLS-1$
} else {
path = path.substring(... | java | public static File substituteExtention( File file, String newExtention ) {
String path = file.getAbsolutePath();
int lastDot = path.lastIndexOf("."); //$NON-NLS-1$
if (lastDot == -1) {
path = path + "." + newExtention; //$NON-NLS-1$
} else {
path = path.substring(... | [
"public",
"static",
"File",
"substituteExtention",
"(",
"File",
"file",
",",
"String",
"newExtention",
")",
"{",
"String",
"path",
"=",
"file",
".",
"getAbsolutePath",
"(",
")",
";",
"int",
"lastDot",
"=",
"path",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";"... | Substitute the extention of a file.
@param file the file.
@param newExtention the new extention (without the dot).
@return the file with the new extention. | [
"Substitute",
"the",
"extention",
"of",
"a",
"file",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java#L299-L308 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java | FileUtilities.getSafeFileName | public static String getSafeFileName( String fileName ) {
// not allowed chars in win and linux
char[] notAllowed = new char[]{'/', '>', '<', ':', '"', '/', '\\', '|', '?', '*'};
char escape = '_';
int len = fileName.length();
StringBuilder sb = new StringBuilder(len);
fo... | java | public static String getSafeFileName( String fileName ) {
// not allowed chars in win and linux
char[] notAllowed = new char[]{'/', '>', '<', ':', '"', '/', '\\', '|', '?', '*'};
char escape = '_';
int len = fileName.length();
StringBuilder sb = new StringBuilder(len);
fo... | [
"public",
"static",
"String",
"getSafeFileName",
"(",
"String",
"fileName",
")",
"{",
"// not allowed chars in win and linux",
"char",
"[",
"]",
"notAllowed",
"=",
"new",
"char",
"[",
"]",
"{",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
... | Makes a file name safe to be used.
@param fileName the file name to "encode".
@return the safe filename. | [
"Makes",
"a",
"file",
"name",
"safe",
"to",
"be",
"used",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java#L316-L359 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java | FileUtilities.getFilesListByExtention | public static File[] getFilesListByExtention( String folderPath, final String ext ) {
File[] files = new File(folderPath).listFiles(new FilenameFilter(){
public boolean accept( File dir, String name ) {
return name.endsWith(ext);
}
});
return files;
} | java | public static File[] getFilesListByExtention( String folderPath, final String ext ) {
File[] files = new File(folderPath).listFiles(new FilenameFilter(){
public boolean accept( File dir, String name ) {
return name.endsWith(ext);
}
});
return files;
} | [
"public",
"static",
"File",
"[",
"]",
"getFilesListByExtention",
"(",
"String",
"folderPath",
",",
"final",
"String",
"ext",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"new",
"File",
"(",
"folderPath",
")",
".",
"listFiles",
"(",
"new",
"FilenameFilter",
"(... | Get the list of files in a folder by its extension.
@param folderPath the folder path.
@param ext the extension without the dot.
@return the list of files patching. | [
"Get",
"the",
"list",
"of",
"files",
"in",
"a",
"folder",
"by",
"its",
"extension",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java#L447-L454 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java | LasUtils.getLasFileVersion | public static String getLasFileVersion( File lasFile ) throws IOException {
FileInputStream fis = null;
FileChannel fc = null;
try {
fis = new FileInputStream(lasFile);
fc = fis.getChannel();
// Version Major
fis.skip(24);
int versionMa... | java | public static String getLasFileVersion( File lasFile ) throws IOException {
FileInputStream fis = null;
FileChannel fc = null;
try {
fis = new FileInputStream(lasFile);
fc = fis.getChannel();
// Version Major
fis.skip(24);
int versionMa... | [
"public",
"static",
"String",
"getLasFileVersion",
"(",
"File",
"lasFile",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fis",
"=",
"null",
";",
"FileChannel",
"fc",
"=",
"null",
";",
"try",
"{",
"fis",
"=",
"new",
"FileInputStream",
"(",
"lasFile",
... | Read just the version bytes from a las file.
<p>This can be handy is one needs to choose version reader.
@param lasFile the las file to check.
@return the version string as "major.minor" .
@throws IOException | [
"Read",
"just",
"the",
"version",
"bytes",
"from",
"a",
"las",
"file",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java#L98-L115 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java | LasUtils.getLasFeatureBuilder | public static SimpleFeatureBuilder getLasFeatureBuilder( CoordinateReferenceSystem crs ) {
if (lasSimpleFeatureBuilder == null) {
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
b.setName("lasdata");
b.setCRS(crs);
b.add(THE_GEOM, Point.class);
... | java | public static SimpleFeatureBuilder getLasFeatureBuilder( CoordinateReferenceSystem crs ) {
if (lasSimpleFeatureBuilder == null) {
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
b.setName("lasdata");
b.setCRS(crs);
b.add(THE_GEOM, Point.class);
... | [
"public",
"static",
"SimpleFeatureBuilder",
"getLasFeatureBuilder",
"(",
"CoordinateReferenceSystem",
"crs",
")",
"{",
"if",
"(",
"lasSimpleFeatureBuilder",
"==",
"null",
")",
"{",
"SimpleFeatureTypeBuilder",
"b",
"=",
"new",
"SimpleFeatureTypeBuilder",
"(",
")",
";",
... | Creates a builder for las data.
The attributes are:
<ul>
<li>the_geom: a point geometry</li>
<li>elev</li>
<li>intensity</li>
<li>classification</li>
<li>impulse</li>
<li>numimpulse</li>
</ul>
@param crs the {@link CoordinateReferenceSystem}.
@return the {@link SimpleFeatureBuilder builder}. | [
"Creates",
"a",
"builder",
"for",
"las",
"data",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java#L135-L151 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java | LasUtils.tofeature | public static SimpleFeature tofeature( LasRecord r, Integer featureId, CoordinateReferenceSystem crs ) {
final Point point = toGeometry(r);
double elev = r.z;
if (!Double.isNaN(r.groundElevation)) {
elev = r.groundElevation;
}
if (featureId == null) {
feat... | java | public static SimpleFeature tofeature( LasRecord r, Integer featureId, CoordinateReferenceSystem crs ) {
final Point point = toGeometry(r);
double elev = r.z;
if (!Double.isNaN(r.groundElevation)) {
elev = r.groundElevation;
}
if (featureId == null) {
feat... | [
"public",
"static",
"SimpleFeature",
"tofeature",
"(",
"LasRecord",
"r",
",",
"Integer",
"featureId",
",",
"CoordinateReferenceSystem",
"crs",
")",
"{",
"final",
"Point",
"point",
"=",
"toGeometry",
"(",
"r",
")",
";",
"double",
"elev",
"=",
"r",
".",
"z",
... | Convert a record to a feature.
@param r the record to convert.
@param featureId an optional feature id, if not available, the id is set to -1.
@param crs the crs to apply.
@return the feature. | [
"Convert",
"a",
"record",
"to",
"a",
"feature",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java#L161-L176 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java | LasUtils.dumpLasFolderOverview | public static void dumpLasFolderOverview( String folder, CoordinateReferenceSystem crs ) throws Exception {
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
b.setName("overview");
b.setCRS(crs);
b.add("the_geom", Polygon.class);
b.add("name", String.class);
Si... | java | public static void dumpLasFolderOverview( String folder, CoordinateReferenceSystem crs ) throws Exception {
SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
b.setName("overview");
b.setCRS(crs);
b.add("the_geom", Polygon.class);
b.add("name", String.class);
Si... | [
"public",
"static",
"void",
"dumpLasFolderOverview",
"(",
"String",
"folder",
",",
"CoordinateReferenceSystem",
"crs",
")",
"throws",
"Exception",
"{",
"SimpleFeatureTypeBuilder",
"b",
"=",
"new",
"SimpleFeatureTypeBuilder",
"(",
")",
";",
"b",
".",
"setName",
"(",
... | Dump an overview shapefile for a las folder.
@param folder the folder.
@param crs the crs to use.
@throws Exception | [
"Dump",
"an",
"overview",
"shapefile",
"for",
"a",
"las",
"folder",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java#L251-L288 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java | LasUtils.distance | public static double distance( LasRecord r1, LasRecord r2 ) {
double distance = NumericsUtilities.pythagoras(r1.x - r2.x, r1.y - r2.y);
return distance;
} | java | public static double distance( LasRecord r1, LasRecord r2 ) {
double distance = NumericsUtilities.pythagoras(r1.x - r2.x, r1.y - r2.y);
return distance;
} | [
"public",
"static",
"double",
"distance",
"(",
"LasRecord",
"r1",
",",
"LasRecord",
"r2",
")",
"{",
"double",
"distance",
"=",
"NumericsUtilities",
".",
"pythagoras",
"(",
"r1",
".",
"x",
"-",
"r2",
".",
"x",
",",
"r1",
".",
"y",
"-",
"r2",
".",
"y",... | Projected distance between two points.
@param r1 the first point.
@param r2 the second point.
@return the 2D distance. | [
"Projected",
"distance",
"between",
"two",
"points",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java#L297-L300 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java | LasUtils.distance3D | public static double distance3D( LasRecord r1, LasRecord r2 ) {
double deltaElev = Math.abs(r1.z - r2.z);
double projectedDistance = NumericsUtilities.pythagoras(r1.x - r2.x, r1.y - r2.y);
double distance = NumericsUtilities.pythagoras(projectedDistance, deltaElev);
return distance;
... | java | public static double distance3D( LasRecord r1, LasRecord r2 ) {
double deltaElev = Math.abs(r1.z - r2.z);
double projectedDistance = NumericsUtilities.pythagoras(r1.x - r2.x, r1.y - r2.y);
double distance = NumericsUtilities.pythagoras(projectedDistance, deltaElev);
return distance;
... | [
"public",
"static",
"double",
"distance3D",
"(",
"LasRecord",
"r1",
",",
"LasRecord",
"r2",
")",
"{",
"double",
"deltaElev",
"=",
"Math",
".",
"abs",
"(",
"r1",
".",
"z",
"-",
"r2",
".",
"z",
")",
";",
"double",
"projectedDistance",
"=",
"NumericsUtiliti... | Distance between two points.
@param r1 the first point.
@param r2 the second point.
@return the 3D distance. | [
"Distance",
"between",
"two",
"points",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java#L309-L314 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java | LasUtils.triangulate | public static List<Geometry> triangulate( List<LasRecord> lasPoints, Double elevThres, boolean useGround,
IHMProgressMonitor pm ) {
pm.beginTask("Triangulation...", -1);
List<Coordinate> lasCoordinates = new ArrayList<Coordinate>();
for( LasRecord lasRecord : lasPoints ) {
... | java | public static List<Geometry> triangulate( List<LasRecord> lasPoints, Double elevThres, boolean useGround,
IHMProgressMonitor pm ) {
pm.beginTask("Triangulation...", -1);
List<Coordinate> lasCoordinates = new ArrayList<Coordinate>();
for( LasRecord lasRecord : lasPoints ) {
... | [
"public",
"static",
"List",
"<",
"Geometry",
">",
"triangulate",
"(",
"List",
"<",
"LasRecord",
">",
"lasPoints",
",",
"Double",
"elevThres",
",",
"boolean",
"useGround",
",",
"IHMProgressMonitor",
"pm",
")",
"{",
"pm",
".",
"beginTask",
"(",
"\"Triangulation.... | Triangulates a set of las points.
<p>If a threshold is supplied, a true dsm filtering is also applied.
@param lasPoints the list of points.
@param elevThres the optional threshold for true dsm calculation.
@param useGround use the ground elevation instead of z.
@param pm the monitor.
@return the list of triangles. | [
"Triangulates",
"a",
"set",
"of",
"las",
"points",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java#L480-L548 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java | LasUtils.smoothIDW | @SuppressWarnings("unchecked")
public static void smoothIDW( List<LasRecord> lasPoints, boolean useGround, double idwBuffer, IHMProgressMonitor pm ) {
List<Coordinate> coordinatesList = new ArrayList<Coordinate>();
if (useGround) {
for( LasRecord dot : lasPoints ) {
Coord... | java | @SuppressWarnings("unchecked")
public static void smoothIDW( List<LasRecord> lasPoints, boolean useGround, double idwBuffer, IHMProgressMonitor pm ) {
List<Coordinate> coordinatesList = new ArrayList<Coordinate>();
if (useGround) {
for( LasRecord dot : lasPoints ) {
Coord... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"smoothIDW",
"(",
"List",
"<",
"LasRecord",
">",
"lasPoints",
",",
"boolean",
"useGround",
",",
"double",
"idwBuffer",
",",
"IHMProgressMonitor",
"pm",
")",
"{",
"List",
"<",
"Coor... | Smooths a set of las points through the IDW method.
<p>Note that the values in the original data are changed.
@param lasPoints the list of points to smooth.
@param useGround if <code>true</code>, the ground elev is smoothed instead of the z.
@param idwBuffer the buffer around the points to consider for smoothing.
@pa... | [
"Smooths",
"a",
"set",
"of",
"las",
"points",
"through",
"the",
"IDW",
"method",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java#L560-L605 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java | LasUtils.getLastVisiblePointData | public static double[] getLastVisiblePointData( LasRecord baseRecord, List<LasRecord> lasRecords, boolean useGround ) {
if (lasRecords.size() < 1) {
throw new IllegalArgumentException("This needs to have at least 1 point.");
}
double baseElev = useGround ? baseRecord.groundElevation ... | java | public static double[] getLastVisiblePointData( LasRecord baseRecord, List<LasRecord> lasRecords, boolean useGround ) {
if (lasRecords.size() < 1) {
throw new IllegalArgumentException("This needs to have at least 1 point.");
}
double baseElev = useGround ? baseRecord.groundElevation ... | [
"public",
"static",
"double",
"[",
"]",
"getLastVisiblePointData",
"(",
"LasRecord",
"baseRecord",
",",
"List",
"<",
"LasRecord",
">",
"lasRecords",
",",
"boolean",
"useGround",
")",
"{",
"if",
"(",
"lasRecords",
".",
"size",
"(",
")",
"<",
"1",
")",
"{",
... | Return last visible point data for a las records points list from a given position.
<p>For the profile the min and max angles of "sight" are
calculated. The min azimuth angle represents the "upper"
line of sight, as thought from the zenith.
<p>The max azimuth angle represents the "below the earth" line
of sight (think... | [
"Return",
"last",
"visible",
"point",
"data",
"for",
"a",
"las",
"records",
"points",
"list",
"from",
"a",
"given",
"position",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/las/utils/LasUtils.java#L634-L683 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessageManager.java | ValidationMessageManager.getString | public static String getString(String key, Object... params) {
String message = getStringSafely(key);
if (params != null && params.length > 0) {
return MessageFormat.format(message, params);
} else {
return message;
}
} | java | public static String getString(String key, Object... params) {
String message = getStringSafely(key);
if (params != null && params.length > 0) {
return MessageFormat.format(message, params);
} else {
return message;
}
} | [
"public",
"static",
"String",
"getString",
"(",
"String",
"key",
",",
"Object",
"...",
"params",
")",
"{",
"String",
"message",
"=",
"getStringSafely",
"(",
"key",
")",
";",
"if",
"(",
"params",
"!=",
"null",
"&&",
"params",
".",
"length",
">",
"0",
")... | Applies the message parameters and returns the message
from one of the message bundles.
@param key property key
@param params message parameters to be used in message's place holders
@return Resource value or place-holder error String | [
"Applies",
"the",
"message",
"parameters",
"and",
"returns",
"the",
"message",
"from",
"one",
"of",
"the",
"message",
"bundles",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessageManager.java#L57-L64 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessageManager.java | ValidationMessageManager.getStringSafely | private static String getStringSafely(String key) {
String resource = null;
for (ResourceBundle bundle: bundles) {
try {
resource = bundle.getString(key);
} catch (MissingResourceException mrex) {
continue;
}
return resource;
}
return NO_MESSAGE + key;
} | java | private static String getStringSafely(String key) {
String resource = null;
for (ResourceBundle bundle: bundles) {
try {
resource = bundle.getString(key);
} catch (MissingResourceException mrex) {
continue;
}
return resource;
}
return NO_MESSAGE + key;
} | [
"private",
"static",
"String",
"getStringSafely",
"(",
"String",
"key",
")",
"{",
"String",
"resource",
"=",
"null",
";",
"for",
"(",
"ResourceBundle",
"bundle",
":",
"bundles",
")",
"{",
"try",
"{",
"resource",
"=",
"bundle",
".",
"getString",
"(",
"key",... | Returns the message from one of the message bundles. | [
"Returns",
"the",
"message",
"from",
"one",
"of",
"the",
"message",
"bundles",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/ValidationMessageManager.java#L67-L78 | train |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/validation/plan/ValidationPlan.java | ValidationPlan.execute | @SuppressWarnings("unchecked")
public ValidationPlanResult execute(ValidationCheck check, Object target) throws ValidationEngineException {
if (check == null)
{
return validationPlanResult;
}
try
{
check.setEmblEntryValidationPlanProperty(planProperty);
if(planProperty.enproConnection.get()!=n... | java | @SuppressWarnings("unchecked")
public ValidationPlanResult execute(ValidationCheck check, Object target) throws ValidationEngineException {
if (check == null)
{
return validationPlanResult;
}
try
{
check.setEmblEntryValidationPlanProperty(planProperty);
if(planProperty.enproConnection.get()!=n... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"ValidationPlanResult",
"execute",
"(",
"ValidationCheck",
"check",
",",
"Object",
"target",
")",
"throws",
"ValidationEngineException",
"{",
"if",
"(",
"check",
"==",
"null",
")",
"{",
"return",
"valid... | Executes a validation check.
@param check a validation check to be executed
@param target target object to be checked
@return a validation result
@throws ValidationEngineException | [
"Executes",
"a",
"validation",
"check",
"."
] | 4127f5e1a17540239f5810136153fbd6737fa262 | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/validation/plan/ValidationPlan.java#L106-L171 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/vectorwriter/OmsVectorWriter.java | OmsVectorWriter.writeVector | public static void writeVector( String path, SimpleFeatureCollection featureCollection ) throws IOException {
OmsVectorWriter writer = new OmsVectorWriter();
writer.file = path;
writer.inVector = featureCollection;
writer.process();
} | java | public static void writeVector( String path, SimpleFeatureCollection featureCollection ) throws IOException {
OmsVectorWriter writer = new OmsVectorWriter();
writer.file = path;
writer.inVector = featureCollection;
writer.process();
} | [
"public",
"static",
"void",
"writeVector",
"(",
"String",
"path",
",",
"SimpleFeatureCollection",
"featureCollection",
")",
"throws",
"IOException",
"{",
"OmsVectorWriter",
"writer",
"=",
"new",
"OmsVectorWriter",
"(",
")",
";",
"writer",
".",
"file",
"=",
"path",... | Fast write access mode.
@param path the vector file path.
@param featureCollection the {@link FeatureCollection} to write.
@throws IOException | [
"Fast",
"write",
"access",
"mode",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/vectorwriter/OmsVectorWriter.java#L102-L107 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/forms/Utilities.java | Utilities.getFormItems | public static JSONArray getFormItems( JSONObject formObj ) throws JSONException {
if (formObj.has(TAG_FORMITEMS)) {
JSONArray formItemsArray = formObj.getJSONArray(TAG_FORMITEMS);
return formItemsArray;
}
return null;
} | java | public static JSONArray getFormItems( JSONObject formObj ) throws JSONException {
if (formObj.has(TAG_FORMITEMS)) {
JSONArray formItemsArray = formObj.getJSONArray(TAG_FORMITEMS);
return formItemsArray;
}
return null;
} | [
"public",
"static",
"JSONArray",
"getFormItems",
"(",
"JSONObject",
"formObj",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"formObj",
".",
"has",
"(",
"TAG_FORMITEMS",
")",
")",
"{",
"JSONArray",
"formItemsArray",
"=",
"formObj",
".",
"getJSONArray",
"(",
... | Utility method to get the formitems of a form object.
<p>Note that the entering json object has to be one
object of the main array, not THE main array itself,
i.e. a choice was already done.
@param jsonObj the single object.
@return the array of items of the contained form or <code>null</code> if
no form is contained... | [
"Utility",
"method",
"to",
"get",
"the",
"formitems",
"of",
"a",
"form",
"object",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/forms/Utilities.java#L268-L274 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/forms/Utilities.java | Utilities.getImageIds | public static List<String> getImageIds( String formString ) throws Exception {
List<String> imageIds = new ArrayList<String>();
if (formString != null && formString.length() > 0) {
JSONObject sectionObject = new JSONObject(formString);
List<String> formsNames = Utilities.getFormN... | java | public static List<String> getImageIds( String formString ) throws Exception {
List<String> imageIds = new ArrayList<String>();
if (formString != null && formString.length() > 0) {
JSONObject sectionObject = new JSONObject(formString);
List<String> formsNames = Utilities.getFormN... | [
"public",
"static",
"List",
"<",
"String",
">",
"getImageIds",
"(",
"String",
"formString",
")",
"throws",
"Exception",
"{",
"List",
"<",
"String",
">",
"imageIds",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"formString",
"!="... | Get the images paths out of a form string.
@param formString the form.
@return the list of images paths.
@throws Exception if something goes wrong. | [
"Get",
"the",
"images",
"paths",
"out",
"of",
"a",
"form",
"string",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/forms/Utilities.java#L283-L325 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/forms/Utilities.java | Utilities.formsRootFromSectionsMap | public static JSONArray formsRootFromSectionsMap( HashMap<String, JSONObject> sectionsMap ) {
JSONArray rootArray = new JSONArray();
Collection<JSONObject> objects = sectionsMap.values();
for( JSONObject jsonObject : objects ) {
rootArray.put(jsonObject);
}
return roo... | java | public static JSONArray formsRootFromSectionsMap( HashMap<String, JSONObject> sectionsMap ) {
JSONArray rootArray = new JSONArray();
Collection<JSONObject> objects = sectionsMap.values();
for( JSONObject jsonObject : objects ) {
rootArray.put(jsonObject);
}
return roo... | [
"public",
"static",
"JSONArray",
"formsRootFromSectionsMap",
"(",
"HashMap",
"<",
"String",
",",
"JSONObject",
">",
"sectionsMap",
")",
"{",
"JSONArray",
"rootArray",
"=",
"new",
"JSONArray",
"(",
")",
";",
"Collection",
"<",
"JSONObject",
">",
"objects",
"=",
... | Create the forms root json object from the map of sections json objects.
@param sectionsMap the json sections map.
@return the root object that can be dumped to file through the toString method. | [
"Create",
"the",
"forms",
"root",
"json",
"object",
"from",
"the",
"map",
"of",
"sections",
"json",
"objects",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/forms/Utilities.java#L333-L340 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/compat/ADatabaseSyntaxHelper.java | ADatabaseSyntaxHelper.ofCompat | public String ofCompat( String compatibilityDataTypeName ) {
switch( compatibilityDataTypeName ) {
case COMPAT_TEXT:
return TEXT();
case COMPAT_INT:
return INTEGER();
case COMPAT_LONG:
return LONG();
case COMPAT_REAL:
return REAL();... | java | public String ofCompat( String compatibilityDataTypeName ) {
switch( compatibilityDataTypeName ) {
case COMPAT_TEXT:
return TEXT();
case COMPAT_INT:
return INTEGER();
case COMPAT_LONG:
return LONG();
case COMPAT_REAL:
return REAL();... | [
"public",
"String",
"ofCompat",
"(",
"String",
"compatibilityDataTypeName",
")",
"{",
"switch",
"(",
"compatibilityDataTypeName",
")",
"{",
"case",
"COMPAT_TEXT",
":",
"return",
"TEXT",
"(",
")",
";",
"case",
"COMPAT_INT",
":",
"return",
"INTEGER",
"(",
")",
"... | Get the type by its compatibility name.
@param compatibilityDataTypeName the compat name, as for example {@link #COMPAT_TEXT};
@return the data type; | [
"Get",
"the",
"type",
"by",
"its",
"compatibility",
"name",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/compat/ADatabaseSyntaxHelper.java#L69-L85 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/org/hortonmachine/dbs/compat/ADatabaseSyntaxHelper.java | ADatabaseSyntaxHelper.ofDbType | public String ofDbType( String dbSpecificType ) {
if (dbSpecificType.equals(TEXT())) {
return COMPAT_TEXT;
} else if (dbSpecificType.equals(INTEGER())) {
return COMPAT_INT;
} else if (dbSpecificType.equals(LONG())) {
return COMPAT_LONG;
} else if (dbSp... | java | public String ofDbType( String dbSpecificType ) {
if (dbSpecificType.equals(TEXT())) {
return COMPAT_TEXT;
} else if (dbSpecificType.equals(INTEGER())) {
return COMPAT_INT;
} else if (dbSpecificType.equals(LONG())) {
return COMPAT_LONG;
} else if (dbSp... | [
"public",
"String",
"ofDbType",
"(",
"String",
"dbSpecificType",
")",
"{",
"if",
"(",
"dbSpecificType",
".",
"equals",
"(",
"TEXT",
"(",
")",
")",
")",
"{",
"return",
"COMPAT_TEXT",
";",
"}",
"else",
"if",
"(",
"dbSpecificType",
".",
"equals",
"(",
"INTE... | Get the compatibility name by the db specific type.
@param dbSpecificType the db specific name, as for example DOUBLE;
@return the compat data type; | [
"Get",
"the",
"compatibility",
"name",
"by",
"the",
"db",
"specific",
"type",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/org/hortonmachine/dbs/compat/ADatabaseSyntaxHelper.java#L93-L108 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/morpher/Thin.java | Thin.thinBinaryRep | private BinaryFast thinBinaryRep( BinaryFast b, int[] kernel ) {
Point p;
HashSet<Point> inputHashSet = new HashSet<Point>();
int[][] pixels = b.getPixels();
if (kernelNo0s(kernel)) {
for( int j = 0; j < b.getHeight(); ++j ) {
for( int i = 0; i < b.getWidth();... | java | private BinaryFast thinBinaryRep( BinaryFast b, int[] kernel ) {
Point p;
HashSet<Point> inputHashSet = new HashSet<Point>();
int[][] pixels = b.getPixels();
if (kernelNo0s(kernel)) {
for( int j = 0; j < b.getHeight(); ++j ) {
for( int i = 0; i < b.getWidth();... | [
"private",
"BinaryFast",
"thinBinaryRep",
"(",
"BinaryFast",
"b",
",",
"int",
"[",
"]",
"kernel",
")",
"{",
"Point",
"p",
";",
"HashSet",
"<",
"Point",
">",
"inputHashSet",
"=",
"new",
"HashSet",
"<",
"Point",
">",
"(",
")",
";",
"int",
"[",
"]",
"["... | Takes an image and a kernel and thins it once.
@param b the BinaryFast input image
@param kernel the thinning kernel
@return the thinned BinaryFast image | [
"Takes",
"an",
"image",
"and",
"a",
"kernel",
"and",
"thins",
"it",
"once",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/morpher/Thin.java#L48-L86 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/morpher/Thin.java | Thin.processSkeleton | public void processSkeleton( BinaryFast binary, int[][] kernel ) {
int oldForeEdge = 0;
int oldBackEdge = 0;
while( !(binary.getForegroundEdgePixels().size() == oldForeEdge && binary.getBackgroundEdgePixels().size() == oldBackEdge) ) {
oldForeEdge = binary.getForegroundEdgePixels().s... | java | public void processSkeleton( BinaryFast binary, int[][] kernel ) {
int oldForeEdge = 0;
int oldBackEdge = 0;
while( !(binary.getForegroundEdgePixels().size() == oldForeEdge && binary.getBackgroundEdgePixels().size() == oldBackEdge) ) {
oldForeEdge = binary.getForegroundEdgePixels().s... | [
"public",
"void",
"processSkeleton",
"(",
"BinaryFast",
"binary",
",",
"int",
"[",
"]",
"[",
"]",
"kernel",
")",
"{",
"int",
"oldForeEdge",
"=",
"0",
";",
"int",
"oldBackEdge",
"=",
"0",
";",
"while",
"(",
"!",
"(",
"binary",
".",
"getForegroundEdgePixel... | Takes an image and a kernel and thins it the specified number of times.
@param binary the BinaryFast input image.
@param kernel the kernel to apply. | [
"Takes",
"an",
"image",
"and",
"a",
"kernel",
"and",
"thins",
"it",
"the",
"specified",
"number",
"of",
"times",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/morpher/Thin.java#L94-L105 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/morpher/Thin.java | Thin.kernelMatch | private boolean kernelMatch( Point p, int[][] pixels, int w, int h, int[] kernel ) {
int matched = 0;
for( int j = -1; j < 2; ++j ) {
for( int i = -1; i < 2; ++i ) {
if (kernel[((j + 1) * 3) + (i + 1)] == 2) {
++matched;
} else if ((p.x + i... | java | private boolean kernelMatch( Point p, int[][] pixels, int w, int h, int[] kernel ) {
int matched = 0;
for( int j = -1; j < 2; ++j ) {
for( int i = -1; i < 2; ++i ) {
if (kernel[((j + 1) * 3) + (i + 1)] == 2) {
++matched;
} else if ((p.x + i... | [
"private",
"boolean",
"kernelMatch",
"(",
"Point",
"p",
",",
"int",
"[",
"]",
"[",
"]",
"pixels",
",",
"int",
"w",
",",
"int",
"h",
",",
"int",
"[",
"]",
"kernel",
")",
"{",
"int",
"matched",
"=",
"0",
";",
"for",
"(",
"int",
"j",
"=",
"-",
"... | Returns true if the 8 neighbours of p match the kernel
0 is background
1 is foreground
2 is don't care.
@param p the point at the centre of the
9 pixel neighbourhood
@param pixels the 2D array of the image
@param w the width of the image
@param h the height of the image
@param kernel the array of the kernel values
@re... | [
"Returns",
"true",
"if",
"the",
"8",
"neighbours",
"of",
"p",
"match",
"the",
"kernel",
"0",
"is",
"background",
"1",
"is",
"foreground",
"2",
"is",
"don",
"t",
"care",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/morpher/Thin.java#L137-L157 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/morpher/Thin.java | Thin.hitMissHashSet | private HashSet<Point> hitMissHashSet( BinaryFast b, HashSet<Point> input, int[] kernel ) {
HashSet<Point> output = new HashSet<Point>();
Iterator<Point> it = input.iterator();
while( it.hasNext() ) {
Point p = it.next();
if (kernelMatch(p, b.getPixels(), b.getWidth(), b.... | java | private HashSet<Point> hitMissHashSet( BinaryFast b, HashSet<Point> input, int[] kernel ) {
HashSet<Point> output = new HashSet<Point>();
Iterator<Point> it = input.iterator();
while( it.hasNext() ) {
Point p = it.next();
if (kernelMatch(p, b.getPixels(), b.getWidth(), b.... | [
"private",
"HashSet",
"<",
"Point",
">",
"hitMissHashSet",
"(",
"BinaryFast",
"b",
",",
"HashSet",
"<",
"Point",
">",
"input",
",",
"int",
"[",
"]",
"kernel",
")",
"{",
"HashSet",
"<",
"Point",
">",
"output",
"=",
"new",
"HashSet",
"<",
"Point",
">",
... | Applies the hitmiss operation to a set of pixels
stored in a hash table.
@param b the BinaryFast input image
@param input the set of pixels requiring matching
@param kernel the kernel to match them with
@return A hash table containing all the successful matches. | [
"Applies",
"the",
"hitmiss",
"operation",
"to",
"a",
"set",
"of",
"pixels",
"stored",
"in",
"a",
"hash",
"table",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/morpher/Thin.java#L168-L180 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/r/morpher/Thin.java | Thin.kernelNo0s | private boolean kernelNo0s( int[] kernel ) {
for( int i = 0; i < kernel.length; ++i ) {
if (kernel[i] == 0)
return false;
}
return true;
} | java | private boolean kernelNo0s( int[] kernel ) {
for( int i = 0; i < kernel.length; ++i ) {
if (kernel[i] == 0)
return false;
}
return true;
} | [
"private",
"boolean",
"kernelNo0s",
"(",
"int",
"[",
"]",
"kernel",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"kernel",
".",
"length",
";",
"++",
"i",
")",
"{",
"if",
"(",
"kernel",
"[",
"i",
"]",
"==",
"0",
")",
"return",
"f... | Returns true if the kernel has no 0s.
@param kernel the array storing the kernel values.
@return True if no 0s (false otherwise) | [
"Returns",
"true",
"if",
"the",
"kernel",
"has",
"no",
"0s",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/r/morpher/Thin.java#L188-L194 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/styles/Style.java | Style.dashFromString | public static float[] dashFromString( String dashPattern ) {
if (dashPattern.trim().length() > 0) {
String[] split = dashPattern.split(",");
if (split.length > 1) {
float[] dash = new float[split.length];
for( int i = 0; i < split.length; i++ ) {
... | java | public static float[] dashFromString( String dashPattern ) {
if (dashPattern.trim().length() > 0) {
String[] split = dashPattern.split(",");
if (split.length > 1) {
float[] dash = new float[split.length];
for( int i = 0; i < split.length; i++ ) {
... | [
"public",
"static",
"float",
"[",
"]",
"dashFromString",
"(",
"String",
"dashPattern",
")",
"{",
"if",
"(",
"dashPattern",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"String",
"[",
"]",
"split",
"=",
"dashPattern",
".",
"spli... | Convert string to dash.
@param dashPattern the string to convert.
@return the dash array or null, if conversion failed. | [
"Convert",
"string",
"to",
"dash",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/styles/Style.java#L179-L197 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/styles/Style.java | Style.dashToString | public static String dashToString( float[] dash, Float shift ) {
StringBuilder sb = new StringBuilder();
if (shift != null)
sb.append(shift);
for( int i = 0; i < dash.length; i++ ) {
if (shift != null || i > 0) {
sb.append(",");
}
s... | java | public static String dashToString( float[] dash, Float shift ) {
StringBuilder sb = new StringBuilder();
if (shift != null)
sb.append(shift);
for( int i = 0; i < dash.length; i++ ) {
if (shift != null || i > 0) {
sb.append(",");
}
s... | [
"public",
"static",
"String",
"dashToString",
"(",
"float",
"[",
"]",
"dash",
",",
"Float",
"shift",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"shift",
"!=",
"null",
")",
"sb",
".",
"append",
"(",
"shift",
... | Convert a dash array to string.
@param dash the dash to convert.
@param shift the shift.
@return the string representation. | [
"Convert",
"a",
"dash",
"array",
"to",
"string",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/styles/Style.java#L206-L217 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmClusters.java | GvmClusters.clear | public void clear() {
Arrays.fill(clusters, 0, bound, null);
pairs.clear();
additions = 0;
count = 0;
bound = 0;
} | java | public void clear() {
Arrays.fill(clusters, 0, bound, null);
pairs.clear();
additions = 0;
count = 0;
bound = 0;
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"Arrays",
".",
"fill",
"(",
"clusters",
",",
"0",
",",
"bound",
",",
"null",
")",
";",
"pairs",
".",
"clear",
"(",
")",
";",
"additions",
"=",
"0",
";",
"count",
"=",
"0",
";",
"bound",
"=",
"0",
";",
... | Removes all clusters and clustered points but retains the keyer. | [
"Removes",
"all",
"clusters",
"and",
"clustered",
"points",
"but",
"retains",
"the",
"keyer",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmClusters.java#L157-L163 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmClusters.java | GvmClusters.add | public void add(double m, Object pt, K key) {
if (m == 0.0) return; //nothing to do
if (count < capacity) { //shortcut
//TODO should prefer add if var comes to zero
GvmCluster<S,K> cluster = new GvmCluster<S,K>(this);
clusters[additions] = cluster;
cluster.set(m, pt);
addPairs();
cluster.key = key... | java | public void add(double m, Object pt, K key) {
if (m == 0.0) return; //nothing to do
if (count < capacity) { //shortcut
//TODO should prefer add if var comes to zero
GvmCluster<S,K> cluster = new GvmCluster<S,K>(this);
clusters[additions] = cluster;
cluster.set(m, pt);
addPairs();
cluster.key = key... | [
"public",
"void",
"add",
"(",
"double",
"m",
",",
"Object",
"pt",
",",
"K",
"key",
")",
"{",
"if",
"(",
"m",
"==",
"0.0",
")",
"return",
";",
"//nothing to do",
"if",
"(",
"count",
"<",
"capacity",
")",
"{",
"//shortcut",
"//TODO should prefer add if var... | Adds a point to be clustered.
@param m
the mass at the point
@param xs
the coordinates of the point
@param key
a key assigned to the point, may be null | [
"Adds",
"a",
"point",
"to",
"be",
"clustered",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmClusters.java#L176-L226 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmClusters.java | GvmClusters.addPairs | private void addPairs() {
GvmCluster<S,K> cj = clusters[count];
int c = count - 1; //index at which new pairs registered for existing clusters
for (int i = 0; i < count; i++) {
GvmCluster<S,K> ci = clusters[i];
GvmClusterPair<S,K> pair = new GvmClusterPair<S,K>(ci, cj);
ci.pairs[c] = pair;
cj.pairs[i]... | java | private void addPairs() {
GvmCluster<S,K> cj = clusters[count];
int c = count - 1; //index at which new pairs registered for existing clusters
for (int i = 0; i < count; i++) {
GvmCluster<S,K> ci = clusters[i];
GvmClusterPair<S,K> pair = new GvmClusterPair<S,K>(ci, cj);
ci.pairs[c] = pair;
cj.pairs[i]... | [
"private",
"void",
"addPairs",
"(",
")",
"{",
"GvmCluster",
"<",
"S",
",",
"K",
">",
"cj",
"=",
"clusters",
"[",
"count",
"]",
";",
"int",
"c",
"=",
"count",
"-",
"1",
";",
"//index at which new pairs registered for existing clusters",
"for",
"(",
"int",
"... | assumes pairs are contiguous | [
"assumes",
"pairs",
"are",
"contiguous"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmClusters.java#L346-L357 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmClusters.java | GvmClusters.updatePairs | private void updatePairs(GvmCluster<S,K> cluster) {
GvmClusterPair<S,K>[] pairs = cluster.pairs;
//accelerated path
if (count == bound) {
int limit = count - 1;
for (int i = 0; i < limit; i++) {
this.pairs.reprioritize(pairs[i]);
}
} else {
int limit = bound - 1;
for (int i = 0; i < limit; i+... | java | private void updatePairs(GvmCluster<S,K> cluster) {
GvmClusterPair<S,K>[] pairs = cluster.pairs;
//accelerated path
if (count == bound) {
int limit = count - 1;
for (int i = 0; i < limit; i++) {
this.pairs.reprioritize(pairs[i]);
}
} else {
int limit = bound - 1;
for (int i = 0; i < limit; i+... | [
"private",
"void",
"updatePairs",
"(",
"GvmCluster",
"<",
"S",
",",
"K",
">",
"cluster",
")",
"{",
"GvmClusterPair",
"<",
"S",
",",
"K",
">",
"[",
"]",
"pairs",
"=",
"cluster",
".",
"pairs",
";",
"//accelerated path",
"if",
"(",
"count",
"==",
"bound",... | does not assume pairs are contiguous | [
"does",
"not",
"assume",
"pairs",
"are",
"contiguous"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmClusters.java#L360-L376 | train |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmClusters.java | GvmClusters.removePairs | private void removePairs(GvmCluster<S,K> cluster) {
GvmClusterPair<S,K>[] pairs = cluster.pairs;
for (int i = 0; i < bound-1; i++) {
GvmClusterPair<S,K> pair = pairs[i];
if (pair.c1.removed || pair.c2.removed) continue;
this.pairs.remove(pair);
}
} | java | private void removePairs(GvmCluster<S,K> cluster) {
GvmClusterPair<S,K>[] pairs = cluster.pairs;
for (int i = 0; i < bound-1; i++) {
GvmClusterPair<S,K> pair = pairs[i];
if (pair.c1.removed || pair.c2.removed) continue;
this.pairs.remove(pair);
}
} | [
"private",
"void",
"removePairs",
"(",
"GvmCluster",
"<",
"S",
",",
"K",
">",
"cluster",
")",
"{",
"GvmClusterPair",
"<",
"S",
",",
"K",
">",
"[",
"]",
"pairs",
"=",
"cluster",
".",
"pairs",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | these are tidied when everything is made contiguous again | [
"these",
"are",
"tidied",
"when",
"everything",
"is",
"made",
"contiguous",
"again"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/clustering/GvmClusters.java#L381-L389 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Database.java | Database.open | public void open( String filename, int mode ) throws jsqlite.Exception {
this.filename = filename;
if ((mode & 0200) != 0) {
mode = jsqlite.Constants.SQLITE_OPEN_READWRITE | jsqlite.Constants.SQLITE_OPEN_CREATE;
} else if ((mode & 0400) != 0) {
mode = jsqlite.Constants.SQ... | java | public void open( String filename, int mode ) throws jsqlite.Exception {
this.filename = filename;
if ((mode & 0200) != 0) {
mode = jsqlite.Constants.SQLITE_OPEN_READWRITE | jsqlite.Constants.SQLITE_OPEN_CREATE;
} else if ((mode & 0400) != 0) {
mode = jsqlite.Constants.SQ... | [
"public",
"void",
"open",
"(",
"String",
"filename",
",",
"int",
"mode",
")",
"throws",
"jsqlite",
".",
"Exception",
"{",
"this",
".",
"filename",
"=",
"filename",
";",
"if",
"(",
"(",
"mode",
"&",
"0200",
")",
"!=",
"0",
")",
"{",
"mode",
"=",
"js... | Open an SQLite database file.
@param filename the name of the database file
@param mode open mode (e.g. SQLITE_OPEN_READONLY)
@throws jsqlite.Exception | [
"Open",
"an",
"SQLite",
"database",
"file",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Database.java#L35-L51 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Database.java | Database.create_function | public void create_function( String name, int nargs, Function f ) {
synchronized (this) {
_create_function(name, nargs, f);
}
} | java | public void create_function( String name, int nargs, Function f ) {
synchronized (this) {
_create_function(name, nargs, f);
}
} | [
"public",
"void",
"create_function",
"(",
"String",
"name",
",",
"int",
"nargs",
",",
"Function",
"f",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"_create_function",
"(",
"name",
",",
"nargs",
",",
"f",
")",
";",
"}",
"}"
] | Create regular function.
@param name the name of the new function
@param nargs number of arguments to function
@param f interface of function | [
"Create",
"regular",
"function",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Database.java#L453-L457 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Database.java | Database.create_aggregate | public void create_aggregate( String name, int nargs, Function f ) {
synchronized (this) {
_create_aggregate(name, nargs, f);
}
} | java | public void create_aggregate( String name, int nargs, Function f ) {
synchronized (this) {
_create_aggregate(name, nargs, f);
}
} | [
"public",
"void",
"create_aggregate",
"(",
"String",
"name",
",",
"int",
"nargs",
",",
"Function",
"f",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"_create_aggregate",
"(",
"name",
",",
"nargs",
",",
"f",
")",
";",
"}",
"}"
] | Create aggregate function.
@param name the name of the new function
@param nargs number of arguments to function
@param f interface of function | [
"Create",
"aggregate",
"function",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Database.java#L469-L473 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Database.java | Database.backup | public Backup backup( Database dest, String destName, String srcName ) throws jsqlite.Exception {
synchronized (this) {
Backup b = new Backup();
_backup(b, dest, destName, this, srcName);
return b;
}
} | java | public Backup backup( Database dest, String destName, String srcName ) throws jsqlite.Exception {
synchronized (this) {
Backup b = new Backup();
_backup(b, dest, destName, this, srcName);
return b;
}
} | [
"public",
"Backup",
"backup",
"(",
"Database",
"dest",
",",
"String",
"destName",
",",
"String",
"srcName",
")",
"throws",
"jsqlite",
".",
"Exception",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Backup",
"b",
"=",
"new",
"Backup",
"(",
")",
";",
"_back... | Initiate a database backup, SQLite 3.x only.
@param dest destination database
@param destName schema of destination database to be backed up
@param srcName schema of source database
@return Backup object to perform the backup operation | [
"Initiate",
"a",
"database",
"backup",
"SQLite",
"3",
".",
"x",
"only",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Database.java#L591-L597 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Database.java | Database.compile | public Vm compile( String sql ) throws jsqlite.Exception {
synchronized (this) {
Vm vm = new Vm();
vm_compile(sql, vm);
return vm;
}
} | java | public Vm compile( String sql ) throws jsqlite.Exception {
synchronized (this) {
Vm vm = new Vm();
vm_compile(sql, vm);
return vm;
}
} | [
"public",
"Vm",
"compile",
"(",
"String",
"sql",
")",
"throws",
"jsqlite",
".",
"Exception",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Vm",
"vm",
"=",
"new",
"Vm",
"(",
")",
";",
"vm_compile",
"(",
"sql",
",",
"vm",
")",
";",
"return",
"vm",
";"... | Compile and return SQLite VM for SQL statement. Only available
in SQLite 2.8.0 and above, otherwise a no-op.
@param sql SQL statement to be compiled
@return a Vm object | [
"Compile",
"and",
"return",
"SQLite",
"VM",
"for",
"SQL",
"statement",
".",
"Only",
"available",
"in",
"SQLite",
"2",
".",
"8",
".",
"0",
"and",
"above",
"otherwise",
"a",
"no",
"-",
"op",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Database.java#L679-L685 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Database.java | Database.compile | public Vm compile( String sql, String args[] ) throws jsqlite.Exception {
synchronized (this) {
Vm vm = new Vm();
vm_compile_args(sql, vm, args);
return vm;
}
} | java | public Vm compile( String sql, String args[] ) throws jsqlite.Exception {
synchronized (this) {
Vm vm = new Vm();
vm_compile_args(sql, vm, args);
return vm;
}
} | [
"public",
"Vm",
"compile",
"(",
"String",
"sql",
",",
"String",
"args",
"[",
"]",
")",
"throws",
"jsqlite",
".",
"Exception",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Vm",
"vm",
"=",
"new",
"Vm",
"(",
")",
";",
"vm_compile_args",
"(",
"sql",
",",... | Compile and return SQLite VM for SQL statement. Only available
in SQLite 3.0 and above, otherwise a no-op.
@param sql SQL statement to be compiled
@param args arguments for the SQL statement, '%q' substitution
@return a Vm object | [
"Compile",
"and",
"return",
"SQLite",
"VM",
"for",
"SQL",
"statement",
".",
"Only",
"available",
"in",
"SQLite",
"3",
".",
"0",
"and",
"above",
"otherwise",
"a",
"no",
"-",
"op",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Database.java#L696-L702 | train |
TheHortonMachine/hortonmachine | dbs/src/main/java/jsqlite/Database.java | Database.prepare | public Stmt prepare( String sql ) throws jsqlite.Exception {
synchronized (this) {
Stmt stmt = new Stmt();
stmt_prepare(sql, stmt);
return stmt;
}
} | java | public Stmt prepare( String sql ) throws jsqlite.Exception {
synchronized (this) {
Stmt stmt = new Stmt();
stmt_prepare(sql, stmt);
return stmt;
}
} | [
"public",
"Stmt",
"prepare",
"(",
"String",
"sql",
")",
"throws",
"jsqlite",
".",
"Exception",
"{",
"synchronized",
"(",
"this",
")",
"{",
"Stmt",
"stmt",
"=",
"new",
"Stmt",
"(",
")",
";",
"stmt_prepare",
"(",
"sql",
",",
"stmt",
")",
";",
"return",
... | Prepare and return SQLite3 statement for SQL. Only available
in SQLite 3.0 and above, otherwise a no-op.
@param sql SQL statement to be prepared
@return a Stmt object | [
"Prepare",
"and",
"return",
"SQLite3",
"statement",
"for",
"SQL",
".",
"Only",
"available",
"in",
"SQLite",
"3",
".",
"0",
"and",
"above",
"otherwise",
"a",
"no",
"-",
"op",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/dbs/src/main/java/jsqlite/Database.java#L712-L718 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.