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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22,200 | prometheus/client_java | simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/GraphiteNamePattern.java | GraphiteNamePattern.initializePattern | private void initializePattern(final String pattern) {
final String[] split = pattern.split(Pattern.quote("*"), -1);
final StringBuilder escapedPattern = new StringBuilder(Pattern.quote(split[0]));
for (int i = 1; i < split.length; i++) {
String quoted = Pattern.quote(split[i]);
... | java | private void initializePattern(final String pattern) {
final String[] split = pattern.split(Pattern.quote("*"), -1);
final StringBuilder escapedPattern = new StringBuilder(Pattern.quote(split[0]));
for (int i = 1; i < split.length; i++) {
String quoted = Pattern.quote(split[i]);
... | [
"private",
"void",
"initializePattern",
"(",
"final",
"String",
"pattern",
")",
"{",
"final",
"String",
"[",
"]",
"split",
"=",
"pattern",
".",
"split",
"(",
"Pattern",
".",
"quote",
"(",
"\"*\"",
")",
",",
"-",
"1",
")",
";",
"final",
"StringBuilder",
... | Turns the GLOB pattern into a REGEX.
@param pattern The pattern to use | [
"Turns",
"the",
"GLOB",
"pattern",
"into",
"a",
"REGEX",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/samplebuilder/GraphiteNamePattern.java#L78-L89 |
22,201 | prometheus/client_java | simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java | Graphite.push | public void push(CollectorRegistry registry) throws IOException {
Socket s = new Socket(host, port);
BufferedWriter writer = new BufferedWriter(new PrintWriter(s.getOutputStream()));
Matcher m = INVALID_GRAPHITE_CHARS.matcher("");
long now = System.currentTimeMillis() / 1000;
for (Collector.MetricFa... | java | public void push(CollectorRegistry registry) throws IOException {
Socket s = new Socket(host, port);
BufferedWriter writer = new BufferedWriter(new PrintWriter(s.getOutputStream()));
Matcher m = INVALID_GRAPHITE_CHARS.matcher("");
long now = System.currentTimeMillis() / 1000;
for (Collector.MetricFa... | [
"public",
"void",
"push",
"(",
"CollectorRegistry",
"registry",
")",
"throws",
"IOException",
"{",
"Socket",
"s",
"=",
"new",
"Socket",
"(",
"host",
",",
"port",
")",
";",
"BufferedWriter",
"writer",
"=",
"new",
"BufferedWriter",
"(",
"new",
"PrintWriter",
"... | Push samples from the given registry to Graphite. | [
"Push",
"samples",
"from",
"the",
"given",
"registry",
"to",
"Graphite",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java#L51-L69 |
22,202 | prometheus/client_java | simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java | Graphite.start | public Thread start(CollectorRegistry registry, int intervalSeconds) {
Thread thread = new PushThread(registry, intervalSeconds);
thread.setDaemon(true);
thread.start();
return thread;
} | java | public Thread start(CollectorRegistry registry, int intervalSeconds) {
Thread thread = new PushThread(registry, intervalSeconds);
thread.setDaemon(true);
thread.start();
return thread;
} | [
"public",
"Thread",
"start",
"(",
"CollectorRegistry",
"registry",
",",
"int",
"intervalSeconds",
")",
"{",
"Thread",
"thread",
"=",
"new",
"PushThread",
"(",
"registry",
",",
"intervalSeconds",
")",
";",
"thread",
".",
"setDaemon",
"(",
"true",
")",
";",
"t... | Push samples from the given registry to Graphite at the given interval. | [
"Push",
"samples",
"from",
"the",
"given",
"registry",
"to",
"Graphite",
"at",
"the",
"given",
"interval",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java#L81-L86 |
22,203 | prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java | CKMSQuantiles.insert | public synchronized void insert(double value) {
buffer[bufferCount] = value;
bufferCount++;
if (bufferCount == buffer.length) {
insertBatch();
compress();
}
} | java | public synchronized void insert(double value) {
buffer[bufferCount] = value;
bufferCount++;
if (bufferCount == buffer.length) {
insertBatch();
compress();
}
} | [
"public",
"synchronized",
"void",
"insert",
"(",
"double",
"value",
")",
"{",
"buffer",
"[",
"bufferCount",
"]",
"=",
"value",
";",
"bufferCount",
"++",
";",
"if",
"(",
"bufferCount",
"==",
"buffer",
".",
"length",
")",
"{",
"insertBatch",
"(",
")",
";",... | Add a new value from the stream.
@param value | [
"Add",
"a",
"new",
"value",
"from",
"the",
"stream",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java#L90-L98 |
22,204 | prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java | CKMSQuantiles.get | public synchronized double get(double q) {
// clear the buffer
insertBatch();
compress();
if (sample.size() == 0) {
return Double.NaN;
}
int rankMin = 0;
int desired = (int) (q * count);
ListIterator<Item> it = sample.listIterator();
... | java | public synchronized double get(double q) {
// clear the buffer
insertBatch();
compress();
if (sample.size() == 0) {
return Double.NaN;
}
int rankMin = 0;
int desired = (int) (q * count);
ListIterator<Item> it = sample.listIterator();
... | [
"public",
"synchronized",
"double",
"get",
"(",
"double",
"q",
")",
"{",
"// clear the buffer",
"insertBatch",
"(",
")",
";",
"compress",
"(",
")",
";",
"if",
"(",
"sample",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"Double",
".",
"NaN",
... | Get the estimated value at the specified quantile.
@param q
Queried quantile, e.g. 0.50 or 0.99.
@return Estimated value at that quantile. | [
"Get",
"the",
"estimated",
"value",
"at",
"the",
"specified",
"quantile",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java#L107-L136 |
22,205 | prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java | CKMSQuantiles.allowableError | private double allowableError(int rank) {
// NOTE: according to CKMS, this should be count, not size, but this
// leads
// to error larger than the error bounds. Leaving it like this is
// essentially a HACK, and blows up memory, but does "work".
// int size = count;
int ... | java | private double allowableError(int rank) {
// NOTE: according to CKMS, this should be count, not size, but this
// leads
// to error larger than the error bounds. Leaving it like this is
// essentially a HACK, and blows up memory, but does "work".
// int size = count;
int ... | [
"private",
"double",
"allowableError",
"(",
"int",
"rank",
")",
"{",
"// NOTE: according to CKMS, this should be count, not size, but this",
"// leads",
"// to error larger than the error bounds. Leaving it like this is",
"// essentially a HACK, and blows up memory, but does \"work\".",
"// ... | Specifies the allowable error for this rank, depending on which quantiles
are being targeted.
This is the f(r_i, n) function from the CKMS paper. It's basically how
wide the range of this rank can be.
@param rank
the index in the list of samples | [
"Specifies",
"the",
"allowable",
"error",
"for",
"this",
"rank",
"depending",
"on",
"which",
"quantiles",
"are",
"being",
"targeted",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java#L148-L170 |
22,206 | prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java | CKMSQuantiles.compress | private void compress() {
if (sample.size() < 2) {
return;
}
ListIterator<Item> it = sample.listIterator();
int removed = 0;
Item prev = null;
Item next = it.next();
while (it.hasNext()) {
prev = next;
next = it.next();
... | java | private void compress() {
if (sample.size() < 2) {
return;
}
ListIterator<Item> it = sample.listIterator();
int removed = 0;
Item prev = null;
Item next = it.next();
while (it.hasNext()) {
prev = next;
next = it.next();
... | [
"private",
"void",
"compress",
"(",
")",
"{",
"if",
"(",
"sample",
".",
"size",
"(",
")",
"<",
"2",
")",
"{",
"return",
";",
"}",
"ListIterator",
"<",
"Item",
">",
"it",
"=",
"sample",
".",
"listIterator",
"(",
")",
";",
"int",
"removed",
"=",
"0... | Try to remove extraneous items from the set of sampled items. This checks
if an item is unnecessary based on the desired error bounds, and merges
it with the adjacent item if it is. | [
"Try",
"to",
"remove",
"extraneous",
"items",
"from",
"the",
"set",
"of",
"sampled",
"items",
".",
"This",
"checks",
"if",
"an",
"item",
"is",
"unnecessary",
"based",
"on",
"the",
"desired",
"error",
"bounds",
"and",
"merges",
"it",
"with",
"the",
"adjacen... | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/CKMSQuantiles.java#L229-L255 |
22,207 | prometheus/client_java | simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/DefaultExports.java | DefaultExports.register | public static void register(CollectorRegistry registry) {
new StandardExports().register(registry);
new MemoryPoolsExports().register(registry);
new MemoryAllocationExports().register(registry);
new BufferPoolsExports().register(registry);
new GarbageCollectorExports().register(registry);
new Th... | java | public static void register(CollectorRegistry registry) {
new StandardExports().register(registry);
new MemoryPoolsExports().register(registry);
new MemoryAllocationExports().register(registry);
new BufferPoolsExports().register(registry);
new GarbageCollectorExports().register(registry);
new Th... | [
"public",
"static",
"void",
"register",
"(",
"CollectorRegistry",
"registry",
")",
"{",
"new",
"StandardExports",
"(",
")",
".",
"register",
"(",
"registry",
")",
";",
"new",
"MemoryPoolsExports",
"(",
")",
".",
"register",
"(",
"registry",
")",
";",
"new",
... | Register the default Hotspot collectors with the given registry. | [
"Register",
"the",
"default",
"Hotspot",
"collectors",
"with",
"the",
"given",
"registry",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/DefaultExports.java#L36-L45 |
22,208 | prometheus/client_java | simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java | TextFormat.write004 | public static void write004(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) throws IOException {
/* See http://prometheus.io/docs/instrumenting/exposition_formats/
* for the output format specification. */
while(mfs.hasMoreElements()) {
Collector.MetricFamilySamples metricFamilySamples... | java | public static void write004(Writer writer, Enumeration<Collector.MetricFamilySamples> mfs) throws IOException {
/* See http://prometheus.io/docs/instrumenting/exposition_formats/
* for the output format specification. */
while(mfs.hasMoreElements()) {
Collector.MetricFamilySamples metricFamilySamples... | [
"public",
"static",
"void",
"write004",
"(",
"Writer",
"writer",
",",
"Enumeration",
"<",
"Collector",
".",
"MetricFamilySamples",
">",
"mfs",
")",
"throws",
"IOException",
"{",
"/* See http://prometheus.io/docs/instrumenting/exposition_formats/\n * for the output format sp... | Write out the text version 0.0.4 of the given MetricFamilySamples. | [
"Write",
"out",
"the",
"text",
"version",
"0",
".",
"0",
".",
"4",
"of",
"the",
"given",
"MetricFamilySamples",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java#L18-L56 |
22,209 | prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/Collector.java | Collector.sanitizeMetricName | public static String sanitizeMetricName(String metricName) {
return SANITIZE_BODY_PATTERN.matcher(
SANITIZE_PREFIX_PATTERN.matcher(metricName).replaceFirst("_")
).replaceAll("_");
} | java | public static String sanitizeMetricName(String metricName) {
return SANITIZE_BODY_PATTERN.matcher(
SANITIZE_PREFIX_PATTERN.matcher(metricName).replaceFirst("_")
).replaceAll("_");
} | [
"public",
"static",
"String",
"sanitizeMetricName",
"(",
"String",
"metricName",
")",
"{",
"return",
"SANITIZE_BODY_PATTERN",
".",
"matcher",
"(",
"SANITIZE_PREFIX_PATTERN",
".",
"matcher",
"(",
"metricName",
")",
".",
"replaceFirst",
"(",
"\"_\"",
")",
")",
".",
... | Sanitize metric name | [
"Sanitize",
"metric",
"name"
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/Collector.java#L192-L196 |
22,210 | prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/Collector.java | Collector.checkMetricLabelName | protected static void checkMetricLabelName(String name) {
if (!METRIC_LABEL_NAME_RE.matcher(name).matches()) {
throw new IllegalArgumentException("Invalid metric label name: " + name);
}
if (RESERVED_METRIC_LABEL_NAME_RE.matcher(name).matches()) {
throw new IllegalArgumentException("Invalid metr... | java | protected static void checkMetricLabelName(String name) {
if (!METRIC_LABEL_NAME_RE.matcher(name).matches()) {
throw new IllegalArgumentException("Invalid metric label name: " + name);
}
if (RESERVED_METRIC_LABEL_NAME_RE.matcher(name).matches()) {
throw new IllegalArgumentException("Invalid metr... | [
"protected",
"static",
"void",
"checkMetricLabelName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"!",
"METRIC_LABEL_NAME_RE",
".",
"matcher",
"(",
"name",
")",
".",
"matches",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid me... | Throw an exception if the metric label name is invalid. | [
"Throw",
"an",
"exception",
"if",
"the",
"metric",
"label",
"name",
"is",
"invalid",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/Collector.java#L201-L208 |
22,211 | prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/Collector.java | Collector.doubleToGoString | public static String doubleToGoString(double d) {
if (d == Double.POSITIVE_INFINITY) {
return "+Inf";
}
if (d == Double.NEGATIVE_INFINITY) {
return "-Inf";
}
if (Double.isNaN(d)) {
return "NaN";
}
return Double.toString(d);
} | java | public static String doubleToGoString(double d) {
if (d == Double.POSITIVE_INFINITY) {
return "+Inf";
}
if (d == Double.NEGATIVE_INFINITY) {
return "-Inf";
}
if (Double.isNaN(d)) {
return "NaN";
}
return Double.toString(d);
} | [
"public",
"static",
"String",
"doubleToGoString",
"(",
"double",
"d",
")",
"{",
"if",
"(",
"d",
"==",
"Double",
".",
"POSITIVE_INFINITY",
")",
"{",
"return",
"\"+Inf\"",
";",
"}",
"if",
"(",
"d",
"==",
"Double",
".",
"NEGATIVE_INFINITY",
")",
"{",
"retur... | Convert a double to its string representation in Go. | [
"Convert",
"a",
"double",
"to",
"its",
"string",
"representation",
"in",
"Go",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/Collector.java#L213-L224 |
22,212 | prometheus/client_java | simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java | HTTPServer.start | private void start(boolean daemon) {
if (daemon == Thread.currentThread().isDaemon()) {
server.start();
} else {
FutureTask<Void> startTask = new FutureTask<Void>(new Runnable() {
@Override
public void run() {
server.start();
... | java | private void start(boolean daemon) {
if (daemon == Thread.currentThread().isDaemon()) {
server.start();
} else {
FutureTask<Void> startTask = new FutureTask<Void>(new Runnable() {
@Override
public void run() {
server.start();
... | [
"private",
"void",
"start",
"(",
"boolean",
"daemon",
")",
"{",
"if",
"(",
"daemon",
"==",
"Thread",
".",
"currentThread",
"(",
")",
".",
"isDaemon",
"(",
")",
")",
"{",
"server",
".",
"start",
"(",
")",
";",
"}",
"else",
"{",
"FutureTask",
"<",
"V... | Start a HTTP server by making sure that its background thread inherit proper daemon flag. | [
"Start",
"a",
"HTTP",
"server",
"by",
"making",
"sure",
"that",
"its",
"background",
"thread",
"inherit",
"proper",
"daemon",
"flag",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_httpserver/src/main/java/io/prometheus/client/exporter/HTTPServer.java#L207-L229 |
22,213 | prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/CollectorRegistry.java | CollectorRegistry.unregister | public void unregister(Collector m) {
synchronized (collectorsToNames) {
List<String> names = collectorsToNames.remove(m);
for (String name : names) {
namesToCollectors.remove(name);
}
}
} | java | public void unregister(Collector m) {
synchronized (collectorsToNames) {
List<String> names = collectorsToNames.remove(m);
for (String name : names) {
namesToCollectors.remove(name);
}
}
} | [
"public",
"void",
"unregister",
"(",
"Collector",
"m",
")",
"{",
"synchronized",
"(",
"collectorsToNames",
")",
"{",
"List",
"<",
"String",
">",
"names",
"=",
"collectorsToNames",
".",
"remove",
"(",
"m",
")",
";",
"for",
"(",
"String",
"name",
":",
"nam... | Unregister a Collector. | [
"Unregister",
"a",
"Collector",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/CollectorRegistry.java#L67-L74 |
22,214 | prometheus/client_java | simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/PushGateway.java | PushGateway.createURLSneakily | private static URL createURLSneakily(final String urlString) {
try {
return new URL(urlString);
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
} | java | private static URL createURLSneakily(final String urlString) {
try {
return new URL(urlString);
} catch (MalformedURLException e) {
throw new RuntimeException(e);
}
} | [
"private",
"static",
"URL",
"createURLSneakily",
"(",
"final",
"String",
"urlString",
")",
"{",
"try",
"{",
"return",
"new",
"URL",
"(",
"urlString",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"("... | Creates a URL instance from a String representation of a URL without throwing a checked exception.
Required because you can't wrap a call to another constructor in a try statement.
TODO: Remove this along with other deprecated methods before version 1.0 is released.
@param urlString the String representation of the U... | [
"Creates",
"a",
"URL",
"instance",
"from",
"a",
"String",
"representation",
"of",
"a",
"URL",
"without",
"throwing",
"a",
"checked",
"exception",
".",
"Required",
"because",
"you",
"can",
"t",
"wrap",
"a",
"call",
"to",
"another",
"constructor",
"in",
"a",
... | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/PushGateway.java#L100-L106 |
22,215 | prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/DoubleAdder.java | DoubleAdder.add | public void add(double x) {
Cell[] as; long b, v; int[] hc; Cell a; int n;
if ((as = cells) != null ||
!casBase(b = base,
Double.doubleToRawLongBits
(Double.longBitsToDouble(b) + x))) {
boolean uncontended = true;
... | java | public void add(double x) {
Cell[] as; long b, v; int[] hc; Cell a; int n;
if ((as = cells) != null ||
!casBase(b = base,
Double.doubleToRawLongBits
(Double.longBitsToDouble(b) + x))) {
boolean uncontended = true;
... | [
"public",
"void",
"add",
"(",
"double",
"x",
")",
"{",
"Cell",
"[",
"]",
"as",
";",
"long",
"b",
",",
"v",
";",
"int",
"[",
"]",
"hc",
";",
"Cell",
"a",
";",
"int",
"n",
";",
"if",
"(",
"(",
"as",
"=",
"cells",
")",
"!=",
"null",
"||",
"!... | Adds the given value.
@param x the value to add | [
"Adds",
"the",
"given",
"value",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/DoubleAdder.java#L67-L82 |
22,216 | prometheus/client_java | simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java | DropwizardExports.fromSnapshotAndCount | MetricFamilySamples fromSnapshotAndCount(String dropwizardName, Snapshot snapshot, long count, double factor, String helpMessage) {
List<MetricFamilySamples.Sample> samples = Arrays.asList(
sampleBuilder.createSample(dropwizardName, "", Arrays.asList("quantile"), Arrays.asList("0.5"), snapshot.g... | java | MetricFamilySamples fromSnapshotAndCount(String dropwizardName, Snapshot snapshot, long count, double factor, String helpMessage) {
List<MetricFamilySamples.Sample> samples = Arrays.asList(
sampleBuilder.createSample(dropwizardName, "", Arrays.asList("quantile"), Arrays.asList("0.5"), snapshot.g... | [
"MetricFamilySamples",
"fromSnapshotAndCount",
"(",
"String",
"dropwizardName",
",",
"Snapshot",
"snapshot",
",",
"long",
"count",
",",
"double",
"factor",
",",
"String",
"helpMessage",
")",
"{",
"List",
"<",
"MetricFamilySamples",
".",
"Sample",
">",
"samples",
"... | Export a histogram snapshot as a prometheus SUMMARY.
@param dropwizardName metric name.
@param snapshot the histogram snapshot.
@param count the total sample count for this snapshot.
@param factor a factor to apply to histogram values. | [
"Export",
"a",
"histogram",
"snapshot",
"as",
"a",
"prometheus",
"SUMMARY",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java#L86-L97 |
22,217 | prometheus/client_java | simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java | DropwizardExports.fromTimer | MetricFamilySamples fromTimer(String dropwizardName, Timer timer) {
return fromSnapshotAndCount(dropwizardName, timer.getSnapshot(), timer.getCount(),
1.0D / TimeUnit.SECONDS.toNanos(1L), getHelpMessage(dropwizardName, timer));
} | java | MetricFamilySamples fromTimer(String dropwizardName, Timer timer) {
return fromSnapshotAndCount(dropwizardName, timer.getSnapshot(), timer.getCount(),
1.0D / TimeUnit.SECONDS.toNanos(1L), getHelpMessage(dropwizardName, timer));
} | [
"MetricFamilySamples",
"fromTimer",
"(",
"String",
"dropwizardName",
",",
"Timer",
"timer",
")",
"{",
"return",
"fromSnapshotAndCount",
"(",
"dropwizardName",
",",
"timer",
".",
"getSnapshot",
"(",
")",
",",
"timer",
".",
"getCount",
"(",
")",
",",
"1.0D",
"/"... | Export Dropwizard Timer as a histogram. Use TIME_UNIT as time unit. | [
"Export",
"Dropwizard",
"Timer",
"as",
"a",
"histogram",
".",
"Use",
"TIME_UNIT",
"as",
"time",
"unit",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java#L110-L113 |
22,218 | prometheus/client_java | simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java | DropwizardExports.fromMeter | MetricFamilySamples fromMeter(String dropwizardName, Meter meter) {
final MetricFamilySamples.Sample sample = sampleBuilder.createSample(dropwizardName, "_total",
new ArrayList<String>(),
new ArrayList<String>(),
meter.getCount());
return new MetricFamilyS... | java | MetricFamilySamples fromMeter(String dropwizardName, Meter meter) {
final MetricFamilySamples.Sample sample = sampleBuilder.createSample(dropwizardName, "_total",
new ArrayList<String>(),
new ArrayList<String>(),
meter.getCount());
return new MetricFamilyS... | [
"MetricFamilySamples",
"fromMeter",
"(",
"String",
"dropwizardName",
",",
"Meter",
"meter",
")",
"{",
"final",
"MetricFamilySamples",
".",
"Sample",
"sample",
"=",
"sampleBuilder",
".",
"createSample",
"(",
"dropwizardName",
",",
"\"_total\"",
",",
"new",
"ArrayList... | Export a Meter as as prometheus COUNTER. | [
"Export",
"a",
"Meter",
"as",
"as",
"prometheus",
"COUNTER",
"."
] | 4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java#L118-L125 |
22,219 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeParserBucket.java | DateTimeParserBucket.saveField | public void saveField(DateTimeFieldType fieldType, int value) {
obtainSaveField().init(fieldType.getField(iChrono), value);
} | java | public void saveField(DateTimeFieldType fieldType, int value) {
obtainSaveField().init(fieldType.getField(iChrono), value);
} | [
"public",
"void",
"saveField",
"(",
"DateTimeFieldType",
"fieldType",
",",
"int",
"value",
")",
"{",
"obtainSaveField",
"(",
")",
".",
"init",
"(",
"fieldType",
".",
"getField",
"(",
"iChrono",
")",
",",
"value",
")",
";",
"}"
] | Saves a datetime field value.
@param fieldType the field type
@param value the value | [
"Saves",
"a",
"datetime",
"field",
"value",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeParserBucket.java#L308-L310 |
22,220 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeParserBucket.java | DateTimeParserBucket.saveField | public void saveField(DateTimeFieldType fieldType, String text, Locale locale) {
obtainSaveField().init(fieldType.getField(iChrono), text, locale);
} | java | public void saveField(DateTimeFieldType fieldType, String text, Locale locale) {
obtainSaveField().init(fieldType.getField(iChrono), text, locale);
} | [
"public",
"void",
"saveField",
"(",
"DateTimeFieldType",
"fieldType",
",",
"String",
"text",
",",
"Locale",
"locale",
")",
"{",
"obtainSaveField",
"(",
")",
".",
"init",
"(",
"fieldType",
".",
"getField",
"(",
"iChrono",
")",
",",
"text",
",",
"locale",
")... | Saves a datetime field text value.
@param fieldType the field type
@param text the text value
@param locale the locale to use | [
"Saves",
"a",
"datetime",
"field",
"text",
"value",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeParserBucket.java#L319-L321 |
22,221 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeParserBucket.java | DateTimeParserBucket.restoreState | public boolean restoreState(Object savedState) {
if (savedState instanceof SavedState) {
if (((SavedState) savedState).restoreState(this)) {
iSavedState = savedState;
return true;
}
}
return false;
} | java | public boolean restoreState(Object savedState) {
if (savedState instanceof SavedState) {
if (((SavedState) savedState).restoreState(this)) {
iSavedState = savedState;
return true;
}
}
return false;
} | [
"public",
"boolean",
"restoreState",
"(",
"Object",
"savedState",
")",
"{",
"if",
"(",
"savedState",
"instanceof",
"SavedState",
")",
"{",
"if",
"(",
"(",
"(",
"SavedState",
")",
"savedState",
")",
".",
"restoreState",
"(",
"this",
")",
")",
"{",
"iSavedSt... | Restores the state of this bucket from a previously saved state. The
state object passed into this method is not consumed, and it can be used
later to restore to that state again.
@param savedState opaque saved state, returned from saveState
@return true state object is valid and state restored | [
"Restores",
"the",
"state",
"of",
"this",
"bucket",
"from",
"a",
"previously",
"saved",
"state",
".",
"The",
"state",
"object",
"passed",
"into",
"this",
"method",
"is",
"not",
"consumed",
"and",
"it",
"can",
"be",
"used",
"later",
"to",
"restore",
"to",
... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeParserBucket.java#L367-L375 |
22,222 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeParserBucket.java | DateTimeParserBucket.computeMillis | public long computeMillis(boolean resetFields, CharSequence text) {
SavedField[] savedFields = iSavedFields;
int count = iSavedFieldsCount;
if (iSavedFieldsShared) {
// clone so that sort does not affect saved state
iSavedFields = savedFields = (SavedField[])iSavedFields.... | java | public long computeMillis(boolean resetFields, CharSequence text) {
SavedField[] savedFields = iSavedFields;
int count = iSavedFieldsCount;
if (iSavedFieldsShared) {
// clone so that sort does not affect saved state
iSavedFields = savedFields = (SavedField[])iSavedFields.... | [
"public",
"long",
"computeMillis",
"(",
"boolean",
"resetFields",
",",
"CharSequence",
"text",
")",
"{",
"SavedField",
"[",
"]",
"savedFields",
"=",
"iSavedFields",
";",
"int",
"count",
"=",
"iSavedFieldsCount",
";",
"if",
"(",
"iSavedFieldsShared",
")",
"{",
... | Computes the parsed datetime by setting the saved fields.
This method is idempotent, but it is not thread-safe.
@param resetFields false by default, but when true, unsaved field values are cleared
@param text optional text being parsed, to be included in any error message
@return milliseconds since 1970-01-01T00:00:00... | [
"Computes",
"the",
"parsed",
"datetime",
"by",
"setting",
"the",
"saved",
"fields",
".",
"This",
"method",
"is",
"idempotent",
"but",
"it",
"is",
"not",
"thread",
"-",
"safe",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeParserBucket.java#L424-L478 |
22,223 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/ISOChronology.java | ISOChronology.getInstance | public static ISOChronology getInstance(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
ISOChronology chrono = cCache.get(zone);
if (chrono == null) {
chrono = new ISOChronology(ZonedChronology.getInstance(INSTANCE_UTC, zone));
... | java | public static ISOChronology getInstance(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
ISOChronology chrono = cCache.get(zone);
if (chrono == null) {
chrono = new ISOChronology(ZonedChronology.getInstance(INSTANCE_UTC, zone));
... | [
"public",
"static",
"ISOChronology",
"getInstance",
"(",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"zone",
"==",
"null",
")",
"{",
"zone",
"=",
"DateTimeZone",
".",
"getDefault",
"(",
")",
";",
"}",
"ISOChronology",
"chrono",
"=",
"cCache",
".",
"get",
... | Gets an instance of the ISOChronology in the given time zone.
@param zone the time zone to get the chronology in, null is default
@return a chronology in the specified time zone | [
"Gets",
"an",
"instance",
"of",
"the",
"ISOChronology",
"in",
"the",
"given",
"time",
"zone",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/ISOChronology.java#L88-L101 |
22,224 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/IslamicChronology.java | IslamicChronology.getInstance | public static IslamicChronology getInstance(DateTimeZone zone, LeapYearPatternType leapYears) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
IslamicChronology chrono;
IslamicChronology[] chronos = cCache.get(zone);
if (chronos == null) {
chronos... | java | public static IslamicChronology getInstance(DateTimeZone zone, LeapYearPatternType leapYears) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
IslamicChronology chrono;
IslamicChronology[] chronos = cCache.get(zone);
if (chronos == null) {
chronos... | [
"public",
"static",
"IslamicChronology",
"getInstance",
"(",
"DateTimeZone",
"zone",
",",
"LeapYearPatternType",
"leapYears",
")",
"{",
"if",
"(",
"zone",
"==",
"null",
")",
"{",
"zone",
"=",
"DateTimeZone",
".",
"getDefault",
"(",
")",
";",
"}",
"IslamicChron... | Gets an instance of the IslamicChronology in the given time zone.
@param zone the time zone to get the chronology in, null is default
@param leapYears the type defining the leap year pattern
@return a chronology in the specified time zone | [
"Gets",
"an",
"instance",
"of",
"the",
"IslamicChronology",
"in",
"the",
"given",
"time",
"zone",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/IslamicChronology.java#L190-L226 |
22,225 | JodaOrg/joda-time | src/main/java/org/joda/time/field/StrictDateTimeField.java | StrictDateTimeField.getInstance | public static DateTimeField getInstance(DateTimeField field) {
if (field == null) {
return null;
}
if (field instanceof LenientDateTimeField) {
field = ((LenientDateTimeField)field).getWrappedField();
}
if (!field.isLenient()) {
return field;
... | java | public static DateTimeField getInstance(DateTimeField field) {
if (field == null) {
return null;
}
if (field instanceof LenientDateTimeField) {
field = ((LenientDateTimeField)field).getWrappedField();
}
if (!field.isLenient()) {
return field;
... | [
"public",
"static",
"DateTimeField",
"getInstance",
"(",
"DateTimeField",
"field",
")",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"field",
"instanceof",
"LenientDateTimeField",
")",
"{",
"field",
"=",
"(",
"(",... | Returns a strict version of the given field. If it is already strict,
then it is returned as-is. Otherwise, a new StrictDateTimeField is
returned. | [
"Returns",
"a",
"strict",
"version",
"of",
"the",
"given",
"field",
".",
"If",
"it",
"is",
"already",
"strict",
"then",
"it",
"is",
"returned",
"as",
"-",
"is",
".",
"Otherwise",
"a",
"new",
"StrictDateTimeField",
"is",
"returned",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/StrictDateTimeField.java#L40-L51 |
22,226 | JodaOrg/joda-time | src/main/java/org/joda/time/field/StrictDateTimeField.java | StrictDateTimeField.set | public long set(long instant, int value) {
FieldUtils.verifyValueBounds
(this, value, getMinimumValue(instant), getMaximumValue(instant));
return super.set(instant, value);
} | java | public long set(long instant, int value) {
FieldUtils.verifyValueBounds
(this, value, getMinimumValue(instant), getMaximumValue(instant));
return super.set(instant, value);
} | [
"public",
"long",
"set",
"(",
"long",
"instant",
",",
"int",
"value",
")",
"{",
"FieldUtils",
".",
"verifyValueBounds",
"(",
"this",
",",
"value",
",",
"getMinimumValue",
"(",
"instant",
")",
",",
"getMaximumValue",
"(",
"instant",
")",
")",
";",
"return",... | Does a bounds check before setting the value.
@throws IllegalArgumentException if the value is invalid | [
"Does",
"a",
"bounds",
"check",
"before",
"setting",
"the",
"value",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/StrictDateTimeField.java#L66-L70 |
22,227 | JodaOrg/joda-time | src/main/java/org/joda/time/field/PreciseDurationDateTimeField.java | PreciseDurationDateTimeField.set | public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, getMinimumValue(),
getMaximumValueForSet(instant, value));
return instant + (value - get(instant)) * iUnitMillis;
} | java | public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, getMinimumValue(),
getMaximumValueForSet(instant, value));
return instant + (value - get(instant)) * iUnitMillis;
} | [
"public",
"long",
"set",
"(",
"long",
"instant",
",",
"int",
"value",
")",
"{",
"FieldUtils",
".",
"verifyValueBounds",
"(",
"this",
",",
"value",
",",
"getMinimumValue",
"(",
")",
",",
"getMaximumValueForSet",
"(",
"instant",
",",
"value",
")",
")",
";",
... | Set the specified amount of units to the specified time instant.
@param instant the milliseconds from 1970-01-01T00:00:00Z to set in
@param value value of units to set.
@return the updated time instant.
@throws IllegalArgumentException if value is too large or too small. | [
"Set",
"the",
"specified",
"amount",
"of",
"units",
"to",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/PreciseDurationDateTimeField.java#L78-L82 |
22,228 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableDateTime.java | MutableDateTime.set | public void set(DateTimeFieldType type, int value) {
if (type == null) {
throw new IllegalArgumentException("Field must not be null");
}
setMillis(type.getField(getChronology()).set(getMillis(), value));
} | java | public void set(DateTimeFieldType type, int value) {
if (type == null) {
throw new IllegalArgumentException("Field must not be null");
}
setMillis(type.getField(getChronology()).set(getMillis(), value));
} | [
"public",
"void",
"set",
"(",
"DateTimeFieldType",
"type",
",",
"int",
"value",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field must not be null\"",
")",
";",
"}",
"setMillis",
"(",
"type",
".",
... | Sets the value of one of the fields of the instant, such as hourOfDay.
@param type a field type, usually obtained from DateTimeFieldType, not null
@param value the value to set the field to
@throws IllegalArgumentException if the value is null or invalid | [
"Sets",
"the",
"value",
"of",
"one",
"of",
"the",
"fields",
"of",
"the",
"instant",
"such",
"as",
"hourOfDay",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableDateTime.java#L619-L624 |
22,229 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableDateTime.java | MutableDateTime.add | public void add(DurationFieldType type, int amount) {
if (type == null) {
throw new IllegalArgumentException("Field must not be null");
}
if (amount != 0) {
setMillis(type.getField(getChronology()).add(getMillis(), amount));
}
} | java | public void add(DurationFieldType type, int amount) {
if (type == null) {
throw new IllegalArgumentException("Field must not be null");
}
if (amount != 0) {
setMillis(type.getField(getChronology()).add(getMillis(), amount));
}
} | [
"public",
"void",
"add",
"(",
"DurationFieldType",
"type",
",",
"int",
"amount",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field must not be null\"",
")",
";",
"}",
"if",
"(",
"amount",
"!=",
"... | Adds to the instant specifying the duration and multiple to add.
@param type a field type, usually obtained from DateTimeFieldType, not null
@param amount the amount to add of this duration
@throws IllegalArgumentException if the value is null or invalid
@throws ArithmeticException if the result exceeds the capacity... | [
"Adds",
"to",
"the",
"instant",
"specifying",
"the",
"duration",
"and",
"multiple",
"to",
"add",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableDateTime.java#L634-L641 |
22,230 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableDateTime.java | MutableDateTime.setDate | public void setDate(
final int year,
final int monthOfYear,
final int dayOfMonth) {
Chronology c = getChronology();
long instantMidnight = c.getDateTimeMillis(year, monthOfYear, dayOfMonth, 0);
setDate(instantMidnight);
} | java | public void setDate(
final int year,
final int monthOfYear,
final int dayOfMonth) {
Chronology c = getChronology();
long instantMidnight = c.getDateTimeMillis(year, monthOfYear, dayOfMonth, 0);
setDate(instantMidnight);
} | [
"public",
"void",
"setDate",
"(",
"final",
"int",
"year",
",",
"final",
"int",
"monthOfYear",
",",
"final",
"int",
"dayOfMonth",
")",
"{",
"Chronology",
"c",
"=",
"getChronology",
"(",
")",
";",
"long",
"instantMidnight",
"=",
"c",
".",
"getDateTimeMillis",
... | Set the date from fields.
The time part of this object will be unaffected.
@param year the year
@param monthOfYear the month of the year
@param dayOfMonth the day of the month
@throws IllegalArgumentException if the value is invalid | [
"Set",
"the",
"date",
"from",
"fields",
".",
"The",
"time",
"part",
"of",
"this",
"object",
"will",
"be",
"unaffected",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableDateTime.java#L952-L959 |
22,231 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableDateTime.java | MutableDateTime.setTime | public void setTime(final long millis) {
int millisOfDay = ISOChronology.getInstanceUTC().millisOfDay().get(millis);
setMillis(getChronology().millisOfDay().set(getMillis(), millisOfDay));
} | java | public void setTime(final long millis) {
int millisOfDay = ISOChronology.getInstanceUTC().millisOfDay().get(millis);
setMillis(getChronology().millisOfDay().set(getMillis(), millisOfDay));
} | [
"public",
"void",
"setTime",
"(",
"final",
"long",
"millis",
")",
"{",
"int",
"millisOfDay",
"=",
"ISOChronology",
".",
"getInstanceUTC",
"(",
")",
".",
"millisOfDay",
"(",
")",
".",
"get",
"(",
"millis",
")",
";",
"setMillis",
"(",
"getChronology",
"(",
... | Set the time from milliseconds.
The date part of this object will be unaffected.
@param millis an instant to copy the time from, date part ignored
@throws IllegalArgumentException if the value is invalid | [
"Set",
"the",
"time",
"from",
"milliseconds",
".",
"The",
"date",
"part",
"of",
"this",
"object",
"will",
"be",
"unaffected",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableDateTime.java#L969-L972 |
22,232 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableDateTime.java | MutableDateTime.setTime | public void setTime(final ReadableInstant instant) {
long instantMillis = DateTimeUtils.getInstantMillis(instant);
Chronology instantChrono = DateTimeUtils.getInstantChronology(instant);
DateTimeZone zone = instantChrono.getZone();
if (zone != null) {
instantMillis = zone.get... | java | public void setTime(final ReadableInstant instant) {
long instantMillis = DateTimeUtils.getInstantMillis(instant);
Chronology instantChrono = DateTimeUtils.getInstantChronology(instant);
DateTimeZone zone = instantChrono.getZone();
if (zone != null) {
instantMillis = zone.get... | [
"public",
"void",
"setTime",
"(",
"final",
"ReadableInstant",
"instant",
")",
"{",
"long",
"instantMillis",
"=",
"DateTimeUtils",
".",
"getInstantMillis",
"(",
"instant",
")",
";",
"Chronology",
"instantChrono",
"=",
"DateTimeUtils",
".",
"getInstantChronology",
"("... | Set the time from another instant.
The date part of this object will be unaffected.
@param instant an instant to copy the time from, date part ignored
@throws IllegalArgumentException if the object is invalid | [
"Set",
"the",
"time",
"from",
"another",
"instant",
".",
"The",
"date",
"part",
"of",
"this",
"object",
"will",
"be",
"unaffected",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableDateTime.java#L981-L989 |
22,233 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableDateTime.java | MutableDateTime.setTime | public void setTime(
final int hour,
final int minuteOfHour,
final int secondOfMinute,
final int millisOfSecond) {
long instant = getChronology().getDateTimeMillis(
getMillis(), hour, minuteOfHour, secondOfMinute, millisOfSecond);
setMillis(ins... | java | public void setTime(
final int hour,
final int minuteOfHour,
final int secondOfMinute,
final int millisOfSecond) {
long instant = getChronology().getDateTimeMillis(
getMillis(), hour, minuteOfHour, secondOfMinute, millisOfSecond);
setMillis(ins... | [
"public",
"void",
"setTime",
"(",
"final",
"int",
"hour",
",",
"final",
"int",
"minuteOfHour",
",",
"final",
"int",
"secondOfMinute",
",",
"final",
"int",
"millisOfSecond",
")",
"{",
"long",
"instant",
"=",
"getChronology",
"(",
")",
".",
"getDateTimeMillis",
... | Set the time from fields.
The date part of this object will be unaffected.
@param hour the hour
@param minuteOfHour the minute of the hour
@param secondOfMinute the second of the minute
@param millisOfSecond the millisecond of the second
@throws IllegalArgumentException if the value is invalid | [
"Set",
"the",
"time",
"from",
"fields",
".",
"The",
"date",
"part",
"of",
"this",
"object",
"will",
"be",
"unaffected",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableDateTime.java#L1001-L1009 |
22,234 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableDateTime.java | MutableDateTime.setDateTime | public void setDateTime(
final int year,
final int monthOfYear,
final int dayOfMonth,
final int hourOfDay,
final int minuteOfHour,
final int secondOfMinute,
final int millisOfSecond) {
long instant = getChronology().getDateTimeM... | java | public void setDateTime(
final int year,
final int monthOfYear,
final int dayOfMonth,
final int hourOfDay,
final int minuteOfHour,
final int secondOfMinute,
final int millisOfSecond) {
long instant = getChronology().getDateTimeM... | [
"public",
"void",
"setDateTime",
"(",
"final",
"int",
"year",
",",
"final",
"int",
"monthOfYear",
",",
"final",
"int",
"dayOfMonth",
",",
"final",
"int",
"hourOfDay",
",",
"final",
"int",
"minuteOfHour",
",",
"final",
"int",
"secondOfMinute",
",",
"final",
"... | Set the date and time from fields.
@param year the year
@param monthOfYear the month of the year
@param dayOfMonth the day of the month
@param hourOfDay the hour of the day
@param minuteOfHour the minute of the hour
@param secondOfMinute the second of the minute
@param millisOfSecond the millisecond of the seco... | [
"Set",
"the",
"date",
"and",
"time",
"from",
"fields",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableDateTime.java#L1023-L1034 |
22,235 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ConverterSet.java | ConverterSet.select | Converter select(Class<?> type) throws IllegalStateException {
// Check the hashtable first.
Entry[] entries = iSelectEntries;
int length = entries.length;
int index = type == null ? 0 : type.hashCode() & (length - 1);
Entry e;
// This loop depends on there being at leas... | java | Converter select(Class<?> type) throws IllegalStateException {
// Check the hashtable first.
Entry[] entries = iSelectEntries;
int length = entries.length;
int index = type == null ? 0 : type.hashCode() & (length - 1);
Entry e;
// This loop depends on there being at leas... | [
"Converter",
"select",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"throws",
"IllegalStateException",
"{",
"// Check the hashtable first.",
"Entry",
"[",
"]",
"entries",
"=",
"iSelectEntries",
";",
"int",
"length",
"=",
"entries",
".",
"length",
";",
"int",
"ind... | Returns the closest matching converter for the given type, or null if
none found.
@param type type to select, which may be null
@throws IllegalStateException if multiple converters match the type
equally well | [
"Returns",
"the",
"closest",
"matching",
"converter",
"for",
"the",
"given",
"type",
"or",
"null",
"if",
"none",
"found",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ConverterSet.java#L47-L112 |
22,236 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ConverterSet.java | ConverterSet.add | ConverterSet add(Converter converter, Converter[] removed) {
Converter[] converters = iConverters;
int length = converters.length;
for (int i=0; i<length; i++) {
Converter existing = converters[i];
if (converter.equals(existing)) {
// Already in the set.
... | java | ConverterSet add(Converter converter, Converter[] removed) {
Converter[] converters = iConverters;
int length = converters.length;
for (int i=0; i<length; i++) {
Converter existing = converters[i];
if (converter.equals(existing)) {
// Already in the set.
... | [
"ConverterSet",
"add",
"(",
"Converter",
"converter",
",",
"Converter",
"[",
"]",
"removed",
")",
"{",
"Converter",
"[",
"]",
"converters",
"=",
"iConverters",
";",
"int",
"length",
"=",
"converters",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",... | Returns a copy of this set, with the given converter added. If a
matching converter is already in the set, the given converter replaces
it. If the converter is exactly the same as one already in the set, the
original set is returned.
@param converter converter to add, must not be null
@param removed if not null, ele... | [
"Returns",
"a",
"copy",
"of",
"this",
"set",
"with",
"the",
"given",
"converter",
"added",
".",
"If",
"a",
"matching",
"converter",
"is",
"already",
"in",
"the",
"set",
"the",
"given",
"converter",
"replaces",
"it",
".",
"If",
"the",
"converter",
"is",
"... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ConverterSet.java#L138-L180 |
22,237 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ConverterSet.java | ConverterSet.remove | ConverterSet remove(Converter converter, Converter[] removed) {
Converter[] converters = iConverters;
int length = converters.length;
for (int i=0; i<length; i++) {
if (converter.equals(converters[i])) {
return remove(i, removed);
}
}
// ... | java | ConverterSet remove(Converter converter, Converter[] removed) {
Converter[] converters = iConverters;
int length = converters.length;
for (int i=0; i<length; i++) {
if (converter.equals(converters[i])) {
return remove(i, removed);
}
}
// ... | [
"ConverterSet",
"remove",
"(",
"Converter",
"converter",
",",
"Converter",
"[",
"]",
"removed",
")",
"{",
"Converter",
"[",
"]",
"converters",
"=",
"iConverters",
";",
"int",
"length",
"=",
"converters",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"... | Returns a copy of this set, with the given converter removed. If the
converter was not in the set, the original set is returned.
@param converter converter to remove, must not be null
@param removed if not null, element 0 is set to the removed converter
@throws NullPointerException if converter is null | [
"Returns",
"a",
"copy",
"of",
"this",
"set",
"with",
"the",
"given",
"converter",
"removed",
".",
"If",
"the",
"converter",
"was",
"not",
"in",
"the",
"set",
"the",
"original",
"set",
"is",
"returned",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ConverterSet.java#L190-L205 |
22,238 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ConverterSet.java | ConverterSet.remove | ConverterSet remove(final int index, Converter[] removed) {
Converter[] converters = iConverters;
int length = converters.length;
if (index >= length) {
throw new IndexOutOfBoundsException();
}
if (removed != null) {
removed[0] = converters[index];
... | java | ConverterSet remove(final int index, Converter[] removed) {
Converter[] converters = iConverters;
int length = converters.length;
if (index >= length) {
throw new IndexOutOfBoundsException();
}
if (removed != null) {
removed[0] = converters[index];
... | [
"ConverterSet",
"remove",
"(",
"final",
"int",
"index",
",",
"Converter",
"[",
"]",
"removed",
")",
"{",
"Converter",
"[",
"]",
"converters",
"=",
"iConverters",
";",
"int",
"length",
"=",
"converters",
".",
"length",
";",
"if",
"(",
"index",
">=",
"leng... | Returns a copy of this set, with the converter at the given index
removed.
@param index index of converter to remove
@param removed if not null, element 0 is set to the removed converter
@throws IndexOutOfBoundsException if the index is invalid | [
"Returns",
"a",
"copy",
"of",
"this",
"set",
"with",
"the",
"converter",
"at",
"the",
"given",
"index",
"removed",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ConverterSet.java#L215-L236 |
22,239 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ConverterSet.java | ConverterSet.selectSlow | private static Converter selectSlow(ConverterSet set, Class<?> type) {
Converter[] converters = set.iConverters;
int length = converters.length;
Converter converter;
for (int i=length; --i>=0; ) {
converter = converters[i];
Class<?> supportedType = converter.getS... | java | private static Converter selectSlow(ConverterSet set, Class<?> type) {
Converter[] converters = set.iConverters;
int length = converters.length;
Converter converter;
for (int i=length; --i>=0; ) {
converter = converters[i];
Class<?> supportedType = converter.getS... | [
"private",
"static",
"Converter",
"selectSlow",
"(",
"ConverterSet",
"set",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"Converter",
"[",
"]",
"converters",
"=",
"set",
".",
"iConverters",
";",
"int",
"length",
"=",
"converters",
".",
"length",
";",
"... | Returns the closest matching converter for the given type, but not very
efficiently. | [
"Returns",
"the",
"closest",
"matching",
"converter",
"for",
"the",
"given",
"type",
"but",
"not",
"very",
"efficiently",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ConverterSet.java#L242-L316 |
22,240 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ConverterManager.java | ConverterManager.checkAlterIntervalConverters | private void checkAlterIntervalConverters() throws SecurityException {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new JodaTimePermission("ConverterManager.alterIntervalConverters"));
}
} | java | private void checkAlterIntervalConverters() throws SecurityException {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new JodaTimePermission("ConverterManager.alterIntervalConverters"));
}
} | [
"private",
"void",
"checkAlterIntervalConverters",
"(",
")",
"throws",
"SecurityException",
"{",
"SecurityManager",
"sm",
"=",
"System",
".",
"getSecurityManager",
"(",
")",
";",
"if",
"(",
"sm",
"!=",
"null",
")",
"{",
"sm",
".",
"checkPermission",
"(",
"new"... | Checks whether the user has permission 'ConverterManager.alterIntervalConverters'.
@throws SecurityException if the user does not have the permission | [
"Checks",
"whether",
"the",
"user",
"has",
"permission",
"ConverterManager",
".",
"alterIntervalConverters",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ConverterManager.java#L577-L582 |
22,241 | JodaOrg/joda-time | src/main/java/org/joda/time/field/BaseDateTimeField.java | BaseDateTimeField.roundHalfFloor | public long roundHalfFloor(long instant) {
long floor = roundFloor(instant);
long ceiling = roundCeiling(instant);
long diffFromFloor = instant - floor;
long diffToCeiling = ceiling - instant;
if (diffFromFloor <= diffToCeiling) {
// Closer to the floor, or halfway ... | java | public long roundHalfFloor(long instant) {
long floor = roundFloor(instant);
long ceiling = roundCeiling(instant);
long diffFromFloor = instant - floor;
long diffToCeiling = ceiling - instant;
if (diffFromFloor <= diffToCeiling) {
// Closer to the floor, or halfway ... | [
"public",
"long",
"roundHalfFloor",
"(",
"long",
"instant",
")",
"{",
"long",
"floor",
"=",
"roundFloor",
"(",
"instant",
")",
";",
"long",
"ceiling",
"=",
"roundCeiling",
"(",
"instant",
")",
";",
"long",
"diffFromFloor",
"=",
"instant",
"-",
"floor",
";"... | Round to the nearest whole unit of this field. If the given millisecond
value is closer to the floor or is exactly halfway, this function
behaves like roundFloor. If the millisecond value is closer to the
ceiling, this function behaves like roundCeiling.
@param instant the milliseconds from 1970-01-01T00:00:00Z to ro... | [
"Round",
"to",
"the",
"nearest",
"whole",
"unit",
"of",
"this",
"field",
".",
"If",
"the",
"given",
"millisecond",
"value",
"is",
"closer",
"to",
"the",
"floor",
"or",
"is",
"exactly",
"halfway",
"this",
"function",
"behaves",
"like",
"roundFloor",
".",
"I... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/BaseDateTimeField.java#L902-L915 |
22,242 | JodaOrg/joda-time | src/main/java/org/joda/time/field/BaseDateTimeField.java | BaseDateTimeField.roundHalfCeiling | public long roundHalfCeiling(long instant) {
long floor = roundFloor(instant);
long ceiling = roundCeiling(instant);
long diffFromFloor = instant - floor;
long diffToCeiling = ceiling - instant;
if (diffToCeiling <= diffFromFloor) {
// Closer to the ceiling, or half... | java | public long roundHalfCeiling(long instant) {
long floor = roundFloor(instant);
long ceiling = roundCeiling(instant);
long diffFromFloor = instant - floor;
long diffToCeiling = ceiling - instant;
if (diffToCeiling <= diffFromFloor) {
// Closer to the ceiling, or half... | [
"public",
"long",
"roundHalfCeiling",
"(",
"long",
"instant",
")",
"{",
"long",
"floor",
"=",
"roundFloor",
"(",
"instant",
")",
";",
"long",
"ceiling",
"=",
"roundCeiling",
"(",
"instant",
")",
";",
"long",
"diffFromFloor",
"=",
"instant",
"-",
"floor",
"... | Round to the nearest whole unit of this field. If the given millisecond
value is closer to the floor, this function behaves like roundFloor. If
the millisecond value is closer to the ceiling or is exactly halfway,
this function behaves like roundCeiling.
@param instant the milliseconds from 1970-01-01T00:00:00Z to ro... | [
"Round",
"to",
"the",
"nearest",
"whole",
"unit",
"of",
"this",
"field",
".",
"If",
"the",
"given",
"millisecond",
"value",
"is",
"closer",
"to",
"the",
"floor",
"this",
"function",
"behaves",
"like",
"roundFloor",
".",
"If",
"the",
"millisecond",
"value",
... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/BaseDateTimeField.java#L926-L939 |
22,243 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/GJYearOfEraDateTimeField.java | GJYearOfEraDateTimeField.set | public long set(long instant, int year) {
FieldUtils.verifyValueBounds(this, year, 1, getMaximumValue());
if (iChronology.getYear(instant) <= 0) {
year = 1 - year;
}
return super.set(instant, year);
} | java | public long set(long instant, int year) {
FieldUtils.verifyValueBounds(this, year, 1, getMaximumValue());
if (iChronology.getYear(instant) <= 0) {
year = 1 - year;
}
return super.set(instant, year);
} | [
"public",
"long",
"set",
"(",
"long",
"instant",
",",
"int",
"year",
")",
"{",
"FieldUtils",
".",
"verifyValueBounds",
"(",
"this",
",",
"year",
",",
"1",
",",
"getMaximumValue",
"(",
")",
")",
";",
"if",
"(",
"iChronology",
".",
"getYear",
"(",
"insta... | Set the year component of the specified time instant.
@param instant the time instant in millis to update.
@param year the year (0,292278994) to update the time to.
@return the updated time instant.
@throws IllegalArgumentException if year is invalid. | [
"Set",
"the",
"year",
"component",
"of",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/GJYearOfEraDateTimeField.java#L91-L97 |
22,244 | JodaOrg/joda-time | src/main/java/org/joda/time/base/BaseInterval.java | BaseInterval.setInterval | protected void setInterval(long startInstant, long endInstant, Chronology chrono) {
checkInterval(startInstant, endInstant);
iStartMillis = startInstant;
iEndMillis = endInstant;
iChronology = DateTimeUtils.getChronology(chrono);
} | java | protected void setInterval(long startInstant, long endInstant, Chronology chrono) {
checkInterval(startInstant, endInstant);
iStartMillis = startInstant;
iEndMillis = endInstant;
iChronology = DateTimeUtils.getChronology(chrono);
} | [
"protected",
"void",
"setInterval",
"(",
"long",
"startInstant",
",",
"long",
"endInstant",
",",
"Chronology",
"chrono",
")",
"{",
"checkInterval",
"(",
"startInstant",
",",
"endInstant",
")",
";",
"iStartMillis",
"=",
"startInstant",
";",
"iEndMillis",
"=",
"en... | Sets this interval from two millisecond instants and a chronology.
@param startInstant the start of the time interval
@param endInstant the start of the time interval
@param chrono the chronology, not null
@throws IllegalArgumentException if the end is before the start | [
"Sets",
"this",
"interval",
"from",
"two",
"millisecond",
"instants",
"and",
"a",
"chronology",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BaseInterval.java#L247-L252 |
22,245 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/DateConverter.java | DateConverter.getInstantMillis | public long getInstantMillis(Object object, Chronology chrono) {
Date date = (Date) object;
return date.getTime();
} | java | public long getInstantMillis(Object object, Chronology chrono) {
Date date = (Date) object;
return date.getTime();
} | [
"public",
"long",
"getInstantMillis",
"(",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"Date",
"date",
"=",
"(",
"Date",
")",
"object",
";",
"return",
"date",
".",
"getTime",
"(",
")",
";",
"}"
] | Gets the millis, which is the Date millis value.
@param object the Date to convert, must not be null
@param chrono the non-null result of getChronology
@return the millisecond value
@throws NullPointerException if the object is null
@throws ClassCastException if the object is an invalid type | [
"Gets",
"the",
"millis",
"which",
"is",
"the",
"Date",
"millis",
"value",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/DateConverter.java#L54-L57 |
22,246 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/NullConverter.java | NullConverter.setInto | public void setInto(ReadWritablePeriod duration, Object object, Chronology chrono) {
duration.setPeriod((Period) null);
} | java | public void setInto(ReadWritablePeriod duration, Object object, Chronology chrono) {
duration.setPeriod((Period) null);
} | [
"public",
"void",
"setInto",
"(",
"ReadWritablePeriod",
"duration",
",",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"duration",
".",
"setPeriod",
"(",
"(",
"Period",
")",
"null",
")",
";",
"}"
] | Sets the given ReadWritableDuration to zero milliseconds.
@param duration duration to get modified
@param object the object to convert, which is null
@param chrono the chronology to use
@throws NullPointerException if the duration is null | [
"Sets",
"the",
"given",
"ReadWritableDuration",
"to",
"zero",
"milliseconds",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/NullConverter.java#L68-L70 |
22,247 | JodaOrg/joda-time | src/main/java/org/joda/time/format/ISOPeriodFormat.java | ISOPeriodFormat.standard | public static PeriodFormatter standard() {
if (cStandard == null) {
cStandard = new PeriodFormatterBuilder()
.appendLiteral("P")
.appendYears()
.appendSuffix("Y")
.appendMonths()
.appendSuffix("M")
.appen... | java | public static PeriodFormatter standard() {
if (cStandard == null) {
cStandard = new PeriodFormatterBuilder()
.appendLiteral("P")
.appendYears()
.appendSuffix("Y")
.appendMonths()
.appendSuffix("M")
.appen... | [
"public",
"static",
"PeriodFormatter",
"standard",
"(",
")",
"{",
"if",
"(",
"cStandard",
"==",
"null",
")",
"{",
"cStandard",
"=",
"new",
"PeriodFormatterBuilder",
"(",
")",
".",
"appendLiteral",
"(",
"\"P\"",
")",
".",
"appendYears",
"(",
")",
".",
"appe... | The standard ISO format - PyYmMwWdDThHmMsS.
Milliseconds are not output.
Note that the ISO8601 standard actually indicates weeks should not
be shown if any other field is present and vice versa.
@return the formatter | [
"The",
"standard",
"ISO",
"format",
"-",
"PyYmMwWdDThHmMsS",
".",
"Milliseconds",
"are",
"not",
"output",
".",
"Note",
"that",
"the",
"ISO8601",
"standard",
"actually",
"indicates",
"weeks",
"should",
"not",
"be",
"shown",
"if",
"any",
"other",
"field",
"is",
... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/ISOPeriodFormat.java#L64-L86 |
22,248 | JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatterBuilder.java | PeriodFormatterBuilder.clear | public void clear() {
iMinPrintedDigits = 1;
iPrintZeroSetting = PRINT_ZERO_RARELY_LAST;
iMaxParsedDigits = 10;
iRejectSignedValues = false;
iPrefix = null;
if (iElementPairs == null) {
iElementPairs = new ArrayList<Object>();
} else {
iEle... | java | public void clear() {
iMinPrintedDigits = 1;
iPrintZeroSetting = PRINT_ZERO_RARELY_LAST;
iMaxParsedDigits = 10;
iRejectSignedValues = false;
iPrefix = null;
if (iElementPairs == null) {
iElementPairs = new ArrayList<Object>();
} else {
iEle... | [
"public",
"void",
"clear",
"(",
")",
"{",
"iMinPrintedDigits",
"=",
"1",
";",
"iPrintZeroSetting",
"=",
"PRINT_ZERO_RARELY_LAST",
";",
"iMaxParsedDigits",
"=",
"10",
";",
"iRejectSignedValues",
"=",
"false",
";",
"iPrefix",
"=",
"null",
";",
"if",
"(",
"iEleme... | Clears out all the appended elements, allowing this builder to be reused. | [
"Clears",
"out",
"all",
"the",
"appended",
"elements",
"allowing",
"this",
"builder",
"to",
"be",
"reused",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java#L184-L198 |
22,249 | JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatterBuilder.java | PeriodFormatterBuilder.append | public PeriodFormatterBuilder append(PeriodFormatter formatter) {
if (formatter == null) {
throw new IllegalArgumentException("No formatter supplied");
}
clearPrefix();
append0(formatter.getPrinter(), formatter.getParser());
return this;
} | java | public PeriodFormatterBuilder append(PeriodFormatter formatter) {
if (formatter == null) {
throw new IllegalArgumentException("No formatter supplied");
}
clearPrefix();
append0(formatter.getPrinter(), formatter.getParser());
return this;
} | [
"public",
"PeriodFormatterBuilder",
"append",
"(",
"PeriodFormatter",
"formatter",
")",
"{",
"if",
"(",
"formatter",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"No formatter supplied\"",
")",
";",
"}",
"clearPrefix",
"(",
")",
";",
... | Appends another formatter.
@return this PeriodFormatterBuilder | [
"Appends",
"another",
"formatter",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatterBuilder.java#L205-L212 |
22,250 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/ZoneInfoCompiler.java | ZoneInfoCompiler.main | public static void main(String[] args) throws Exception {
if (args.length == 0) {
printUsage();
return;
}
File inputDir = null;
File outputDir = null;
boolean verbose = false;
int i;
for (i=0; i<args.length; i++) {
try {
... | java | public static void main(String[] args) throws Exception {
if (args.length == 0) {
printUsage();
return;
}
File inputDir = null;
File outputDir = null;
boolean verbose = false;
int i;
for (i=0; i<args.length; i++) {
try {
... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"{",
"printUsage",
"(",
")",
";",
"return",
";",
"}",
"File",
"inputDir",
"=",
"null",
";",
"Fil... | Launches the ZoneInfoCompiler tool.
<pre>
Usage: java org.joda.time.tz.ZoneInfoCompiler <options> <source files>
where possible options include:
-src <directory> Specify where to read source files
-dst <directory> Specify where to write generated files
-verbose Output verbosely... | [
"Launches",
"the",
"ZoneInfoCompiler",
"tool",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/ZoneInfoCompiler.java#L80-L124 |
22,251 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableInterval.java | MutableInterval.setInterval | public void setInterval(ReadableInterval interval) {
if (interval == null) {
throw new IllegalArgumentException("Interval must not be null");
}
long startMillis = interval.getStartMillis();
long endMillis = interval.getEndMillis();
Chronology chrono = interval.getChro... | java | public void setInterval(ReadableInterval interval) {
if (interval == null) {
throw new IllegalArgumentException("Interval must not be null");
}
long startMillis = interval.getStartMillis();
long endMillis = interval.getEndMillis();
Chronology chrono = interval.getChro... | [
"public",
"void",
"setInterval",
"(",
"ReadableInterval",
"interval",
")",
"{",
"if",
"(",
"interval",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Interval must not be null\"",
")",
";",
"}",
"long",
"startMillis",
"=",
"interval",
... | Sets this interval to be the same as another.
@param interval the interval to copy
@throws IllegalArgumentException if the interval is null | [
"Sets",
"this",
"interval",
"to",
"be",
"the",
"same",
"as",
"another",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableInterval.java#L226-L234 |
22,252 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableInterval.java | MutableInterval.setInterval | public void setInterval(ReadableInstant start, ReadableInstant end) {
if (start == null && end == null) {
long now = DateTimeUtils.currentTimeMillis();
setInterval(now, now);
} else {
long startMillis = DateTimeUtils.getInstantMillis(start);
long endMillis... | java | public void setInterval(ReadableInstant start, ReadableInstant end) {
if (start == null && end == null) {
long now = DateTimeUtils.currentTimeMillis();
setInterval(now, now);
} else {
long startMillis = DateTimeUtils.getInstantMillis(start);
long endMillis... | [
"public",
"void",
"setInterval",
"(",
"ReadableInstant",
"start",
",",
"ReadableInstant",
"end",
")",
"{",
"if",
"(",
"start",
"==",
"null",
"&&",
"end",
"==",
"null",
")",
"{",
"long",
"now",
"=",
"DateTimeUtils",
".",
"currentTimeMillis",
"(",
")",
";",
... | Sets this interval from two instants, replacing the chronology with
that from the start instant.
@param start the start of the time interval
@param end the start of the time interval
@throws IllegalArgumentException if the end is before the start | [
"Sets",
"this",
"interval",
"from",
"two",
"instants",
"replacing",
"the",
"chronology",
"with",
"that",
"from",
"the",
"start",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableInterval.java#L244-L254 |
22,253 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableInterval.java | MutableInterval.setStart | public void setStart(ReadableInstant start) {
long startMillis = DateTimeUtils.getInstantMillis(start);
super.setInterval(startMillis, getEndMillis(), getChronology());
} | java | public void setStart(ReadableInstant start) {
long startMillis = DateTimeUtils.getInstantMillis(start);
super.setInterval(startMillis, getEndMillis(), getChronology());
} | [
"public",
"void",
"setStart",
"(",
"ReadableInstant",
"start",
")",
"{",
"long",
"startMillis",
"=",
"DateTimeUtils",
".",
"getInstantMillis",
"(",
"start",
")",
";",
"super",
".",
"setInterval",
"(",
"startMillis",
",",
"getEndMillis",
"(",
")",
",",
"getChro... | Sets the start of this time interval as an Instant.
@param start the start of the time interval, null means now
@throws IllegalArgumentException if the end is before the start | [
"Sets",
"the",
"start",
"of",
"this",
"time",
"interval",
"as",
"an",
"Instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableInterval.java#L283-L286 |
22,254 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableInterval.java | MutableInterval.setEnd | public void setEnd(ReadableInstant end) {
long endMillis = DateTimeUtils.getInstantMillis(end);
super.setInterval(getStartMillis(), endMillis, getChronology());
} | java | public void setEnd(ReadableInstant end) {
long endMillis = DateTimeUtils.getInstantMillis(end);
super.setInterval(getStartMillis(), endMillis, getChronology());
} | [
"public",
"void",
"setEnd",
"(",
"ReadableInstant",
"end",
")",
"{",
"long",
"endMillis",
"=",
"DateTimeUtils",
".",
"getInstantMillis",
"(",
"end",
")",
";",
"super",
".",
"setInterval",
"(",
"getStartMillis",
"(",
")",
",",
"endMillis",
",",
"getChronology",... | Sets the end of this time interval as an Instant.
@param end the end of the time interval, null means now
@throws IllegalArgumentException if the end is before the start | [
"Sets",
"the",
"end",
"of",
"this",
"time",
"interval",
"as",
"an",
"Instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableInterval.java#L305-L308 |
22,255 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableInterval.java | MutableInterval.setDurationAfterStart | public void setDurationAfterStart(ReadableDuration duration) {
long durationMillis = DateTimeUtils.getDurationMillis(duration);
setEndMillis(FieldUtils.safeAdd(getStartMillis(), durationMillis));
} | java | public void setDurationAfterStart(ReadableDuration duration) {
long durationMillis = DateTimeUtils.getDurationMillis(duration);
setEndMillis(FieldUtils.safeAdd(getStartMillis(), durationMillis));
} | [
"public",
"void",
"setDurationAfterStart",
"(",
"ReadableDuration",
"duration",
")",
"{",
"long",
"durationMillis",
"=",
"DateTimeUtils",
".",
"getDurationMillis",
"(",
"duration",
")",
";",
"setEndMillis",
"(",
"FieldUtils",
".",
"safeAdd",
"(",
"getStartMillis",
"... | Sets the duration of this time interval, preserving the start instant.
@param duration new duration for interval, null means zero length
@throws IllegalArgumentException if the end is before the start
@throws ArithmeticException if the end instant exceeds the capacity of a long | [
"Sets",
"the",
"duration",
"of",
"this",
"time",
"interval",
"preserving",
"the",
"start",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableInterval.java#L341-L344 |
22,256 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableInterval.java | MutableInterval.setDurationBeforeEnd | public void setDurationBeforeEnd(ReadableDuration duration) {
long durationMillis = DateTimeUtils.getDurationMillis(duration);
setStartMillis(FieldUtils.safeAdd(getEndMillis(), -durationMillis));
} | java | public void setDurationBeforeEnd(ReadableDuration duration) {
long durationMillis = DateTimeUtils.getDurationMillis(duration);
setStartMillis(FieldUtils.safeAdd(getEndMillis(), -durationMillis));
} | [
"public",
"void",
"setDurationBeforeEnd",
"(",
"ReadableDuration",
"duration",
")",
"{",
"long",
"durationMillis",
"=",
"DateTimeUtils",
".",
"getDurationMillis",
"(",
"duration",
")",
";",
"setStartMillis",
"(",
"FieldUtils",
".",
"safeAdd",
"(",
"getEndMillis",
"(... | Sets the duration of this time interval, preserving the end instant.
@param duration new duration for interval, null means zero length
@throws IllegalArgumentException if the end is before the start
@throws ArithmeticException if the start instant exceeds the capacity of a long | [
"Sets",
"the",
"duration",
"of",
"this",
"time",
"interval",
"preserving",
"the",
"end",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableInterval.java#L353-L356 |
22,257 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableInterval.java | MutableInterval.setPeriodAfterStart | public void setPeriodAfterStart(ReadablePeriod period) {
if (period == null) {
setEndMillis(getStartMillis());
} else {
setEndMillis(getChronology().add(period, getStartMillis(), 1));
}
} | java | public void setPeriodAfterStart(ReadablePeriod period) {
if (period == null) {
setEndMillis(getStartMillis());
} else {
setEndMillis(getChronology().add(period, getStartMillis(), 1));
}
} | [
"public",
"void",
"setPeriodAfterStart",
"(",
"ReadablePeriod",
"period",
")",
"{",
"if",
"(",
"period",
"==",
"null",
")",
"{",
"setEndMillis",
"(",
"getStartMillis",
"(",
")",
")",
";",
"}",
"else",
"{",
"setEndMillis",
"(",
"getChronology",
"(",
")",
".... | Sets the period of this time interval, preserving the start instant
and using the ISOChronology in the default zone for calculations.
@param period new period for interval, null means zero length
@throws IllegalArgumentException if the end is before the start
@throws ArithmeticException if the end instant exceeds the... | [
"Sets",
"the",
"period",
"of",
"this",
"time",
"interval",
"preserving",
"the",
"start",
"instant",
"and",
"using",
"the",
"ISOChronology",
"in",
"the",
"default",
"zone",
"for",
"calculations",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableInterval.java#L367-L373 |
22,258 | JodaOrg/joda-time | src/main/java/org/joda/time/MutableInterval.java | MutableInterval.setPeriodBeforeEnd | public void setPeriodBeforeEnd(ReadablePeriod period) {
if (period == null) {
setStartMillis(getEndMillis());
} else {
setStartMillis(getChronology().add(period, getEndMillis(), -1));
}
} | java | public void setPeriodBeforeEnd(ReadablePeriod period) {
if (period == null) {
setStartMillis(getEndMillis());
} else {
setStartMillis(getChronology().add(period, getEndMillis(), -1));
}
} | [
"public",
"void",
"setPeriodBeforeEnd",
"(",
"ReadablePeriod",
"period",
")",
"{",
"if",
"(",
"period",
"==",
"null",
")",
"{",
"setStartMillis",
"(",
"getEndMillis",
"(",
")",
")",
";",
"}",
"else",
"{",
"setStartMillis",
"(",
"getChronology",
"(",
")",
"... | Sets the period of this time interval, preserving the end instant
and using the ISOChronology in the default zone for calculations.
@param period new period for interval, null means zero length
@throws IllegalArgumentException if the end is before the start
@throws ArithmeticException if the start instant exceeds the... | [
"Sets",
"the",
"period",
"of",
"this",
"time",
"interval",
"preserving",
"the",
"end",
"instant",
"and",
"using",
"the",
"ISOChronology",
"in",
"the",
"default",
"zone",
"for",
"calculations",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutableInterval.java#L383-L389 |
22,259 | JodaOrg/joda-time | src/main/java/org/joda/time/format/FormatUtils.java | FormatUtils.appendPaddedInteger | public static void appendPaddedInteger(Appendable appenadble, int value, int size) throws IOException {
if (value < 0) {
appenadble.append('-');
if (value != Integer.MIN_VALUE) {
value = -value;
} else {
for (; size > 10; size--) {
... | java | public static void appendPaddedInteger(Appendable appenadble, int value, int size) throws IOException {
if (value < 0) {
appenadble.append('-');
if (value != Integer.MIN_VALUE) {
value = -value;
} else {
for (; size > 10; size--) {
... | [
"public",
"static",
"void",
"appendPaddedInteger",
"(",
"Appendable",
"appenadble",
",",
"int",
"value",
",",
"int",
"size",
")",
"throws",
"IOException",
"{",
"if",
"(",
"value",
"<",
"0",
")",
"{",
"appenadble",
".",
"append",
"(",
"'",
"'",
")",
";",
... | Converts an integer to a string, prepended with a variable amount of '0'
pad characters, and appends it to the given appendable.
<p>This method is optimized for converting small values to strings.
@param appenadble receives integer converted to a string
@param value value to convert to a string
@param size minimum am... | [
"Converts",
"an",
"integer",
"to",
"a",
"string",
"prepended",
"with",
"a",
"variable",
"amount",
"of",
"0",
"pad",
"characters",
"and",
"appends",
"it",
"to",
"the",
"given",
"appendable",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/FormatUtils.java#L68-L111 |
22,260 | JodaOrg/joda-time | src/main/java/org/joda/time/format/FormatUtils.java | FormatUtils.appendUnpaddedInteger | public static void appendUnpaddedInteger(StringBuffer buf, int value) {
try {
appendUnpaddedInteger((Appendable) buf, value);
} catch (IOException e) {
// StringBuffer do not throw IOException
}
} | java | public static void appendUnpaddedInteger(StringBuffer buf, int value) {
try {
appendUnpaddedInteger((Appendable) buf, value);
} catch (IOException e) {
// StringBuffer do not throw IOException
}
} | [
"public",
"static",
"void",
"appendUnpaddedInteger",
"(",
"StringBuffer",
"buf",
",",
"int",
"value",
")",
"{",
"try",
"{",
"appendUnpaddedInteger",
"(",
"(",
"Appendable",
")",
"buf",
",",
"value",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{"... | Converts an integer to a string, and appends it to the given buffer.
<p>This method is optimized for converting small values to strings.
@param buf receives integer converted to a string
@param value value to convert to a string | [
"Converts",
"an",
"integer",
"to",
"a",
"string",
"and",
"appends",
"it",
"to",
"the",
"given",
"buffer",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/FormatUtils.java#L273-L279 |
22,261 | JodaOrg/joda-time | src/main/java/org/joda/time/format/FormatUtils.java | FormatUtils.calculateDigitCount | public static int calculateDigitCount(long value) {
if (value < 0) {
if (value != Long.MIN_VALUE) {
return calculateDigitCount(-value) + 1;
} else {
return 20;
}
}
return
(value < 10 ? 1 :
(value < 100 ... | java | public static int calculateDigitCount(long value) {
if (value < 0) {
if (value != Long.MIN_VALUE) {
return calculateDigitCount(-value) + 1;
} else {
return 20;
}
}
return
(value < 10 ? 1 :
(value < 100 ... | [
"public",
"static",
"int",
"calculateDigitCount",
"(",
"long",
"value",
")",
"{",
"if",
"(",
"value",
"<",
"0",
")",
"{",
"if",
"(",
"value",
"!=",
"Long",
".",
"MIN_VALUE",
")",
"{",
"return",
"calculateDigitCount",
"(",
"-",
"value",
")",
"+",
"1",
... | Calculates the number of decimal digits for the given value,
including the sign. | [
"Calculates",
"the",
"number",
"of",
"decimal",
"digits",
"for",
"the",
"given",
"value",
"including",
"the",
"sign",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/FormatUtils.java#L406-L420 |
22,262 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/JulianChronology.java | JulianChronology.getInstance | public static JulianChronology getInstance(DateTimeZone zone, int minDaysInFirstWeek) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
JulianChronology chrono;
JulianChronology[] chronos = cCache.get(zone);
if (chronos == null) {
chronos = new Jul... | java | public static JulianChronology getInstance(DateTimeZone zone, int minDaysInFirstWeek) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
JulianChronology chrono;
JulianChronology[] chronos = cCache.get(zone);
if (chronos == null) {
chronos = new Jul... | [
"public",
"static",
"JulianChronology",
"getInstance",
"(",
"DateTimeZone",
"zone",
",",
"int",
"minDaysInFirstWeek",
")",
"{",
"if",
"(",
"zone",
"==",
"null",
")",
"{",
"zone",
"=",
"DateTimeZone",
".",
"getDefault",
"(",
")",
";",
"}",
"JulianChronology",
... | Gets an instance of the JulianChronology in the given time zone.
@param zone the time zone to get the chronology in, null is default
@param minDaysInFirstWeek minimum number of days in first week of the year; default is 4
@return a chronology in the specified time zone | [
"Gets",
"an",
"instance",
"of",
"the",
"JulianChronology",
"in",
"the",
"given",
"time",
"zone",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/JulianChronology.java#L123-L158 |
22,263 | JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatter.java | PeriodFormatter.printTo | public void printTo(StringBuffer buf, ReadablePeriod period) {
checkPrinter();
checkPeriod(period);
getPrinter().printTo(buf, period, iLocale);
} | java | public void printTo(StringBuffer buf, ReadablePeriod period) {
checkPrinter();
checkPeriod(period);
getPrinter().printTo(buf, period, iLocale);
} | [
"public",
"void",
"printTo",
"(",
"StringBuffer",
"buf",
",",
"ReadablePeriod",
"period",
")",
"{",
"checkPrinter",
"(",
")",
";",
"checkPeriod",
"(",
"period",
")",
";",
"getPrinter",
"(",
")",
".",
"printTo",
"(",
"buf",
",",
"period",
",",
"iLocale",
... | Prints a ReadablePeriod to a StringBuffer.
@param buf the formatted period is appended to this buffer
@param period the period to format, not null | [
"Prints",
"a",
"ReadablePeriod",
"to",
"a",
"StringBuffer",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatter.java#L213-L218 |
22,264 | JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatter.java | PeriodFormatter.printTo | public void printTo(Writer out, ReadablePeriod period) throws IOException {
checkPrinter();
checkPeriod(period);
getPrinter().printTo(out, period, iLocale);
} | java | public void printTo(Writer out, ReadablePeriod period) throws IOException {
checkPrinter();
checkPeriod(period);
getPrinter().printTo(out, period, iLocale);
} | [
"public",
"void",
"printTo",
"(",
"Writer",
"out",
",",
"ReadablePeriod",
"period",
")",
"throws",
"IOException",
"{",
"checkPrinter",
"(",
")",
";",
"checkPeriod",
"(",
"period",
")",
";",
"getPrinter",
"(",
")",
".",
"printTo",
"(",
"out",
",",
"period",... | Prints a ReadablePeriod to a Writer.
@param out the formatted period is written out
@param period the period to format, not null | [
"Prints",
"a",
"ReadablePeriod",
"to",
"a",
"Writer",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatter.java#L226-L231 |
22,265 | JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatter.java | PeriodFormatter.print | public String print(ReadablePeriod period) {
checkPrinter();
checkPeriod(period);
PeriodPrinter printer = getPrinter();
StringBuffer buf = new StringBuffer(printer.calculatePrintedLength(period, iLocale));
printer.printTo(buf, period, iLocale);
return buf.toStrin... | java | public String print(ReadablePeriod period) {
checkPrinter();
checkPeriod(period);
PeriodPrinter printer = getPrinter();
StringBuffer buf = new StringBuffer(printer.calculatePrintedLength(period, iLocale));
printer.printTo(buf, period, iLocale);
return buf.toStrin... | [
"public",
"String",
"print",
"(",
"ReadablePeriod",
"period",
")",
"{",
"checkPrinter",
"(",
")",
";",
"checkPeriod",
"(",
"period",
")",
";",
"PeriodPrinter",
"printer",
"=",
"getPrinter",
"(",
")",
";",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(... | Prints a ReadablePeriod to a new String.
@param period the period to format, not null
@return the printed result | [
"Prints",
"a",
"ReadablePeriod",
"to",
"a",
"new",
"String",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatter.java#L239-L247 |
22,266 | JodaOrg/joda-time | src/main/java/org/joda/time/format/PeriodFormatter.java | PeriodFormatter.parseMutablePeriod | public MutablePeriod parseMutablePeriod(String text) {
checkParser();
MutablePeriod period = new MutablePeriod(0, iParseType);
int newPos = getParser().parseInto(period, text, 0, iLocale);
if (newPos >= 0) {
if (newPos >= text.length()) {
return perio... | java | public MutablePeriod parseMutablePeriod(String text) {
checkParser();
MutablePeriod period = new MutablePeriod(0, iParseType);
int newPos = getParser().parseInto(period, text, 0, iLocale);
if (newPos >= 0) {
if (newPos >= text.length()) {
return perio... | [
"public",
"MutablePeriod",
"parseMutablePeriod",
"(",
"String",
"text",
")",
"{",
"checkParser",
"(",
")",
";",
"MutablePeriod",
"period",
"=",
"new",
"MutablePeriod",
"(",
"0",
",",
"iParseType",
")",
";",
"int",
"newPos",
"=",
"getParser",
"(",
")",
".",
... | Parses a period from the given text, returning a new MutablePeriod.
@param text text to parse
@return parsed value in a MutablePeriod object
@throws IllegalArgumentException if any field is out of range | [
"Parses",
"a",
"period",
"from",
"the",
"given",
"text",
"returning",
"a",
"new",
"MutablePeriod",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/PeriodFormatter.java#L318-L331 |
22,267 | JodaOrg/joda-time | src/main/java/org/joda/time/LocalDate.java | LocalDate.isSupported | public boolean isSupported(DurationFieldType type) {
if (type == null) {
return false;
}
DurationField field = type.getField(getChronology());
if (DATE_DURATION_TYPES.contains(type) ||
field.getUnitMillis() >= getChronology().days().getUnitMillis()) {
... | java | public boolean isSupported(DurationFieldType type) {
if (type == null) {
return false;
}
DurationField field = type.getField(getChronology());
if (DATE_DURATION_TYPES.contains(type) ||
field.getUnitMillis() >= getChronology().days().getUnitMillis()) {
... | [
"public",
"boolean",
"isSupported",
"(",
"DurationFieldType",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"DurationField",
"field",
"=",
"type",
".",
"getField",
"(",
"getChronology",
"(",
")",
")",
";",
"if"... | Checks if the duration type specified is supported by this
local date and chronology.
@param type a duration type, usually obtained from DurationFieldType
@return true if the field type is supported | [
"Checks",
"if",
"the",
"duration",
"type",
"specified",
"is",
"supported",
"by",
"this",
"local",
"date",
"and",
"chronology",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDate.java#L589-L599 |
22,268 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/LimitChronology.java | LimitChronology.getInstance | public static LimitChronology getInstance(Chronology base,
ReadableDateTime lowerLimit,
ReadableDateTime upperLimit) {
if (base == null) {
throw new IllegalArgumentException("Must supply a chronology");
... | java | public static LimitChronology getInstance(Chronology base,
ReadableDateTime lowerLimit,
ReadableDateTime upperLimit) {
if (base == null) {
throw new IllegalArgumentException("Must supply a chronology");
... | [
"public",
"static",
"LimitChronology",
"getInstance",
"(",
"Chronology",
"base",
",",
"ReadableDateTime",
"lowerLimit",
",",
"ReadableDateTime",
"upperLimit",
")",
"{",
"if",
"(",
"base",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"... | Wraps another chronology, with datetime limits. When withUTC or
withZone is called, the returned LimitChronology instance has
the same limits, except they are time zone adjusted.
@param base base chronology to wrap
@param lowerLimit inclusive lower limit, or null if none
@param upperLimit exclusive upper limit, or ... | [
"Wraps",
"another",
"chronology",
"with",
"datetime",
"limits",
".",
"When",
"withUTC",
"or",
"withZone",
"is",
"called",
"the",
"returned",
"LimitChronology",
"instance",
"has",
"the",
"same",
"limits",
"except",
"they",
"are",
"time",
"zone",
"adjusted",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/LimitChronology.java#L64-L80 |
22,269 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/LimitChronology.java | LimitChronology.withZone | public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
if (zone == getZone()) {
return this;
}
if (zone == DateTimeZone.UTC && iWithUTC != null) {
return iWithUTC;
}
DateTime lo... | java | public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
if (zone == getZone()) {
return this;
}
if (zone == DateTimeZone.UTC && iWithUTC != null) {
return iWithUTC;
}
DateTime lo... | [
"public",
"Chronology",
"withZone",
"(",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"zone",
"==",
"null",
")",
"{",
"zone",
"=",
"DateTimeZone",
".",
"getDefault",
"(",
")",
";",
"}",
"if",
"(",
"zone",
"==",
"getZone",
"(",
")",
")",
"{",
"return"... | If this LimitChronology has the same time zone as the one given, then
this is returned. Otherwise, a new instance is returned, with the limits
adjusted to the new time zone. | [
"If",
"this",
"LimitChronology",
"has",
"the",
"same",
"time",
"zone",
"as",
"the",
"one",
"given",
"then",
"this",
"is",
"returned",
".",
"Otherwise",
"a",
"new",
"instance",
"is",
"returned",
"with",
"the",
"limits",
"adjusted",
"to",
"the",
"new",
"time... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/LimitChronology.java#L135-L169 |
22,270 | JodaOrg/joda-time | src/main/java/org/joda/time/base/AbstractInstant.java | AbstractInstant.toDateTime | public DateTime toDateTime(DateTimeZone zone) {
Chronology chrono = DateTimeUtils.getChronology(getChronology());
chrono = chrono.withZone(zone);
return new DateTime(getMillis(), chrono);
} | java | public DateTime toDateTime(DateTimeZone zone) {
Chronology chrono = DateTimeUtils.getChronology(getChronology());
chrono = chrono.withZone(zone);
return new DateTime(getMillis(), chrono);
} | [
"public",
"DateTime",
"toDateTime",
"(",
"DateTimeZone",
"zone",
")",
"{",
"Chronology",
"chrono",
"=",
"DateTimeUtils",
".",
"getChronology",
"(",
"getChronology",
"(",
")",
")",
";",
"chrono",
"=",
"chrono",
".",
"withZone",
"(",
"zone",
")",
";",
"return"... | Get this object as a DateTime using the same chronology but a different zone.
@param zone time zone to apply, or default if null
@return a DateTime using the same millis | [
"Get",
"this",
"object",
"as",
"a",
"DateTime",
"using",
"the",
"same",
"chronology",
"but",
"a",
"different",
"zone",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/AbstractInstant.java#L164-L168 |
22,271 | JodaOrg/joda-time | src/main/java/org/joda/time/base/AbstractInstant.java | AbstractInstant.toMutableDateTime | public MutableDateTime toMutableDateTime(DateTimeZone zone) {
Chronology chrono = DateTimeUtils.getChronology(getChronology());
chrono = chrono.withZone(zone);
return new MutableDateTime(getMillis(), chrono);
} | java | public MutableDateTime toMutableDateTime(DateTimeZone zone) {
Chronology chrono = DateTimeUtils.getChronology(getChronology());
chrono = chrono.withZone(zone);
return new MutableDateTime(getMillis(), chrono);
} | [
"public",
"MutableDateTime",
"toMutableDateTime",
"(",
"DateTimeZone",
"zone",
")",
"{",
"Chronology",
"chrono",
"=",
"DateTimeUtils",
".",
"getChronology",
"(",
"getChronology",
"(",
")",
")",
";",
"chrono",
"=",
"chrono",
".",
"withZone",
"(",
"zone",
")",
"... | Get this object as a MutableDateTime using the same chronology but a different zone.
@param zone time zone to apply, or default if null
@return a MutableDateTime using the same millis | [
"Get",
"this",
"object",
"as",
"a",
"MutableDateTime",
"using",
"the",
"same",
"chronology",
"but",
"a",
"different",
"zone",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/AbstractInstant.java#L209-L213 |
22,272 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/EthiopicChronology.java | EthiopicChronology.getInstance | public static EthiopicChronology getInstance(DateTimeZone zone, int minDaysInFirstWeek) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
EthiopicChronology chrono;
EthiopicChronology[] chronos = cCache.get(zone);
if (chronos == null) {
chronos = n... | java | public static EthiopicChronology getInstance(DateTimeZone zone, int minDaysInFirstWeek) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
EthiopicChronology chrono;
EthiopicChronology[] chronos = cCache.get(zone);
if (chronos == null) {
chronos = n... | [
"public",
"static",
"EthiopicChronology",
"getInstance",
"(",
"DateTimeZone",
"zone",
",",
"int",
"minDaysInFirstWeek",
")",
"{",
"if",
"(",
"zone",
"==",
"null",
")",
"{",
"zone",
"=",
"DateTimeZone",
".",
"getDefault",
"(",
")",
";",
"}",
"EthiopicChronology... | Gets an instance of the EthiopicChronology in the given time zone.
@param zone the time zone to get the chronology in, null is default
@param minDaysInFirstWeek minimum number of days in first week of the year; default is 4
@return a chronology in the specified time zone | [
"Gets",
"an",
"instance",
"of",
"the",
"EthiopicChronology",
"in",
"the",
"given",
"time",
"zone",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/EthiopicChronology.java#L117-L159 |
22,273 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/GJDayOfWeekDateTimeField.java | GJDayOfWeekDateTimeField.getAsText | public String getAsText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToText(fieldValue);
} | java | public String getAsText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToText(fieldValue);
} | [
"public",
"String",
"getAsText",
"(",
"int",
"fieldValue",
",",
"Locale",
"locale",
")",
"{",
"return",
"GJLocaleSymbols",
".",
"forLocale",
"(",
"locale",
")",
".",
"dayOfWeekValueToText",
"(",
"fieldValue",
")",
";",
"}"
] | Get the textual value of the specified time instant.
@param fieldValue the field value to query
@param locale the locale to use
@return the day of the week, such as 'Monday' | [
"Get",
"the",
"textual",
"value",
"of",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/GJDayOfWeekDateTimeField.java#L67-L69 |
22,274 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/GJDayOfWeekDateTimeField.java | GJDayOfWeekDateTimeField.getAsShortText | public String getAsShortText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToShortText(fieldValue);
} | java | public String getAsShortText(int fieldValue, Locale locale) {
return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToShortText(fieldValue);
} | [
"public",
"String",
"getAsShortText",
"(",
"int",
"fieldValue",
",",
"Locale",
"locale",
")",
"{",
"return",
"GJLocaleSymbols",
".",
"forLocale",
"(",
"locale",
")",
".",
"dayOfWeekValueToShortText",
"(",
"fieldValue",
")",
";",
"}"
] | Get the abbreviated textual value of the specified time instant.
@param fieldValue the field value to query
@param locale the locale to use
@return the day of the week, such as 'Mon' | [
"Get",
"the",
"abbreviated",
"textual",
"value",
"of",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/GJDayOfWeekDateTimeField.java#L78-L80 |
22,275 | JodaOrg/joda-time | src/main/java/org/joda/time/base/BaseSingleFieldPeriod.java | BaseSingleFieldPeriod.between | protected static int between(ReadableInstant start, ReadableInstant end, DurationFieldType field) {
if (start == null || end == null) {
throw new IllegalArgumentException("ReadableInstant objects must not be null");
}
Chronology chrono = DateTimeUtils.getInstantChronology(start);
... | java | protected static int between(ReadableInstant start, ReadableInstant end, DurationFieldType field) {
if (start == null || end == null) {
throw new IllegalArgumentException("ReadableInstant objects must not be null");
}
Chronology chrono = DateTimeUtils.getInstantChronology(start);
... | [
"protected",
"static",
"int",
"between",
"(",
"ReadableInstant",
"start",
",",
"ReadableInstant",
"end",
",",
"DurationFieldType",
"field",
")",
"{",
"if",
"(",
"start",
"==",
"null",
"||",
"end",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExcepti... | Calculates the number of whole units between the two specified datetimes.
@param start the start instant, validated to not be null
@param end the end instant, validated to not be null
@param field the field type to use, must not be null
@return the period
@throws IllegalArgumentException if the instants are null or... | [
"Calculates",
"the",
"number",
"of",
"whole",
"units",
"between",
"the",
"two",
"specified",
"datetimes",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BaseSingleFieldPeriod.java#L67-L74 |
22,276 | JodaOrg/joda-time | src/main/java/org/joda/time/base/BaseSingleFieldPeriod.java | BaseSingleFieldPeriod.compareTo | public int compareTo(BaseSingleFieldPeriod other) {
if (other.getClass() != getClass()) {
throw new ClassCastException(getClass() + " cannot be compared to " + other.getClass());
}
int otherValue = other.getValue();
int thisValue = getValue();
if (thisValue > otherVal... | java | public int compareTo(BaseSingleFieldPeriod other) {
if (other.getClass() != getClass()) {
throw new ClassCastException(getClass() + " cannot be compared to " + other.getClass());
}
int otherValue = other.getValue();
int thisValue = getValue();
if (thisValue > otherVal... | [
"public",
"int",
"compareTo",
"(",
"BaseSingleFieldPeriod",
"other",
")",
"{",
"if",
"(",
"other",
".",
"getClass",
"(",
")",
"!=",
"getClass",
"(",
")",
")",
"{",
"throw",
"new",
"ClassCastException",
"(",
"getClass",
"(",
")",
"+",
"\" cannot be compared t... | Compares this period to another object of the same class.
@param other the other period, must not be null
@return zero if equal, positive if greater, negative if less
@throws NullPointerException if the other period is null
@throws ClassCastException if the other period is of a different type | [
"Compares",
"this",
"period",
"to",
"another",
"object",
"of",
"the",
"same",
"class",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BaseSingleFieldPeriod.java#L331-L344 |
22,277 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/GJEraDateTimeField.java | GJEraDateTimeField.set | public long set(long instant, int era) {
FieldUtils.verifyValueBounds(this, era, DateTimeConstants.BCE, DateTimeConstants.CE);
int oldEra = get(instant);
if (oldEra != era) {
int year = iChronology.getYear(instant);
return iChronology.setYear(instant, -year);... | java | public long set(long instant, int era) {
FieldUtils.verifyValueBounds(this, era, DateTimeConstants.BCE, DateTimeConstants.CE);
int oldEra = get(instant);
if (oldEra != era) {
int year = iChronology.getYear(instant);
return iChronology.setYear(instant, -year);... | [
"public",
"long",
"set",
"(",
"long",
"instant",
",",
"int",
"era",
")",
"{",
"FieldUtils",
".",
"verifyValueBounds",
"(",
"this",
",",
"era",
",",
"DateTimeConstants",
".",
"BCE",
",",
"DateTimeConstants",
".",
"CE",
")",
";",
"int",
"oldEra",
"=",
"get... | Set the Era component of the specified time instant.
@param instant the time instant in millis to update.
@param era the era to update the time to.
@return the updated time instant.
@throws IllegalArgumentException if era is invalid. | [
"Set",
"the",
"Era",
"component",
"of",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/GJEraDateTimeField.java#L80-L90 |
22,278 | JodaOrg/joda-time | src/main/java/org/joda/time/DateMidnight.java | DateMidnight.withZoneRetainFields | public DateMidnight withZoneRetainFields(DateTimeZone newZone) {
newZone = DateTimeUtils.getZone(newZone);
DateTimeZone originalZone = DateTimeUtils.getZone(getZone());
if (newZone == originalZone) {
return this;
}
long millis = originalZone.getMillisKeepLoca... | java | public DateMidnight withZoneRetainFields(DateTimeZone newZone) {
newZone = DateTimeUtils.getZone(newZone);
DateTimeZone originalZone = DateTimeUtils.getZone(getZone());
if (newZone == originalZone) {
return this;
}
long millis = originalZone.getMillisKeepLoca... | [
"public",
"DateMidnight",
"withZoneRetainFields",
"(",
"DateTimeZone",
"newZone",
")",
"{",
"newZone",
"=",
"DateTimeUtils",
".",
"getZone",
"(",
"newZone",
")",
";",
"DateTimeZone",
"originalZone",
"=",
"DateTimeUtils",
".",
"getZone",
"(",
"getZone",
"(",
")",
... | Returns a copy of this date with a different time zone, preserving the day
The returned object will have a local time of midnight in the new zone on
the same day as the original instant.
@param newZone the new time zone, null means default
@return a copy of this instant with a different time zone | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"with",
"a",
"different",
"time",
"zone",
"preserving",
"the",
"day",
"The",
"returned",
"object",
"will",
"have",
"a",
"local",
"time",
"of",
"midnight",
"in",
"the",
"new",
"zone",
"on",
"the",
"same",
"day... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateMidnight.java#L414-L423 |
22,279 | JodaOrg/joda-time | src/main/java/org/joda/time/field/PreciseDateTimeField.java | PreciseDateTimeField.get | public int get(long instant) {
if (instant >= 0) {
return (int) ((instant / getUnitMillis()) % iRange);
} else {
return iRange - 1 + (int) (((instant + 1) / getUnitMillis()) % iRange);
}
} | java | public int get(long instant) {
if (instant >= 0) {
return (int) ((instant / getUnitMillis()) % iRange);
} else {
return iRange - 1 + (int) (((instant + 1) / getUnitMillis()) % iRange);
}
} | [
"public",
"int",
"get",
"(",
"long",
"instant",
")",
"{",
"if",
"(",
"instant",
">=",
"0",
")",
"{",
"return",
"(",
"int",
")",
"(",
"(",
"instant",
"/",
"getUnitMillis",
"(",
")",
")",
"%",
"iRange",
")",
";",
"}",
"else",
"{",
"return",
"iRange... | Get the amount of fractional units from the specified time instant.
@param instant the milliseconds from 1970-01-01T00:00:00Z to query
@return the amount of fractional units extracted from the input. | [
"Get",
"the",
"amount",
"of",
"fractional",
"units",
"from",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/PreciseDateTimeField.java#L79-L85 |
22,280 | JodaOrg/joda-time | src/main/java/org/joda/time/field/PreciseDateTimeField.java | PreciseDateTimeField.addWrapField | public long addWrapField(long instant, int amount) {
int thisValue = get(instant);
int wrappedValue = FieldUtils.getWrappedValue
(thisValue, amount, getMinimumValue(), getMaximumValue());
// copy code from set() to avoid repeat call to get()
return instant + (wrappedValue - t... | java | public long addWrapField(long instant, int amount) {
int thisValue = get(instant);
int wrappedValue = FieldUtils.getWrappedValue
(thisValue, amount, getMinimumValue(), getMaximumValue());
// copy code from set() to avoid repeat call to get()
return instant + (wrappedValue - t... | [
"public",
"long",
"addWrapField",
"(",
"long",
"instant",
",",
"int",
"amount",
")",
"{",
"int",
"thisValue",
"=",
"get",
"(",
"instant",
")",
";",
"int",
"wrappedValue",
"=",
"FieldUtils",
".",
"getWrappedValue",
"(",
"thisValue",
",",
"amount",
",",
"get... | Add to the component of the specified time instant, wrapping around
within that component if necessary.
@param instant the milliseconds from 1970-01-01T00:00:00Z to add to
@param amount the amount of units to add (can be negative).
@return the updated time instant. | [
"Add",
"to",
"the",
"component",
"of",
"the",
"specified",
"time",
"instant",
"wrapping",
"around",
"within",
"that",
"component",
"if",
"necessary",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/PreciseDateTimeField.java#L95-L101 |
22,281 | JodaOrg/joda-time | src/example/org/joda/example/time/DateTimePerformance.java | DateTimePerformance.end | private void end(int count) {
end = System.currentTimeMillis();
long time = (end - start);
result.time = result.time + time;
result.runs = result.runs + count;
result.avg = (result.time * 1000000) / result.runs;
System.out.print(".");
} | java | private void end(int count) {
end = System.currentTimeMillis();
long time = (end - start);
result.time = result.time + time;
result.runs = result.runs + count;
result.avg = (result.time * 1000000) / result.runs;
System.out.print(".");
} | [
"private",
"void",
"end",
"(",
"int",
"count",
")",
"{",
"end",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"time",
"=",
"(",
"end",
"-",
"start",
")",
";",
"result",
".",
"time",
"=",
"result",
".",
"time",
"+",
"time",
";",
... | End the stopwatch and print the result. | [
"End",
"the",
"stopwatch",
"and",
"print",
"the",
"result",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/example/org/joda/example/time/DateTimePerformance.java#L891-L898 |
22,282 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatter.java | DateTimeFormatter.selectChronology | private Chronology selectChronology(Chronology chrono) {
chrono = DateTimeUtils.getChronology(chrono);
if (iChrono != null) {
chrono = iChrono;
}
if (iZone != null) {
chrono = chrono.withZone(iZone);
}
return chrono;
} | java | private Chronology selectChronology(Chronology chrono) {
chrono = DateTimeUtils.getChronology(chrono);
if (iChrono != null) {
chrono = iChrono;
}
if (iZone != null) {
chrono = chrono.withZone(iZone);
}
return chrono;
} | [
"private",
"Chronology",
"selectChronology",
"(",
"Chronology",
"chrono",
")",
"{",
"chrono",
"=",
"DateTimeUtils",
".",
"getChronology",
"(",
"chrono",
")",
";",
"if",
"(",
"iChrono",
"!=",
"null",
")",
"{",
"chrono",
"=",
"iChrono",
";",
"}",
"if",
"(",
... | Determines the correct chronology to use.
@param chrono the proposed chronology
@return the actual chronology | [
"Determines",
"the",
"correct",
"chronology",
"to",
"use",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatter.java#L1013-L1022 |
22,283 | JodaOrg/joda-time | src/main/java/org/joda/time/IllegalFieldValueException.java | IllegalFieldValueException.getIllegalValueAsString | public String getIllegalValueAsString() {
String value = iStringValue;
if (value == null) {
value = String.valueOf(iNumberValue);
}
return value;
} | java | public String getIllegalValueAsString() {
String value = iStringValue;
if (value == null) {
value = String.valueOf(iNumberValue);
}
return value;
} | [
"public",
"String",
"getIllegalValueAsString",
"(",
")",
"{",
"String",
"value",
"=",
"iStringValue",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"value",
"=",
"String",
".",
"valueOf",
"(",
"iNumberValue",
")",
";",
"}",
"return",
"value",
";",
"}"... | Returns the illegal value assigned to the field as a non-null string.
@return the value | [
"Returns",
"the",
"illegal",
"value",
"assigned",
"to",
"the",
"field",
"as",
"a",
"non",
"-",
"null",
"string",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/IllegalFieldValueException.java#L287-L293 |
22,284 | JodaOrg/joda-time | src/main/java/org/joda/time/IllegalFieldValueException.java | IllegalFieldValueException.prependMessage | public void prependMessage(String message) {
if (iMessage == null) {
iMessage = message;
} else if (message != null) {
iMessage = message + ": " + iMessage;
}
} | java | public void prependMessage(String message) {
if (iMessage == null) {
iMessage = message;
} else if (message != null) {
iMessage = message + ": " + iMessage;
}
} | [
"public",
"void",
"prependMessage",
"(",
"String",
"message",
")",
"{",
"if",
"(",
"iMessage",
"==",
"null",
")",
"{",
"iMessage",
"=",
"message",
";",
"}",
"else",
"if",
"(",
"message",
"!=",
"null",
")",
"{",
"iMessage",
"=",
"message",
"+",
"\": \""... | Provide additional detail by prepending a message to the existing message.
A colon is separator is automatically inserted between the messages.
@since 1.3 | [
"Provide",
"additional",
"detail",
"by",
"prepending",
"a",
"message",
"to",
"the",
"existing",
"message",
".",
"A",
"colon",
"is",
"separator",
"is",
"automatically",
"inserted",
"between",
"the",
"messages",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/IllegalFieldValueException.java#L322-L328 |
22,285 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/GJChronology.java | GJChronology.withZone | public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
if (zone == getZone()) {
return this;
}
return getInstance(zone, iCutoverInstant, getMinimumDaysInFirstWeek());
} | java | public Chronology withZone(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
if (zone == getZone()) {
return this;
}
return getInstance(zone, iCutoverInstant, getMinimumDaysInFirstWeek());
} | [
"public",
"Chronology",
"withZone",
"(",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"zone",
"==",
"null",
")",
"{",
"zone",
"=",
"DateTimeZone",
".",
"getDefault",
"(",
")",
";",
"}",
"if",
"(",
"zone",
"==",
"getZone",
"(",
")",
")",
"{",
"return"... | Gets the Chronology in a specific time zone.
@param zone the zone to get the chronology in, null is default
@return the chronology | [
"Gets",
"the",
"Chronology",
"in",
"a",
"specific",
"time",
"zone",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/GJChronology.java#L307-L315 |
22,286 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java | DateTimeZoneBuilder.readMillis | static long readMillis(DataInput in) throws IOException {
int v = in.readUnsignedByte();
switch (v >> 6) {
case 0: default:
// Form 00 (6 bits effective precision)
v = (v << (32 - 6)) >> (32 - 6);
return v * (30 * 60000L);
case 1:
// Form ... | java | static long readMillis(DataInput in) throws IOException {
int v = in.readUnsignedByte();
switch (v >> 6) {
case 0: default:
// Form 00 (6 bits effective precision)
v = (v << (32 - 6)) >> (32 - 6);
return v * (30 * 60000L);
case 1:
// Form ... | [
"static",
"long",
"readMillis",
"(",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"int",
"v",
"=",
"in",
".",
"readUnsignedByte",
"(",
")",
";",
"switch",
"(",
"v",
">>",
"6",
")",
"{",
"case",
"0",
":",
"default",
":",
"// Form 00 (6 bits effec... | Reads encoding generated by writeMillis. | [
"Reads",
"encoding",
"generated",
"by",
"writeMillis",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java#L183-L212 |
22,287 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java | DateTimeZoneBuilder.addCutover | public DateTimeZoneBuilder addCutover(int year,
char mode,
int monthOfYear,
int dayOfMonth,
int dayOfWeek,
boo... | java | public DateTimeZoneBuilder addCutover(int year,
char mode,
int monthOfYear,
int dayOfMonth,
int dayOfWeek,
boo... | [
"public",
"DateTimeZoneBuilder",
"addCutover",
"(",
"int",
"year",
",",
"char",
"mode",
",",
"int",
"monthOfYear",
",",
"int",
"dayOfMonth",
",",
"int",
"dayOfWeek",
",",
"boolean",
"advanceDayOfWeek",
",",
"int",
"millisOfDay",
")",
"{",
"if",
"(",
"iRuleSets... | Adds a cutover for added rules. The standard offset at the cutover
defaults to 0. Call setStandardOffset afterwards to change it.
@param year the year of cutover
@param mode 'u' - cutover is measured against UTC, 'w' - against wall
offset, 's' - against standard offset
@param monthOfYear the month from 1 (January) t... | [
"Adds",
"a",
"cutover",
"for",
"added",
"rules",
".",
"The",
"standard",
"offset",
"at",
"the",
"cutover",
"defaults",
"to",
"0",
".",
"Call",
"setStandardOffset",
"afterwards",
"to",
"change",
"it",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java#L245-L261 |
22,288 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java | DateTimeZoneBuilder.addRecurringSavings | public DateTimeZoneBuilder addRecurringSavings(String nameKey, int saveMillis,
int fromYear, int toYear,
char mode,
int monthOfYear,
... | java | public DateTimeZoneBuilder addRecurringSavings(String nameKey, int saveMillis,
int fromYear, int toYear,
char mode,
int monthOfYear,
... | [
"public",
"DateTimeZoneBuilder",
"addRecurringSavings",
"(",
"String",
"nameKey",
",",
"int",
"saveMillis",
",",
"int",
"fromYear",
",",
"int",
"toYear",
",",
"char",
"mode",
",",
"int",
"monthOfYear",
",",
"int",
"dayOfMonth",
",",
"int",
"dayOfWeek",
",",
"b... | Add a recurring daylight saving time rule.
@param nameKey the name key of new rule
@param saveMillis the milliseconds to add to standard offset
@param fromYear the first year that rule is in effect, MIN_VALUE indicates
beginning of time
@param toYear the last year (inclusive) that rule is in effect, MAX_VALUE
indi... | [
"Add",
"a",
"recurring",
"daylight",
"saving",
"time",
"rule",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java#L301-L318 |
22,289 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java | DateTimeZoneBuilder.toDateTimeZone | public DateTimeZone toDateTimeZone(String id, boolean outputID) {
if (id == null) {
throw new IllegalArgumentException();
}
// Discover where all the transitions occur and store the results in
// these lists.
ArrayList<Transition> transitions = new ArrayList<Transiti... | java | public DateTimeZone toDateTimeZone(String id, boolean outputID) {
if (id == null) {
throw new IllegalArgumentException();
}
// Discover where all the transitions occur and store the results in
// these lists.
ArrayList<Transition> transitions = new ArrayList<Transiti... | [
"public",
"DateTimeZone",
"toDateTimeZone",
"(",
"String",
"id",
",",
"boolean",
"outputID",
")",
"{",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"// Discover where all the transitions occur and store the... | Processes all the rules and builds a DateTimeZone.
@param id time zone id to assign
@param outputID true if the zone id should be output | [
"Processes",
"all",
"the",
"rules",
"and",
"builds",
"a",
"DateTimeZone",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/DateTimeZoneBuilder.java#L333-L400 |
22,290 | JodaOrg/joda-time | src/main/java/org/joda/time/LocalDateTime.java | LocalDateTime.isSupported | public boolean isSupported(DurationFieldType type) {
if (type == null) {
return false;
}
return type.getField(getChronology()).isSupported();
} | java | public boolean isSupported(DurationFieldType type) {
if (type == null) {
return false;
}
return type.getField(getChronology()).isSupported();
} | [
"public",
"boolean",
"isSupported",
"(",
"DurationFieldType",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"type",
".",
"getField",
"(",
"getChronology",
"(",
")",
")",
".",
"isSupported",
"(",
")",
... | Checks if the duration type specified is supported by this
local datetime and chronology.
@param type a duration type, usually obtained from DurationFieldType
@return true if the field type is supported | [
"Checks",
"if",
"the",
"duration",
"type",
"specified",
"is",
"supported",
"by",
"this",
"local",
"datetime",
"and",
"chronology",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDateTime.java#L635-L640 |
22,291 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/ZonedChronology.java | ZonedChronology.getInstance | public static ZonedChronology getInstance(Chronology base, DateTimeZone zone) {
if (base == null) {
throw new IllegalArgumentException("Must supply a chronology");
}
base = base.withUTC();
if (base == null) {
throw new IllegalArgumentException("UTC chronology must... | java | public static ZonedChronology getInstance(Chronology base, DateTimeZone zone) {
if (base == null) {
throw new IllegalArgumentException("Must supply a chronology");
}
base = base.withUTC();
if (base == null) {
throw new IllegalArgumentException("UTC chronology must... | [
"public",
"static",
"ZonedChronology",
"getInstance",
"(",
"Chronology",
"base",
",",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"base",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Must supply a chronology\"",
")",
";",
"}",
"ba... | Create a ZonedChronology for any chronology, overriding any time zone it
may already have.
@param base base chronology to wrap
@param zone the time zone
@throws IllegalArgumentException if chronology or time zone is null | [
"Create",
"a",
"ZonedChronology",
"for",
"any",
"chronology",
"overriding",
"any",
"time",
"zone",
"it",
"may",
"already",
"have",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/ZonedChronology.java#L58-L70 |
22,292 | JodaOrg/joda-time | src/main/java/org/joda/time/base/BasePeriod.java | BasePeriod.checkAndUpdate | private void checkAndUpdate(DurationFieldType type, int[] values, int newValue) {
int index = indexOf(type);
if (index == -1) {
if (newValue != 0) {
throw new IllegalArgumentException(
"Period does not support field '" + type.getName() + "'");
... | java | private void checkAndUpdate(DurationFieldType type, int[] values, int newValue) {
int index = indexOf(type);
if (index == -1) {
if (newValue != 0) {
throw new IllegalArgumentException(
"Period does not support field '" + type.getName() + "'");
... | [
"private",
"void",
"checkAndUpdate",
"(",
"DurationFieldType",
"type",
",",
"int",
"[",
"]",
"values",
",",
"int",
"newValue",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"type",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"if",
"(",
... | Checks whether a field type is supported, and if so adds the new value
to the relevant index in the specified array.
@param type the field type
@param values the array to update
@param newValue the new value to store if successful | [
"Checks",
"whether",
"a",
"field",
"type",
"is",
"supported",
"and",
"if",
"so",
"adds",
"the",
"new",
"value",
"to",
"the",
"relevant",
"index",
"in",
"the",
"specified",
"array",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BasePeriod.java#L389-L399 |
22,293 | JodaOrg/joda-time | src/main/java/org/joda/time/base/BasePeriod.java | BasePeriod.setPeriod | protected void setPeriod(int years, int months, int weeks, int days,
int hours, int minutes, int seconds, int millis) {
int[] newValues = setPeriodInternal(years, months, weeks, days, hours, minutes, seconds, millis);
setValues(newValues);
} | java | protected void setPeriod(int years, int months, int weeks, int days,
int hours, int minutes, int seconds, int millis) {
int[] newValues = setPeriodInternal(years, months, weeks, days, hours, minutes, seconds, millis);
setValues(newValues);
} | [
"protected",
"void",
"setPeriod",
"(",
"int",
"years",
",",
"int",
"months",
",",
"int",
"weeks",
",",
"int",
"days",
",",
"int",
"hours",
",",
"int",
"minutes",
",",
"int",
"seconds",
",",
"int",
"millis",
")",
"{",
"int",
"[",
"]",
"newValues",
"="... | Sets the eight standard the fields in one go.
@param years amount of years in this period, which must be zero if unsupported
@param months amount of months in this period, which must be zero if unsupported
@param weeks amount of weeks in this period, which must be zero if unsupported
@param days amount of days in ... | [
"Sets",
"the",
"eight",
"standard",
"the",
"fields",
"in",
"one",
"go",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BasePeriod.java#L442-L446 |
22,294 | JodaOrg/joda-time | src/main/java/org/joda/time/base/BasePeriod.java | BasePeriod.setFieldInto | protected void setFieldInto(int[] values, DurationFieldType field, int value) {
int index = indexOf(field);
if (index == -1) {
if (value != 0 || field == null) {
throw new IllegalArgumentException(
"Period does not support field '" + field + "'");
... | java | protected void setFieldInto(int[] values, DurationFieldType field, int value) {
int index = indexOf(field);
if (index == -1) {
if (value != 0 || field == null) {
throw new IllegalArgumentException(
"Period does not support field '" + field + "'");
... | [
"protected",
"void",
"setFieldInto",
"(",
"int",
"[",
"]",
"values",
",",
"DurationFieldType",
"field",
",",
"int",
"value",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"field",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"if",
"(",
... | Sets the value of a field in this period.
@param values the array of values to update
@param field the field to set
@param value the value to set
@throws IllegalArgumentException if field is null or not supported. | [
"Sets",
"the",
"value",
"of",
"a",
"field",
"in",
"this",
"period",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BasePeriod.java#L485-L495 |
22,295 | JodaOrg/joda-time | src/main/java/org/joda/time/base/BasePeriod.java | BasePeriod.addFieldInto | protected void addFieldInto(int[] values, DurationFieldType field, int value) {
int index = indexOf(field);
if (index == -1) {
if (value != 0 || field == null) {
throw new IllegalArgumentException(
"Period does not support field '" + field + "'");
... | java | protected void addFieldInto(int[] values, DurationFieldType field, int value) {
int index = indexOf(field);
if (index == -1) {
if (value != 0 || field == null) {
throw new IllegalArgumentException(
"Period does not support field '" + field + "'");
... | [
"protected",
"void",
"addFieldInto",
"(",
"int",
"[",
"]",
"values",
",",
"DurationFieldType",
"field",
",",
"int",
"value",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"field",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"if",
"(",
... | Adds the value of a field in this period.
@param values the array of values to update
@param field the field to set
@param value the value to set
@throws IllegalArgumentException if field is is null or not supported. | [
"Adds",
"the",
"value",
"of",
"a",
"field",
"in",
"this",
"period",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BasePeriod.java#L516-L526 |
22,296 | JodaOrg/joda-time | src/main/java/org/joda/time/base/BasePeriod.java | BasePeriod.mergePeriodInto | protected int[] mergePeriodInto(int[] values, ReadablePeriod period) {
for (int i = 0, isize = period.size(); i < isize; i++) {
DurationFieldType type = period.getFieldType(i);
int value = period.getValue(i);
checkAndUpdate(type, values, value);
}
return value... | java | protected int[] mergePeriodInto(int[] values, ReadablePeriod period) {
for (int i = 0, isize = period.size(); i < isize; i++) {
DurationFieldType type = period.getFieldType(i);
int value = period.getValue(i);
checkAndUpdate(type, values, value);
}
return value... | [
"protected",
"int",
"[",
"]",
"mergePeriodInto",
"(",
"int",
"[",
"]",
"values",
",",
"ReadablePeriod",
"period",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"isize",
"=",
"period",
".",
"size",
"(",
")",
";",
"i",
"<",
"isize",
";",
"i",
"+... | Merges the fields from another period.
@param values the array of values to update
@param period the period to add from, not null
@return the updated values
@throws IllegalArgumentException if an unsupported field's value is non-zero | [
"Merges",
"the",
"fields",
"from",
"another",
"period",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BasePeriod.java#L548-L555 |
22,297 | JodaOrg/joda-time | src/main/java/org/joda/time/base/BasePeriod.java | BasePeriod.addPeriodInto | protected int[] addPeriodInto(int[] values, ReadablePeriod period) {
for (int i = 0, isize = period.size(); i < isize; i++) {
DurationFieldType type = period.getFieldType(i);
int value = period.getValue(i);
if (value != 0) {
int index = indexOf(type);
... | java | protected int[] addPeriodInto(int[] values, ReadablePeriod period) {
for (int i = 0, isize = period.size(); i < isize; i++) {
DurationFieldType type = period.getFieldType(i);
int value = period.getValue(i);
if (value != 0) {
int index = indexOf(type);
... | [
"protected",
"int",
"[",
"]",
"addPeriodInto",
"(",
"int",
"[",
"]",
"values",
",",
"ReadablePeriod",
"period",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"isize",
"=",
"period",
".",
"size",
"(",
")",
";",
"i",
"<",
"isize",
";",
"i",
"++"... | Adds the fields from another period.
@param values the array of values to update
@param period the period to add from, not null
@return the updated values
@throws IllegalArgumentException if an unsupported field's value is non-zero | [
"Adds",
"the",
"fields",
"from",
"another",
"period",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/BasePeriod.java#L577-L592 |
22,298 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/GJLocaleSymbols.java | GJLocaleSymbols.forLocale | static GJLocaleSymbols forLocale(Locale locale) {
if (locale == null) {
locale = Locale.getDefault();
}
GJLocaleSymbols symbols = cCache.get(locale);
if (symbols == null) {
symbols = new GJLocaleSymbols(locale);
GJLocaleSymbols oldSymbols = cCache.putI... | java | static GJLocaleSymbols forLocale(Locale locale) {
if (locale == null) {
locale = Locale.getDefault();
}
GJLocaleSymbols symbols = cCache.get(locale);
if (symbols == null) {
symbols = new GJLocaleSymbols(locale);
GJLocaleSymbols oldSymbols = cCache.putI... | [
"static",
"GJLocaleSymbols",
"forLocale",
"(",
"Locale",
"locale",
")",
"{",
"if",
"(",
"locale",
"==",
"null",
")",
"{",
"locale",
"=",
"Locale",
".",
"getDefault",
"(",
")",
";",
"}",
"GJLocaleSymbols",
"symbols",
"=",
"cCache",
".",
"get",
"(",
"local... | Obtains the symbols for a locale.
@param locale the locale, null returns default
@return the symbols, not null | [
"Obtains",
"the",
"symbols",
"for",
"a",
"locale",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/GJLocaleSymbols.java#L44-L57 |
22,299 | JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.safeAdd | public static int safeAdd(int val1, int val2) {
int sum = val1 + val2;
// If there is a sign change, but the two values have the same sign...
if ((val1 ^ sum) < 0 && (val1 ^ val2) >= 0) {
throw new ArithmeticException
("The calculation caused an overflow: " + val1 + "... | java | public static int safeAdd(int val1, int val2) {
int sum = val1 + val2;
// If there is a sign change, but the two values have the same sign...
if ((val1 ^ sum) < 0 && (val1 ^ val2) >= 0) {
throw new ArithmeticException
("The calculation caused an overflow: " + val1 + "... | [
"public",
"static",
"int",
"safeAdd",
"(",
"int",
"val1",
",",
"int",
"val2",
")",
"{",
"int",
"sum",
"=",
"val1",
"+",
"val2",
";",
"// If there is a sign change, but the two values have the same sign...",
"if",
"(",
"(",
"val1",
"^",
"sum",
")",
"<",
"0",
... | Add two values throwing an exception if overflow occurs.
@param val1 the first value
@param val2 the second value
@return the new total
@throws ArithmeticException if the value is too big or too small | [
"Add",
"two",
"values",
"throwing",
"an",
"exception",
"if",
"overflow",
"occurs",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L66-L74 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.