docstring_tokens
list | code_tokens
list |
---|---|
[
"override",
"the",
"thread",
"context",
"class",
"loader",
"with",
"the",
"environment",
"s",
"bean",
"class",
"loader",
"if",
"necessary",
"i",
"e",
"if",
"the",
"bean",
"class",
"loader",
"is",
"not",
"equivalent",
"to",
"the",
"thread",
"context",
"class",
"loader",
"already"
]
| [
"thread",
"current",
"thread",
"=",
"thread",
"current",
"thread",
"(",
")",
";",
"class",
"loader",
"thread",
"context",
"class",
"loader",
"=",
"current",
"thread",
"get",
"context",
"class",
"loader",
"(",
")",
";",
"if",
"(",
"class",
"loader",
"to",
"use",
"!",
"=",
"null",
"&",
"&",
"!",
"class",
"loader",
"to",
"use",
"equals",
"(",
"thread",
"context",
"class",
"loader",
")",
")",
"{",
"current",
"thread",
"set",
"context",
"class",
"loader",
"(",
"class",
"loader",
"to",
"use",
")",
";",
"return",
"thread",
"context",
"class",
"loader",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}"
]
|
[
"given",
"an",
"input",
"class",
"object",
"return",
"a",
"string",
"which",
"consists",
"of",
"the",
"class",
"s",
"package",
"name",
"as",
"a",
"pathname",
"i",
"e",
"all",
"dots",
"(",
")",
"are",
"replaced",
"by",
"slashes",
"(",
"/",
")",
"neither",
"a",
"leading",
"nor",
"trailing",
"slash",
"is",
"added",
"the",
"result",
"could",
"be",
"concatenated",
"with",
"a",
"slash",
"and",
"the",
"name",
"of",
"a",
"resource",
"and",
"fed",
"directly",
"to",
"{"
]
| [
"if",
"(",
"clazz",
"=",
"=",
"null",
")",
"{",
"return",
"\"",
"\"",
";",
"}",
"string",
"class",
"name",
"=",
"clazz",
"get",
"name",
"(",
")",
";",
"int",
"package",
"end",
"index",
"=",
"class",
"name",
"last",
"index",
"of",
"(",
"package",
"separator",
")",
";",
"if",
"(",
"package",
"end",
"index",
"=",
"=",
"-",
"1",
")",
"{",
"return",
"\"",
"\"",
";",
"}",
"string",
"package",
"name",
"=",
"class",
"name",
"substring",
"(",
"0",
",",
"package",
"end",
"index",
")",
";",
"return",
"package",
"name",
"replace",
"(",
"package",
"separator",
",",
"path",
"separator",
")",
";"
]
|
[
"build",
"a",
"string",
"that",
"consists",
"of",
"the",
"names",
"of",
"the",
"classes",
"/",
"interfaces",
"in",
"the",
"given",
"array",
"<",
"p",
">",
"basically",
"like",
"{"
]
| [
"return",
"class",
"names",
"to",
"string",
"(",
"arrays",
"as",
"list",
"(",
"classes",
")",
")",
";"
]
|
[
"copy",
"the",
"given",
"{"
]
| [
"return",
"collection",
"to",
"array",
"(",
"new",
"class",
"<",
"?",
">",
"[",
"0",
"]",
")",
";"
]
|
[
"return",
"all",
"interfaces",
"that",
"the",
"given",
"class",
"implements",
"as",
"an",
"array",
"including",
"ones",
"implemented",
"by",
"superclasses",
"<",
"p",
">",
"if",
"the",
"class",
"itself",
"is",
"an",
"interface",
"it",
"gets",
"returned",
"as",
"sole",
"interface"
]
| [
"return",
"to",
"class",
"array",
"(",
"get",
"all",
"interfaces",
"for",
"class",
"as",
"set",
"(",
"clazz",
",",
"class",
"loader",
")",
")",
";"
]
|
[
"return",
"all",
"interfaces",
"that",
"the",
"given",
"class",
"implements",
"as",
"a",
"set",
"including",
"ones",
"implemented",
"by",
"superclasses",
"<",
"p",
">",
"if",
"the",
"class",
"itself",
"is",
"an",
"interface",
"it",
"gets",
"returned",
"as",
"sole",
"interface"
]
| [
"return",
"get",
"all",
"interfaces",
"for",
"class",
"as",
"set",
"(",
"clazz",
",",
"null",
")",
";"
]
|
[
"determine",
"the",
"common",
"ancestor",
"of",
"the",
"given",
"classes",
"if",
"any"
]
| [
"if",
"(",
"clazz",
"1",
"=",
"=",
"null",
")",
"{",
"return",
"clazz",
"2",
";",
"}",
"if",
"(",
"clazz",
"2",
"=",
"=",
"null",
")",
"{",
"return",
"clazz",
"1",
";",
"}",
"if",
"(",
"clazz",
"1",
"is",
"assignable",
"from",
"(",
"clazz",
"2",
")",
")",
"{",
"return",
"clazz",
"1",
";",
"}",
"if",
"(",
"clazz",
"2",
"is",
"assignable",
"from",
"(",
"clazz",
"1",
")",
")",
"{",
"return",
"clazz",
"2",
";",
"}",
"class",
"<",
"?",
">",
"ancestor",
"=",
"clazz",
"1",
";",
"do",
"{",
"ancestor",
"=",
"ancestor",
"get",
"superclass",
"(",
")",
";",
"if",
"(",
"ancestor",
"=",
"=",
"null",
"|",
"|",
"object",
"class",
"=",
"=",
"ancestor",
")",
"{",
"return",
"null",
";",
"}",
"}",
"while",
"(",
"!",
"ancestor",
"is",
"assignable",
"from",
"(",
"clazz",
"2",
")",
")",
";",
"return",
"ancestor",
";"
]
|
[
"determine",
"whether",
"the",
"given",
"interface",
"is",
"a",
"common",
"java",
"language",
"interface",
":",
"{"
]
| [
"return",
"java",
"language",
"interfaces",
"contains",
"(",
"ifc",
")",
";"
]
|
[
"determine",
"if",
"the",
"supplied",
"class",
"is",
"an",
"<",
"em",
">",
"inner",
"class",
"<",
"/",
"em",
">",
"i",
"e",
"a",
"non",
"-",
"static",
"member",
"of",
"an",
"enclosing",
"class"
]
| [
"return",
"(",
"clazz",
"is",
"member",
"class",
"(",
")",
"&",
"&",
"!",
"modifier",
"is",
"static",
"(",
"clazz",
"get",
"modifiers",
"(",
")",
")",
")",
";"
]
|
[
"check",
"whether",
"the",
"specified",
"class",
"is",
"a",
"cglib",
"-",
"generated",
"class"
]
| [
"return",
"(",
"clazz",
"!",
"=",
"null",
"&",
"&",
"is",
"cglib",
"proxy",
"class",
"name",
"(",
"clazz",
"get",
"name",
"(",
")",
")",
")",
";"
]
|
[
"check",
"whether",
"the",
"specified",
"class",
"name",
"is",
"a",
"cglib",
"-",
"generated",
"class"
]
| [
"return",
"(",
"class",
"name",
"!",
"=",
"null",
"&",
"&",
"class",
"name",
"contains",
"(",
"cglib",
"class",
"separator",
")",
")",
";"
]
|
[
"return",
"the",
"user",
"-",
"defined",
"class",
"for",
"the",
"given",
"class",
":",
"usually",
"simply",
"the",
"given",
"class",
"but",
"the",
"original",
"class",
"in",
"case",
"of",
"a",
"cglib",
"-",
"generated",
"subclass"
]
| [
"if",
"(",
"clazz",
"get",
"name",
"(",
")",
"contains",
"(",
"cglib",
"class",
"separator",
")",
")",
"{",
"class",
"<",
"?",
">",
"superclass",
"=",
"clazz",
"get",
"superclass",
"(",
")",
";",
"if",
"(",
"superclass",
"!",
"=",
"null",
"&",
"&",
"superclass",
"!",
"=",
"object",
"class",
")",
"{",
"return",
"superclass",
";",
"}",
"}",
"return",
"clazz",
";"
]
|
[
"check",
"whether",
"the",
"given",
"class",
"matches",
"the",
"user",
"-",
"specified",
"type",
"name"
]
| [
"return",
"(",
"type",
"name",
"!",
"=",
"null",
"&",
"&",
"(",
"type",
"name",
"equals",
"(",
"clazz",
"get",
"type",
"name",
"(",
")",
")",
"|",
"|",
"type",
"name",
"equals",
"(",
"clazz",
"get",
"simple",
"name",
"(",
")",
")",
")",
")",
";"
]
|
[
"return",
"the",
"short",
"string",
"name",
"of",
"a",
"java",
"class",
"in",
"uncapitalized",
"java",
"beans",
"property",
"format",
"strips",
"the",
"outer",
"class",
"name",
"in",
"case",
"of",
"an",
"inner",
"class"
]
| [
"string",
"short",
"name",
"=",
"get",
"short",
"name",
"(",
"clazz",
")",
";",
"int",
"dot",
"index",
"=",
"short",
"name",
"last",
"index",
"of",
"(",
"package",
"separator",
")",
";",
"short",
"name",
"=",
"(",
"dot",
"index",
"!",
"=",
"-",
"1",
"?",
"short",
"name",
"substring",
"(",
"dot",
"index",
"+",
"1",
")",
":",
"short",
"name",
")",
";",
"return",
"introspector",
"decapitalize",
"(",
"short",
"name",
")",
";"
]
|
[
"return",
"the",
"qualified",
"name",
"of",
"the",
"given",
"method",
"consisting",
"of",
"fully",
"qualified",
"interface",
"/",
"class",
"name",
"+",
"+",
"method",
"name"
]
| [
"return",
"get",
"qualified",
"method",
"name",
"(",
"method",
",",
"null",
")",
";"
]
|
[
"determine",
"whether",
"the",
"given",
"class",
"has",
"a",
"public",
"constructor",
"with",
"the",
"given",
"signature",
"<",
"p",
">",
"essentially",
"translates",
"{"
]
| [
"return",
"(",
"get",
"constructor",
"if",
"available",
"(",
"clazz",
",",
"param",
"types",
")",
"!",
"=",
"null",
")",
";"
]
|
[
"determine",
"whether",
"the",
"given",
"class",
"has",
"a",
"public",
"method",
"with",
"the",
"given",
"signature",
"<",
"p",
">",
"essentially",
"translates",
"{"
]
| [
"return",
"(",
"get",
"method",
"if",
"available",
"(",
"clazz",
",",
"method",
"name",
",",
"param",
"types",
")",
"!",
"=",
"null",
")",
";"
]
|
[
"determine",
"whether",
"the",
"given",
"method",
"is",
"overridable",
"in",
"the",
"given",
"target",
"class"
]
| [
"if",
"(",
"modifier",
"is",
"private",
"(",
"method",
"get",
"modifiers",
"(",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"modifier",
"is",
"public",
"(",
"method",
"get",
"modifiers",
"(",
")",
")",
"|",
"|",
"modifier",
"is",
"protected",
"(",
"method",
"get",
"modifiers",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"(",
"target",
"class",
"=",
"=",
"null",
"|",
"|",
"get",
"package",
"name",
"(",
"method",
"get",
"declaring",
"class",
"(",
")",
")",
"equals",
"(",
"get",
"package",
"name",
"(",
"target",
"class",
")",
")",
")",
";"
]
|
[
"for",
"unknown",
"reasons",
"the",
"before",
"-",
"class",
"setting",
"of",
"the",
"jvm",
"properties",
"were",
"not",
"being",
"picked",
"up",
"this",
"method",
"addresses",
"that",
"by",
"setting",
"them",
"before",
"every",
"test",
"case"
]
| []
|
[
"init",
"hadoop",
"security",
"by",
"setting",
"up",
"the",
"ugi",
"config"
]
| [
"user",
"group",
"information",
"set",
"configuration",
"(",
"conf",
")",
";",
"kerberos",
"name",
"set",
"rules",
"(",
"kerberos",
"rule",
")",
";"
]
|
[
"stop",
"the",
"secure",
"zk",
"and",
"log",
"out",
"the",
"zk",
"account"
]
| [
"service",
"operations",
"stop",
"(",
"secure",
"z",
"k",
")",
";",
"secure",
"z",
"k",
"=",
"null",
";",
"logout",
"(",
"zookeeper",
"login",
")",
";",
"zookeeper",
"login",
"=",
"null",
";"
]
|
[
"/",
"*",
"to",
"two",
"methods",
"below",
"are",
"to",
"avoid",
"creating",
"methods",
"on",
"already",
"long",
"material",
"interface",
"with",
"a",
"no",
"op",
"implementations"
]
| [
"list",
"<",
"scm",
"material",
">",
"scm",
"materials",
"=",
"new",
"array",
"list",
"<",
">",
"(",
")",
";",
"for",
"(",
"material",
"material",
":",
"this",
")",
"{",
"if",
"(",
"material",
"instanceof",
"scm",
"material",
")",
"{",
"scm",
"materials",
"add",
"(",
"(",
"scm",
"material",
")",
"material",
")",
";",
"}",
"}",
"return",
"scm",
"materials",
";"
]
|
[
"this",
"method",
"updates",
"vocab",
"cache",
"and",
"all",
"it",
"s",
"elements",
"with",
"huffman",
"indexes",
"please",
"note",
":",
"it",
"should",
"be",
"the",
"same",
"vocab",
"cache",
"as",
"was",
"used",
"for",
"huffman",
"tree",
"initialization"
]
| [
"if",
"(",
"!",
"build",
"trigger",
")",
"build",
"(",
")",
";",
"for",
"(",
"int",
"a",
"=",
"0",
";",
"a",
"<",
"words",
"size",
"(",
")",
";",
"a",
"+",
"+",
")",
"{",
"if",
"(",
"words",
"get",
"(",
"a",
")",
"get",
"label",
"(",
")",
"!",
"=",
"null",
")",
"{",
"cache",
"add",
"word",
"to",
"index",
"(",
"a",
",",
"words",
"get",
"(",
"a",
")",
"get",
"label",
"(",
")",
")",
";",
"}",
"else",
"{",
"cache",
"add",
"word",
"to",
"index",
"(",
"a",
",",
"words",
"get",
"(",
"a",
")",
"get",
"storage",
"id",
"(",
")",
")",
";",
"}",
"words",
"get",
"(",
"a",
")",
"set",
"index",
"(",
"a",
")",
";",
"}"
]
|
[
"returns",
"the",
"name",
"of",
"this",
"section",
"for",
"annotation",
"purposes"
]
| [
"return",
"name",
";"
]
|
[
"the",
"multi",
"fetch",
"result",
"should",
"contain",
"results",
"in",
"the",
"same",
"order",
"as",
"the",
"requests"
]
| [
"protected",
"abstract",
"multi",
"fetch",
"result",
"multi",
"fetch",
"impl",
"(",
"iterable",
"<",
"fetch",
"request",
">",
"requests",
")",
"throws",
"i",
"o",
"exception",
";"
]
|
[
"set",
"it",
"to",
"true",
"if",
"you",
"want",
"to",
"enable",
"direct",
"memory",
"tracking",
"for",
"debugging",
"purpose",
"default",
"is",
"false",
"to",
"print",
"direct",
"memory",
"usage",
"use",
"buffer",
"utils",
"print",
"current",
"direct",
"memory",
"(",
"string",
"builder",
"store",
")",
";"
]
| [
"track",
"direct",
"memory",
"=",
"enabled",
";"
]
|
[
"creates",
"a",
"clone",
"of",
"the",
"given",
"buffer",
"the",
"clone",
"s",
"capacity",
"is",
"equal",
"to",
"the",
"given",
"buffer",
"s",
"limit"
]
| [
"if",
"(",
"buf",
"instanceof",
"float",
"buffer",
")",
"{",
"return",
"clone",
"(",
"(",
"float",
"buffer",
")",
"buf",
")",
";",
"}",
"else",
"if",
"(",
"buf",
"instanceof",
"short",
"buffer",
")",
"{",
"return",
"clone",
"(",
"(",
"short",
"buffer",
")",
"buf",
")",
";",
"}",
"else",
"if",
"(",
"buf",
"instanceof",
"byte",
"buffer",
")",
"{",
"return",
"clone",
"(",
"(",
"byte",
"buffer",
")",
"buf",
")",
";",
"}",
"else",
"if",
"(",
"buf",
"instanceof",
"int",
"buffer",
")",
"{",
"return",
"clone",
"(",
"(",
"int",
"buffer",
")",
"buf",
")",
";",
"}",
"else",
"if",
"(",
"buf",
"instanceof",
"double",
"buffer",
")",
"{",
"return",
"clone",
"(",
"(",
"double",
"buffer",
")",
"buf",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"unsupported",
"operation",
"exception",
"(",
")",
";",
"}"
]
|
[
"generate",
"a",
"new",
"float",
"buffer",
"using",
"the",
"given",
"array",
"of",
"vector",
"3f",
"objects",
"the",
"float",
"buffer",
"will",
"be",
"3",
"*",
"data",
"length",
"long",
"and",
"contain",
"the",
"vector",
"data",
"as",
"data",
"[",
"0",
"]",
"x",
"data",
"[",
"0",
"]",
"y",
"data",
"[",
"0",
"]",
"z",
"data",
"[",
"1",
"]",
"x",
"etc"
]
| [
"if",
"(",
"data",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"float",
"buffer",
"buff",
"=",
"create",
"float",
"buffer",
"(",
"3",
"*",
"data",
"length",
")",
";",
"for",
"(",
"vector",
"3f",
"element",
":",
"data",
")",
"{",
"if",
"(",
"element",
"!",
"=",
"null",
")",
"{",
"buff",
"put",
"(",
"element",
"x",
")",
"put",
"(",
"element",
"y",
")",
"put",
"(",
"element",
"z",
")",
";",
"}",
"else",
"{",
"buff",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
";",
"}",
"}",
"buff",
"flip",
"(",
")",
";",
"return",
"buff",
";"
]
|
[
"generate",
"a",
"new",
"float",
"buffer",
"using",
"the",
"given",
"array",
"of",
"quaternion",
"objects",
"the",
"float",
"buffer",
"will",
"be",
"4",
"*",
"data",
"length",
"long",
"and",
"contain",
"the",
"vector",
"data"
]
| [
"if",
"(",
"data",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"float",
"buffer",
"buff",
"=",
"create",
"float",
"buffer",
"(",
"4",
"*",
"data",
"length",
")",
";",
"for",
"(",
"quaternion",
"element",
":",
"data",
")",
"{",
"if",
"(",
"element",
"!",
"=",
"null",
")",
"{",
"buff",
"put",
"(",
"element",
"get",
"x",
"(",
")",
")",
"put",
"(",
"element",
"get",
"y",
"(",
")",
")",
"put",
"(",
"element",
"get",
"z",
"(",
")",
")",
"put",
"(",
"element",
"get",
"w",
"(",
")",
")",
";",
"}",
"else",
"{",
"buff",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
";",
"}",
"}",
"buff",
"flip",
"(",
")",
";",
"return",
"buff",
";"
]
|
[
"generate",
"a",
"new",
"float",
"buffer",
"using",
"the",
"given",
"array",
"of",
"vector",
"4",
"objects",
"the",
"float",
"buffer",
"will",
"be",
"4",
"*",
"data",
"length",
"long",
"and",
"contain",
"the",
"vector",
"data"
]
| [
"if",
"(",
"data",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"float",
"buffer",
"buff",
"=",
"create",
"float",
"buffer",
"(",
"4",
"*",
"data",
"length",
")",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"data",
"length",
";",
"x",
"+",
"+",
")",
"{",
"if",
"(",
"data",
"[",
"x",
"]",
"!",
"=",
"null",
")",
"{",
"buff",
"put",
"(",
"data",
"[",
"x",
"]",
"get",
"x",
"(",
")",
")",
"put",
"(",
"data",
"[",
"x",
"]",
"get",
"y",
"(",
")",
")",
"put",
"(",
"data",
"[",
"x",
"]",
"get",
"z",
"(",
")",
")",
"put",
"(",
"data",
"[",
"x",
"]",
"get",
"w",
"(",
")",
")",
";",
"}",
"else",
"{",
"buff",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
";",
"}",
"}",
"buff",
"flip",
"(",
")",
";",
"return",
"buff",
";"
]
|
[
"generate",
"a",
"new",
"float",
"buffer",
"using",
"the",
"given",
"array",
"of",
"color",
"r",
"g",
"b",
"a",
"objects",
"the",
"float",
"buffer",
"will",
"be",
"4",
"*",
"data",
"length",
"long",
"and",
"contain",
"the",
"color",
"data"
]
| [
"if",
"(",
"data",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"float",
"buffer",
"buff",
"=",
"create",
"float",
"buffer",
"(",
"4",
"*",
"data",
"length",
")",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"data",
"length",
";",
"x",
"+",
"+",
")",
"{",
"if",
"(",
"data",
"[",
"x",
"]",
"!",
"=",
"null",
")",
"{",
"buff",
"put",
"(",
"data",
"[",
"x",
"]",
"get",
"red",
"(",
")",
")",
"put",
"(",
"data",
"[",
"x",
"]",
"get",
"green",
"(",
")",
")",
"put",
"(",
"data",
"[",
"x",
"]",
"get",
"blue",
"(",
")",
")",
"put",
"(",
"data",
"[",
"x",
"]",
"get",
"alpha",
"(",
")",
")",
";",
"}",
"else",
"{",
"buff",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
";",
"}",
"}",
"buff",
"flip",
"(",
")",
";",
"return",
"buff",
";"
]
|
[
"generate",
"a",
"new",
"float",
"buffer",
"using",
"the",
"given",
"array",
"of",
"float",
"primitives"
]
| [
"if",
"(",
"data",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"float",
"buffer",
"buff",
"=",
"create",
"float",
"buffer",
"(",
"data",
"length",
")",
";",
"buff",
"clear",
"(",
")",
";",
"buff",
"put",
"(",
"data",
")",
";",
"buff",
"flip",
"(",
")",
";",
"return",
"buff",
";"
]
|
[
"create",
"a",
"new",
"float",
"buffer",
"of",
"an",
"appropriate",
"size",
"to",
"hold",
"the",
"specified",
"number",
"of",
"vector",
"3f",
"object",
"data"
]
| [
"float",
"buffer",
"v",
"buff",
"=",
"create",
"float",
"buffer",
"(",
"3",
"*",
"vertices",
")",
";",
"return",
"v",
"buff",
";"
]
|
[
"create",
"a",
"new",
"float",
"buffer",
"of",
"an",
"appropriate",
"size",
"to",
"hold",
"the",
"specified",
"number",
"of",
"vector",
"3f",
"object",
"data",
"only",
"if",
"the",
"given",
"buffer",
"if",
"not",
"already",
"the",
"right",
"size"
]
| [
"if",
"(",
"buf",
"!",
"=",
"null",
"&",
"&",
"buf",
"limit",
"(",
")",
"=",
"=",
"3",
"*",
"vertices",
")",
"{",
"buf",
"rewind",
"(",
")",
";",
"return",
"buf",
";",
"}",
"return",
"create",
"float",
"buffer",
"(",
"3",
"*",
"vertices",
")",
";"
]
|
[
"sets",
"the",
"data",
"contained",
"in",
"the",
"given",
"color",
"into",
"the",
"float",
"buffer",
"at",
"the",
"specified",
"index"
]
| [
"buf",
"position",
"(",
"index",
"*",
"4",
")",
";",
"buf",
"put",
"(",
"color",
"r",
")",
";",
"buf",
"put",
"(",
"color",
"g",
")",
";",
"buf",
"put",
"(",
"color",
"b",
")",
";",
"buf",
"put",
"(",
"color",
"a",
")",
";"
]
|
[
"sets",
"the",
"data",
"contained",
"in",
"the",
"given",
"quaternion",
"into",
"the",
"float",
"buffer",
"at",
"the",
"specified",
"index"
]
| [
"buf",
"position",
"(",
"index",
"*",
"4",
")",
";",
"buf",
"put",
"(",
"quat",
"get",
"x",
"(",
")",
")",
";",
"buf",
"put",
"(",
"quat",
"get",
"y",
"(",
")",
")",
";",
"buf",
"put",
"(",
"quat",
"get",
"z",
"(",
")",
")",
";",
"buf",
"put",
"(",
"quat",
"get",
"w",
"(",
")",
")",
";"
]
|
[
"sets",
"the",
"data",
"contained",
"in",
"the",
"given",
"vector",
"4",
"into",
"the",
"float",
"buffer",
"at",
"the",
"specified",
"index"
]
| [
"buf",
"position",
"(",
"index",
"*",
"4",
")",
";",
"buf",
"put",
"(",
"vec",
"get",
"x",
"(",
")",
")",
";",
"buf",
"put",
"(",
"vec",
"get",
"y",
"(",
")",
")",
";",
"buf",
"put",
"(",
"vec",
"get",
"z",
"(",
")",
")",
";",
"buf",
"put",
"(",
"vec",
"get",
"w",
"(",
")",
")",
";"
]
|
[
"sets",
"the",
"data",
"contained",
"in",
"the",
"given",
"vector",
"3",
"f",
"into",
"the",
"float",
"buffer",
"at",
"the",
"specified",
"index"
]
| [
"if",
"(",
"buf",
"=",
"=",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"vector",
"=",
"=",
"null",
")",
"{",
"buf",
"put",
"(",
"index",
"*",
"3",
",",
"0",
")",
";",
"buf",
"put",
"(",
"(",
"index",
"*",
"3",
")",
"+",
"1",
",",
"0",
")",
";",
"buf",
"put",
"(",
"(",
"index",
"*",
"3",
")",
"+",
"2",
",",
"0",
")",
";",
"}",
"else",
"{",
"buf",
"put",
"(",
"index",
"*",
"3",
",",
"vector",
"x",
")",
";",
"buf",
"put",
"(",
"(",
"index",
"*",
"3",
")",
"+",
"1",
",",
"vector",
"y",
")",
";",
"buf",
"put",
"(",
"(",
"index",
"*",
"3",
")",
"+",
"2",
",",
"vector",
"z",
")",
";",
"}"
]
|
[
"updates",
"the",
"values",
"of",
"the",
"given",
"vector",
"from",
"the",
"specified",
"buffer",
"at",
"the",
"index",
"provided"
]
| [
"vector",
"x",
"=",
"buf",
"get",
"(",
"index",
"*",
"3",
")",
";",
"vector",
"y",
"=",
"buf",
"get",
"(",
"index",
"*",
"3",
"+",
"1",
")",
";",
"vector",
"z",
"=",
"buf",
"get",
"(",
"index",
"*",
"3",
"+",
"2",
")",
";"
]
|
[
"updates",
"the",
"values",
"of",
"the",
"given",
"vector",
"from",
"the",
"specified",
"buffer",
"at",
"the",
"index",
"provided"
]
| [
"vector",
"x",
"=",
"buf",
"get",
"(",
"index",
"*",
"4",
")",
";",
"vector",
"y",
"=",
"buf",
"get",
"(",
"index",
"*",
"4",
"+",
"1",
")",
";",
"vector",
"z",
"=",
"buf",
"get",
"(",
"index",
"*",
"4",
"+",
"2",
")",
";",
"vector",
"w",
"=",
"buf",
"get",
"(",
"index",
"*",
"4",
"+",
"3",
")",
";"
]
|
[
"generates",
"a",
"vector",
"3f",
"array",
"from",
"the",
"given",
"float",
"buffer"
]
| [
"buff",
"clear",
"(",
")",
";",
"vector",
"3f",
"[",
"]",
"verts",
"=",
"new",
"vector",
"3f",
"[",
"buff",
"limit",
"(",
")",
"/",
"3",
"]",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"verts",
"length",
";",
"x",
"+",
"+",
")",
"{",
"vector",
"3f",
"v",
"=",
"new",
"vector",
"3f",
"(",
"buff",
"get",
"(",
")",
",",
"buff",
"get",
"(",
")",
",",
"buff",
"get",
"(",
")",
")",
";",
"verts",
"[",
"x",
"]",
"=",
"v",
";",
"}",
"return",
"verts",
";"
]
|
[
"copies",
"a",
"vector",
"3f",
"from",
"one",
"position",
"in",
"the",
"buffer",
"to",
"another",
"the",
"index",
"values",
"are",
"in",
"terms",
"of",
"vector",
"number",
"(",
"eg",
"vector",
"number",
"0",
"is",
"positions",
"0",
"-",
"2",
"in",
"the",
"float",
"buffer",
")"
]
| [
"copy",
"internal",
"(",
"buf",
",",
"from",
"pos",
"*",
"3",
",",
"to",
"pos",
"*",
"3",
",",
"3",
")",
";"
]
|
[
"normalize",
"a",
"vector",
"3f",
"in",
"-",
"buffer"
]
| [
"temp",
"vars",
"vars",
"=",
"temp",
"vars",
"get",
"(",
")",
";",
"vector",
"3f",
"temp",
"vec",
"3",
"=",
"vars",
"vect",
"1",
";",
"populate",
"from",
"buffer",
"(",
"temp",
"vec",
"3",
",",
"buf",
",",
"index",
")",
";",
"temp",
"vec",
"3",
"normalize",
"local",
"(",
")",
";",
"set",
"in",
"buffer",
"(",
"temp",
"vec",
"3",
",",
"buf",
",",
"index",
")",
";",
"vars",
"release",
"(",
")",
";"
]
|
[
"add",
"to",
"a",
"vector",
"3f",
"in",
"-",
"buffer"
]
| [
"temp",
"vars",
"vars",
"=",
"temp",
"vars",
"get",
"(",
")",
";",
"vector",
"3f",
"temp",
"vec",
"3",
"=",
"vars",
"vect",
"1",
";",
"populate",
"from",
"buffer",
"(",
"temp",
"vec",
"3",
",",
"buf",
",",
"index",
")",
";",
"temp",
"vec",
"3",
"add",
"local",
"(",
"to",
"add",
")",
";",
"set",
"in",
"buffer",
"(",
"temp",
"vec",
"3",
",",
"buf",
",",
"index",
")",
";",
"vars",
"release",
"(",
")",
";"
]
|
[
"multiply",
"and",
"store",
"a",
"vector",
"3f",
"in",
"-",
"buffer"
]
| [
"temp",
"vars",
"vars",
"=",
"temp",
"vars",
"get",
"(",
")",
";",
"vector",
"3f",
"temp",
"vec",
"3",
"=",
"vars",
"vect",
"1",
";",
"populate",
"from",
"buffer",
"(",
"temp",
"vec",
"3",
",",
"buf",
",",
"index",
")",
";",
"temp",
"vec",
"3",
"mult",
"local",
"(",
"to",
"mult",
")",
";",
"set",
"in",
"buffer",
"(",
"temp",
"vec",
"3",
",",
"buf",
",",
"index",
")",
";",
"vars",
"release",
"(",
")",
";"
]
|
[
"checks",
"to",
"see",
"if",
"the",
"given",
"vector",
"3f",
"is",
"equals",
"to",
"the",
"data",
"stored",
"in",
"the",
"buffer",
"at",
"the",
"given",
"data",
"index"
]
| [
"temp",
"vars",
"vars",
"=",
"temp",
"vars",
"get",
"(",
")",
";",
"vector",
"3f",
"temp",
"vec",
"3",
"=",
"vars",
"vect",
"1",
";",
"populate",
"from",
"buffer",
"(",
"temp",
"vec",
"3",
",",
"buf",
",",
"index",
")",
";",
"boolean",
"eq",
"=",
"temp",
"vec",
"3",
"equals",
"(",
"check",
")",
";",
"vars",
"release",
"(",
")",
";",
"return",
"eq",
";"
]
|
[
"generate",
"a",
"new",
"float",
"buffer",
"using",
"the",
"given",
"array",
"of",
"vector",
"2f",
"objects",
"the",
"float",
"buffer",
"will",
"be",
"2",
"*",
"data",
"length",
"long",
"and",
"contain",
"the",
"vector",
"data",
"as",
"data",
"[",
"0",
"]",
"x",
"data",
"[",
"0",
"]",
"y",
"data",
"[",
"1",
"]",
"x",
"etc"
]
| [
"if",
"(",
"data",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"float",
"buffer",
"buff",
"=",
"create",
"float",
"buffer",
"(",
"2",
"*",
"data",
"length",
")",
";",
"for",
"(",
"vector",
"2f",
"element",
":",
"data",
")",
"{",
"if",
"(",
"element",
"!",
"=",
"null",
")",
"{",
"buff",
"put",
"(",
"element",
"x",
")",
"put",
"(",
"element",
"y",
")",
";",
"}",
"else",
"{",
"buff",
"put",
"(",
"0",
")",
"put",
"(",
"0",
")",
";",
"}",
"}",
"buff",
"flip",
"(",
")",
";",
"return",
"buff",
";"
]
|
[
"create",
"a",
"new",
"float",
"buffer",
"of",
"an",
"appropriate",
"size",
"to",
"hold",
"the",
"specified",
"number",
"of",
"vector",
"2f",
"object",
"data"
]
| [
"float",
"buffer",
"v",
"buff",
"=",
"create",
"float",
"buffer",
"(",
"2",
"*",
"vertices",
")",
";",
"return",
"v",
"buff",
";"
]
|
[
"create",
"a",
"new",
"float",
"buffer",
"of",
"an",
"appropriate",
"size",
"to",
"hold",
"the",
"specified",
"number",
"of",
"vector",
"2f",
"object",
"data",
"only",
"if",
"the",
"given",
"buffer",
"if",
"not",
"already",
"the",
"right",
"size"
]
| [
"if",
"(",
"buf",
"!",
"=",
"null",
"&",
"&",
"buf",
"limit",
"(",
")",
"=",
"=",
"2",
"*",
"vertices",
")",
"{",
"buf",
"rewind",
"(",
")",
";",
"return",
"buf",
";",
"}",
"return",
"create",
"float",
"buffer",
"(",
"2",
"*",
"vertices",
")",
";"
]
|
[
"sets",
"the",
"data",
"contained",
"in",
"the",
"given",
"vector",
"2",
"f",
"into",
"the",
"float",
"buffer",
"at",
"the",
"specified",
"index"
]
| [
"buf",
"put",
"(",
"index",
"*",
"2",
",",
"vector",
"x",
")",
";",
"buf",
"put",
"(",
"(",
"index",
"*",
"2",
")",
"+",
"1",
",",
"vector",
"y",
")",
";"
]
|
[
"updates",
"the",
"values",
"of",
"the",
"given",
"vector",
"from",
"the",
"specified",
"buffer",
"at",
"the",
"index",
"provided"
]
| [
"vector",
"x",
"=",
"buf",
"get",
"(",
"index",
"*",
"2",
")",
";",
"vector",
"y",
"=",
"buf",
"get",
"(",
"index",
"*",
"2",
"+",
"1",
")",
";"
]
|
[
"generates",
"a",
"vector",
"2f",
"array",
"from",
"the",
"given",
"float",
"buffer"
]
| [
"buff",
"clear",
"(",
")",
";",
"vector",
"2f",
"[",
"]",
"verts",
"=",
"new",
"vector",
"2f",
"[",
"buff",
"limit",
"(",
")",
"/",
"2",
"]",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"verts",
"length",
";",
"x",
"+",
"+",
")",
"{",
"vector",
"2f",
"v",
"=",
"new",
"vector",
"2f",
"(",
"buff",
"get",
"(",
")",
",",
"buff",
"get",
"(",
")",
")",
";",
"verts",
"[",
"x",
"]",
"=",
"v",
";",
"}",
"return",
"verts",
";"
]
|
[
"copies",
"a",
"vector",
"2f",
"from",
"one",
"position",
"in",
"the",
"buffer",
"to",
"another",
"the",
"index",
"values",
"are",
"in",
"terms",
"of",
"vector",
"number",
"(",
"eg",
"vector",
"number",
"0",
"is",
"positions",
"0",
"-",
"1",
"in",
"the",
"float",
"buffer",
")"
]
| [
"copy",
"internal",
"(",
"buf",
",",
"from",
"pos",
"*",
"2",
",",
"to",
"pos",
"*",
"2",
",",
"2",
")",
";"
]
|
[
"normalize",
"a",
"vector",
"2f",
"in",
"-",
"buffer"
]
| [
"temp",
"vars",
"vars",
"=",
"temp",
"vars",
"get",
"(",
")",
";",
"vector",
"2f",
"temp",
"vec",
"2",
"=",
"vars",
"vect",
"2d",
";",
"populate",
"from",
"buffer",
"(",
"temp",
"vec",
"2",
",",
"buf",
",",
"index",
")",
";",
"temp",
"vec",
"2",
"normalize",
"local",
"(",
")",
";",
"set",
"in",
"buffer",
"(",
"temp",
"vec",
"2",
",",
"buf",
",",
"index",
")",
";",
"vars",
"release",
"(",
")",
";"
]
|
[
"add",
"to",
"a",
"vector",
"2f",
"in",
"-",
"buffer"
]
| [
"temp",
"vars",
"vars",
"=",
"temp",
"vars",
"get",
"(",
")",
";",
"vector",
"2f",
"temp",
"vec",
"2",
"=",
"vars",
"vect",
"2d",
";",
"populate",
"from",
"buffer",
"(",
"temp",
"vec",
"2",
",",
"buf",
",",
"index",
")",
";",
"temp",
"vec",
"2",
"add",
"local",
"(",
"to",
"add",
")",
";",
"set",
"in",
"buffer",
"(",
"temp",
"vec",
"2",
",",
"buf",
",",
"index",
")",
";",
"vars",
"release",
"(",
")",
";"
]
|
[
"multiply",
"and",
"store",
"a",
"vector",
"2f",
"in",
"-",
"buffer"
]
| [
"temp",
"vars",
"vars",
"=",
"temp",
"vars",
"get",
"(",
")",
";",
"vector",
"2f",
"temp",
"vec",
"2",
"=",
"vars",
"vect",
"2d",
";",
"populate",
"from",
"buffer",
"(",
"temp",
"vec",
"2",
",",
"buf",
",",
"index",
")",
";",
"temp",
"vec",
"2",
"mult",
"local",
"(",
"to",
"mult",
")",
";",
"set",
"in",
"buffer",
"(",
"temp",
"vec",
"2",
",",
"buf",
",",
"index",
")",
";",
"vars",
"release",
"(",
")",
";"
]
|
[
"checks",
"to",
"see",
"if",
"the",
"given",
"vector",
"2f",
"is",
"equals",
"to",
"the",
"data",
"stored",
"in",
"the",
"buffer",
"at",
"the",
"given",
"data",
"index"
]
| [
"temp",
"vars",
"vars",
"=",
"temp",
"vars",
"get",
"(",
")",
";",
"vector",
"2f",
"temp",
"vec",
"2",
"=",
"vars",
"vect",
"2d",
";",
"populate",
"from",
"buffer",
"(",
"temp",
"vec",
"2",
",",
"buf",
",",
"index",
")",
";",
"boolean",
"eq",
"=",
"temp",
"vec",
"2",
"equals",
"(",
"check",
")",
";",
"vars",
"release",
"(",
")",
";",
"return",
"eq",
";"
]
|
[
"generate",
"a",
"new",
"int",
"buffer",
"using",
"the",
"given",
"array",
"of",
"ints",
"the",
"int",
"buffer",
"will",
"be",
"data",
"length",
"long",
"and",
"contain",
"the",
"int",
"data",
"as",
"data",
"[",
"0",
"]",
"data",
"[",
"1",
"]",
"etc"
]
| [
"if",
"(",
"data",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"buffer",
"buff",
"=",
"create",
"int",
"buffer",
"(",
"data",
"length",
")",
";",
"buff",
"clear",
"(",
")",
";",
"buff",
"put",
"(",
"data",
")",
";",
"buff",
"flip",
"(",
")",
";",
"return",
"buff",
";"
]
|
[
"create",
"a",
"new",
"int",
"[",
"]",
"array",
"and",
"populate",
"it",
"with",
"the",
"given",
"int",
"buffer",
"s",
"contents"
]
| [
"if",
"(",
"buff",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"buff",
"clear",
"(",
")",
";",
"int",
"[",
"]",
"inds",
"=",
"new",
"int",
"[",
"buff",
"limit",
"(",
")",
"]",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"inds",
"length",
";",
"x",
"+",
"+",
")",
"{",
"inds",
"[",
"x",
"]",
"=",
"buff",
"get",
"(",
")",
";",
"}",
"return",
"inds",
";"
]
|
[
"create",
"a",
"new",
"float",
"[",
"]",
"array",
"and",
"populate",
"it",
"with",
"the",
"given",
"float",
"buffer",
"s",
"contents"
]
| [
"if",
"(",
"buff",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"buff",
"clear",
"(",
")",
";",
"float",
"[",
"]",
"inds",
"=",
"new",
"float",
"[",
"buff",
"limit",
"(",
")",
"]",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"inds",
"length",
";",
"x",
"+",
"+",
")",
"{",
"inds",
"[",
"x",
"]",
"=",
"buff",
"get",
"(",
")",
";",
"}",
"return",
"inds",
";"
]
|
[
"create",
"a",
"new",
"double",
"buffer",
"of",
"the",
"specified",
"size"
]
| [
"double",
"buffer",
"buf",
"=",
"allocator",
"allocate",
"(",
"8",
"*",
"size",
")",
"order",
"(",
"byte",
"order",
"native",
"order",
"(",
")",
")",
"as",
"double",
"buffer",
"(",
")",
";",
"buf",
"clear",
"(",
")",
";",
"on",
"buffer",
"allocated",
"(",
"buf",
")",
";",
"return",
"buf",
";"
]
|
[
"create",
"a",
"new",
"double",
"buffer",
"of",
"an",
"appropriate",
"size",
"to",
"hold",
"the",
"specified",
"number",
"of",
"doubles",
"only",
"if",
"the",
"given",
"buffer",
"if",
"not",
"already",
"the",
"right",
"size"
]
| [
"if",
"(",
"buf",
"!",
"=",
"null",
"&",
"&",
"buf",
"limit",
"(",
")",
"=",
"=",
"size",
")",
"{",
"buf",
"rewind",
"(",
")",
";",
"return",
"buf",
";",
"}",
"buf",
"=",
"create",
"double",
"buffer",
"(",
"size",
")",
";",
"return",
"buf",
";"
]
|
[
"creates",
"a",
"new",
"double",
"buffer",
"with",
"the",
"same",
"contents",
"as",
"the",
"given",
"double",
"buffer",
"the",
"new",
"double",
"buffer",
"is",
"separate",
"from",
"the",
"old",
"one",
"and",
"changes",
"are",
"not",
"reflected",
"across",
"if",
"you",
"want",
"to",
"reflect",
"changes",
"consider",
"using",
"buffer",
"duplicate",
"(",
")"
]
| [
"if",
"(",
"buf",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"buf",
"rewind",
"(",
")",
";",
"double",
"buffer",
"copy",
";",
"if",
"(",
"is",
"direct",
"(",
"buf",
")",
")",
"{",
"copy",
"=",
"create",
"double",
"buffer",
"(",
"buf",
"limit",
"(",
")",
")",
";",
"}",
"else",
"{",
"copy",
"=",
"double",
"buffer",
"allocate",
"(",
"buf",
"limit",
"(",
")",
")",
";",
"}",
"copy",
"put",
"(",
"buf",
")",
";",
"return",
"copy",
";"
]
|
[
"create",
"a",
"new",
"float",
"buffer",
"of",
"the",
"specified",
"size"
]
| [
"float",
"buffer",
"buf",
"=",
"allocator",
"allocate",
"(",
"4",
"*",
"size",
")",
"order",
"(",
"byte",
"order",
"native",
"order",
"(",
")",
")",
"as",
"float",
"buffer",
"(",
")",
";",
"buf",
"clear",
"(",
")",
";",
"on",
"buffer",
"allocated",
"(",
"buf",
")",
";",
"return",
"buf",
";"
]
|
[
"copies",
"floats",
"from",
"one",
"position",
"in",
"the",
"buffer",
"to",
"another"
]
| [
"float",
"[",
"]",
"data",
"=",
"new",
"float",
"[",
"length",
"]",
";",
"buf",
"position",
"(",
"from",
"pos",
")",
";",
"buf",
"get",
"(",
"data",
")",
";",
"buf",
"position",
"(",
"to",
"pos",
")",
";",
"buf",
"put",
"(",
"data",
")",
";"
]
|
[
"creates",
"a",
"new",
"float",
"buffer",
"with",
"the",
"same",
"contents",
"as",
"the",
"given",
"float",
"buffer",
"the",
"new",
"float",
"buffer",
"is",
"separate",
"from",
"the",
"old",
"one",
"and",
"changes",
"are",
"not",
"reflected",
"across",
"if",
"you",
"want",
"to",
"reflect",
"changes",
"consider",
"using",
"buffer",
"duplicate",
"(",
")"
]
| [
"if",
"(",
"buf",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"buf",
"rewind",
"(",
")",
";",
"float",
"buffer",
"copy",
";",
"if",
"(",
"is",
"direct",
"(",
"buf",
")",
")",
"{",
"copy",
"=",
"create",
"float",
"buffer",
"(",
"buf",
"limit",
"(",
")",
")",
";",
"}",
"else",
"{",
"copy",
"=",
"float",
"buffer",
"allocate",
"(",
"buf",
"limit",
"(",
")",
")",
";",
"}",
"copy",
"put",
"(",
"buf",
")",
";",
"return",
"copy",
";"
]
|
[
"create",
"a",
"new",
"int",
"buffer",
"of",
"the",
"specified",
"size"
]
| [
"int",
"buffer",
"buf",
"=",
"allocator",
"allocate",
"(",
"4",
"*",
"size",
")",
"order",
"(",
"byte",
"order",
"native",
"order",
"(",
")",
")",
"as",
"int",
"buffer",
"(",
")",
";",
"buf",
"clear",
"(",
")",
";",
"on",
"buffer",
"allocated",
"(",
"buf",
")",
";",
"return",
"buf",
";"
]
|
[
"create",
"a",
"new",
"int",
"buffer",
"of",
"an",
"appropriate",
"size",
"to",
"hold",
"the",
"specified",
"number",
"of",
"ints",
"only",
"if",
"the",
"given",
"buffer",
"if",
"not",
"already",
"the",
"right",
"size"
]
| [
"if",
"(",
"buf",
"!",
"=",
"null",
"&",
"&",
"buf",
"limit",
"(",
")",
"=",
"=",
"size",
")",
"{",
"buf",
"rewind",
"(",
")",
";",
"return",
"buf",
";",
"}",
"buf",
"=",
"create",
"int",
"buffer",
"(",
"size",
")",
";",
"return",
"buf",
";"
]
|
[
"creates",
"a",
"new",
"int",
"buffer",
"with",
"the",
"same",
"contents",
"as",
"the",
"given",
"int",
"buffer",
"the",
"new",
"int",
"buffer",
"is",
"separate",
"from",
"the",
"old",
"one",
"and",
"changes",
"are",
"not",
"reflected",
"across",
"if",
"you",
"want",
"to",
"reflect",
"changes",
"consider",
"using",
"buffer",
"duplicate",
"(",
")"
]
| [
"if",
"(",
"buf",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"buf",
"rewind",
"(",
")",
";",
"int",
"buffer",
"copy",
";",
"if",
"(",
"is",
"direct",
"(",
"buf",
")",
")",
"{",
"copy",
"=",
"create",
"int",
"buffer",
"(",
"buf",
"limit",
"(",
")",
")",
";",
"}",
"else",
"{",
"copy",
"=",
"int",
"buffer",
"allocate",
"(",
"buf",
"limit",
"(",
")",
")",
";",
"}",
"copy",
"put",
"(",
"buf",
")",
";",
"return",
"copy",
";"
]
|
[
"create",
"a",
"new",
"byte",
"buffer",
"of",
"the",
"specified",
"size"
]
| [
"byte",
"buffer",
"buf",
"=",
"allocator",
"allocate",
"(",
"size",
")",
"order",
"(",
"byte",
"order",
"native",
"order",
"(",
")",
")",
";",
"buf",
"clear",
"(",
")",
";",
"on",
"buffer",
"allocated",
"(",
"buf",
")",
";",
"return",
"buf",
";"
]
|
[
"create",
"a",
"new",
"byte",
"buffer",
"of",
"an",
"appropriate",
"size",
"to",
"hold",
"the",
"specified",
"number",
"of",
"ints",
"only",
"if",
"the",
"given",
"buffer",
"if",
"not",
"already",
"the",
"right",
"size"
]
| [
"if",
"(",
"buf",
"!",
"=",
"null",
"&",
"&",
"buf",
"limit",
"(",
")",
"=",
"=",
"size",
")",
"{",
"buf",
"rewind",
"(",
")",
";",
"return",
"buf",
";",
"}",
"buf",
"=",
"create",
"byte",
"buffer",
"(",
"size",
")",
";",
"return",
"buf",
";"
]
|
[
"creates",
"a",
"new",
"byte",
"buffer",
"with",
"the",
"same",
"contents",
"as",
"the",
"given",
"byte",
"buffer",
"the",
"new",
"byte",
"buffer",
"is",
"separate",
"from",
"the",
"old",
"one",
"and",
"changes",
"are",
"not",
"reflected",
"across",
"if",
"you",
"want",
"to",
"reflect",
"changes",
"consider",
"using",
"buffer",
"duplicate",
"(",
")"
]
| [
"if",
"(",
"buf",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"buf",
"rewind",
"(",
")",
";",
"byte",
"buffer",
"copy",
";",
"if",
"(",
"is",
"direct",
"(",
"buf",
")",
")",
"{",
"copy",
"=",
"create",
"byte",
"buffer",
"(",
"buf",
"limit",
"(",
")",
")",
";",
"}",
"else",
"{",
"copy",
"=",
"byte",
"buffer",
"allocate",
"(",
"buf",
"limit",
"(",
")",
")",
";",
"}",
"copy",
"put",
"(",
"buf",
")",
";",
"return",
"copy",
";"
]
|
[
"create",
"a",
"new",
"short",
"buffer",
"of",
"the",
"specified",
"size"
]
| [
"short",
"buffer",
"buf",
"=",
"allocator",
"allocate",
"(",
"2",
"*",
"size",
")",
"order",
"(",
"byte",
"order",
"native",
"order",
"(",
")",
")",
"as",
"short",
"buffer",
"(",
")",
";",
"buf",
"clear",
"(",
")",
";",
"on",
"buffer",
"allocated",
"(",
"buf",
")",
";",
"return",
"buf",
";"
]
|
[
"create",
"a",
"new",
"short",
"buffer",
"of",
"an",
"appropriate",
"size",
"to",
"hold",
"the",
"specified",
"number",
"of",
"shorts",
"only",
"if",
"the",
"given",
"buffer",
"if",
"not",
"already",
"the",
"right",
"size"
]
| [
"if",
"(",
"buf",
"!",
"=",
"null",
"&",
"&",
"buf",
"limit",
"(",
")",
"=",
"=",
"size",
")",
"{",
"buf",
"rewind",
"(",
")",
";",
"return",
"buf",
";",
"}",
"buf",
"=",
"create",
"short",
"buffer",
"(",
"size",
")",
";",
"return",
"buf",
";"
]
|
[
"creates",
"a",
"new",
"short",
"buffer",
"with",
"the",
"same",
"contents",
"as",
"the",
"given",
"short",
"buffer",
"the",
"new",
"short",
"buffer",
"is",
"separate",
"from",
"the",
"old",
"one",
"and",
"changes",
"are",
"not",
"reflected",
"across",
"if",
"you",
"want",
"to",
"reflect",
"changes",
"consider",
"using",
"buffer",
"duplicate",
"(",
")"
]
| [
"if",
"(",
"buf",
"=",
"=",
"null",
")",
"{",
"return",
"null",
";",
"}",
"buf",
"rewind",
"(",
")",
";",
"short",
"buffer",
"copy",
";",
"if",
"(",
"is",
"direct",
"(",
"buf",
")",
")",
"{",
"copy",
"=",
"create",
"short",
"buffer",
"(",
"buf",
"limit",
"(",
")",
")",
";",
"}",
"else",
"{",
"copy",
"=",
"short",
"buffer",
"allocate",
"(",
"buf",
"limit",
"(",
")",
")",
";",
"}",
"copy",
"put",
"(",
"buf",
")",
";",
"return",
"copy",
";"
]
|
[
"ensures",
"there",
"is",
"at",
"least",
"the",
"<",
"code",
">",
"required",
"<",
"/",
"code",
">",
"number",
"of",
"entries",
"left",
"after",
"the",
"current",
"position",
"of",
"the",
"buffer",
"if",
"the",
"buffer",
"is",
"too",
"small",
"a",
"larger",
"one",
"is",
"created",
"and",
"the",
"old",
"one",
"copied",
"to",
"the",
"new",
"buffer"
]
| [
"if",
"(",
"buffer",
"!",
"=",
"null",
")",
"{",
"buffer",
"limit",
"(",
"buffer",
"capacity",
"(",
")",
")",
";",
"}",
"if",
"(",
"buffer",
"=",
"=",
"null",
"|",
"|",
"(",
"buffer",
"remaining",
"(",
")",
"<",
"required",
")",
")",
"{",
"int",
"position",
"=",
"(",
"buffer",
"!",
"=",
"null",
"?",
"buffer",
"position",
"(",
")",
":",
"0",
")",
";",
"float",
"buffer",
"new",
"verts",
"=",
"create",
"float",
"buffer",
"(",
"position",
"+",
"required",
")",
";",
"if",
"(",
"buffer",
"!",
"=",
"null",
")",
"{",
"buffer",
"flip",
"(",
")",
";",
"new",
"verts",
"put",
"(",
"buffer",
")",
";",
"new",
"verts",
"position",
"(",
"position",
")",
";",
"}",
"buffer",
"=",
"new",
"verts",
";",
"}",
"return",
"buffer",
";"
]
|
[
"direct",
"buffers",
"are",
"garbage",
"collected",
"by",
"using",
"a",
"phantom",
"reference",
"and",
"a",
"reference",
"queue",
"every",
"once",
"a",
"while",
"the",
"jvm",
"checks",
"the",
"reference",
"queue",
"and",
"cleans",
"the",
"direct",
"buffers",
"however",
"as",
"this",
"doesn",
"t",
"happen",
"immediately",
"after",
"discarding",
"all",
"references",
"to",
"a",
"direct",
"buffer",
"it",
"s",
"easy",
"to",
"out",
"of",
"memory",
"error",
"yourself",
"using",
"direct",
"buffers"
]
| [
"if",
"(",
"!",
"is",
"direct",
"(",
"to",
"be",
"destroyed",
")",
")",
"{",
"return",
";",
"}",
"allocator",
"destroy",
"direct",
"buffer",
"(",
"to",
"be",
"destroyed",
")",
";"
]
|
[
"acquires",
"a",
"cached",
"instance",
"of",
"{",
"@",
"link",
"string",
"builder",
"}",
"if",
"current",
"thread",
"is",
"not",
"using",
"it",
"yet",
"otherwise",
"a",
"new",
"instance",
"of",
"string",
"builder",
"is",
"returned"
]
| [
"return",
"builders",
"get",
"(",
")",
"acquire",
"(",
")",
";"
]
|
[
"releases",
"{",
"@",
"link",
"string",
"builder",
"}",
"back",
"to",
"cache"
]
| [
"builders",
"get",
"(",
")",
"release",
"(",
"builder",
")",
";"
]
|
[
"{"
]
| [
"try",
"{",
"thread",
"state",
"bind",
"(",
")",
";",
"do",
"run",
"(",
"this",
"runnable",
")",
";",
"}",
"finally",
"{",
"thread",
"state",
"restore",
"(",
")",
";",
"}"
]
|
[
"simply",
"calls",
"the",
"target",
"{",
"@",
"link",
"runnable",
"runnable",
"}",
"s",
"{",
"@",
"link",
"runnable",
"#",
"run",
"run",
"(",
")",
"}",
"method"
]
| [
"runnable",
"run",
"(",
")",
";"
]
|
[
"rechecks",
"if",
"lock",
"should",
"be",
"reassigned"
]
| [
"cache",
"object",
"val",
";",
"cache",
"lock",
"candidates",
"prev",
"=",
"null",
";",
"cache",
"lock",
"candidates",
"owner",
"=",
"null",
";",
"lock",
"entry",
"(",
")",
";",
"try",
"{",
"grid",
"cache",
"mvcc",
"mvcc",
"=",
"mvcc",
"extras",
"(",
")",
";",
"if",
"(",
"mvcc",
"!",
"=",
"null",
")",
"{",
"prev",
"=",
"mvcc",
"all",
"owners",
"(",
")",
";",
"owner",
"=",
"mvcc",
"recheck",
"(",
")",
";",
"if",
"(",
"mvcc",
"is",
"empty",
"(",
")",
")",
"mvcc",
"extras",
"(",
"null",
")",
";",
"}",
"val",
"=",
"this",
"val",
";",
"}",
"finally",
"{",
"unlock",
"entry",
"(",
")",
";",
"}",
"check",
"owner",
"changed",
"(",
"prev",
",",
"owner",
",",
"val",
")",
";"
]
|
[
"unlocks",
"lock",
"if",
"it",
"is",
"currently",
"owned"
]
| [
"remove",
"lock",
"(",
"tx",
"xid",
"version",
"(",
")",
")",
";"
]
|
[
"releases",
"local",
"lock"
]
| [
"release",
"local",
"(",
"thread",
"current",
"thread",
"(",
")",
"get",
"id",
"(",
")",
")",
";"
]
|
[
"releases",
"local",
"lock"
]
| [
"cache",
"object",
"val",
";",
"cache",
"lock",
"candidates",
"prev",
"=",
"null",
";",
"cache",
"lock",
"candidates",
"owner",
"=",
"null",
";",
"lock",
"entry",
"(",
")",
";",
"try",
"{",
"grid",
"cache",
"mvcc",
"mvcc",
"=",
"mvcc",
"extras",
"(",
")",
";",
"if",
"(",
"mvcc",
"!",
"=",
"null",
")",
"{",
"prev",
"=",
"mvcc",
"local",
"owners",
"(",
")",
";",
"mvcc",
"release",
"local",
"(",
"thread",
"id",
")",
";",
"if",
"(",
"mvcc",
"is",
"empty",
"(",
")",
")",
"mvcc",
"extras",
"(",
"null",
")",
";",
"else",
"owner",
"=",
"mvcc",
"all",
"owners",
"(",
")",
";",
"}",
"val",
"=",
"this",
"val",
";",
"}",
"finally",
"{",
"unlock",
"entry",
"(",
")",
";",
"}",
"if",
"(",
"prev",
"!",
"=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"prev",
"size",
"(",
")",
";",
"i",
"+",
"+",
")",
"{",
"grid",
"cache",
"mvcc",
"candidate",
"cand",
"=",
"prev",
"candidate",
"(",
"i",
")",
";",
"boolean",
"unlocked",
"=",
"owner",
"=",
"=",
"null",
"|",
"|",
"!",
"owner",
"has",
"candidate",
"(",
"cand",
"version",
"(",
")",
")",
";",
"if",
"(",
"unlocked",
")",
"check",
"thread",
"chain",
"(",
"cand",
")",
";",
"}",
"}",
"check",
"owner",
"changed",
"(",
"prev",
",",
"owner",
",",
"val",
")",
";"
]
|
[
"{"
]
| [
"cache",
"object",
"val",
";",
"cache",
"lock",
"candidates",
"prev",
"=",
"null",
";",
"cache",
"lock",
"candidates",
"owner",
"=",
"null",
";",
"grid",
"cache",
"mvcc",
"candidate",
"doomed",
";",
"lock",
"entry",
"(",
")",
";",
"try",
"{",
"grid",
"cache",
"version",
"obsolete",
"ver",
"=",
"obsolete",
"version",
"extras",
"(",
")",
";",
"if",
"(",
"obsolete",
"ver",
"!",
"=",
"null",
"&",
"&",
"!",
"obsolete",
"ver",
"equals",
"(",
"ver",
")",
")",
"check",
"obsolete",
"(",
")",
";",
"grid",
"cache",
"mvcc",
"mvcc",
"=",
"mvcc",
"extras",
"(",
")",
";",
"doomed",
"=",
"mvcc",
"=",
"=",
"null",
"?",
"null",
":",
"mvcc",
"candidate",
"(",
"ver",
")",
";",
"if",
"(",
"doomed",
"!",
"=",
"null",
")",
"{",
"prev",
"=",
"mvcc",
"all",
"owners",
"(",
")",
";",
"mvcc",
"remove",
"(",
"ver",
")",
";",
"if",
"(",
"mvcc",
"is",
"empty",
"(",
")",
")",
"mvcc",
"extras",
"(",
"null",
")",
";",
"else",
"owner",
"=",
"mvcc",
"all",
"owners",
"(",
")",
";",
"}",
"val",
"=",
"this",
"val",
";",
"}",
"finally",
"{",
"unlock",
"entry",
"(",
")",
";",
"}",
"if",
"(",
"doomed",
"!",
"=",
"null",
")",
"check",
"thread",
"chain",
"(",
"doomed",
")",
";",
"check",
"owner",
"changed",
"(",
"prev",
",",
"owner",
",",
"val",
")",
";",
"return",
"doomed",
"!",
"=",
"null",
";"
]
|
[
"{"
]
| [
"lock",
"entry",
"(",
")",
";",
"try",
"{",
"return",
"s",
"to",
"string",
"(",
"grid",
"local",
"cache",
"entry",
"class",
",",
"this",
",",
"super",
"to",
"string",
"(",
")",
")",
";",
"}",
"finally",
"{",
"unlock",
"entry",
"(",
")",
";",
"}"
]
|
[
"returns",
"true",
"if",
"field",
"stats",
"desc",
"is",
"set",
"(",
"has",
"been",
"assigned",
"a",
"value",
")",
"and",
"false",
"otherwise"
]
| [
"return",
"this",
"stats",
"desc",
"!",
"=",
"null",
";"
]
|
[
"returns",
"true",
"if",
"field",
"stats",
"obj",
"is",
"set",
"(",
"has",
"been",
"assigned",
"a",
"value",
")",
"and",
"false",
"otherwise"
]
| [
"return",
"this",
"stats",
"obj",
"!",
"=",
"null",
";"
]
|
[
"returns",
"true",
"if",
"field",
"corresponding",
"to",
"field",
"i",
"d",
"is",
"set",
"(",
"has",
"been",
"assigned",
"a",
"value",
")",
"and",
"false",
"otherwise"
]
| [
"if",
"(",
"field",
"=",
"=",
"null",
")",
"{",
"throw",
"new",
"illegal",
"argument",
"exception",
"(",
")",
";",
"}",
"switch",
"(",
"field",
")",
"{",
"case",
"stats",
"desc",
":",
"return",
"is",
"set",
"stats",
"desc",
"(",
")",
";",
"case",
"stats",
"obj",
":",
"return",
"is",
"set",
"stats",
"obj",
"(",
")",
";",
"case",
"is",
"stats",
"compliant",
":",
"return",
"is",
"set",
"is",
"stats",
"compliant",
"(",
")",
";",
"}",
"throw",
"new",
"illegal",
"state",
"exception",
"(",
")",
";"
]
|
[
"calls",
"adapter",
"s",
"notify",
"*",
"methods",
"when",
"items",
"are",
"added",
"/",
"removed",
"/",
"moved",
"/",
"updated"
]
| [
"diff",
"util",
"calculate",
"diff",
"(",
"new",
"diff",
"util",
"callback",
"(",
")",
"{",
"@",
"override",
"public",
"int",
"get",
"old",
"list",
"size",
"(",
")",
"{",
"return",
"old",
"list",
"=",
"=",
"null",
"?",
"0",
":",
"old",
"list",
"size",
"(",
")",
";",
"}",
"@",
"override",
"public",
"int",
"get",
"new",
"list",
"size",
"(",
")",
"{",
"return",
"new",
"list",
"=",
"=",
"null",
"?",
"0",
":",
"new",
"list",
"size",
"(",
")",
";",
"}",
"@",
"override",
"public",
"boolean",
"are",
"items",
"the",
"same",
"(",
"int",
"old",
"item",
"position",
",",
"int",
"new",
"item",
"position",
")",
"{",
"return",
"old",
"list",
"get",
"(",
"old",
"item",
"position",
")",
"equals",
"(",
"new",
"list",
"get",
"(",
"new",
"item",
"position",
")",
")",
";",
"}",
"@",
"override",
"public",
"boolean",
"are",
"contents",
"the",
"same",
"(",
"int",
"old",
"item",
"position",
",",
"int",
"new",
"item",
"position",
")",
"{",
"return",
"are",
"items",
"the",
"same",
"(",
"old",
"item",
"position",
",",
"new",
"item",
"position",
")",
";",
"}",
"}",
")",
"dispatch",
"updates",
"to",
"(",
"adapter",
")",
";"
]
|
[
"set",
"the",
"{"
]
| [
"this",
"generate",
"unique",
"database",
"name",
"=",
"generate",
"unique",
"database",
"name",
";"
]
|
[
"set",
"the",
"type",
"of",
"embedded",
"database",
"to",
"use",
"<",
"p",
">",
"call",
"this",
"when",
"you",
"wish",
"to",
"configure",
"one",
"of",
"the",
"pre",
"-",
"supported",
"types",
"<",
"p",
">",
"defaults",
"to",
"hsql"
]
| [
"this",
"database",
"configurer",
"=",
"embedded",
"database",
"configurer",
"factory",
"get",
"configurer",
"(",
"type",
")",
";"
]
|
[
"set",
"the",
"strategy",
"that",
"will",
"be",
"used",
"to",
"configure",
"the",
"embedded",
"database",
"instance",
"<",
"p",
">",
"call",
"this",
"when",
"you",
"wish",
"to",
"use",
"an",
"embedded",
"database",
"type",
"not",
"already",
"supported"
]
| [
"this",
"database",
"configurer",
"=",
"configurer",
";"
]
|
[
"set",
"the",
"strategy",
"that",
"will",
"be",
"used",
"to",
"initialize",
"or",
"populate",
"the",
"embedded",
"database",
"<",
"p",
">",
"defaults",
"to",
"{"
]
| [
"this",
"database",
"populator",
"=",
"populator",
";"
]
|
[
"factory",
"method",
"that",
"returns",
"the",
"{"
]
| [
"if",
"(",
"this",
"data",
"source",
"=",
"=",
"null",
")",
"{",
"init",
"database",
"(",
")",
";",
"}",
"return",
"new",
"embedded",
"data",
"source",
"proxy",
"(",
"this",
"data",
"source",
")",
";"
]
|
[
"hook",
"that",
"gets",
"the",
"{"
]
| [
"return",
"this",
"data",
"source",
";"
]
|
[
"<",
"p",
">",
"describes",
"the",
"<",
"code",
">",
"database",
"name",
"<",
"/",
"code",
">",
"and",
"<",
"code",
">",
"instance",
"identifier",
"<",
"/",
"code",
">",
"of",
"an",
"amazon",
"rds",
"database",
"<",
"/",
"p",
">"
]
| [
"this",
"database",
"information",
"=",
"database",
"information",
";"
]
|
[
"<",
"p",
">",
"describes",
"the",
"<",
"code",
">",
"database",
"name",
"<",
"/",
"code",
">",
"and",
"<",
"code",
">",
"instance",
"identifier",
"<",
"/",
"code",
">",
"of",
"an",
"amazon",
"rds",
"database",
"<",
"/",
"p",
">"
]
| [
"return",
"this",
"database",
"information",
";"
]
|
[
"<",
"p",
">",
"describes",
"the",
"<",
"code",
">",
"database",
"name",
"<",
"/",
"code",
">",
"and",
"<",
"code",
">",
"instance",
"identifier",
"<",
"/",
"code",
">",
"of",
"an",
"amazon",
"rds",
"database",
"<",
"/",
"p",
">"
]
| [
"set",
"database",
"information",
"(",
"database",
"information",
")",
";",
"return",
"this",
";"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.