id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
102,000 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/BasicStreamReader.java | BasicStreamReader.readPI | private void readPI()
throws XMLStreamException
{
int ptr = mInputPtr;
int start = ptr;
char[] inputBuf = mInputBuffer;
int inputLen = mInputEnd;
outer_loop:
while (ptr < inputLen) {
char c = inputBuf[ptr++];
if (c < CHAR_SPACE) {
... | java | private void readPI()
throws XMLStreamException
{
int ptr = mInputPtr;
int start = ptr;
char[] inputBuf = mInputBuffer;
int inputLen = mInputEnd;
outer_loop:
while (ptr < inputLen) {
char c = inputBuf[ptr++];
if (c < CHAR_SPACE) {
... | [
"private",
"void",
"readPI",
"(",
")",
"throws",
"XMLStreamException",
"{",
"int",
"ptr",
"=",
"mInputPtr",
";",
"int",
"start",
"=",
"ptr",
";",
"char",
"[",
"]",
"inputBuf",
"=",
"mInputBuffer",
";",
"int",
"inputLen",
"=",
"mInputEnd",
";",
"outer_loop"... | Method that parses a processing instruction's data portion; at this
point target has been parsed. | [
"Method",
"that",
"parses",
"a",
"processing",
"instruction",
"s",
"data",
"portion",
";",
"at",
"this",
"point",
"target",
"has",
"been",
"parsed",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/BasicStreamReader.java#L4042-L4100 |
102,001 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/BasicStreamReader.java | BasicStreamReader.readSpacePrimary | private final boolean readSpacePrimary(char c, boolean prologWS)
throws XMLStreamException
{
int ptr = mInputPtr;
char[] inputBuf = mInputBuffer;
int inputLen = mInputEnd;
int start = ptr-1;
// Let's first see if we can just share input buffer:
while (true) {... | java | private final boolean readSpacePrimary(char c, boolean prologWS)
throws XMLStreamException
{
int ptr = mInputPtr;
char[] inputBuf = mInputBuffer;
int inputLen = mInputEnd;
int start = ptr-1;
// Let's first see if we can just share input buffer:
while (true) {... | [
"private",
"final",
"boolean",
"readSpacePrimary",
"(",
"char",
"c",
",",
"boolean",
"prologWS",
")",
"throws",
"XMLStreamException",
"{",
"int",
"ptr",
"=",
"mInputPtr",
";",
"char",
"[",
"]",
"inputBuf",
"=",
"mInputBuffer",
";",
"int",
"inputLen",
"=",
"m... | Reading whitespace should be very similar to reading normal text;
although couple of simplifications can be made. Further, since this
method is very unlikely to be of much performance concern, some
optimizations are left out, where it simplifies code.
@param c First white space characters; known to contain white space... | [
"Reading",
"whitespace",
"should",
"be",
"very",
"similar",
"to",
"reading",
"normal",
"text",
";",
"although",
"couple",
"of",
"simplifications",
"can",
"be",
"made",
".",
"Further",
"since",
"this",
"method",
"is",
"very",
"unlikely",
"to",
"be",
"of",
"mu... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/BasicStreamReader.java#L4987-L5046 |
102,002 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/BasicStreamReader.java | BasicStreamReader._constructUnexpectedInTyped | protected XMLStreamException _constructUnexpectedInTyped(int nextToken) {
if (nextToken == START_ELEMENT) {
return _constructTypeException("Element content can not contain child START_ELEMENT when using Typed Access methods", null);
}
return _constructTypeException("Expected a text t... | java | protected XMLStreamException _constructUnexpectedInTyped(int nextToken) {
if (nextToken == START_ELEMENT) {
return _constructTypeException("Element content can not contain child START_ELEMENT when using Typed Access methods", null);
}
return _constructTypeException("Expected a text t... | [
"protected",
"XMLStreamException",
"_constructUnexpectedInTyped",
"(",
"int",
"nextToken",
")",
"{",
"if",
"(",
"nextToken",
"==",
"START_ELEMENT",
")",
"{",
"return",
"_constructTypeException",
"(",
"\"Element content can not contain child START_ELEMENT when using Typed Access m... | Method called to report a problem with | [
"Method",
"called",
"to",
"report",
"a",
"problem",
"with"
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/BasicStreamReader.java#L5601-L5606 |
102,003 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/FullDTDReader.java | FullDTDReader.readInternalSubset | public static DTDSubset readInternalSubset(WstxInputData srcData,
WstxInputSource input,
ReaderConfig cfg,
boolean constructFully,
i... | java | public static DTDSubset readInternalSubset(WstxInputData srcData,
WstxInputSource input,
ReaderConfig cfg,
boolean constructFully,
i... | [
"public",
"static",
"DTDSubset",
"readInternalSubset",
"(",
"WstxInputData",
"srcData",
",",
"WstxInputSource",
"input",
",",
"ReaderConfig",
"cfg",
",",
"boolean",
"constructFully",
",",
"int",
"xmlVersion",
")",
"throws",
"XMLStreamException",
"{",
"FullDTDReader",
... | Method called to read in the internal subset definition. | [
"Method",
"called",
"to",
"read",
"in",
"the",
"internal",
"subset",
"definition",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L414-L436 |
102,004 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/FullDTDReader.java | FullDTDReader.readExternalSubset | public static DTDSubset readExternalSubset
(WstxInputSource src, ReaderConfig cfg, DTDSubset intSubset,
boolean constructFully, int xmlVersion)
throws XMLStreamException
{
FullDTDReader r = new FullDTDReader(src, cfg, intSubset, constructFully, xmlVersion);
return r.parseDT... | java | public static DTDSubset readExternalSubset
(WstxInputSource src, ReaderConfig cfg, DTDSubset intSubset,
boolean constructFully, int xmlVersion)
throws XMLStreamException
{
FullDTDReader r = new FullDTDReader(src, cfg, intSubset, constructFully, xmlVersion);
return r.parseDT... | [
"public",
"static",
"DTDSubset",
"readExternalSubset",
"(",
"WstxInputSource",
"src",
",",
"ReaderConfig",
"cfg",
",",
"DTDSubset",
"intSubset",
",",
"boolean",
"constructFully",
",",
"int",
"xmlVersion",
")",
"throws",
"XMLStreamException",
"{",
"FullDTDReader",
"r",... | Method called to read in the external subset definition. | [
"Method",
"called",
"to",
"read",
"in",
"the",
"external",
"subset",
"definition",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L441-L448 |
102,005 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/FullDTDReader.java | FullDTDReader.setFlattenWriter | public void setFlattenWriter(Writer w, boolean inclComments,
boolean inclConditionals, boolean inclPEs)
{
mFlattenWriter = new DTDWriter(w, inclComments, inclConditionals,
inclPEs);
} | java | public void setFlattenWriter(Writer w, boolean inclComments,
boolean inclConditionals, boolean inclPEs)
{
mFlattenWriter = new DTDWriter(w, inclComments, inclConditionals,
inclPEs);
} | [
"public",
"void",
"setFlattenWriter",
"(",
"Writer",
"w",
",",
"boolean",
"inclComments",
",",
"boolean",
"inclConditionals",
",",
"boolean",
"inclPEs",
")",
"{",
"mFlattenWriter",
"=",
"new",
"DTDWriter",
"(",
"w",
",",
"inclComments",
",",
"inclConditionals",
... | Method that will set specified Writer as the 'flattening writer';
writer used to output flattened version of DTD read in. This is
similar to running a C-preprocessor on C-sources, except that
defining writer will not prevent normal parsing of DTD itself. | [
"Method",
"that",
"will",
"set",
"specified",
"Writer",
"as",
"the",
"flattening",
"writer",
";",
"writer",
"used",
"to",
"output",
"flattened",
"version",
"of",
"DTD",
"read",
"in",
".",
"This",
"is",
"similar",
"to",
"running",
"a",
"C",
"-",
"preprocess... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L510-L515 |
102,006 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/FullDTDReader.java | FullDTDReader.expandPE | private void expandPE()
throws XMLStreamException
{
String id;
char c;
if (mCheckForbiddenPEs) {
/* Ok; we hit a PE where we should not have (within the internal
* dtd subset proper, within a declaration). This is a WF error.
*/
thro... | java | private void expandPE()
throws XMLStreamException
{
String id;
char c;
if (mCheckForbiddenPEs) {
/* Ok; we hit a PE where we should not have (within the internal
* dtd subset proper, within a declaration). This is a WF error.
*/
thro... | [
"private",
"void",
"expandPE",
"(",
")",
"throws",
"XMLStreamException",
"{",
"String",
"id",
";",
"char",
"c",
";",
"if",
"(",
"mCheckForbiddenPEs",
")",
"{",
"/* Ok; we hit a PE where we should not have (within the internal\n * dtd subset proper, within a declarat... | Method called to handle expansion of parameter entities. When called,
'%' character has been encountered as a reference indicator, and
now we should get parameter entity name. | [
"Method",
"called",
"to",
"handle",
"expansion",
"of",
"parameter",
"entities",
".",
"When",
"called",
"%",
"character",
"has",
"been",
"encountered",
"as",
"a",
"reference",
"indicator",
"and",
"now",
"we",
"should",
"get",
"parameter",
"entity",
"name",
"."
... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L1095-L1137 |
102,007 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/FullDTDReader.java | FullDTDReader.checkDTDKeyword | protected String checkDTDKeyword(String exp)
throws XMLStreamException
{
int i = 0;
int len = exp.length();
char c = ' ';
for (; i < len; ++i) {
if (mInputPtr < mInputEnd) {
c = mInputBuffer[mInputPtr++];
} else {
c = d... | java | protected String checkDTDKeyword(String exp)
throws XMLStreamException
{
int i = 0;
int len = exp.length();
char c = ' ';
for (; i < len; ++i) {
if (mInputPtr < mInputEnd) {
c = mInputBuffer[mInputPtr++];
} else {
c = d... | [
"protected",
"String",
"checkDTDKeyword",
"(",
"String",
"exp",
")",
"throws",
"XMLStreamException",
"{",
"int",
"i",
"=",
"0",
";",
"int",
"len",
"=",
"exp",
".",
"length",
"(",
")",
";",
"char",
"c",
"=",
"'",
"'",
";",
"for",
"(",
";",
"i",
"<",... | Method called to verify whether input has specified keyword; if it
has, returns null and points to char after the keyword; if not,
returns whatever constitutes a keyword matched, for error
reporting purposes. | [
"Method",
"called",
"to",
"verify",
"whether",
"input",
"has",
"specified",
"keyword",
";",
"if",
"it",
"has",
"returns",
"null",
"and",
"points",
"to",
"char",
"after",
"the",
"keyword",
";",
"if",
"not",
"returns",
"whatever",
"constitutes",
"a",
"keyword"... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L1151-L1197 |
102,008 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/FullDTDReader.java | FullDTDReader.readMixedSpec | private StructValidator readMixedSpec(PrefixedName elemName, boolean construct)
throws XMLStreamException
{
String keyw = checkDTDKeyword("PCDATA");
if (keyw != null) {
_reportWFCViolation("Unrecognized directive #"+keyw+"'; expected #PCDATA (or element name)");
}
... | java | private StructValidator readMixedSpec(PrefixedName elemName, boolean construct)
throws XMLStreamException
{
String keyw = checkDTDKeyword("PCDATA");
if (keyw != null) {
_reportWFCViolation("Unrecognized directive #"+keyw+"'; expected #PCDATA (or element name)");
}
... | [
"private",
"StructValidator",
"readMixedSpec",
"(",
"PrefixedName",
"elemName",
",",
"boolean",
"construct",
")",
"throws",
"XMLStreamException",
"{",
"String",
"keyw",
"=",
"checkDTDKeyword",
"(",
"\"PCDATA\"",
")",
";",
"if",
"(",
"keyw",
"!=",
"null",
")",
"{... | Method called to parse what seems like a mixed content specification.
@param construct If true, will build full object for validating content
within mixed content model; if false, will just parse and discard
information (done in non-validating DTD-supporting mode) | [
"Method",
"called",
"to",
"parse",
"what",
"seems",
"like",
"a",
"mixed",
"content",
"specification",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L2986-L3050 |
102,009 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/FullDTDReader.java | FullDTDReader.handleUndeclaredEntity | @Override
protected void handleUndeclaredEntity(String id)
throws XMLStreamException
{
_reportVCViolation("Undeclared parameter entity '"+id+"'.");
if (mCurrAttrDefault != null) {
Location loc = getLastCharLocation();
if (mExpandingPE) {
mCurrAttrD... | java | @Override
protected void handleUndeclaredEntity(String id)
throws XMLStreamException
{
_reportVCViolation("Undeclared parameter entity '"+id+"'.");
if (mCurrAttrDefault != null) {
Location loc = getLastCharLocation();
if (mExpandingPE) {
mCurrAttrD... | [
"@",
"Override",
"protected",
"void",
"handleUndeclaredEntity",
"(",
"String",
"id",
")",
"throws",
"XMLStreamException",
"{",
"_reportVCViolation",
"(",
"\"Undeclared parameter entity '\"",
"+",
"id",
"+",
"\"'.\"",
")",
";",
"if",
"(",
"mCurrAttrDefault",
"!=",
"n... | Undeclared parameter entity is a VC, not WFC... | [
"Undeclared",
"parameter",
"entity",
"is",
"a",
"VC",
"not",
"WFC",
"..."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L3407-L3426 |
102,010 | FasterXML/woodstox | src/main/java/com/ctc/wstx/evt/MergedNsContext.java | MergedNsContext.outputNamespaceDeclarations | @Override
public void outputNamespaceDeclarations(XMLStreamWriter w) throws XMLStreamException
{
for (int i = 0, len = mNamespaces.size(); i < len; ++i) {
Namespace ns = mNamespaces.get(i);
if (ns.isDefaultNamespaceDeclaration()) {
w.writeDefaultNamespace(ns.getNa... | java | @Override
public void outputNamespaceDeclarations(XMLStreamWriter w) throws XMLStreamException
{
for (int i = 0, len = mNamespaces.size(); i < len; ++i) {
Namespace ns = mNamespaces.get(i);
if (ns.isDefaultNamespaceDeclaration()) {
w.writeDefaultNamespace(ns.getNa... | [
"@",
"Override",
"public",
"void",
"outputNamespaceDeclarations",
"(",
"XMLStreamWriter",
"w",
")",
"throws",
"XMLStreamException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"len",
"=",
"mNamespaces",
".",
"size",
"(",
")",
";",
"i",
"<",
"len",
";",
"... | Method called by the matching start element class to
output all namespace declarations active in current namespace
scope, if any. | [
"Method",
"called",
"by",
"the",
"matching",
"start",
"element",
"class",
"to",
"output",
"all",
"namespace",
"declarations",
"active",
"in",
"current",
"namespace",
"scope",
"if",
"any",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/evt/MergedNsContext.java#L168-L179 |
102,011 | FasterXML/woodstox | src/main/java/com/ctc/wstx/api/WriterConfig.java | WriterConfig.allocMediumCBuffer | public char[] allocMediumCBuffer(int minSize)
{
if (mCurrRecycler != null) {
char[] result = mCurrRecycler.getMediumCBuffer(minSize);
if (result != null) {
return result;
}
}
return new char[minSize];
} | java | public char[] allocMediumCBuffer(int minSize)
{
if (mCurrRecycler != null) {
char[] result = mCurrRecycler.getMediumCBuffer(minSize);
if (result != null) {
return result;
}
}
return new char[minSize];
} | [
"public",
"char",
"[",
"]",
"allocMediumCBuffer",
"(",
"int",
"minSize",
")",
"{",
"if",
"(",
"mCurrRecycler",
"!=",
"null",
")",
"{",
"char",
"[",
"]",
"result",
"=",
"mCurrRecycler",
".",
"getMediumCBuffer",
"(",
"minSize",
")",
";",
"if",
"(",
"result... | Method called to allocate intermediate recyclable copy buffers | [
"Method",
"called",
"to",
"allocate",
"intermediate",
"recyclable",
"copy",
"buffers"
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/api/WriterConfig.java#L799-L808 |
102,012 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/InputSourceFactory.java | InputSourceFactory.constructDocumentSource | public static BranchingReaderSource constructDocumentSource
(ReaderConfig cfg, InputBootstrapper bs, String pubId, SystemId sysId,
Reader r, boolean realClose)
{
/* To resolve [WSTX-50] need to ensure that P_BASE_URL overrides
* the defaults if/as necessary
*/
URL... | java | public static BranchingReaderSource constructDocumentSource
(ReaderConfig cfg, InputBootstrapper bs, String pubId, SystemId sysId,
Reader r, boolean realClose)
{
/* To resolve [WSTX-50] need to ensure that P_BASE_URL overrides
* the defaults if/as necessary
*/
URL... | [
"public",
"static",
"BranchingReaderSource",
"constructDocumentSource",
"(",
"ReaderConfig",
"cfg",
",",
"InputBootstrapper",
"bs",
",",
"String",
"pubId",
",",
"SystemId",
"sysId",
",",
"Reader",
"r",
",",
"boolean",
"realClose",
")",
"{",
"/* To resolve [WSTX-50] ne... | Factory method used for creating the main-level document reader
source. | [
"Factory",
"method",
"used",
"for",
"creating",
"the",
"main",
"-",
"level",
"document",
"reader",
"source",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/InputSourceFactory.java#L46-L63 |
102,013 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/InputSourceFactory.java | InputSourceFactory.constructCharArraySource | public static WstxInputSource constructCharArraySource
(WstxInputSource parent, String fromEntity,
char[] text, int offset, int len, Location loc, URL src)
{
SystemId sysId = SystemId.construct(loc.getSystemId(), src);
return new CharArraySource(parent, fromEntity, text, offset, len, l... | java | public static WstxInputSource constructCharArraySource
(WstxInputSource parent, String fromEntity,
char[] text, int offset, int len, Location loc, URL src)
{
SystemId sysId = SystemId.construct(loc.getSystemId(), src);
return new CharArraySource(parent, fromEntity, text, offset, len, l... | [
"public",
"static",
"WstxInputSource",
"constructCharArraySource",
"(",
"WstxInputSource",
"parent",
",",
"String",
"fromEntity",
",",
"char",
"[",
"]",
"text",
",",
"int",
"offset",
",",
"int",
"len",
",",
"Location",
"loc",
",",
"URL",
"src",
")",
"{",
"Sy... | Factory method usually used to expand internal parsed entities; in
which case context remains mostly the same. | [
"Factory",
"method",
"usually",
"used",
"to",
"expand",
"internal",
"parsed",
"entities",
";",
"in",
"which",
"case",
"context",
"remains",
"mostly",
"the",
"same",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/InputSourceFactory.java#L69-L75 |
102,014 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java | SimpleOutputElement.createChild | protected SimpleOutputElement createChild(String localName)
{
/* At this point we can also discard attribute Map; it is assumed
* that when a child element has been opened, no more attributes
* can be output.
*/
mAttrSet = null;
return new SimpleOutputElement(this,... | java | protected SimpleOutputElement createChild(String localName)
{
/* At this point we can also discard attribute Map; it is assumed
* that when a child element has been opened, no more attributes
* can be output.
*/
mAttrSet = null;
return new SimpleOutputElement(this,... | [
"protected",
"SimpleOutputElement",
"createChild",
"(",
"String",
"localName",
")",
"{",
"/* At this point we can also discard attribute Map; it is assumed\n * that when a child element has been opened, no more attributes\n * can be output.\n */",
"mAttrSet",
"=",
"null... | Simplest factory method, which gets called when a 1-argument
element output method is called. It is, then, assumed to
use the default namespce. | [
"Simplest",
"factory",
"method",
"which",
"gets",
"called",
"when",
"a",
"1",
"-",
"argument",
"element",
"output",
"method",
"is",
"called",
".",
"It",
"is",
"then",
"assumed",
"to",
"use",
"the",
"default",
"namespce",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java#L147-L156 |
102,015 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java | SimpleOutputElement.createChild | protected SimpleOutputElement createChild(String prefix, String localName,
String uri)
{
/* At this point we can also discard attribute Map; it is assumed
* that when a child element has been opened, no more attributes
* can be output.
... | java | protected SimpleOutputElement createChild(String prefix, String localName,
String uri)
{
/* At this point we can also discard attribute Map; it is assumed
* that when a child element has been opened, no more attributes
* can be output.
... | [
"protected",
"SimpleOutputElement",
"createChild",
"(",
"String",
"prefix",
",",
"String",
"localName",
",",
"String",
"uri",
")",
"{",
"/* At this point we can also discard attribute Map; it is assumed\n * that when a child element has been opened, no more attributes\n *... | Full factory method, used for 'normal' namespace qualified output
methods. | [
"Full",
"factory",
"method",
"used",
"for",
"normal",
"namespace",
"qualified",
"output",
"methods",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sw/SimpleOutputElement.java#L184-L193 |
102,016 | FasterXML/woodstox | src/main/java/com/ctc/wstx/api/ReaderConfig.java | ReaderConfig.configureForSpeed | public void configureForSpeed()
{
// StAX (1.0):
doCoalesceText(false);
// StAX2:
doPreserveLocation(false);
doReportPrologWhitespace(false);
//doInternNames(true); // this is a NOP
doInternNsURIs(true);
doXmlIdUniqChecks(false);
// Woodstox-... | java | public void configureForSpeed()
{
// StAX (1.0):
doCoalesceText(false);
// StAX2:
doPreserveLocation(false);
doReportPrologWhitespace(false);
//doInternNames(true); // this is a NOP
doInternNsURIs(true);
doXmlIdUniqChecks(false);
// Woodstox-... | [
"public",
"void",
"configureForSpeed",
"(",
")",
"{",
"// StAX (1.0):",
"doCoalesceText",
"(",
"false",
")",
";",
"// StAX2:",
"doPreserveLocation",
"(",
"false",
")",
";",
"doReportPrologWhitespace",
"(",
"false",
")",
";",
"//doInternNames(true); // this is a NOP",
... | Method to call to make the Reader created be as fast as possible reading
documents, especially for long-running processes where caching is
likely to help.
See {@link XMLInputFactory2#configureForSpeed} for
required settings for standard StAX/StAX properties.
<p>
In addition to the standard settings, following Woodstox... | [
"Method",
"to",
"call",
"to",
"make",
"the",
"Reader",
"created",
"be",
"as",
"fast",
"as",
"possible",
"reading",
"documents",
"especially",
"for",
"long",
"-",
"running",
"processes",
"where",
"caching",
"is",
"likely",
"to",
"help",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/api/ReaderConfig.java#L1131-L1154 |
102,017 | FasterXML/woodstox | src/main/java/com/ctc/wstx/util/SymbolTable.java | SymbolTable.calcHash | @SuppressWarnings("cast")
public static int calcHash(char[] buffer, int start, int len) {
int hash = (int) buffer[start];
for (int i = 1; i < len; ++i) {
hash = (hash * 31) + (int) buffer[start+i];
}
return hash;
} | java | @SuppressWarnings("cast")
public static int calcHash(char[] buffer, int start, int len) {
int hash = (int) buffer[start];
for (int i = 1; i < len; ++i) {
hash = (hash * 31) + (int) buffer[start+i];
}
return hash;
} | [
"@",
"SuppressWarnings",
"(",
"\"cast\"",
")",
"public",
"static",
"int",
"calcHash",
"(",
"char",
"[",
"]",
"buffer",
",",
"int",
"start",
",",
"int",
"len",
")",
"{",
"int",
"hash",
"=",
"(",
"int",
")",
"buffer",
"[",
"start",
"]",
";",
"for",
"... | Implementation of a hashing method for variable length
Strings. Most of the time intention is that this calculation
is done by caller during parsing, not here; however, sometimes
it needs to be done for parsed "String" too.
@param len Length of String; has to be at least 1 (caller guarantees
this pre-condition) | [
"Implementation",
"of",
"a",
"hashing",
"method",
"for",
"variable",
"length",
"Strings",
".",
"Most",
"of",
"the",
"time",
"intention",
"is",
"that",
"this",
"calculation",
"is",
"done",
"by",
"caller",
"during",
"parsing",
"not",
"here",
";",
"however",
"s... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/SymbolTable.java#L558-L565 |
102,018 | FasterXML/woodstox | src/main/java/com/ctc/wstx/util/SymbolTable.java | SymbolTable.copyArrays | private void copyArrays() {
String[] oldSyms = mSymbols;
int size = oldSyms.length;
mSymbols = new String[size];
System.arraycopy(oldSyms, 0, mSymbols, 0, size);
Bucket[] oldBuckets = mBuckets;
size = oldBuckets.length;
mBuckets = new Bucket[size];
System.... | java | private void copyArrays() {
String[] oldSyms = mSymbols;
int size = oldSyms.length;
mSymbols = new String[size];
System.arraycopy(oldSyms, 0, mSymbols, 0, size);
Bucket[] oldBuckets = mBuckets;
size = oldBuckets.length;
mBuckets = new Bucket[size];
System.... | [
"private",
"void",
"copyArrays",
"(",
")",
"{",
"String",
"[",
"]",
"oldSyms",
"=",
"mSymbols",
";",
"int",
"size",
"=",
"oldSyms",
".",
"length",
";",
"mSymbols",
"=",
"new",
"String",
"[",
"size",
"]",
";",
"System",
".",
"arraycopy",
"(",
"oldSyms",... | Method called when copy-on-write is needed; generally when first
change is made to a derived symbol table. | [
"Method",
"called",
"when",
"copy",
"-",
"on",
"-",
"write",
"is",
"needed",
";",
"generally",
"when",
"first",
"change",
"is",
"made",
"to",
"a",
"derived",
"symbol",
"table",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/SymbolTable.java#L587-L596 |
102,019 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDAttribute.java | DTDAttribute.normalizeDefault | public void normalizeDefault()
{
String val = mDefValue.getValue();
if (val.length() > 0) {
char[] cbuf = val.toCharArray();
String str = StringUtil.normalizeSpaces(cbuf, 0, cbuf.length);
if (str != null) {
mDefValue.setValue(str);
}
... | java | public void normalizeDefault()
{
String val = mDefValue.getValue();
if (val.length() > 0) {
char[] cbuf = val.toCharArray();
String str = StringUtil.normalizeSpaces(cbuf, 0, cbuf.length);
if (str != null) {
mDefValue.setValue(str);
}
... | [
"public",
"void",
"normalizeDefault",
"(",
")",
"{",
"String",
"val",
"=",
"mDefValue",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"val",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"char",
"[",
"]",
"cbuf",
"=",
"val",
".",
"toCharArray",
"(",
... | Method called to do initial normalization of the default attribute
value, without trying to verify its validity. Thus, it's
called independent of whether we are fully validating the document. | [
"Method",
"called",
"to",
"do",
"initial",
"normalization",
"of",
"the",
"default",
"attribute",
"value",
"without",
"trying",
"to",
"verify",
"its",
"validity",
".",
"Thus",
"it",
"s",
"called",
"independent",
"of",
"whether",
"we",
"are",
"fully",
"validatin... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDAttribute.java#L274-L284 |
102,020 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDAttribute.java | DTDAttribute.reportValidationProblem | protected String reportValidationProblem(InputProblemReporter rep, String msg)
throws XMLStreamException
{
rep.reportValidationProblem("Attribute definition '"+mName+"': "+msg);
return null;
} | java | protected String reportValidationProblem(InputProblemReporter rep, String msg)
throws XMLStreamException
{
rep.reportValidationProblem("Attribute definition '"+mName+"': "+msg);
return null;
} | [
"protected",
"String",
"reportValidationProblem",
"(",
"InputProblemReporter",
"rep",
",",
"String",
"msg",
")",
"throws",
"XMLStreamException",
"{",
"rep",
".",
"reportValidationProblem",
"(",
"\"Attribute definition '\"",
"+",
"mName",
"+",
"\"': \"",
"+",
"msg",
")... | Method called during parsing of DTD schema, to report a problem.
Note that unlike during actual validation, we have no option of
just gracefully listing problems and ignoring them; an exception
is always thrown. | [
"Method",
"called",
"during",
"parsing",
"of",
"DTD",
"schema",
"to",
"report",
"a",
"problem",
".",
"Note",
"that",
"unlike",
"during",
"actual",
"validation",
"we",
"have",
"no",
"option",
"of",
"just",
"gracefully",
"listing",
"problems",
"and",
"ignoring",... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDAttribute.java#L505-L510 |
102,021 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dom/WstxDOMWrappingWriter.java | WstxDOMWrappingWriter.createStartElem | protected void createStartElem(String nsURI, String prefix, String localName, boolean isEmpty)
throws XMLStreamException
{
DOMOutputElement elem;
if (!mNsAware) {
if(nsURI != null && nsURI.length() > 0) {
throwOutputError("Can not specify non-empty uri/prefix in ... | java | protected void createStartElem(String nsURI, String prefix, String localName, boolean isEmpty)
throws XMLStreamException
{
DOMOutputElement elem;
if (!mNsAware) {
if(nsURI != null && nsURI.length() > 0) {
throwOutputError("Can not specify non-empty uri/prefix in ... | [
"protected",
"void",
"createStartElem",
"(",
"String",
"nsURI",
",",
"String",
"prefix",
",",
"String",
"localName",
",",
"boolean",
"isEmpty",
")",
"throws",
"XMLStreamException",
"{",
"DOMOutputElement",
"elem",
";",
"if",
"(",
"!",
"mNsAware",
")",
"{",
"if... | Method called by all start element write methods.
@param nsURI Namespace URI to use: null and empty String denote 'no namespace' | [
"Method",
"called",
"by",
"all",
"start",
"element",
"write",
"methods",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dom/WstxDOMWrappingWriter.java#L472-L545 |
102,022 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sw/NonNsStreamWriter.java | NonNsStreamWriter.copyStartElement | @Override
public void copyStartElement(InputElementStack elemStack,
AttributeCollector attrCollector)
throws IOException, XMLStreamException
{
String ln = elemStack.getLocalName();
boolean nsAware = elemStack.isNamespaceAware();
/* First,... | java | @Override
public void copyStartElement(InputElementStack elemStack,
AttributeCollector attrCollector)
throws IOException, XMLStreamException
{
String ln = elemStack.getLocalName();
boolean nsAware = elemStack.isNamespaceAware();
/* First,... | [
"@",
"Override",
"public",
"void",
"copyStartElement",
"(",
"InputElementStack",
"elemStack",
",",
"AttributeCollector",
"attrCollector",
")",
"throws",
"IOException",
",",
"XMLStreamException",
"{",
"String",
"ln",
"=",
"elemStack",
".",
"getLocalName",
"(",
")",
"... | Element copier method implementation suitable to be used with
non-namespace-aware writers. The only special thing here is that
the copier can convert namespace declarations to equivalent
attribute writes. | [
"Element",
"copier",
"method",
"implementation",
"suitable",
"to",
"be",
"used",
"with",
"non",
"-",
"namespace",
"-",
"aware",
"writers",
".",
"The",
"only",
"special",
"thing",
"here",
"is",
"that",
"the",
"copier",
"can",
"convert",
"namespace",
"declaratio... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sw/NonNsStreamWriter.java#L363-L412 |
102,023 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/WstxInputData.java | WstxInputData.findIllegalNameChar | public final static int findIllegalNameChar(String name, boolean nsAware, boolean xml11)
{
int len = name.length();
if (len < 1) {
return -1;
}
char c = name.charAt(0);
// First char legal?
if (c <= 0x7A) { // 'z' or earlier
if (c < 0... | java | public final static int findIllegalNameChar(String name, boolean nsAware, boolean xml11)
{
int len = name.length();
if (len < 1) {
return -1;
}
char c = name.charAt(0);
// First char legal?
if (c <= 0x7A) { // 'z' or earlier
if (c < 0... | [
"public",
"final",
"static",
"int",
"findIllegalNameChar",
"(",
"String",
"name",
",",
"boolean",
"nsAware",
",",
"boolean",
"xml11",
")",
"{",
"int",
"len",
"=",
"name",
".",
"length",
"(",
")",
";",
"if",
"(",
"len",
"<",
"1",
")",
"{",
"return",
"... | Method that can be called to check whether given String contains
any characters that are not legal XML names.
@return Index of the first illegal xml name characters, if any;
-1 if the name is completely legal | [
"Method",
"that",
"can",
"be",
"called",
"to",
"check",
"whether",
"given",
"String",
"contains",
"any",
"characters",
"that",
"are",
"not",
"legal",
"XML",
"names",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/WstxInputData.java#L340-L409 |
102,024 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/CharsetNames.java | CharsetNames.findEncodingFor | public static String findEncodingFor(Writer w)
{
if (w instanceof OutputStreamWriter) {
String enc = ((OutputStreamWriter) w).getEncoding();
/* [WSTX-146]: It is important that we normalize this, since
* older JDKs return legacy encoding names ("UTF8" instead of
... | java | public static String findEncodingFor(Writer w)
{
if (w instanceof OutputStreamWriter) {
String enc = ((OutputStreamWriter) w).getEncoding();
/* [WSTX-146]: It is important that we normalize this, since
* older JDKs return legacy encoding names ("UTF8" instead of
... | [
"public",
"static",
"String",
"findEncodingFor",
"(",
"Writer",
"w",
")",
"{",
"if",
"(",
"w",
"instanceof",
"OutputStreamWriter",
")",
"{",
"String",
"enc",
"=",
"(",
"(",
"OutputStreamWriter",
")",
"w",
")",
".",
"getEncoding",
"(",
")",
";",
"/* [WSTX-1... | Because of legacy encodings used by earlier JDK versions, we
need to be careful when accessing encoding names via JDK
classes. | [
"Because",
"of",
"legacy",
"encodings",
"used",
"by",
"earlier",
"JDK",
"versions",
"we",
"need",
"to",
"be",
"careful",
"when",
"accessing",
"encoding",
"names",
"via",
"JDK",
"classes",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/CharsetNames.java#L282-L293 |
102,025 | FasterXML/woodstox | src/main/java/com/ctc/wstx/util/ExceptionUtil.java | ExceptionUtil.throwRuntimeException | public static void throwRuntimeException(Throwable t)
{
// Unchecked? Can re-throw as is
throwIfUnchecked(t);
// Otherwise, let's just change its type:
throw new RuntimeException("[was "+t.getClass()+"] "+t.getMessage(), t);
} | java | public static void throwRuntimeException(Throwable t)
{
// Unchecked? Can re-throw as is
throwIfUnchecked(t);
// Otherwise, let's just change its type:
throw new RuntimeException("[was "+t.getClass()+"] "+t.getMessage(), t);
} | [
"public",
"static",
"void",
"throwRuntimeException",
"(",
"Throwable",
"t",
")",
"{",
"// Unchecked? Can re-throw as is",
"throwIfUnchecked",
"(",
"t",
")",
";",
"// Otherwise, let's just change its type:",
"throw",
"new",
"RuntimeException",
"(",
"\"[was \"",
"+",
"t",
... | Method that can be used to convert any Throwable to a RuntimeException;
conversion is only done for checked exceptions. | [
"Method",
"that",
"can",
"be",
"used",
"to",
"convert",
"any",
"Throwable",
"to",
"a",
"RuntimeException",
";",
"conversion",
"is",
"only",
"done",
"for",
"checked",
"exceptions",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/ExceptionUtil.java#L13-L19 |
102,026 | FasterXML/woodstox | src/main/java/com/ctc/wstx/util/StringUtil.java | StringUtil.trimEncoding | public static String trimEncoding(String str, boolean upperCase)
{
int i = 0;
int len = str.length();
// Let's first check if String is fine as is:
for (; i < len; ++i) {
char c = str.charAt(i);
if (c <= CHAR_SPACE || !Character.isLetterOrDigit(c)) {
... | java | public static String trimEncoding(String str, boolean upperCase)
{
int i = 0;
int len = str.length();
// Let's first check if String is fine as is:
for (; i < len; ++i) {
char c = str.charAt(i);
if (c <= CHAR_SPACE || !Character.isLetterOrDigit(c)) {
... | [
"public",
"static",
"String",
"trimEncoding",
"(",
"String",
"str",
",",
"boolean",
"upperCase",
")",
"{",
"int",
"i",
"=",
"0",
";",
"int",
"len",
"=",
"str",
".",
"length",
"(",
")",
";",
"// Let's first check if String is fine as is:",
"for",
"(",
";",
... | Method that will remove all non-alphanumeric characters, and optionally
upper-case included letters, from the given String. | [
"Method",
"that",
"will",
"remove",
"all",
"non",
"-",
"alphanumeric",
"characters",
"and",
"optionally",
"upper",
"-",
"case",
"included",
"letters",
"from",
"the",
"given",
"String",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/StringUtil.java#L280-L313 |
102,027 | FasterXML/woodstox | src/main/java/com/ctc/wstx/util/URLUtil.java | URLUtil.urlFromCurrentDir | public static URL urlFromCurrentDir()
throws IOException /* MalformedURLException or such */
{
/* This seems to work; independent of whether there happens to
* be such/file dir or not.
*/
File parent = new File("a").getAbsoluteFile().getParentFile();
return toURL(pa... | java | public static URL urlFromCurrentDir()
throws IOException /* MalformedURLException or such */
{
/* This seems to work; independent of whether there happens to
* be such/file dir or not.
*/
File parent = new File("a").getAbsoluteFile().getParentFile();
return toURL(pa... | [
"public",
"static",
"URL",
"urlFromCurrentDir",
"(",
")",
"throws",
"IOException",
"/* MalformedURLException or such */",
"{",
"/* This seems to work; independent of whether there happens to\n * be such/file dir or not.\n */",
"File",
"parent",
"=",
"new",
"File",
"("... | Method that tries to create and return URL that denotes current
working directory. Usually used to create a context, when one is
not explicitly passed. | [
"Method",
"that",
"tries",
"to",
"create",
"and",
"return",
"URL",
"that",
"denotes",
"current",
"working",
"directory",
".",
"Usually",
"used",
"to",
"create",
"a",
"context",
"when",
"one",
"is",
"not",
"explicitly",
"passed",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/URLUtil.java#L120-L128 |
102,028 | FasterXML/woodstox | src/main/java/com/ctc/wstx/util/URLUtil.java | URLUtil.throwIOException | private static void throwIOException(Exception mex, String sysId)
throws IOException
{
String msg = "[resolving systemId '"+sysId+"']: "+mex.toString();
throw ExceptionUtil.constructIOException(msg, mex);
} | java | private static void throwIOException(Exception mex, String sysId)
throws IOException
{
String msg = "[resolving systemId '"+sysId+"']: "+mex.toString();
throw ExceptionUtil.constructIOException(msg, mex);
} | [
"private",
"static",
"void",
"throwIOException",
"(",
"Exception",
"mex",
",",
"String",
"sysId",
")",
"throws",
"IOException",
"{",
"String",
"msg",
"=",
"\"[resolving systemId '\"",
"+",
"sysId",
"+",
"\"']: \"",
"+",
"mex",
".",
"toString",
"(",
")",
";",
... | Helper method that tries to fully convert strange URL-specific exception
to more general IO exception. Also, to try to use JDK 1.4 feature without
creating requirement, uses reflection to try to set the root cause, if
we are running on JDK1.4 | [
"Helper",
"method",
"that",
"tries",
"to",
"fully",
"convert",
"strange",
"URL",
"-",
"specific",
"exception",
"to",
"more",
"general",
"IO",
"exception",
".",
"Also",
"to",
"try",
"to",
"use",
"JDK",
"1",
".",
"4",
"feature",
"without",
"creating",
"requi... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/URLUtil.java#L215-L220 |
102,029 | FasterXML/woodstox | src/main/java/com/ctc/wstx/stax/WstxEventFactory.java | WstxEventFactory.createStartElement | @SuppressWarnings("unchecked")
@Override
protected StartElement createStartElement(QName name, Iterator<?> attr,
Iterator<?> ns, NamespaceContext ctxt)
{
return SimpleStartElement.construct(mLocation, name,
(Iterator<Attribute>) attr,
(Iterator<Namespace>)... | java | @SuppressWarnings("unchecked")
@Override
protected StartElement createStartElement(QName name, Iterator<?> attr,
Iterator<?> ns, NamespaceContext ctxt)
{
return SimpleStartElement.construct(mLocation, name,
(Iterator<Attribute>) attr,
(Iterator<Namespace>)... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"protected",
"StartElement",
"createStartElement",
"(",
"QName",
"name",
",",
"Iterator",
"<",
"?",
">",
"attr",
",",
"Iterator",
"<",
"?",
">",
"ns",
",",
"NamespaceContext",
"ctxt",
")",
... | Must override this method to use a more efficient StartElement
implementation | [
"Must",
"override",
"this",
"method",
"to",
"use",
"a",
"more",
"efficient",
"StartElement",
"implementation"
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/stax/WstxEventFactory.java#L115-L123 |
102,030 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/DefaultInputResolver.java | DefaultInputResolver.resolveEntity | public static WstxInputSource resolveEntity
(WstxInputSource parent, URL pathCtxt, String entityName,
String publicId, String systemId,
XMLResolver customResolver, ReaderConfig cfg, int xmlVersion)
throws IOException, XMLStreamException
{
if (pathCtxt == null) {
... | java | public static WstxInputSource resolveEntity
(WstxInputSource parent, URL pathCtxt, String entityName,
String publicId, String systemId,
XMLResolver customResolver, ReaderConfig cfg, int xmlVersion)
throws IOException, XMLStreamException
{
if (pathCtxt == null) {
... | [
"public",
"static",
"WstxInputSource",
"resolveEntity",
"(",
"WstxInputSource",
"parent",
",",
"URL",
"pathCtxt",
",",
"String",
"entityName",
",",
"String",
"publicId",
",",
"String",
"systemId",
",",
"XMLResolver",
"customResolver",
",",
"ReaderConfig",
"cfg",
","... | Basic external resource resolver implementation; usable both with
DTD and entity resolution.
@param parent Input source that contains reference to be expanded.
@param pathCtxt Reference context to use for resolving path, if
known. If null, reference context of the parent will
be used; and if that is null (which is pos... | [
"Basic",
"external",
"resource",
"resolver",
"implementation",
";",
"usable",
"both",
"with",
"DTD",
"and",
"entity",
"resolution",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/DefaultInputResolver.java#L64-L93 |
102,031 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/DefaultInputResolver.java | DefaultInputResolver.resolveEntityUsing | public static WstxInputSource resolveEntityUsing
(WstxInputSource refCtxt, String entityName,
String publicId, String systemId,
XMLResolver resolver, ReaderConfig cfg, int xmlVersion)
throws IOException, XMLStreamException
{
URL ctxt = (refCtxt == null) ? null : refCtxt.get... | java | public static WstxInputSource resolveEntityUsing
(WstxInputSource refCtxt, String entityName,
String publicId, String systemId,
XMLResolver resolver, ReaderConfig cfg, int xmlVersion)
throws IOException, XMLStreamException
{
URL ctxt = (refCtxt == null) ? null : refCtxt.get... | [
"public",
"static",
"WstxInputSource",
"resolveEntityUsing",
"(",
"WstxInputSource",
"refCtxt",
",",
"String",
"entityName",
",",
"String",
"publicId",
",",
"String",
"systemId",
",",
"XMLResolver",
"resolver",
",",
"ReaderConfig",
"cfg",
",",
"int",
"xmlVersion",
"... | A very simple utility expansion method used generally when the
only way to resolve an entity is via passed resolver; and where
failing to resolve it is not fatal. | [
"A",
"very",
"simple",
"utility",
"expansion",
"method",
"used",
"generally",
"when",
"the",
"only",
"way",
"to",
"resolve",
"an",
"entity",
"is",
"via",
"passed",
"resolver",
";",
"and",
"where",
"failing",
"to",
"resolve",
"it",
"is",
"not",
"fatal",
"."... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/DefaultInputResolver.java#L100-L112 |
102,032 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/ValidatingStreamReader.java | ValidatingStreamReader.reportValidationProblem | @Override
public void reportValidationProblem(XMLValidationProblem prob)
throws XMLStreamException
{
if (mVldProbHandler != null) {
// Fix for [WSTX-209]
mVldProbHandler.reportProblem(prob);
} else {
super.reportValidationProblem(prob);
}
} | java | @Override
public void reportValidationProblem(XMLValidationProblem prob)
throws XMLStreamException
{
if (mVldProbHandler != null) {
// Fix for [WSTX-209]
mVldProbHandler.reportProblem(prob);
} else {
super.reportValidationProblem(prob);
}
} | [
"@",
"Override",
"public",
"void",
"reportValidationProblem",
"(",
"XMLValidationProblem",
"prob",
")",
"throws",
"XMLStreamException",
"{",
"if",
"(",
"mVldProbHandler",
"!=",
"null",
")",
"{",
"// Fix for [WSTX-209]",
"mVldProbHandler",
".",
"reportProblem",
"(",
"p... | If there is an error handler established, call it. | [
"If",
"there",
"is",
"an",
"error",
"handler",
"established",
"call",
"it",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/ValidatingStreamReader.java#L375-L385 |
102,033 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/ValidatingStreamReader.java | ValidatingStreamReader.resolveExtSubsetPath | private URI resolveExtSubsetPath(String systemId) throws IOException
{
// Do we have a context to use for resolving?
URL ctxt = (mInput == null) ? null : mInput.getSource();
/* Ok, either got a context or not; let's create the URL based on
* the id, and optional context:
*... | java | private URI resolveExtSubsetPath(String systemId) throws IOException
{
// Do we have a context to use for resolving?
URL ctxt = (mInput == null) ? null : mInput.getSource();
/* Ok, either got a context or not; let's create the URL based on
* the id, and optional context:
*... | [
"private",
"URI",
"resolveExtSubsetPath",
"(",
"String",
"systemId",
")",
"throws",
"IOException",
"{",
"// Do we have a context to use for resolving?",
"URL",
"ctxt",
"=",
"(",
"mInput",
"==",
"null",
")",
"?",
"null",
":",
"mInput",
".",
"getSource",
"(",
")",
... | Method called to resolve path to external DTD subset, given
system identifier. | [
"Method",
"called",
"to",
"resolve",
"path",
"to",
"external",
"DTD",
"subset",
"given",
"system",
"identifier",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/ValidatingStreamReader.java#L507-L528 |
102,034 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/StreamBootstrapper.java | StreamBootstrapper.getInstance | public static StreamBootstrapper getInstance(String pubId, SystemId sysId, InputStream in)
{
return new StreamBootstrapper(pubId, sysId, in);
} | java | public static StreamBootstrapper getInstance(String pubId, SystemId sysId, InputStream in)
{
return new StreamBootstrapper(pubId, sysId, in);
} | [
"public",
"static",
"StreamBootstrapper",
"getInstance",
"(",
"String",
"pubId",
",",
"SystemId",
"sysId",
",",
"InputStream",
"in",
")",
"{",
"return",
"new",
"StreamBootstrapper",
"(",
"pubId",
",",
"sysId",
",",
"in",
")",
";",
"}"
] | Factory method used when the underlying data provider is an
actual stream. | [
"Factory",
"method",
"used",
"when",
"the",
"underlying",
"data",
"provider",
"is",
"an",
"actual",
"stream",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/StreamBootstrapper.java#L136-L139 |
102,035 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/StreamBootstrapper.java | StreamBootstrapper.getInstance | public static StreamBootstrapper getInstance(String pubId, SystemId sysId, byte[] data, int start, int end)
{
return new StreamBootstrapper(pubId, sysId, data, start, end);
} | java | public static StreamBootstrapper getInstance(String pubId, SystemId sysId, byte[] data, int start, int end)
{
return new StreamBootstrapper(pubId, sysId, data, start, end);
} | [
"public",
"static",
"StreamBootstrapper",
"getInstance",
"(",
"String",
"pubId",
",",
"SystemId",
"sysId",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"new",
"StreamBootstrapper",
"(",
"pubId",
",",
"sysId",
"... | Factory method used when the underlying data provider is a pre-allocated
block source, and no stream is used.
Additionally the buffer passed is not owned by the bootstrapper
or Reader that is created, so it is not to be recycled. | [
"Factory",
"method",
"used",
"when",
"the",
"underlying",
"data",
"provider",
"is",
"a",
"pre",
"-",
"allocated",
"block",
"source",
"and",
"no",
"stream",
"is",
"used",
".",
"Additionally",
"the",
"buffer",
"passed",
"is",
"not",
"owned",
"by",
"the",
"bo... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/StreamBootstrapper.java#L147-L150 |
102,036 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/StreamBootstrapper.java | StreamBootstrapper.resolveStreamEncoding | protected void resolveStreamEncoding()
throws IOException, WstxException
{
// Let's first set defaults:
mBytesPerChar = 0;
mBigEndian = true;
/* Ok; first just need 4 bytes for determining bytes-per-char from
* BOM or first char(s) of likely xml declaration:
... | java | protected void resolveStreamEncoding()
throws IOException, WstxException
{
// Let's first set defaults:
mBytesPerChar = 0;
mBigEndian = true;
/* Ok; first just need 4 bytes for determining bytes-per-char from
* BOM or first char(s) of likely xml declaration:
... | [
"protected",
"void",
"resolveStreamEncoding",
"(",
")",
"throws",
"IOException",
",",
"WstxException",
"{",
"// Let's first set defaults:",
"mBytesPerChar",
"=",
"0",
";",
"mBigEndian",
"=",
"true",
";",
"/* Ok; first just need 4 bytes for determining bytes-per-char from\n ... | Method called to try to figure out physical encoding the underlying
input stream uses. | [
"Method",
"called",
"to",
"try",
"to",
"figure",
"out",
"physical",
"encoding",
"the",
"underlying",
"input",
"stream",
"uses",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/StreamBootstrapper.java#L296-L421 |
102,037 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/DTDSchemaFactory.java | DTDSchemaFactory.doCreateSchema | @SuppressWarnings("resource")
protected XMLValidationSchema doCreateSchema
(ReaderConfig rcfg, InputBootstrapper bs, String publicId, String systemIdStr, URL ctxt)
throws XMLStreamException
{
try {
Reader r = bs.bootstrapInput(rcfg, false, XmlConsts.XML_V_UNKNOWN);
... | java | @SuppressWarnings("resource")
protected XMLValidationSchema doCreateSchema
(ReaderConfig rcfg, InputBootstrapper bs, String publicId, String systemIdStr, URL ctxt)
throws XMLStreamException
{
try {
Reader r = bs.bootstrapInput(rcfg, false, XmlConsts.XML_V_UNKNOWN);
... | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"protected",
"XMLValidationSchema",
"doCreateSchema",
"(",
"ReaderConfig",
"rcfg",
",",
"InputBootstrapper",
"bs",
",",
"String",
"publicId",
",",
"String",
"systemIdStr",
",",
"URL",
"ctxt",
")",
"throws",
"XMLStre... | The main validator construction method, called by all externally
visible methods. | [
"The",
"main",
"validator",
"construction",
"method",
"called",
"by",
"all",
"externally",
"visible",
"methods",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/DTDSchemaFactory.java#L168-L198 |
102,038 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/ReaderSource.java | ReaderSource.doInitInputLocation | @Override
protected void doInitInputLocation(WstxInputData reader)
{
reader.mCurrInputProcessed = mInputProcessed;
reader.mCurrInputRow = mInputRow;
reader.mCurrInputRowStart = mInputRowStart;
} | java | @Override
protected void doInitInputLocation(WstxInputData reader)
{
reader.mCurrInputProcessed = mInputProcessed;
reader.mCurrInputRow = mInputRow;
reader.mCurrInputRowStart = mInputRowStart;
} | [
"@",
"Override",
"protected",
"void",
"doInitInputLocation",
"(",
"WstxInputData",
"reader",
")",
"{",
"reader",
".",
"mCurrInputProcessed",
"=",
"mInputProcessed",
";",
"reader",
".",
"mCurrInputRow",
"=",
"mInputRow",
";",
"reader",
".",
"mCurrInputRowStart",
"=",... | Input location is easy to set, as we'll start from the beginning
of a File. | [
"Input",
"location",
"is",
"easy",
"to",
"set",
"as",
"we",
"ll",
"start",
"from",
"the",
"beginning",
"of",
"a",
"File",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/ReaderSource.java#L62-L68 |
102,039 | FasterXML/woodstox | src/main/java/com/ctc/wstx/util/BijectiveNsMap.java | BijectiveNsMap.addMapping | public String addMapping(String prefix, String uri)
{
String[] strs = mNsStrings;
int phash = prefix.hashCode();
for (int ix = mScopeStart, end = mScopeEnd; ix < end; ix += 2) {
String thisP = strs[ix];
if (thisP == prefix ||
(thisP.hashCode() == phas... | java | public String addMapping(String prefix, String uri)
{
String[] strs = mNsStrings;
int phash = prefix.hashCode();
for (int ix = mScopeStart, end = mScopeEnd; ix < end; ix += 2) {
String thisP = strs[ix];
if (thisP == prefix ||
(thisP.hashCode() == phas... | [
"public",
"String",
"addMapping",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"{",
"String",
"[",
"]",
"strs",
"=",
"mNsStrings",
";",
"int",
"phash",
"=",
"prefix",
".",
"hashCode",
"(",
")",
";",
"for",
"(",
"int",
"ix",
"=",
"mScopeStart",
... | Method to add a new prefix-to-URI mapping for the current scope.
Note that it should NOT be used for the default namespace
declaration
@param prefix Prefix to bind
@param uri URI to bind to the prefix
@return If the prefix was already bound, the URI it was bound to:
null if it's a new binding for the current scope. | [
"Method",
"to",
"add",
"a",
"new",
"prefix",
"-",
"to",
"-",
"URI",
"mapping",
"for",
"the",
"current",
"scope",
".",
"Note",
"that",
"it",
"should",
"NOT",
"be",
"used",
"for",
"the",
"default",
"namespace",
"declaration"
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/BijectiveNsMap.java#L226-L251 |
102,040 | FasterXML/woodstox | src/main/java/com/ctc/wstx/util/BijectiveNsMap.java | BijectiveNsMap.addGeneratedMapping | public String addGeneratedMapping(String prefixBase, NamespaceContext ctxt,
String uri, int[] seqArr)
{
String[] strs = mNsStrings;
int seqNr = seqArr[0];
String prefix;
main_loop:
while (true) {
/* We better intern the resul... | java | public String addGeneratedMapping(String prefixBase, NamespaceContext ctxt,
String uri, int[] seqArr)
{
String[] strs = mNsStrings;
int seqNr = seqArr[0];
String prefix;
main_loop:
while (true) {
/* We better intern the resul... | [
"public",
"String",
"addGeneratedMapping",
"(",
"String",
"prefixBase",
",",
"NamespaceContext",
"ctxt",
",",
"String",
"uri",
",",
"int",
"[",
"]",
"seqArr",
")",
"{",
"String",
"[",
"]",
"strs",
"=",
"mNsStrings",
";",
"int",
"seqNr",
"=",
"seqArr",
"[",... | Method used to add a dynamic binding, and return the prefix
used to bind the specified namespace URI. | [
"Method",
"used",
"to",
"add",
"a",
"dynamic",
"binding",
"and",
"return",
"the",
"prefix",
"used",
"to",
"bind",
"the",
"specified",
"namespace",
"URI",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/util/BijectiveNsMap.java#L257-L307 |
102,041 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/TypedStreamReader.java | TypedStreamReader.getAttributeAsArray | @Override
public int getAttributeAsArray(int index, TypedArrayDecoder tad) throws XMLStreamException
{
if (mCurrToken != START_ELEMENT) {
throw new IllegalStateException(ErrorConsts.ERR_STATE_NOT_STELEM);
}
return mAttrCollector.decodeValues(index, tad, this);
} | java | @Override
public int getAttributeAsArray(int index, TypedArrayDecoder tad) throws XMLStreamException
{
if (mCurrToken != START_ELEMENT) {
throw new IllegalStateException(ErrorConsts.ERR_STATE_NOT_STELEM);
}
return mAttrCollector.decodeValues(index, tad, this);
} | [
"@",
"Override",
"public",
"int",
"getAttributeAsArray",
"(",
"int",
"index",
",",
"TypedArrayDecoder",
"tad",
")",
"throws",
"XMLStreamException",
"{",
"if",
"(",
"mCurrToken",
"!=",
"START_ELEMENT",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"ErrorC... | Method that allows reading contents of an attribute as an array
of whitespace-separate tokens, decoded using specified decoder.
@return Number of tokens decoded, 0 if none found | [
"Method",
"that",
"allows",
"reading",
"contents",
"of",
"an",
"attribute",
"as",
"an",
"array",
"of",
"whitespace",
"-",
"separate",
"tokens",
"decoded",
"using",
"specified",
"decoder",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/TypedStreamReader.java#L694-L701 |
102,042 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/ReaderBootstrapper.java | ReaderBootstrapper.bootstrapInput | @Override
public Reader bootstrapInput(ReaderConfig cfg, boolean mainDoc, int xmlVersion)
throws IOException, XMLStreamException
{
/* First order of business: allocate input buffer. Not done during
* construction for simplicity; that way config object need not be
* passed befor... | java | @Override
public Reader bootstrapInput(ReaderConfig cfg, boolean mainDoc, int xmlVersion)
throws IOException, XMLStreamException
{
/* First order of business: allocate input buffer. Not done during
* construction for simplicity; that way config object need not be
* passed befor... | [
"@",
"Override",
"public",
"Reader",
"bootstrapInput",
"(",
"ReaderConfig",
"cfg",
",",
"boolean",
"mainDoc",
",",
"int",
"xmlVersion",
")",
"throws",
"IOException",
",",
"XMLStreamException",
"{",
"/* First order of business: allocate input buffer. Not done during\n ... | Method called to do actual bootstrapping.
@return Actual reader to use for reading xml content | [
"Method",
"called",
"to",
"do",
"actual",
"bootstrapping",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/ReaderBootstrapper.java#L119-L188 |
102,043 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/AttributeCollector.java | AttributeCollector.getValueByLocalName | public String getValueByLocalName(String localName)
{
// NOTE: can't use hashing, must do linear scan
switch (mAttrCount) {
case 4:
if (mAttributes[0].hasLocalName(localName)) return getValue(0);
if (mAttributes[1].hasLocalName(localName)) return getValue(1);... | java | public String getValueByLocalName(String localName)
{
// NOTE: can't use hashing, must do linear scan
switch (mAttrCount) {
case 4:
if (mAttributes[0].hasLocalName(localName)) return getValue(0);
if (mAttributes[1].hasLocalName(localName)) return getValue(1);... | [
"public",
"String",
"getValueByLocalName",
"(",
"String",
"localName",
")",
"{",
"// NOTE: can't use hashing, must do linear scan",
"switch",
"(",
"mAttrCount",
")",
"{",
"case",
"4",
":",
"if",
"(",
"mAttributes",
"[",
"0",
"]",
".",
"hasLocalName",
"(",
"localNa... | Specialized version in which namespace information is completely ignored.
@since 5.2 | [
"Specialized",
"version",
"in",
"which",
"namespace",
"information",
"is",
"completely",
"ignored",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/AttributeCollector.java#L421-L454 |
102,044 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/AttributeCollector.java | AttributeCollector.decodeValue | public final void decodeValue(int index, TypedValueDecoder tvd)
throws IllegalArgumentException
{
if (index < 0 || index >= mAttrCount) {
throwIndex(index);
}
/* Should be faster to pass the char array even if we might
* have a String
*/
// Eithe... | java | public final void decodeValue(int index, TypedValueDecoder tvd)
throws IllegalArgumentException
{
if (index < 0 || index >= mAttrCount) {
throwIndex(index);
}
/* Should be faster to pass the char array even if we might
* have a String
*/
// Eithe... | [
"public",
"final",
"void",
"decodeValue",
"(",
"int",
"index",
",",
"TypedValueDecoder",
"tvd",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"mAttrCount",
")",
"{",
"throwIndex",
"(",
"index",
")",
";",
... | Method called to decode the whole attribute value as a single
typed value.
Decoding is done using the decoder provided. | [
"Method",
"called",
"to",
"decode",
"the",
"whole",
"attribute",
"value",
"as",
"a",
"single",
"typed",
"value",
".",
"Decoding",
"is",
"done",
"using",
"the",
"decoder",
"provided",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/AttributeCollector.java#L537-L564 |
102,045 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/AttributeCollector.java | AttributeCollector.decodeValues | public final int decodeValues(int index, TypedArrayDecoder tad,
InputProblemReporter rep)
throws XMLStreamException
{
if (index < 0 || index >= mAttrCount) {
throwIndex(index);
}
// Char[] faster than String... and no need to trim here:
... | java | public final int decodeValues(int index, TypedArrayDecoder tad,
InputProblemReporter rep)
throws XMLStreamException
{
if (index < 0 || index >= mAttrCount) {
throwIndex(index);
}
// Char[] faster than String... and no need to trim here:
... | [
"public",
"final",
"int",
"decodeValues",
"(",
"int",
"index",
",",
"TypedArrayDecoder",
"tad",
",",
"InputProblemReporter",
"rep",
")",
"throws",
"XMLStreamException",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"mAttrCount",
")",
"{",
"throwIndex... | Method called to decode the attribute value that consists of
zero or more space-separated tokens.
Decoding is done using the decoder provided.
@return Number of tokens decoded | [
"Method",
"called",
"to",
"decode",
"the",
"attribute",
"value",
"that",
"consists",
"of",
"zero",
"or",
"more",
"space",
"-",
"separated",
"tokens",
".",
"Decoding",
"is",
"done",
"using",
"the",
"decoder",
"provided",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/AttributeCollector.java#L572-L584 |
102,046 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/AttributeCollector.java | AttributeCollector.checkExpand | private final static boolean checkExpand(TypedArrayDecoder tad)
{
if (tad instanceof ValueDecoderFactory.BaseArrayDecoder) {
((ValueDecoderFactory.BaseArrayDecoder) tad).expand();
return true;
}
return false;
} | java | private final static boolean checkExpand(TypedArrayDecoder tad)
{
if (tad instanceof ValueDecoderFactory.BaseArrayDecoder) {
((ValueDecoderFactory.BaseArrayDecoder) tad).expand();
return true;
}
return false;
} | [
"private",
"final",
"static",
"boolean",
"checkExpand",
"(",
"TypedArrayDecoder",
"tad",
")",
"{",
"if",
"(",
"tad",
"instanceof",
"ValueDecoderFactory",
".",
"BaseArrayDecoder",
")",
"{",
"(",
"(",
"ValueDecoderFactory",
".",
"BaseArrayDecoder",
")",
"tad",
")",
... | Internal method used to see if we can expand the buffer that
the array decoder has. Bit messy, but simpler than having
separately typed instances; and called rarely so that performance
downside of instanceof is irrelevant. | [
"Internal",
"method",
"used",
"to",
"see",
"if",
"we",
"can",
"expand",
"the",
"buffer",
"that",
"the",
"array",
"decoder",
"has",
".",
"Bit",
"messy",
"but",
"simpler",
"than",
"having",
"separately",
"typed",
"instances",
";",
"and",
"called",
"rarely",
... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/AttributeCollector.java#L659-L666 |
102,047 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/AttributeCollector.java | AttributeCollector.resolveNamespaceDecl | protected Attribute resolveNamespaceDecl(int index, boolean internURI)
{
Attribute ns = mNamespaces[index];
String full = mNamespaceBuilder.getAllValues();
String uri;
if (mNsCount == 0) {
uri = full;
} else {
++index;
if (index < mNsCount... | java | protected Attribute resolveNamespaceDecl(int index, boolean internURI)
{
Attribute ns = mNamespaces[index];
String full = mNamespaceBuilder.getAllValues();
String uri;
if (mNsCount == 0) {
uri = full;
} else {
++index;
if (index < mNsCount... | [
"protected",
"Attribute",
"resolveNamespaceDecl",
"(",
"int",
"index",
",",
"boolean",
"internURI",
")",
"{",
"Attribute",
"ns",
"=",
"mNamespaces",
"[",
"index",
"]",
";",
"String",
"full",
"=",
"mNamespaceBuilder",
".",
"getAllValues",
"(",
")",
";",
"String... | Method called to resolve and initialize specified collected
namespace declaration
@return Attribute that contains specified namespace declaration | [
"Method",
"called",
"to",
"resolve",
"and",
"initialize",
"specified",
"collected",
"namespace",
"declaration"
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/AttributeCollector.java#L698-L720 |
102,048 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/AttributeCollector.java | AttributeCollector.addDefaultAttribute | public int addDefaultAttribute(String localName, String uri, String prefix,
String value) throws XMLStreamException
{
int attrIndex = mAttrCount;
if (attrIndex < 1) {
/* had no explicit attributes... better initialize now, then.
* Let's jus... | java | public int addDefaultAttribute(String localName, String uri, String prefix,
String value) throws XMLStreamException
{
int attrIndex = mAttrCount;
if (attrIndex < 1) {
/* had no explicit attributes... better initialize now, then.
* Let's jus... | [
"public",
"int",
"addDefaultAttribute",
"(",
"String",
"localName",
",",
"String",
"uri",
",",
"String",
"prefix",
",",
"String",
"value",
")",
"throws",
"XMLStreamException",
"{",
"int",
"attrIndex",
"=",
"mAttrCount",
";",
"if",
"(",
"attrIndex",
"<",
"1",
... | Method called by validator to insert an attribute that has a default
value and wasn't yet included in collector's attribute set.
@return Index of the newly added attribute, if added; -1 to indicate
this was a duplicate | [
"Method",
"called",
"by",
"validator",
"to",
"insert",
"an",
"attribute",
"that",
"has",
"a",
"default",
"value",
"and",
"wasn",
"t",
"yet",
"included",
"in",
"collector",
"s",
"attribute",
"set",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/AttributeCollector.java#L836-L881 |
102,049 | FasterXML/woodstox | src/main/java/com/ctc/wstx/sr/AttributeCollector.java | AttributeCollector.allocBuffers | protected final void allocBuffers()
{
if (mAttributes == null) {
mAttributes = new Attribute[8];
}
if (mValueBuilder == null) {
mValueBuilder = new TextBuilder(EXP_ATTR_COUNT);
}
} | java | protected final void allocBuffers()
{
if (mAttributes == null) {
mAttributes = new Attribute[8];
}
if (mValueBuilder == null) {
mValueBuilder = new TextBuilder(EXP_ATTR_COUNT);
}
} | [
"protected",
"final",
"void",
"allocBuffers",
"(",
")",
"{",
"if",
"(",
"mAttributes",
"==",
"null",
")",
"{",
"mAttributes",
"=",
"new",
"Attribute",
"[",
"8",
"]",
";",
"}",
"if",
"(",
"mValueBuilder",
"==",
"null",
")",
"{",
"mValueBuilder",
"=",
"n... | Method called to initialize buffers that need not be immediately
initialized | [
"Method",
"called",
"to",
"initialize",
"buffers",
"that",
"need",
"not",
"be",
"immediately",
"initialized"
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/sr/AttributeCollector.java#L1113-L1121 |
102,050 | FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/MinimalDTDReader.java | MinimalDTDReader.skipInternalSubset | protected void skipInternalSubset()
throws XMLStreamException
{
while (true) {
int i = getNextAfterWS();
if (i < 0) {
// Error for internal subset
throwUnexpectedEOF(SUFFIX_IN_DTD_INTERNAL);
}
if (i == '%') { // paramete... | java | protected void skipInternalSubset()
throws XMLStreamException
{
while (true) {
int i = getNextAfterWS();
if (i < 0) {
// Error for internal subset
throwUnexpectedEOF(SUFFIX_IN_DTD_INTERNAL);
}
if (i == '%') { // paramete... | [
"protected",
"void",
"skipInternalSubset",
"(",
")",
"throws",
"XMLStreamException",
"{",
"while",
"(",
"true",
")",
"{",
"int",
"i",
"=",
"getNextAfterWS",
"(",
")",
";",
"if",
"(",
"i",
"<",
"0",
")",
"{",
"// Error for internal subset",
"throwUnexpectedEOF"... | Method that will skip through internal DTD subset, without doing
any parsing, except for trying to match end of subset properly. | [
"Method",
"that",
"will",
"skip",
"through",
"internal",
"DTD",
"subset",
"without",
"doing",
"any",
"parsing",
"except",
"for",
"trying",
"to",
"match",
"end",
"of",
"subset",
"properly",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/MinimalDTDReader.java#L179-L243 |
102,051 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/CharArraySource.java | CharArraySource.doInitInputLocation | @Override
protected void doInitInputLocation(WstxInputData reader)
{
reader.mCurrInputProcessed = mContentStart.getCharacterOffset();
reader.mCurrInputRow = mContentStart.getLineNumber();
/* 13-Apr-2005, TSa: Since column offsets reported by Location
* objects are 1-based, but... | java | @Override
protected void doInitInputLocation(WstxInputData reader)
{
reader.mCurrInputProcessed = mContentStart.getCharacterOffset();
reader.mCurrInputRow = mContentStart.getLineNumber();
/* 13-Apr-2005, TSa: Since column offsets reported by Location
* objects are 1-based, but... | [
"@",
"Override",
"protected",
"void",
"doInitInputLocation",
"(",
"WstxInputData",
"reader",
")",
"{",
"reader",
".",
"mCurrInputProcessed",
"=",
"mContentStart",
".",
"getCharacterOffset",
"(",
")",
";",
"reader",
".",
"mCurrInputRow",
"=",
"mContentStart",
".",
... | Unlike with reader source, we won't start from beginning of a file,
but usually from somewhere in the middle... | [
"Unlike",
"with",
"reader",
"source",
"we",
"won",
"t",
"start",
"from",
"beginning",
"of",
"a",
"file",
"but",
"usually",
"from",
"somewhere",
"in",
"the",
"middle",
"..."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/CharArraySource.java#L44-L54 |
102,052 | FasterXML/woodstox | src/main/java/com/ctc/wstx/io/UTF8Writer.java | UTF8Writer._convertSurrogate | private final int _convertSurrogate(int secondPart)
throws IOException
{
int firstPart = mSurrogate;
mSurrogate = 0;
// Ok, then, is the second part valid?
if (secondPart < SURR2_FIRST || secondPart > SURR2_LAST) {
throw new IOException("Broken surrogate pair: fi... | java | private final int _convertSurrogate(int secondPart)
throws IOException
{
int firstPart = mSurrogate;
mSurrogate = 0;
// Ok, then, is the second part valid?
if (secondPart < SURR2_FIRST || secondPart > SURR2_LAST) {
throw new IOException("Broken surrogate pair: fi... | [
"private",
"final",
"int",
"_convertSurrogate",
"(",
"int",
"secondPart",
")",
"throws",
"IOException",
"{",
"int",
"firstPart",
"=",
"mSurrogate",
";",
"mSurrogate",
"=",
"0",
";",
"// Ok, then, is the second part valid?",
"if",
"(",
"secondPart",
"<",
"SURR2_FIRST... | Method called to calculate UTF codepoint, from a surrogate pair. | [
"Method",
"called",
"to",
"calculate",
"UTF",
"codepoint",
"from",
"a",
"surrogate",
"pair",
"."
] | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/io/UTF8Writer.java#L394-L405 |
102,053 | FasterXML/woodstox | src/main/java/com/ctc/wstx/evt/WstxEventReader.java | WstxEventReader.getErrorDesc | protected String getErrorDesc(int errorType, int currEvent)
{
// Defaults are mostly fine, except we can easily add event type desc
switch (errorType) {
case ERR_GETELEMTEXT_NOT_START_ELEM:
return ErrorConsts.ERR_STATE_NOT_STELEM+", got "+ErrorConsts.tokenTypeDesc(currEvent);
... | java | protected String getErrorDesc(int errorType, int currEvent)
{
// Defaults are mostly fine, except we can easily add event type desc
switch (errorType) {
case ERR_GETELEMTEXT_NOT_START_ELEM:
return ErrorConsts.ERR_STATE_NOT_STELEM+", got "+ErrorConsts.tokenTypeDesc(currEvent);
... | [
"protected",
"String",
"getErrorDesc",
"(",
"int",
"errorType",
",",
"int",
"currEvent",
")",
"{",
"// Defaults are mostly fine, except we can easily add event type desc",
"switch",
"(",
"errorType",
")",
"{",
"case",
"ERR_GETELEMTEXT_NOT_START_ELEM",
":",
"return",
"ErrorC... | Method called upon encountering a problem that should result
in an exception being thrown. If non-null String is returned.
that will be used as the message of exception thrown; if null,
a standard message will be used instead.
@param errorType Type of the problem, one of <code>ERR_</code>
constants
@param eventType Ty... | [
"Method",
"called",
"upon",
"encountering",
"a",
"problem",
"that",
"should",
"result",
"in",
"an",
"exception",
"being",
"thrown",
".",
"If",
"non",
"-",
"null",
"String",
"is",
"returned",
".",
"that",
"will",
"be",
"used",
"as",
"the",
"message",
"of",
... | ffcaabdc06672d9564c48c25d601d029b7fd6548 | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/evt/WstxEventReader.java#L173-L187 |
102,054 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/EastAsianCS.java | EastAsianCS.getLeapMonth | final int getLeapMonth(
int cycle,
int yearOfCycle
) {
int[] leapMonths = this.getLeapMonths();
int elapsedYears = (cycle - 1) * 60 + yearOfCycle - 1;
int index = 2 * ((elapsedYears - leapMonths[0]) / 3); // first lower bound estimation
int lm = 0;
while ((in... | java | final int getLeapMonth(
int cycle,
int yearOfCycle
) {
int[] leapMonths = this.getLeapMonths();
int elapsedYears = (cycle - 1) * 60 + yearOfCycle - 1;
int index = 2 * ((elapsedYears - leapMonths[0]) / 3); // first lower bound estimation
int lm = 0;
while ((in... | [
"final",
"int",
"getLeapMonth",
"(",
"int",
"cycle",
",",
"int",
"yearOfCycle",
")",
"{",
"int",
"[",
"]",
"leapMonths",
"=",
"this",
".",
"getLeapMonths",
"(",
")",
";",
"int",
"elapsedYears",
"=",
"(",
"cycle",
"-",
"1",
")",
"*",
"60",
"+",
"yearO... | number of leap month or zero if no leap year | [
"number",
"of",
"leap",
"month",
"or",
"zero",
"if",
"no",
"leap",
"year"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/EastAsianCS.java#L132-L155 |
102,055 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/EastAsianCS.java | EastAsianCS.isValid | boolean isValid(
int cycle,
int yearOfCycle,
EastAsianMonth month,
int dayOfMonth
) {
if (
(cycle < 72) || (cycle > 94)
|| (yearOfCycle < 1) || (yearOfCycle > 60)
|| ((cycle == 72) && (yearOfCycle < 22))
|| ((cycle == 94) && (ye... | java | boolean isValid(
int cycle,
int yearOfCycle,
EastAsianMonth month,
int dayOfMonth
) {
if (
(cycle < 72) || (cycle > 94)
|| (yearOfCycle < 1) || (yearOfCycle > 60)
|| ((cycle == 72) && (yearOfCycle < 22))
|| ((cycle == 94) && (ye... | [
"boolean",
"isValid",
"(",
"int",
"cycle",
",",
"int",
"yearOfCycle",
",",
"EastAsianMonth",
"month",
",",
"int",
"dayOfMonth",
")",
"{",
"if",
"(",
"(",
"cycle",
"<",
"72",
")",
"||",
"(",
"cycle",
">",
"94",
")",
"||",
"(",
"yearOfCycle",
"<",
"1",... | true if valid else false | [
"true",
"if",
"valid",
"else",
"false"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/EastAsianCS.java#L172-L195 |
102,056 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/EastAsianCS.java | EastAsianCS.hasNoMajorSolarTerm | final boolean hasNoMajorSolarTerm(long utcDays) {
double jd0 = JulianDay.ofEphemerisTime(this.midnight(utcDays)).getValue();
int index0 = (2 + (int) Math.floor(SolarTerm.solarLongitude(jd0) / 30)) % 12;
double jd1 = JulianDay.ofEphemerisTime(this.midnight(this.newMoonOnOrAfter(utcDays + 1))).get... | java | final boolean hasNoMajorSolarTerm(long utcDays) {
double jd0 = JulianDay.ofEphemerisTime(this.midnight(utcDays)).getValue();
int index0 = (2 + (int) Math.floor(SolarTerm.solarLongitude(jd0) / 30)) % 12;
double jd1 = JulianDay.ofEphemerisTime(this.midnight(this.newMoonOnOrAfter(utcDays + 1))).get... | [
"final",
"boolean",
"hasNoMajorSolarTerm",
"(",
"long",
"utcDays",
")",
"{",
"double",
"jd0",
"=",
"JulianDay",
".",
"ofEphemerisTime",
"(",
"this",
".",
"midnight",
"(",
"utcDays",
")",
")",
".",
"getValue",
"(",
")",
";",
"int",
"index0",
"=",
"(",
"2"... | leap months have no major solar terms | [
"leap",
"months",
"have",
"no",
"major",
"solar",
"terms"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/EastAsianCS.java#L215-L221 |
102,057 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/EastAsianCS.java | EastAsianCS.newYearInSui | private long newYearInSui(long utcDays) {
long s1 = this.winterOnOrBefore(utcDays);
long s2 = this.winterOnOrBefore(s1 + 370);
long m12 = this.newMoonOnOrAfter(s1 + 1);
long m13 = this.newMoonOnOrAfter(m12 + 1);
long nextM11 = this.newMoonBefore(s2 + 1);
if ((lunations(m... | java | private long newYearInSui(long utcDays) {
long s1 = this.winterOnOrBefore(utcDays);
long s2 = this.winterOnOrBefore(s1 + 370);
long m12 = this.newMoonOnOrAfter(s1 + 1);
long m13 = this.newMoonOnOrAfter(m12 + 1);
long nextM11 = this.newMoonBefore(s2 + 1);
if ((lunations(m... | [
"private",
"long",
"newYearInSui",
"(",
"long",
"utcDays",
")",
"{",
"long",
"s1",
"=",
"this",
".",
"winterOnOrBefore",
"(",
"utcDays",
")",
";",
"long",
"s2",
"=",
"this",
".",
"winterOnOrBefore",
"(",
"s1",
"+",
"370",
")",
";",
"long",
"m12",
"=",
... | a sui is the period from one winter to next winter ensuring that winter solstice is always in 11th month | [
"a",
"sui",
"is",
"the",
"period",
"from",
"one",
"winter",
"to",
"next",
"winter",
"ensuring",
"that",
"winter",
"solstice",
"is",
"always",
"in",
"11th",
"month"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/EastAsianCS.java#L246-L258 |
102,058 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/EastAsianCS.java | EastAsianCS.newYearOnOrBefore | private long newYearOnOrBefore(long utcDays) {
long ny = this.newYearInSui(utcDays);
if (utcDays >= ny) {
return ny;
} else {
return this.newYearInSui(utcDays - 180); // previous sui
}
} | java | private long newYearOnOrBefore(long utcDays) {
long ny = this.newYearInSui(utcDays);
if (utcDays >= ny) {
return ny;
} else {
return this.newYearInSui(utcDays - 180); // previous sui
}
} | [
"private",
"long",
"newYearOnOrBefore",
"(",
"long",
"utcDays",
")",
"{",
"long",
"ny",
"=",
"this",
".",
"newYearInSui",
"(",
"utcDays",
")",
";",
"if",
"(",
"utcDays",
">=",
"ny",
")",
"{",
"return",
"ny",
";",
"}",
"else",
"{",
"return",
"this",
"... | start of lunisolar year | [
"start",
"of",
"lunisolar",
"year"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/EastAsianCS.java#L261-L268 |
102,059 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/EastAsianCS.java | EastAsianCS.hasLeapMonth | private boolean hasLeapMonth(long m0, long m) {
return (
(m >= m0)
&& (this.hasNoMajorSolarTerm(m) || this.hasLeapMonth(m0, this.newMoonBefore(m)))
);
} | java | private boolean hasLeapMonth(long m0, long m) {
return (
(m >= m0)
&& (this.hasNoMajorSolarTerm(m) || this.hasLeapMonth(m0, this.newMoonBefore(m)))
);
} | [
"private",
"boolean",
"hasLeapMonth",
"(",
"long",
"m0",
",",
"long",
"m",
")",
"{",
"return",
"(",
"(",
"m",
">=",
"m0",
")",
"&&",
"(",
"this",
".",
"hasNoMajorSolarTerm",
"(",
"m",
")",
"||",
"this",
".",
"hasLeapMonth",
"(",
"m0",
",",
"this",
... | is there any leap month between m0 and m? | [
"is",
"there",
"any",
"leap",
"month",
"between",
"m0",
"and",
"m?"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/EastAsianCS.java#L271-L276 |
102,060 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/EastAsianCS.java | EastAsianCS.winterOnOrBefore | private long winterOnOrBefore(long utcDays) {
ZonalOffset offset = this.getOffset(utcDays);
PlainDate date = PlainDate.of(utcDays, EpochDays.UTC);
int year = (((date.getMonth() <= 11) || (date.getDayOfMonth() <= 15)) ? date.getYear() - 1 : date.getYear());
Moment winter = AstronomicalSea... | java | private long winterOnOrBefore(long utcDays) {
ZonalOffset offset = this.getOffset(utcDays);
PlainDate date = PlainDate.of(utcDays, EpochDays.UTC);
int year = (((date.getMonth() <= 11) || (date.getDayOfMonth() <= 15)) ? date.getYear() - 1 : date.getYear());
Moment winter = AstronomicalSea... | [
"private",
"long",
"winterOnOrBefore",
"(",
"long",
"utcDays",
")",
"{",
"ZonalOffset",
"offset",
"=",
"this",
".",
"getOffset",
"(",
"utcDays",
")",
";",
"PlainDate",
"date",
"=",
"PlainDate",
".",
"of",
"(",
"utcDays",
",",
"EpochDays",
".",
"UTC",
")",
... | search for winter solstice | [
"search",
"for",
"winter",
"solstice"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/EastAsianCS.java#L295-L306 |
102,061 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/AstronomicalHijriData.java | AstronomicalHijriData.search | private static int search(
long utcDays,
long[] firstOfMonth
) {
int low = 0;
int high = firstOfMonth.length - 1;
while (low <= high) {
int middle = (low + high) / 2;
if (firstOfMonth[middle] <= utcDays) {
low = middle + 1;
... | java | private static int search(
long utcDays,
long[] firstOfMonth
) {
int low = 0;
int high = firstOfMonth.length - 1;
while (low <= high) {
int middle = (low + high) / 2;
if (firstOfMonth[middle] <= utcDays) {
low = middle + 1;
... | [
"private",
"static",
"int",
"search",
"(",
"long",
"utcDays",
",",
"long",
"[",
"]",
"firstOfMonth",
")",
"{",
"int",
"low",
"=",
"0",
";",
"int",
"high",
"=",
"firstOfMonth",
".",
"length",
"-",
"1",
";",
"while",
"(",
"low",
"<=",
"high",
")",
"{... | returns index of month-start associated with utcDays | [
"returns",
"index",
"of",
"month",
"-",
"start",
"associated",
"with",
"utcDays"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/AstronomicalHijriData.java#L311-L331 |
102,062 | MenoData/Time4J | base/src/main/java/net/time4j/clock/SntpMessage.java | SntpMessage.decode | private static double decode(
byte[] data,
int pointer
) {
long ntp = 0L;
for (int i = 0; i < 8; i++) {
long unsigned = (data[i + pointer] & 0xFF);
ntp |= (unsigned << (56 - i * 8));
}
// Festkomma vor Bit 32, deshalb Bits nach rechts schieb... | java | private static double decode(
byte[] data,
int pointer
) {
long ntp = 0L;
for (int i = 0; i < 8; i++) {
long unsigned = (data[i + pointer] & 0xFF);
ntp |= (unsigned << (56 - i * 8));
}
// Festkomma vor Bit 32, deshalb Bits nach rechts schieb... | [
"private",
"static",
"double",
"decode",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"pointer",
")",
"{",
"long",
"ntp",
"=",
"0L",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"8",
";",
"i",
"++",
")",
"{",
"long",
"unsigned",
"=",
"... | NTP-Timestamp aus byte-Array dekodieren | [
"NTP",
"-",
"Timestamp",
"aus",
"byte",
"-",
"Array",
"dekodieren"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/clock/SntpMessage.java#L832-L852 |
102,063 | MenoData/Time4J | base/src/main/java/net/time4j/clock/SntpMessage.java | SntpMessage.encode | private static void encode(
byte[] data,
int pointer,
double timestamp
) {
// UT1-Mikrosekunden konstruieren
long ut1 = convert(timestamp);
boolean before2036 = (ut1 + OFFSET_2036 < 0);
long micros;
if (before2036) {
micros = ut1 + OFFSET... | java | private static void encode(
byte[] data,
int pointer,
double timestamp
) {
// UT1-Mikrosekunden konstruieren
long ut1 = convert(timestamp);
boolean before2036 = (ut1 + OFFSET_2036 < 0);
long micros;
if (before2036) {
micros = ut1 + OFFSET... | [
"private",
"static",
"void",
"encode",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"pointer",
",",
"double",
"timestamp",
")",
"{",
"// UT1-Mikrosekunden konstruieren",
"long",
"ut1",
"=",
"convert",
"(",
"timestamp",
")",
";",
"boolean",
"before2036",
"=",
"... | NTP-Timestamp als byte-Array kodieren | [
"NTP",
"-",
"Timestamp",
"als",
"byte",
"-",
"Array",
"kodieren"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/clock/SntpMessage.java#L855-L893 |
102,064 | MenoData/Time4J | base/src/main/java/net/time4j/range/SPX.java | SPX.readBoundary | private static Object readBoundary(
ObjectInput in,
byte header
) throws IOException, ClassNotFoundException {
int past = (header & 0x1);
if (past == 1) {
return Boundary.infinitePast();
}
int future = (header & 0x2);
if (future == 2) {
... | java | private static Object readBoundary(
ObjectInput in,
byte header
) throws IOException, ClassNotFoundException {
int past = (header & 0x1);
if (past == 1) {
return Boundary.infinitePast();
}
int future = (header & 0x2);
if (future == 2) {
... | [
"private",
"static",
"Object",
"readBoundary",
"(",
"ObjectInput",
"in",
",",
"byte",
"header",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"int",
"past",
"=",
"(",
"header",
"&",
"0x1",
")",
";",
"if",
"(",
"past",
"==",
"1",
")",
... | serialization of a single boundary object | [
"serialization",
"of",
"a",
"single",
"boundary",
"object"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/SPX.java#L521-L555 |
102,065 | MenoData/Time4J | base/src/main/java/net/time4j/range/TimestampInterval.java | TimestampInterval.in | MomentInterval in(Timezone tz) {
Boundary<Moment> b1;
Boundary<Moment> b2;
if (this.getStart().isInfinite()) {
b1 = Boundary.infinitePast();
} else {
Moment m1 = this.getStart().getTemporal().in(tz);
b1 = Boundary.of(this.getStart().getEdge(), m1);
... | java | MomentInterval in(Timezone tz) {
Boundary<Moment> b1;
Boundary<Moment> b2;
if (this.getStart().isInfinite()) {
b1 = Boundary.infinitePast();
} else {
Moment m1 = this.getStart().getTemporal().in(tz);
b1 = Boundary.of(this.getStart().getEdge(), m1);
... | [
"MomentInterval",
"in",
"(",
"Timezone",
"tz",
")",
"{",
"Boundary",
"<",
"Moment",
">",
"b1",
";",
"Boundary",
"<",
"Moment",
">",
"b2",
";",
"if",
"(",
"this",
".",
"getStart",
"(",
")",
".",
"isInfinite",
"(",
")",
")",
"{",
"b1",
"=",
"Boundary... | combines this local timestamp interval with given timezone to a global UTC-interval | [
"combines",
"this",
"local",
"timestamp",
"interval",
"with",
"given",
"timezone",
"to",
"a",
"global",
"UTC",
"-",
"interval"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/TimestampInterval.java#L1457-L1478 |
102,066 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/astro/JulianDay.java | JulianDay.getValue | static double getValue(
Moment moment,
TimeScale scale
) {
long elapsedTime = moment.getElapsedTime(scale) + jdOffset(scale);
int nano = moment.getNanosecond(scale);
double secs = elapsedTime + nano / (MRD * 1.0);
return secs / DAY_IN_SECONDS;
} | java | static double getValue(
Moment moment,
TimeScale scale
) {
long elapsedTime = moment.getElapsedTime(scale) + jdOffset(scale);
int nano = moment.getNanosecond(scale);
double secs = elapsedTime + nano / (MRD * 1.0);
return secs / DAY_IN_SECONDS;
} | [
"static",
"double",
"getValue",
"(",
"Moment",
"moment",
",",
"TimeScale",
"scale",
")",
"{",
"long",
"elapsedTime",
"=",
"moment",
".",
"getElapsedTime",
"(",
"scale",
")",
"+",
"jdOffset",
"(",
"scale",
")",
";",
"int",
"nano",
"=",
"moment",
".",
"get... | obtains the JD-value for given moment and scale | [
"obtains",
"the",
"JD",
"-",
"value",
"for",
"given",
"moment",
"and",
"scale"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/astro/JulianDay.java#L543-L553 |
102,067 | MenoData/Time4J | base/src/main/java/net/time4j/DayPeriod.java | DayPeriod.of | static DayPeriod of(
Locale locale,
String calendarType
) {
String lang = locale.getLanguage(); // NPE-check
if (lang.equals("nn")) {
locale = new Locale("nb"); // CLDR 29 contains no data for language nn
}
Map<String, String> resourceMap = loadTextForm... | java | static DayPeriod of(
Locale locale,
String calendarType
) {
String lang = locale.getLanguage(); // NPE-check
if (lang.equals("nn")) {
locale = new Locale("nb"); // CLDR 29 contains no data for language nn
}
Map<String, String> resourceMap = loadTextForm... | [
"static",
"DayPeriod",
"of",
"(",
"Locale",
"locale",
",",
"String",
"calendarType",
")",
"{",
"String",
"lang",
"=",
"locale",
".",
"getLanguage",
"(",
")",
";",
"// NPE-check",
"if",
"(",
"lang",
".",
"equals",
"(",
"\"nn\"",
")",
")",
"{",
"locale",
... | package-private because used in deserialization | [
"package",
"-",
"private",
"because",
"used",
"in",
"deserialization"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/DayPeriod.java#L441-L495 |
102,068 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/astro/SolarTime.java | SolarTime.getHighestElevationOfSun | double getHighestElevationOfSun(PlainDate date) {
Moment noon = date.get(this.transitAtNoon());
double jde = JulianDay.getValue(noon, TimeScale.TT);
double decInRad = Math.toRadians(this.getCalculator().getFeature(jde, DECLINATION));
double latInRad = Math.toRadians(this.latitude);
... | java | double getHighestElevationOfSun(PlainDate date) {
Moment noon = date.get(this.transitAtNoon());
double jde = JulianDay.getValue(noon, TimeScale.TT);
double decInRad = Math.toRadians(this.getCalculator().getFeature(jde, DECLINATION));
double latInRad = Math.toRadians(this.latitude);
... | [
"double",
"getHighestElevationOfSun",
"(",
"PlainDate",
"date",
")",
"{",
"Moment",
"noon",
"=",
"date",
".",
"get",
"(",
"this",
".",
"transitAtNoon",
"(",
")",
")",
";",
"double",
"jde",
"=",
"JulianDay",
".",
"getValue",
"(",
"noon",
",",
"TimeScale",
... | used in test classes, too | [
"used",
"in",
"test",
"classes",
"too"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/astro/SolarTime.java#L1066-L1083 |
102,069 | MenoData/Time4J | base/src/main/java/net/time4j/history/EraPreference.java | EraPreference.getPreferredEra | HistoricEra getPreferredEra(
HistoricDate hd,
PlainDate date
) {
if ((this.era == null) || date.isBefore(this.start) || date.isAfter(this.end)) {
return ((hd.compareTo(AD1) < 0) ? HistoricEra.BC : HistoricEra.AD);
} else if ((this.era == HistoricEra.HISPANIC) && (hd.comp... | java | HistoricEra getPreferredEra(
HistoricDate hd,
PlainDate date
) {
if ((this.era == null) || date.isBefore(this.start) || date.isAfter(this.end)) {
return ((hd.compareTo(AD1) < 0) ? HistoricEra.BC : HistoricEra.AD);
} else if ((this.era == HistoricEra.HISPANIC) && (hd.comp... | [
"HistoricEra",
"getPreferredEra",
"(",
"HistoricDate",
"hd",
",",
"PlainDate",
"date",
")",
"{",
"if",
"(",
"(",
"this",
".",
"era",
"==",
"null",
")",
"||",
"date",
".",
"isBefore",
"(",
"this",
".",
"start",
")",
"||",
"date",
".",
"isAfter",
"(",
... | determines the preferred era for a given historic date | [
"determines",
"the",
"preferred",
"era",
"for",
"a",
"given",
"historic",
"date"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/history/EraPreference.java#L324-L337 |
102,070 | MenoData/Time4J | base/src/main/java/net/time4j/tz/model/ArrayTransitionModel.java | ArrayTransitionModel.dump | void dump(
int size,
Appendable buffer
) throws IOException {
for (int i = 0; i < size; i++) {
ZonalTransition transition = this.transitions[i];
TransitionModel.dump(transition, buffer);
}
} | java | void dump(
int size,
Appendable buffer
) throws IOException {
for (int i = 0; i < size; i++) {
ZonalTransition transition = this.transitions[i];
TransitionModel.dump(transition, buffer);
}
} | [
"void",
"dump",
"(",
"int",
"size",
",",
"Appendable",
"buffer",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"ZonalTransition",
"transition",
"=",
"this",
".",
"transitions",
"... | Called by CompositeTransitionModel | [
"Called",
"by",
"CompositeTransitionModel"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/model/ArrayTransitionModel.java#L336-L346 |
102,071 | MenoData/Time4J | base/src/main/java/net/time4j/tz/model/ArrayTransitionModel.java | ArrayTransitionModel.search | private static int search(
long posixTime,
ZonalTransition[] transitions
) {
int low = 0;
int high = transitions.length - 1;
while (low <= high) {
int middle = (low + high) / 2;
if (transitions[middle].getPosixTime() <= posixTime) {
... | java | private static int search(
long posixTime,
ZonalTransition[] transitions
) {
int low = 0;
int high = transitions.length - 1;
while (low <= high) {
int middle = (low + high) / 2;
if (transitions[middle].getPosixTime() <= posixTime) {
... | [
"private",
"static",
"int",
"search",
"(",
"long",
"posixTime",
",",
"ZonalTransition",
"[",
"]",
"transitions",
")",
"{",
"int",
"low",
"=",
"0",
";",
"int",
"high",
"=",
"transitions",
".",
"length",
"-",
"1",
";",
"while",
"(",
"low",
"<=",
"high",
... | returns index of first transition after posixTime | [
"returns",
"index",
"of",
"first",
"transition",
"after",
"posixTime"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/model/ArrayTransitionModel.java#L475-L495 |
102,072 | MenoData/Time4J | base/src/main/java/net/time4j/tz/model/ArrayTransitionModel.java | ArrayTransitionModel.searchLocal | private static int searchLocal(
long localSecs,
ZonalTransition[] transitions
) {
int low = 0;
int high = transitions.length - 1;
while (low <= high) {
int middle = (low + high) / 2;
ZonalTransition zt = transitions[middle];
int offset = ... | java | private static int searchLocal(
long localSecs,
ZonalTransition[] transitions
) {
int low = 0;
int high = transitions.length - 1;
while (low <= high) {
int middle = (low + high) / 2;
ZonalTransition zt = transitions[middle];
int offset = ... | [
"private",
"static",
"int",
"searchLocal",
"(",
"long",
"localSecs",
",",
"ZonalTransition",
"[",
"]",
"transitions",
")",
"{",
"int",
"low",
"=",
"0",
";",
"int",
"high",
"=",
"transitions",
".",
"length",
"-",
"1",
";",
"while",
"(",
"low",
"<=",
"hi... | returns index of first transition after local date and time | [
"returns",
"index",
"of",
"first",
"transition",
"after",
"local",
"date",
"and",
"time"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/model/ArrayTransitionModel.java#L498-L520 |
102,073 | MenoData/Time4J | base/src/main/java/net/time4j/engine/ChronoEntity.java | ChronoEntity.getRule | <V> ElementRule<T, V> getRule(ChronoElement<V> element) {
return this.getChronology().getRule(element);
} | java | <V> ElementRule<T, V> getRule(ChronoElement<V> element) {
return this.getChronology().getRule(element);
} | [
"<",
"V",
">",
"ElementRule",
"<",
"T",
",",
"V",
">",
"getRule",
"(",
"ChronoElement",
"<",
"V",
">",
"element",
")",
"{",
"return",
"this",
".",
"getChronology",
"(",
")",
".",
"getRule",
"(",
"element",
")",
";",
"}"
] | Determines the associated element rule.
@param <V> value type of element
@param element chronological element to be evaluated
@return element rule
@throws RuleNotFoundException if a rule cannot be determined | [
"Determines",
"the",
"associated",
"element",
"rule",
"."
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/engine/ChronoEntity.java#L616-L620 |
102,074 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/Nengo.java | Nengo.getValue | int getValue() {
if (this.matches(Selector.NORTHERN_COURT)) {
return (this.index - NORTHERN_NENGOS.length + NENGO_OEI.index - Nengo.SHOWA.index + 1);
}
return (this.index - Nengo.SHOWA.index + 1);
} | java | int getValue() {
if (this.matches(Selector.NORTHERN_COURT)) {
return (this.index - NORTHERN_NENGOS.length + NENGO_OEI.index - Nengo.SHOWA.index + 1);
}
return (this.index - Nengo.SHOWA.index + 1);
} | [
"int",
"getValue",
"(",
")",
"{",
"if",
"(",
"this",
".",
"matches",
"(",
"Selector",
".",
"NORTHERN_COURT",
")",
")",
"{",
"return",
"(",
"this",
".",
"index",
"-",
"NORTHERN_NENGOS",
".",
"length",
"+",
"NENGO_OEI",
".",
"index",
"-",
"Nengo",
".",
... | verwendet in JapaneseCalendar | [
"verwendet",
"in",
"JapaneseCalendar"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/Nengo.java#L1030-L1038 |
102,075 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/JapaneseCalendar.java | JapaneseCalendar.transform | static long transform(
int relgregyear,
int dayOfYear
) {
if (relgregyear >= 1873) {
return PlainDate.of(relgregyear, dayOfYear).getDaysSinceEpochUTC();
} else {
return START_OF_YEAR[relgregyear - 701] + dayOfYear - 1;
}
} | java | static long transform(
int relgregyear,
int dayOfYear
) {
if (relgregyear >= 1873) {
return PlainDate.of(relgregyear, dayOfYear).getDaysSinceEpochUTC();
} else {
return START_OF_YEAR[relgregyear - 701] + dayOfYear - 1;
}
} | [
"static",
"long",
"transform",
"(",
"int",
"relgregyear",
",",
"int",
"dayOfYear",
")",
"{",
"if",
"(",
"relgregyear",
">=",
"1873",
")",
"{",
"return",
"PlainDate",
".",
"of",
"(",
"relgregyear",
",",
"dayOfYear",
")",
".",
"getDaysSinceEpochUTC",
"(",
")... | also used in serialization | [
"also",
"used",
"in",
"serialization"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/JapaneseCalendar.java#L1546-L1557 |
102,076 | MenoData/Time4J | base/src/main/java/net/time4j/format/expert/LiteralProcessor.java | LiteralProcessor.getPrefixedDigitArea | int getPrefixedDigitArea() {
if (this.multi == null) {
return 0;
}
int digits = 0;
for (int i = 0, n = this.multi.length(); i < n && Character.isDigit(this.multi.charAt(i)); i++) {
digits++;
}
return digits;
} | java | int getPrefixedDigitArea() {
if (this.multi == null) {
return 0;
}
int digits = 0;
for (int i = 0, n = this.multi.length(); i < n && Character.isDigit(this.multi.charAt(i)); i++) {
digits++;
}
return digits;
} | [
"int",
"getPrefixedDigitArea",
"(",
")",
"{",
"if",
"(",
"this",
".",
"multi",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"int",
"digits",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"n",
"=",
"this",
".",
"multi",
".",
"length"... | count of leading digits | [
"count",
"of",
"leading",
"digits"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/format/expert/LiteralProcessor.java#L417-L431 |
102,077 | MenoData/Time4J | base/src/main/java/net/time4j/format/expert/LiteralProcessor.java | LiteralProcessor.subSequenceEquals | static int subSequenceEquals(
CharSequence test,
int offset,
CharSequence expected,
boolean caseInsensitive,
boolean rtl
) {
int j = 0;
int max = test.length();
int len = expected.length();
for (int i = 0; i < len; i++) {
char c =... | java | static int subSequenceEquals(
CharSequence test,
int offset,
CharSequence expected,
boolean caseInsensitive,
boolean rtl
) {
int j = 0;
int max = test.length();
int len = expected.length();
for (int i = 0; i < len; i++) {
char c =... | [
"static",
"int",
"subSequenceEquals",
"(",
"CharSequence",
"test",
",",
"int",
"offset",
",",
"CharSequence",
"expected",
",",
"boolean",
"caseInsensitive",
",",
"boolean",
"rtl",
")",
"{",
"int",
"j",
"=",
"0",
";",
"int",
"max",
"=",
"test",
".",
"length... | also used by LocalizedGMTProcessor | [
"also",
"used",
"by",
"LocalizedGMTProcessor"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/format/expert/LiteralProcessor.java#L434-L485 |
102,078 | MenoData/Time4J | base/src/main/java/net/time4j/format/expert/ChronoFormatter.java | ChronoFormatter.with | ChronoFormatter<T> with(
Map<ChronoElement<?>, Object> outerDefaults,
AttributeSet outerAttrs
) {
AttributeSet merged = AttributeSet.merge(outerAttrs, this.globalAttributes);
return new ChronoFormatter<>(
new ChronoFormatter<>(this, outerDefaults),
merged,
... | java | ChronoFormatter<T> with(
Map<ChronoElement<?>, Object> outerDefaults,
AttributeSet outerAttrs
) {
AttributeSet merged = AttributeSet.merge(outerAttrs, this.globalAttributes);
return new ChronoFormatter<>(
new ChronoFormatter<>(this, outerDefaults),
merged,
... | [
"ChronoFormatter",
"<",
"T",
">",
"with",
"(",
"Map",
"<",
"ChronoElement",
"<",
"?",
">",
",",
"Object",
">",
"outerDefaults",
",",
"AttributeSet",
"outerAttrs",
")",
"{",
"AttributeSet",
"merged",
"=",
"AttributeSet",
".",
"merge",
"(",
"outerAttrs",
",",
... | used by CustomizedProcessor | [
"used",
"by",
"CustomizedProcessor"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/format/expert/ChronoFormatter.java#L2039-L2051 |
102,079 | MenoData/Time4J | base/src/main/java/net/time4j/format/expert/ChronoFormatter.java | ChronoFormatter.hasUnixChronology | static boolean hasUnixChronology(Chronology<?> chronology) {
Chronology<?> c = chronology;
do {
if (UnixTime.class.isAssignableFrom(c.getChronoType())) {
return true;
}
} while ((c = c.preparser()) != null);
return false;
} | java | static boolean hasUnixChronology(Chronology<?> chronology) {
Chronology<?> c = chronology;
do {
if (UnixTime.class.isAssignableFrom(c.getChronoType())) {
return true;
}
} while ((c = c.preparser()) != null);
return false;
} | [
"static",
"boolean",
"hasUnixChronology",
"(",
"Chronology",
"<",
"?",
">",
"chronology",
")",
"{",
"Chronology",
"<",
"?",
">",
"c",
"=",
"chronology",
";",
"do",
"{",
"if",
"(",
"UnixTime",
".",
"class",
".",
"isAssignableFrom",
"(",
"c",
".",
"getChro... | also called in PatternType | [
"also",
"called",
"in",
"PatternType"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/format/expert/ChronoFormatter.java#L3080-L3092 |
102,080 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/astro/LunarTime.java | LunarTime.sinAlt | private static double sinAlt(
double mjd0, // earliest moment of calendar date (usually midnight)
double hour,
double longitudeRad,
double cosLatitude,
double sinLatitude,
double geodeticAngle,
double refraction,
double deltaT
) {
double mjd =... | java | private static double sinAlt(
double mjd0, // earliest moment of calendar date (usually midnight)
double hour,
double longitudeRad,
double cosLatitude,
double sinLatitude,
double geodeticAngle,
double refraction,
double deltaT
) {
double mjd =... | [
"private",
"static",
"double",
"sinAlt",
"(",
"double",
"mjd0",
",",
"// earliest moment of calendar date (usually midnight)",
"double",
"hour",
",",
"double",
"longitudeRad",
",",
"double",
"cosLatitude",
",",
"double",
"sinLatitude",
",",
"double",
"geodeticAngle",
",... | sinus of moon altitude above or below horizon | [
"sinus",
"of",
"moon",
"altitude",
"above",
"or",
"below",
"horizon"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/astro/LunarTime.java#L427-L454 |
102,081 | MenoData/Time4J | base/src/main/java/net/time4j/format/internal/FormatUtils.java | FormatUtils.removeZones | public static String removeZones(String pattern) {
boolean literal = false;
StringBuilder sb = new StringBuilder();
for (int i = 0, n = pattern.length(); i < n; i++) {
char c = pattern.charAt(i);
if (c == '\'') {
if (i + 1 < n && pattern.charAt(i + 1) =... | java | public static String removeZones(String pattern) {
boolean literal = false;
StringBuilder sb = new StringBuilder();
for (int i = 0, n = pattern.length(); i < n; i++) {
char c = pattern.charAt(i);
if (c == '\'') {
if (i + 1 < n && pattern.charAt(i + 1) =... | [
"public",
"static",
"String",
"removeZones",
"(",
"String",
"pattern",
")",
"{",
"boolean",
"literal",
"=",
"false",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"n",
"=",
"pattern",
"."... | Strips off any timezone symbols in clock time patterns. | [
"Strips",
"off",
"any",
"timezone",
"symbols",
"in",
"clock",
"time",
"patterns",
"."
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/format/internal/FormatUtils.java#L104-L149 |
102,082 | MenoData/Time4J | base/src/main/java/net/time4j/PlainTime.java | PlainTime.printNanos | static void printNanos(
StringBuilder sb,
int nano
) {
sb.append(PlainTime.ISO_DECIMAL_SEPARATOR);
String num = Integer.toString(nano);
int len;
if ((nano % MIO) == 0) {
len = 3;
} else if ((nano % KILO) == 0) {
len = 6;
} els... | java | static void printNanos(
StringBuilder sb,
int nano
) {
sb.append(PlainTime.ISO_DECIMAL_SEPARATOR);
String num = Integer.toString(nano);
int len;
if ((nano % MIO) == 0) {
len = 3;
} else if ((nano % KILO) == 0) {
len = 6;
} els... | [
"static",
"void",
"printNanos",
"(",
"StringBuilder",
"sb",
",",
"int",
"nano",
")",
"{",
"sb",
".",
"append",
"(",
"PlainTime",
".",
"ISO_DECIMAL_SEPARATOR",
")",
";",
"String",
"num",
"=",
"Integer",
".",
"toString",
"(",
"nano",
")",
";",
"int",
"len"... | also called by ZonalDateTime | [
"also",
"called",
"by",
"ZonalDateTime"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/PlainTime.java#L1768-L1793 |
102,083 | MenoData/Time4J | base/src/main/java/net/time4j/format/expert/AttributeSet.java | AttributeSet.merge | static AttributeSet merge(
AttributeSet outer,
AttributeSet inner
) {
Map<String, Object> internalsNew = new HashMap<>();
internalsNew.putAll(inner.internals);
internalsNew.putAll(outer.internals);
Attributes attributesNew =
new Attributes.Builder()
... | java | static AttributeSet merge(
AttributeSet outer,
AttributeSet inner
) {
Map<String, Object> internalsNew = new HashMap<>();
internalsNew.putAll(inner.internals);
internalsNew.putAll(outer.internals);
Attributes attributesNew =
new Attributes.Builder()
... | [
"static",
"AttributeSet",
"merge",
"(",
"AttributeSet",
"outer",
",",
"AttributeSet",
"inner",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"internalsNew",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"internalsNew",
".",
"putAll",
"(",
"inner",
".",... | used to create merged global attributes for a new formatter | [
"used",
"to",
"create",
"merged",
"global",
"attributes",
"for",
"a",
"new",
"formatter"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/format/expert/AttributeSet.java#L442-L458 |
102,084 | MenoData/Time4J | base/src/main/java/net/time4j/format/expert/ParsedValues.java | ParsedValues.reset | void reset() {
if (this.keys == null) {
this.len = Integer.MIN_VALUE;
this.mask = Integer.MIN_VALUE;
this.threshold = Integer.MIN_VALUE;
this.count = Integer.MIN_VALUE;
for (int i = 0; i < 3; i++) {
this.ints[i] = Integer.MIN_VALUE;
... | java | void reset() {
if (this.keys == null) {
this.len = Integer.MIN_VALUE;
this.mask = Integer.MIN_VALUE;
this.threshold = Integer.MIN_VALUE;
this.count = Integer.MIN_VALUE;
for (int i = 0; i < 3; i++) {
this.ints[i] = Integer.MIN_VALUE;
... | [
"void",
"reset",
"(",
")",
"{",
"if",
"(",
"this",
".",
"keys",
"==",
"null",
")",
"{",
"this",
".",
"len",
"=",
"Integer",
".",
"MIN_VALUE",
";",
"this",
".",
"mask",
"=",
"Integer",
".",
"MIN_VALUE",
";",
"this",
".",
"threshold",
"=",
"Integer",... | called in context of erraneous or-block | [
"called",
"in",
"context",
"of",
"erraneous",
"or",
"-",
"block"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/format/expert/ParsedValues.java#L545-L562 |
102,085 | MenoData/Time4J | base/src/main/java/net/time4j/range/SingleUnitTimeSpan.java | SingleUnitTimeSpan.parsePeriod | static int parsePeriod(
String period,
char symbol
) throws ParseException {
if (period.isEmpty()) {
throw new ParseException("Empty period.", 0);
}
boolean negative = false;
int index = 0;
int len = period.length();
if (period.charAt(0)... | java | static int parsePeriod(
String period,
char symbol
) throws ParseException {
if (period.isEmpty()) {
throw new ParseException("Empty period.", 0);
}
boolean negative = false;
int index = 0;
int len = period.length();
if (period.charAt(0)... | [
"static",
"int",
"parsePeriod",
"(",
"String",
"period",
",",
"char",
"symbol",
")",
"throws",
"ParseException",
"{",
"if",
"(",
"period",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"ParseException",
"(",
"\"Empty period.\"",
",",
"0",
")",
";",
... | called by subclasses | [
"called",
"by",
"subclasses"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/SingleUnitTimeSpan.java#L464-L519 |
102,086 | MenoData/Time4J | base/src/main/java/net/time4j/tz/model/SPX.java | SPX.writeTransitions | static void writeTransitions(
ZonalTransition[] transitions,
int size,
DataOutput out
) throws IOException {
int n = Math.min(size, transitions.length);
out.writeInt(n);
if (n > 0) {
int stdOffset = transitions[0].getPreviousOffset();
writeOf... | java | static void writeTransitions(
ZonalTransition[] transitions,
int size,
DataOutput out
) throws IOException {
int n = Math.min(size, transitions.length);
out.writeInt(n);
if (n > 0) {
int stdOffset = transitions[0].getPreviousOffset();
writeOf... | [
"static",
"void",
"writeTransitions",
"(",
"ZonalTransition",
"[",
"]",
"transitions",
",",
"int",
"size",
",",
"DataOutput",
"out",
")",
"throws",
"IOException",
"{",
"int",
"n",
"=",
"Math",
".",
"min",
"(",
"size",
",",
"transitions",
".",
"length",
")"... | called by ArrayTransitionModel | [
"called",
"by",
"ArrayTransitionModel"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/model/SPX.java#L218-L236 |
102,087 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/service/StdEnumDateElement.java | StdEnumDateElement.accessor | protected TextAccessor accessor(
AttributeQuery attributes,
OutputContext outputContext,
boolean leap
) {
Locale lang = attributes.get(Attributes.LANGUAGE, Locale.ROOT);
TextWidth textWidth = attributes.get(Attributes.TEXT_WIDTH, TextWidth.WIDE);
CalendarText cnames ... | java | protected TextAccessor accessor(
AttributeQuery attributes,
OutputContext outputContext,
boolean leap
) {
Locale lang = attributes.get(Attributes.LANGUAGE, Locale.ROOT);
TextWidth textWidth = attributes.get(Attributes.TEXT_WIDTH, TextWidth.WIDE);
CalendarText cnames ... | [
"protected",
"TextAccessor",
"accessor",
"(",
"AttributeQuery",
"attributes",
",",
"OutputContext",
"outputContext",
",",
"boolean",
"leap",
")",
"{",
"Locale",
"lang",
"=",
"attributes",
".",
"get",
"(",
"Attributes",
".",
"LANGUAGE",
",",
"Locale",
".",
"ROOT"... | Might be overridden in special cases.
@param attributes format attributes
@param outputContext the output context
@param leap leap month flag
@return TextAccessor
@since 5.3 | [
"Might",
"be",
"overridden",
"in",
"special",
"cases",
"."
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/service/StdEnumDateElement.java#L309-L333 |
102,088 | MenoData/Time4J | base/src/main/java/net/time4j/calendar/HijriAdjustment.java | HijriAdjustment.from | static HijriAdjustment from(String variant) {
int index = variant.indexOf(':');
if (index == -1) {
return new HijriAdjustment(variant, 0);
} else {
try {
int adjustment = Integer.parseInt(variant.substring(index + 1));
return new HijriAdj... | java | static HijriAdjustment from(String variant) {
int index = variant.indexOf(':');
if (index == -1) {
return new HijriAdjustment(variant, 0);
} else {
try {
int adjustment = Integer.parseInt(variant.substring(index + 1));
return new HijriAdj... | [
"static",
"HijriAdjustment",
"from",
"(",
"String",
"variant",
")",
"{",
"int",
"index",
"=",
"variant",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"return",
"new",
"HijriAdjustment",
"(",
"variant",
",",
"... | also called by Hijri calendar systems | [
"also",
"called",
"by",
"Hijri",
"calendar",
"systems"
] | 08b2eda6b2dbb140b92011cf7071bb087edd46a5 | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/HijriAdjustment.java#L196-L211 |
102,089 | TonicArtos/StickyGridHeaders | Library/src/com/tonicartos/widget/stickygridheaders/StickyGridHeadersBaseAdapterWrapper.java | StickyGridHeadersBaseAdapterWrapper.unFilledSpacesInHeaderGroup | private int unFilledSpacesInHeaderGroup(int header) {
//If mNumColumns is equal to zero we will have a divide by 0 exception
if(mNumColumns == 0){
return 0;
}
int remainder = mDelegate.getCountForHeader(header) % mNumColumns;
return remainder == 0 ? 0 : mNumColumns -... | java | private int unFilledSpacesInHeaderGroup(int header) {
//If mNumColumns is equal to zero we will have a divide by 0 exception
if(mNumColumns == 0){
return 0;
}
int remainder = mDelegate.getCountForHeader(header) % mNumColumns;
return remainder == 0 ? 0 : mNumColumns -... | [
"private",
"int",
"unFilledSpacesInHeaderGroup",
"(",
"int",
"header",
")",
"{",
"//If mNumColumns is equal to zero we will have a divide by 0 exception",
"if",
"(",
"mNumColumns",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"int",
"remainder",
"=",
"mDelegate",
"."... | Counts the number of items that would be need to fill out the last row in
the group of items with the given header.
@param header Header set of items are grouped by.
@return The count of unfilled spaces in the last row. | [
"Counts",
"the",
"number",
"of",
"items",
"that",
"would",
"be",
"need",
"to",
"fill",
"out",
"the",
"last",
"row",
"in",
"the",
"group",
"of",
"items",
"with",
"the",
"given",
"header",
"."
] | e3e4f8fa5d5c01edc9af26ff800302a931103b31 | https://github.com/TonicArtos/StickyGridHeaders/blob/e3e4f8fa5d5c01edc9af26ff800302a931103b31/Library/src/com/tonicartos/widget/stickygridheaders/StickyGridHeadersBaseAdapterWrapper.java#L279-L287 |
102,090 | TonicArtos/StickyGridHeaders | Library/src/com/tonicartos/widget/stickygridheaders/StickyGridHeadersGridView.java | StickyGridHeadersGridView.getHeaderAt | public View getHeaderAt(int position) {
if (position == MATCHED_STICKIED_HEADER) {
return mStickiedHeader;
}
try {
return (View)getChildAt(position).getTag();
} catch (Exception e) {
}
return null;
} | java | public View getHeaderAt(int position) {
if (position == MATCHED_STICKIED_HEADER) {
return mStickiedHeader;
}
try {
return (View)getChildAt(position).getTag();
} catch (Exception e) {
}
return null;
} | [
"public",
"View",
"getHeaderAt",
"(",
"int",
"position",
")",
"{",
"if",
"(",
"position",
"==",
"MATCHED_STICKIED_HEADER",
")",
"{",
"return",
"mStickiedHeader",
";",
"}",
"try",
"{",
"return",
"(",
"View",
")",
"getChildAt",
"(",
"position",
")",
".",
"ge... | Gets the header at an item position. However, the position must be that
of a HeaderFiller.
@param position Position of HeaderFiller.
@return Header View wrapped in HeaderFiller or null if no header was
found. | [
"Gets",
"the",
"header",
"at",
"an",
"item",
"position",
".",
"However",
"the",
"position",
"must",
"be",
"that",
"of",
"a",
"HeaderFiller",
"."
] | e3e4f8fa5d5c01edc9af26ff800302a931103b31 | https://github.com/TonicArtos/StickyGridHeaders/blob/e3e4f8fa5d5c01edc9af26ff800302a931103b31/Library/src/com/tonicartos/widget/stickygridheaders/StickyGridHeadersGridView.java#L212-L222 |
102,091 | TonicArtos/StickyGridHeaders | Example/src/com/tonicartos/stickygridheadersexample/ItemListFragment.java | ItemListFragment.setActivateOnItemClick | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void setActivateOnItemClick(boolean activateOnItemClick) {
// When setting CHOICE_MODE_SINGLE, ListView will automatically
// give items the 'activated' state when touched.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
... | java | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void setActivateOnItemClick(boolean activateOnItemClick) {
// When setting CHOICE_MODE_SINGLE, ListView will automatically
// give items the 'activated' state when touched.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"public",
"void",
"setActivateOnItemClick",
"(",
"boolean",
"activateOnItemClick",
")",
"{",
"// When setting CHOICE_MODE_SINGLE, ListView will automatically",
"// give items the 'activated' state when t... | Turns on activate-on-click mode. When this mode is on, list items will be
given the 'activated' state when touched. | [
"Turns",
"on",
"activate",
"-",
"on",
"-",
"click",
"mode",
".",
"When",
"this",
"mode",
"is",
"on",
"list",
"items",
"will",
"be",
"given",
"the",
"activated",
"state",
"when",
"touched",
"."
] | e3e4f8fa5d5c01edc9af26ff800302a931103b31 | https://github.com/TonicArtos/StickyGridHeaders/blob/e3e4f8fa5d5c01edc9af26ff800302a931103b31/Example/src/com/tonicartos/stickygridheadersexample/ItemListFragment.java#L241-L250 |
102,092 | emilsjolander/android-FlipView | library/src/se/emilsjolander/flipview/Recycler.java | Recycler.addScrapView | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
void addScrapView(View scrap, int position, int viewType) {
// create a new Scrap
Scrap item = new Scrap(scrap, true);
if (viewTypeCount == 1) {
currentScraps.put(position, item);
} else {
scraps[viewType].put(position, item);
}
if (Build.VERSION.... | java | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
void addScrapView(View scrap, int position, int viewType) {
// create a new Scrap
Scrap item = new Scrap(scrap, true);
if (viewTypeCount == 1) {
currentScraps.put(position, item);
} else {
scraps[viewType].put(position, item);
}
if (Build.VERSION.... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"ICE_CREAM_SANDWICH",
")",
"void",
"addScrapView",
"(",
"View",
"scrap",
",",
"int",
"position",
",",
"int",
"viewType",
")",
"{",
"// create a new Scrap",
"Scrap",
"item",
"=",
"new",
"Scrap",
"(",
... | Put a view into the ScrapViews list. These views are unordered.
@param scrap
The view to add | [
"Put",
"a",
"view",
"into",
"the",
"ScrapViews",
"list",
".",
"These",
"views",
"are",
"unordered",
"."
] | 7dc0dbd37339dc9691934b60a1c2763b5ed29ffe | https://github.com/emilsjolander/android-FlipView/blob/7dc0dbd37339dc9691934b60a1c2763b5ed29ffe/library/src/se/emilsjolander/flipview/Recycler.java#L61-L74 |
102,093 | emilsjolander/android-FlipView | library/src/se/emilsjolander/flipview/FlipView.java | FlipView.setDrawWithLayer | private void setDrawWithLayer(View v, boolean drawWithLayer) {
if (isHardwareAccelerated()) {
if (v.getLayerType() != LAYER_TYPE_HARDWARE && drawWithLayer) {
v.setLayerType(LAYER_TYPE_HARDWARE, null);
} else if (v.getLayerType() != LAYER_TYPE_NONE && !drawWithLayer) {
v.setLayerType(LAYER_TYPE_NONE, nul... | java | private void setDrawWithLayer(View v, boolean drawWithLayer) {
if (isHardwareAccelerated()) {
if (v.getLayerType() != LAYER_TYPE_HARDWARE && drawWithLayer) {
v.setLayerType(LAYER_TYPE_HARDWARE, null);
} else if (v.getLayerType() != LAYER_TYPE_NONE && !drawWithLayer) {
v.setLayerType(LAYER_TYPE_NONE, nul... | [
"private",
"void",
"setDrawWithLayer",
"(",
"View",
"v",
",",
"boolean",
"drawWithLayer",
")",
"{",
"if",
"(",
"isHardwareAccelerated",
"(",
")",
")",
"{",
"if",
"(",
"v",
".",
"getLayerType",
"(",
")",
"!=",
"LAYER_TYPE_HARDWARE",
"&&",
"drawWithLayer",
")"... | Enable a hardware layer for the view.
@param v
@param drawWithLayer | [
"Enable",
"a",
"hardware",
"layer",
"for",
"the",
"view",
"."
] | 7dc0dbd37339dc9691934b60a1c2763b5ed29ffe | https://github.com/emilsjolander/android-FlipView/blob/7dc0dbd37339dc9691934b60a1c2763b5ed29ffe/library/src/se/emilsjolander/flipview/FlipView.java#L875-L883 |
102,094 | jparsec/jparsec | jparsec/src/main/java/org/jparsec/Scanners.java | Scanners.many | public static Parser<Void> many(CharPredicate predicate) {
return Patterns.isChar(predicate).many().toScanner(predicate + "*");
} | java | public static Parser<Void> many(CharPredicate predicate) {
return Patterns.isChar(predicate).many().toScanner(predicate + "*");
} | [
"public",
"static",
"Parser",
"<",
"Void",
">",
"many",
"(",
"CharPredicate",
"predicate",
")",
"{",
"return",
"Patterns",
".",
"isChar",
"(",
"predicate",
")",
".",
"many",
"(",
")",
".",
"toScanner",
"(",
"predicate",
"+",
"\"*\"",
")",
";",
"}"
] | A scanner that scans greedily for 0 or more characters that satisfies the given CharPredicate.
@param predicate the predicate object.
@return the Parser object. | [
"A",
"scanner",
"that",
"scans",
"greedily",
"for",
"0",
"or",
"more",
"characters",
"that",
"satisfies",
"the",
"given",
"CharPredicate",
"."
] | df1280259f5da9eb5ffc537437569dddba66cb94 | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Scanners.java#L161-L163 |
102,095 | jparsec/jparsec | jparsec/src/main/java/org/jparsec/Scanners.java | Scanners.many1 | public static Parser<Void> many1(CharPredicate predicate) {
return Patterns.many1(predicate).toScanner(predicate + "+");
} | java | public static Parser<Void> many1(CharPredicate predicate) {
return Patterns.many1(predicate).toScanner(predicate + "+");
} | [
"public",
"static",
"Parser",
"<",
"Void",
">",
"many1",
"(",
"CharPredicate",
"predicate",
")",
"{",
"return",
"Patterns",
".",
"many1",
"(",
"predicate",
")",
".",
"toScanner",
"(",
"predicate",
"+",
"\"+\"",
")",
";",
"}"
] | A scanner that scans greedily for 1 or more characters that satisfies the given CharPredicate.
@param predicate the predicate object.
@return the Parser object. | [
"A",
"scanner",
"that",
"scans",
"greedily",
"for",
"1",
"or",
"more",
"characters",
"that",
"satisfies",
"the",
"given",
"CharPredicate",
"."
] | df1280259f5da9eb5ffc537437569dddba66cb94 | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Scanners.java#L171-L173 |
102,096 | jparsec/jparsec | jparsec/src/main/java/org/jparsec/Scanners.java | Scanners.many1 | @Deprecated
public static Parser<Void> many1(Pattern pattern, String name) {
return pattern.many1().toScanner(name);
} | java | @Deprecated
public static Parser<Void> many1(Pattern pattern, String name) {
return pattern.many1().toScanner(name);
} | [
"@",
"Deprecated",
"public",
"static",
"Parser",
"<",
"Void",
">",
"many1",
"(",
"Pattern",
"pattern",
",",
"String",
"name",
")",
"{",
"return",
"pattern",
".",
"many1",
"(",
")",
".",
"toScanner",
"(",
"name",
")",
";",
"}"
] | A scanner that scans greedily for 1 or more occurrences of the given pattern.
@param pattern the pattern object.
@param name the name of what's expected logically. Is used in error message.
@return the Parser object.
@deprecated Use {@code pattern.many1().toScanner(name)}. | [
"A",
"scanner",
"that",
"scans",
"greedily",
"for",
"1",
"or",
"more",
"occurrences",
"of",
"the",
"given",
"pattern",
"."
] | df1280259f5da9eb5ffc537437569dddba66cb94 | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Scanners.java#L196-L199 |
102,097 | jparsec/jparsec | jparsec/src/main/java/org/jparsec/Scanners.java | Scanners.stringCaseInsensitive | public static Parser<Void> stringCaseInsensitive(String str) {
return Patterns.stringCaseInsensitive(str).toScanner(str);
} | java | public static Parser<Void> stringCaseInsensitive(String str) {
return Patterns.stringCaseInsensitive(str).toScanner(str);
} | [
"public",
"static",
"Parser",
"<",
"Void",
">",
"stringCaseInsensitive",
"(",
"String",
"str",
")",
"{",
"return",
"Patterns",
".",
"stringCaseInsensitive",
"(",
"str",
")",
".",
"toScanner",
"(",
"str",
")",
";",
"}"
] | A scanner that matches the input against the specified string case insensitively.
@param str the string to match
@return the scanner. | [
"A",
"scanner",
"that",
"matches",
"the",
"input",
"against",
"the",
"specified",
"string",
"case",
"insensitively",
"."
] | df1280259f5da9eb5ffc537437569dddba66cb94 | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/Scanners.java#L271-L273 |
102,098 | jparsec/jparsec | jparsec/src/main/java/org/jparsec/internal/util/Checks.java | Checks.checkState | public static void checkState(boolean condition, String message, Object... args)
throws IllegalStateException {
if (!condition) {
throw new IllegalStateException(String.format(message, args));
}
} | java | public static void checkState(boolean condition, String message, Object... args)
throws IllegalStateException {
if (!condition) {
throw new IllegalStateException(String.format(message, args));
}
} | [
"public",
"static",
"void",
"checkState",
"(",
"boolean",
"condition",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"St... | Checks a certain state.
@param condition the condition of the state that has to be true
@param message the error message if {@code condition} is false
@param args the arguments to the error message
@throws IllegalStateException if {@code condition} is false | [
"Checks",
"a",
"certain",
"state",
"."
] | df1280259f5da9eb5ffc537437569dddba66cb94 | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/internal/util/Checks.java#L90-L95 |
102,099 | jparsec/jparsec | jparsec-examples/src/main/java/org/jparsec/examples/java/parser/ExpressionParser.java | ExpressionParser.simpleNewExpression | static Parser<Expression> simpleNewExpression(Parser<Expression> arg, Parser<DefBody> body) {
return Parsers.sequence(
term("new").next(TypeLiteralParser.ELEMENT_TYPE_LITERAL),
argumentList(arg),
body.optional(),
(type, args, defBody) -> new NewExpression(null, type, args, defBody));... | java | static Parser<Expression> simpleNewExpression(Parser<Expression> arg, Parser<DefBody> body) {
return Parsers.sequence(
term("new").next(TypeLiteralParser.ELEMENT_TYPE_LITERAL),
argumentList(arg),
body.optional(),
(type, args, defBody) -> new NewExpression(null, type, args, defBody));... | [
"static",
"Parser",
"<",
"Expression",
">",
"simpleNewExpression",
"(",
"Parser",
"<",
"Expression",
">",
"arg",
",",
"Parser",
"<",
"DefBody",
">",
"body",
")",
"{",
"return",
"Parsers",
".",
"sequence",
"(",
"term",
"(",
"\"new\"",
")",
".",
"next",
"(... | new a class instance | [
"new",
"a",
"class",
"instance"
] | df1280259f5da9eb5ffc537437569dddba66cb94 | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec-examples/src/main/java/org/jparsec/examples/java/parser/ExpressionParser.java#L132-L138 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.