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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
37,400 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecord.java | SAXRecord.compareTo | @Override
public int compareTo(SAXRecord o) {
int a = this.occurrences.size();
int b = o.getIndexes().size();
if (a == b) {
return 0;
}
else if (a > b) {
return 1;
}
return -1;
} | java | @Override
public int compareTo(SAXRecord o) {
int a = this.occurrences.size();
int b = o.getIndexes().size();
if (a == b) {
return 0;
}
else if (a > b) {
return 1;
}
return -1;
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"SAXRecord",
"o",
")",
"{",
"int",
"a",
"=",
"this",
".",
"occurrences",
".",
"size",
"(",
")",
";",
"int",
"b",
"=",
"o",
".",
"getIndexes",
"(",
")",
".",
"size",
"(",
")",
";",
"if",
"(",
"... | This comparator compares entries by the length of the entries array - i.e. by the total
frequency of entry occurrence.
@param o an entry to compare with.
@return results of comparison. | [
"This",
"comparator",
"compares",
"entries",
"by",
"the",
"length",
"of",
"the",
"entries",
"array",
"-",
"i",
".",
"e",
".",
"by",
"the",
"total",
"frequency",
"of",
"entry",
"occurrence",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecord.java#L85-L96 |
37,401 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/discord/BruteForceDiscordImplementation.java | BruteForceDiscordImplementation.series2BruteForceDiscords | public static DiscordRecords series2BruteForceDiscords(double[] series, Integer windowSize,
int discordCollectionSize, SlidingWindowMarkerAlgorithm marker, double nThreshold)
throws Exception {
DiscordRecords discords = new DiscordRecords();
// init new registry to the full length, but mark the en... | java | public static DiscordRecords series2BruteForceDiscords(double[] series, Integer windowSize,
int discordCollectionSize, SlidingWindowMarkerAlgorithm marker, double nThreshold)
throws Exception {
DiscordRecords discords = new DiscordRecords();
// init new registry to the full length, but mark the en... | [
"public",
"static",
"DiscordRecords",
"series2BruteForceDiscords",
"(",
"double",
"[",
"]",
"series",
",",
"Integer",
"windowSize",
",",
"int",
"discordCollectionSize",
",",
"SlidingWindowMarkerAlgorithm",
"marker",
",",
"double",
"nThreshold",
")",
"throws",
"Exception... | Brute force discord search implementation. BRUTE FORCE algorithm.
@param series the data we work with.
@param windowSize the sliding window size.
@param discordCollectionSize the number of discords we look for.
@param marker the marker window algorithm implementation.
@param nThreshold the z-Normalization threshold va... | [
"Brute",
"force",
"discord",
"search",
"implementation",
".",
"BRUTE",
"FORCE",
"algorithm",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/discord/BruteForceDiscordImplementation.java#L37-L90 |
37,402 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/discord/BruteForceDiscordImplementation.java | BruteForceDiscordImplementation.findBestDiscordBruteForce | private static DiscordRecord findBestDiscordBruteForce(double[] series, Integer windowSize,
VisitRegistry globalRegistry, double nThreshold) throws Exception {
Date start = new Date();
long distanceCallsCounter = 0;
double bestSoFarDistance = -1.0;
int bestSoFarPosition = -1;
VisitRegistry... | java | private static DiscordRecord findBestDiscordBruteForce(double[] series, Integer windowSize,
VisitRegistry globalRegistry, double nThreshold) throws Exception {
Date start = new Date();
long distanceCallsCounter = 0;
double bestSoFarDistance = -1.0;
int bestSoFarPosition = -1;
VisitRegistry... | [
"private",
"static",
"DiscordRecord",
"findBestDiscordBruteForce",
"(",
"double",
"[",
"]",
"series",
",",
"Integer",
"windowSize",
",",
"VisitRegistry",
"globalRegistry",
",",
"double",
"nThreshold",
")",
"throws",
"Exception",
"{",
"Date",
"start",
"=",
"new",
"... | Finds the best discord. BRUTE FORCE algorithm.
@param series the data.
@param windowSize the SAX sliding window size.
@param globalRegistry the visit registry to use.
@param nThreshold the z-Normalization threshold value.
@return the best discord with respect to registry.
@throws Exception if error occurs. | [
"Finds",
"the",
"best",
"discord",
".",
"BRUTE",
"FORCE",
"algorithm",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/discord/BruteForceDiscordImplementation.java#L102-L170 |
37,403 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.ts2string | public char[] ts2string(double[] ts, int paaSize, double[] cuts, double nThreshold)
throws SAXException {
if (paaSize == ts.length) {
return tsProcessor.ts2String(tsProcessor.znorm(ts, nThreshold), cuts);
}
else {
// perform PAA conversion
double[] paa = tsProcessor.paa(tsPr... | java | public char[] ts2string(double[] ts, int paaSize, double[] cuts, double nThreshold)
throws SAXException {
if (paaSize == ts.length) {
return tsProcessor.ts2String(tsProcessor.znorm(ts, nThreshold), cuts);
}
else {
// perform PAA conversion
double[] paa = tsProcessor.paa(tsPr... | [
"public",
"char",
"[",
"]",
"ts2string",
"(",
"double",
"[",
"]",
"ts",
",",
"int",
"paaSize",
",",
"double",
"[",
"]",
"cuts",
",",
"double",
"nThreshold",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"paaSize",
"==",
"ts",
".",
"length",
")",
"{"... | Convert the timeseries into SAX string representation.
@param ts the timeseries.
@param paaSize the PAA size.
@param cuts the alphabet cuts.
@param nThreshold the normalization thresholds.
@return The SAX representation for timeseries.
@throws SAXException if error occurs. | [
"Convert",
"the",
"timeseries",
"into",
"SAX",
"string",
"representation",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L49-L60 |
37,404 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.ts2saxByChunking | public SAXRecords ts2saxByChunking(double[] ts, int paaSize, double[] cuts, double nThreshold)
throws SAXException {
SAXRecords saxFrequencyData = new SAXRecords();
// Z normalize it
double[] normalizedTS = tsProcessor.znorm(ts, nThreshold);
// perform PAA conversion if needed
doub... | java | public SAXRecords ts2saxByChunking(double[] ts, int paaSize, double[] cuts, double nThreshold)
throws SAXException {
SAXRecords saxFrequencyData = new SAXRecords();
// Z normalize it
double[] normalizedTS = tsProcessor.znorm(ts, nThreshold);
// perform PAA conversion if needed
doub... | [
"public",
"SAXRecords",
"ts2saxByChunking",
"(",
"double",
"[",
"]",
"ts",
",",
"int",
"paaSize",
",",
"double",
"[",
"]",
"cuts",
",",
"double",
"nThreshold",
")",
"throws",
"SAXException",
"{",
"SAXRecords",
"saxFrequencyData",
"=",
"new",
"SAXRecords",
"(",... | Converts the input time series into a SAX data structure via chunking and Z normalization.
@param ts the input data.
@param paaSize the PAA size.
@param cuts the Alphabet cuts.
@param nThreshold the normalization threshold value.
@return SAX representation of the time series.
@throws SAXException if error occurs. | [
"Converts",
"the",
"input",
"time",
"series",
"into",
"a",
"SAX",
"data",
"structure",
"via",
"chunking",
"and",
"Z",
"normalization",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L73-L96 |
37,405 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.charDistance | public int charDistance(char a, char b) {
return Math.abs(Character.getNumericValue(a) - Character.getNumericValue(b));
} | java | public int charDistance(char a, char b) {
return Math.abs(Character.getNumericValue(a) - Character.getNumericValue(b));
} | [
"public",
"int",
"charDistance",
"(",
"char",
"a",
",",
"char",
"b",
")",
"{",
"return",
"Math",
".",
"abs",
"(",
"Character",
".",
"getNumericValue",
"(",
"a",
")",
"-",
"Character",
".",
"getNumericValue",
"(",
"b",
")",
")",
";",
"}"
] | Compute the distance between the two chars based on the ASCII symbol codes.
@param a The first char.
@param b The second char.
@return The distance. | [
"Compute",
"the",
"distance",
"between",
"the",
"two",
"chars",
"based",
"on",
"the",
"ASCII",
"symbol",
"codes",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L316-L318 |
37,406 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.strDistance | public int strDistance(char[] a, char[] b) throws SAXException {
if (a.length == b.length) {
int distance = 0;
for (int i = 0; i < a.length; i++) {
int tDist = Math.abs(Character.getNumericValue(a[i]) - Character.getNumericValue(b[i]));
distance += tDist;
}
return dist... | java | public int strDistance(char[] a, char[] b) throws SAXException {
if (a.length == b.length) {
int distance = 0;
for (int i = 0; i < a.length; i++) {
int tDist = Math.abs(Character.getNumericValue(a[i]) - Character.getNumericValue(b[i]));
distance += tDist;
}
return dist... | [
"public",
"int",
"strDistance",
"(",
"char",
"[",
"]",
"a",
",",
"char",
"[",
"]",
"b",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"a",
".",
"length",
"==",
"b",
".",
"length",
")",
"{",
"int",
"distance",
"=",
"0",
";",
"for",
"(",
"int",
... | Compute the distance between the two strings, this function use the numbers associated with
ASCII codes, i.e. distance between a and b would be 1.
@param a The first string.
@param b The second string.
@return The pairwise distance.
@throws SAXException if length are differ. | [
"Compute",
"the",
"distance",
"between",
"the",
"two",
"strings",
"this",
"function",
"use",
"the",
"numbers",
"associated",
"with",
"ASCII",
"codes",
"i",
".",
"e",
".",
"distance",
"between",
"a",
"and",
"b",
"would",
"be",
"1",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L329-L341 |
37,407 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.saxMinDist | public double saxMinDist(char[] a, char[] b, double[][] distanceMatrix, int n, int w)
throws SAXException {
if (a.length == b.length) {
double dist = 0.0D;
for (int i = 0; i < a.length; i++) {
if (Character.isLetter(a[i]) && Character.isLetter(b[i])) {
// ... forms have num... | java | public double saxMinDist(char[] a, char[] b, double[][] distanceMatrix, int n, int w)
throws SAXException {
if (a.length == b.length) {
double dist = 0.0D;
for (int i = 0; i < a.length; i++) {
if (Character.isLetter(a[i]) && Character.isLetter(b[i])) {
// ... forms have num... | [
"public",
"double",
"saxMinDist",
"(",
"char",
"[",
"]",
"a",
",",
"char",
"[",
"]",
"b",
",",
"double",
"[",
"]",
"[",
"]",
"distanceMatrix",
",",
"int",
"n",
",",
"int",
"w",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"a",
".",
"length",
"=... | This function implements SAX MINDIST function which uses alphabet based distance matrix.
@param a The SAX string.
@param b The SAX string.
@param distanceMatrix The distance matrix to use.
@param n the time series length (sliding window length).
@param w the number of PAA segments.
@return distance between strings.
@t... | [
"This",
"function",
"implements",
"SAX",
"MINDIST",
"function",
"which",
"uses",
"alphabet",
"based",
"distance",
"matrix",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L354-L380 |
37,408 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.checkMinDistIsZero | public boolean checkMinDistIsZero(char[] a, char[] b) {
for (int i = 0; i < a.length; i++) {
if (charDistance(a[i], b[i]) > 1) {
return false;
}
}
return true;
} | java | public boolean checkMinDistIsZero(char[] a, char[] b) {
for (int i = 0; i < a.length; i++) {
if (charDistance(a[i], b[i]) > 1) {
return false;
}
}
return true;
} | [
"public",
"boolean",
"checkMinDistIsZero",
"(",
"char",
"[",
"]",
"a",
",",
"char",
"[",
"]",
"b",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"charDistance",
"(",
"a",
"... | Check for trivial mindist case.
@param a first string.
@param b second string.
@return true if mindist between strings is zero. | [
"Check",
"for",
"trivial",
"mindist",
"case",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L389-L396 |
37,409 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.ts2Shingles | public Map<String, Integer> ts2Shingles(double[] series, int windowSize, int paaSize,
int alphabetSize, NumerosityReductionStrategy strategy, double nrThreshold, int shingleSize)
throws SAXException {
// build all shingles
String[] alphabet = new String[alphabetSize];
for (int i = 0; i < ... | java | public Map<String, Integer> ts2Shingles(double[] series, int windowSize, int paaSize,
int alphabetSize, NumerosityReductionStrategy strategy, double nrThreshold, int shingleSize)
throws SAXException {
// build all shingles
String[] alphabet = new String[alphabetSize];
for (int i = 0; i < ... | [
"public",
"Map",
"<",
"String",
",",
"Integer",
">",
"ts2Shingles",
"(",
"double",
"[",
"]",
"series",
",",
"int",
"windowSize",
",",
"int",
"paaSize",
",",
"int",
"alphabetSize",
",",
"NumerosityReductionStrategy",
"strategy",
",",
"double",
"nrThreshold",
",... | Converts a single time-series into map of shingle frequencies.
@param series the time series.
@param windowSize the sliding window size.
@param paaSize the PAA segments number.
@param alphabetSize the alphabet size.
@param strategy the numerosity reduction strategy.
@param nrThreshold the SAX normalization threshold.
... | [
"Converts",
"a",
"single",
"time",
"-",
"series",
"into",
"map",
"of",
"shingle",
"frequencies",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L514-L546 |
37,410 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.getAllPermutations | public static String[] getAllPermutations(String[] alphabet, int wordLength) {
// initialize our returned list with the number of elements calculated above
String[] allLists = new String[(int) Math.pow(alphabet.length, wordLength)];
// lists of length 1 are just the original elements
if (wordLen... | java | public static String[] getAllPermutations(String[] alphabet, int wordLength) {
// initialize our returned list with the number of elements calculated above
String[] allLists = new String[(int) Math.pow(alphabet.length, wordLength)];
// lists of length 1 are just the original elements
if (wordLen... | [
"public",
"static",
"String",
"[",
"]",
"getAllPermutations",
"(",
"String",
"[",
"]",
"alphabet",
",",
"int",
"wordLength",
")",
"{",
"// initialize our returned list with the number of elements calculated above\r",
"String",
"[",
"]",
"allLists",
"=",
"new",
"String",... | Get all permutations of the given alphabet of given length.
@param alphabet the alphabet to use.
@param wordLength the word length.
@return set of permutation. | [
"Get",
"all",
"permutations",
"of",
"the",
"given",
"alphabet",
"of",
"given",
"length",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L555-L580 |
37,411 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/SAXProcessor.java | SAXProcessor.timeToString | public static String timeToString(long start, long finish) {
Duration duration = new Duration(finish - start); // in milliseconds
PeriodFormatter formatter = new PeriodFormatterBuilder().appendDays().appendSuffix("d")
.appendHours().appendSuffix("h").appendMinutes().appendSuffix("m").appendSeconds(... | java | public static String timeToString(long start, long finish) {
Duration duration = new Duration(finish - start); // in milliseconds
PeriodFormatter formatter = new PeriodFormatterBuilder().appendDays().appendSuffix("d")
.appendHours().appendSuffix("h").appendMinutes().appendSuffix("m").appendSeconds(... | [
"public",
"static",
"String",
"timeToString",
"(",
"long",
"start",
",",
"long",
"finish",
")",
"{",
"Duration",
"duration",
"=",
"new",
"Duration",
"(",
"finish",
"-",
"start",
")",
";",
"// in milliseconds\r",
"PeriodFormatter",
"formatter",
"=",
"new",
"Per... | Generic method to convert the milliseconds into the elapsed time string.
@param start Start timestamp.
@param finish End timestamp.
@return String representation of the elapsed time. | [
"Generic",
"method",
"to",
"convert",
"the",
"milliseconds",
"into",
"the",
"elapsed",
"time",
"string",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/SAXProcessor.java#L589-L598 |
37,412 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/discord/HOTSAXImplementation.java | HOTSAXImplementation.series2DiscordsDeprecated | @Deprecated
public static DiscordRecords series2DiscordsDeprecated(double[] series, int discordsNumToReport,
int windowSize, int paaSize, int alphabetSize, SlidingWindowMarkerAlgorithm markerAlgorithm,
NumerosityReductionStrategy strategy, double nThreshold) throws Exception {
Date start = new Date()... | java | @Deprecated
public static DiscordRecords series2DiscordsDeprecated(double[] series, int discordsNumToReport,
int windowSize, int paaSize, int alphabetSize, SlidingWindowMarkerAlgorithm markerAlgorithm,
NumerosityReductionStrategy strategy, double nThreshold) throws Exception {
Date start = new Date()... | [
"@",
"Deprecated",
"public",
"static",
"DiscordRecords",
"series2DiscordsDeprecated",
"(",
"double",
"[",
"]",
"series",
",",
"int",
"discordsNumToReport",
",",
"int",
"windowSize",
",",
"int",
"paaSize",
",",
"int",
"alphabetSize",
",",
"SlidingWindowMarkerAlgorithm"... | Old implementation. Nearest neighbot for a candidate subsequence is searched among all other
time-series subsequences, regardless of their exclusion by EXACT or MINDIST. This also accepts
a marker implementation which is responsible for marking a segment as visited.
@param series The timeseries.
@param discordsNumToRe... | [
"Old",
"implementation",
".",
"Nearest",
"neighbot",
"for",
"a",
"candidate",
"subsequence",
"is",
"searched",
"among",
"all",
"other",
"time",
"-",
"series",
"subsequences",
"regardless",
"of",
"their",
"exclusion",
"by",
"EXACT",
"or",
"MINDIST",
".",
"This",
... | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/discord/HOTSAXImplementation.java#L374-L416 |
37,413 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/discord/HOTSAXImplementation.java | HOTSAXImplementation.hashToFreqEntries | @Deprecated
private static ArrayList<FrequencyTableEntry> hashToFreqEntries(
HashMap<String, ArrayList<Integer>> hash) {
ArrayList<FrequencyTableEntry> res = new ArrayList<FrequencyTableEntry>();
for (Entry<String, ArrayList<Integer>> e : hash.entrySet()) {
char[] payload = e.getKey().toCharArray(... | java | @Deprecated
private static ArrayList<FrequencyTableEntry> hashToFreqEntries(
HashMap<String, ArrayList<Integer>> hash) {
ArrayList<FrequencyTableEntry> res = new ArrayList<FrequencyTableEntry>();
for (Entry<String, ArrayList<Integer>> e : hash.entrySet()) {
char[] payload = e.getKey().toCharArray(... | [
"@",
"Deprecated",
"private",
"static",
"ArrayList",
"<",
"FrequencyTableEntry",
">",
"hashToFreqEntries",
"(",
"HashMap",
"<",
"String",
",",
"ArrayList",
"<",
"Integer",
">",
">",
"hash",
")",
"{",
"ArrayList",
"<",
"FrequencyTableEntry",
">",
"res",
"=",
"n... | Translates the hash table into sortable array of substrings.
@param hash
@return | [
"Translates",
"the",
"hash",
"table",
"into",
"sortable",
"array",
"of",
"substrings",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/discord/HOTSAXImplementation.java#L651-L663 |
37,414 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/discord/HOTSAXImplementation.java | HOTSAXImplementation.distance | private static double distance(double[] subseries, double[] series, int from, int to,
double nThreshold) throws Exception {
double[] subsequence = tp.znorm(tp.subseriesByCopy(series, from, to), nThreshold);
Double sum = 0D;
for (int i = 0; i < subseries.length; i++) {
double tmp = subseries[i] -... | java | private static double distance(double[] subseries, double[] series, int from, int to,
double nThreshold) throws Exception {
double[] subsequence = tp.znorm(tp.subseriesByCopy(series, from, to), nThreshold);
Double sum = 0D;
for (int i = 0; i < subseries.length; i++) {
double tmp = subseries[i] -... | [
"private",
"static",
"double",
"distance",
"(",
"double",
"[",
"]",
"subseries",
",",
"double",
"[",
"]",
"series",
",",
"int",
"from",
",",
"int",
"to",
",",
"double",
"nThreshold",
")",
"throws",
"Exception",
"{",
"double",
"[",
"]",
"subsequence",
"="... | Calculates the Euclidean distance between two points. Don't use this unless you need that.
@param subseries The first subsequence -- ASSUMED TO BE Z-normalized.
@param series The second point.
@param from the initial index of the range to be copied, inclusive
@param to the final index of the range to be copied, exclus... | [
"Calculates",
"the",
"Euclidean",
"distance",
"between",
"two",
"points",
".",
"Don",
"t",
"use",
"this",
"unless",
"you",
"need",
"that",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/discord/HOTSAXImplementation.java#L676-L685 |
37,415 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/bitmap/Shingles.java | Shingles.addShingledSeries | public void addShingledSeries(String key, Map<String, Integer> shingledSeries) {
// allocate the weights array corresponding to the time series
int[] counts = new int[this.indexTable.size()];
// fill in the counts
for (String str : shingledSeries.keySet()) {
Integer idx = this.indexTable.get(str);... | java | public void addShingledSeries(String key, Map<String, Integer> shingledSeries) {
// allocate the weights array corresponding to the time series
int[] counts = new int[this.indexTable.size()];
// fill in the counts
for (String str : shingledSeries.keySet()) {
Integer idx = this.indexTable.get(str);... | [
"public",
"void",
"addShingledSeries",
"(",
"String",
"key",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"shingledSeries",
")",
"{",
"// allocate the weights array corresponding to the time series",
"int",
"[",
"]",
"counts",
"=",
"new",
"int",
"[",
"this",
".... | Adds a shingled series assuring the proper index.
@param key the timeseries key (i.e., label).
@param shingledSeries a shingled timeseries in a map of <shingle, index> entries. | [
"Adds",
"a",
"shingled",
"series",
"assuring",
"the",
"proper",
"index",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/bitmap/Shingles.java#L75-L87 |
37,416 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/tinker/ParallelPerformanceEvaluation.java | ParallelPerformanceEvaluation.main | public static void main(String[] args) throws Exception {
NormalAlphabet na = new NormalAlphabet();
SAXProcessor sp = new SAXProcessor();
String dataFileName = args[0];
System.out.println("data file: " + dataFileName);
double[] ts = TSProcessor.readFileColumn(dataFileName, 0, 0);
System.out.p... | java | public static void main(String[] args) throws Exception {
NormalAlphabet na = new NormalAlphabet();
SAXProcessor sp = new SAXProcessor();
String dataFileName = args[0];
System.out.println("data file: " + dataFileName);
double[] ts = TSProcessor.readFileColumn(dataFileName, 0, 0);
System.out.p... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"NormalAlphabet",
"na",
"=",
"new",
"NormalAlphabet",
"(",
")",
";",
"SAXProcessor",
"sp",
"=",
"new",
"SAXProcessor",
"(",
")",
";",
"String",
"dataFileN... | Runs the evaluation.
@param args some accepted, see the code.
@throws Exception thrown if an error occured. | [
"Runs",
"the",
"evaluation",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/tinker/ParallelPerformanceEvaluation.java#L38-L103 |
37,417 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java | VisitRegistry.markVisited | public void markVisited(int loc) {
if (checkBounds(loc)) {
if (ZERO == this.registry[loc]) {
this.unvisitedCount--;
}
this.registry[loc] = ONE;
}
else {
throw new RuntimeException(
"The location " + loc + " out of bounds [0," + (this.registry.length - 1) + "]");
... | java | public void markVisited(int loc) {
if (checkBounds(loc)) {
if (ZERO == this.registry[loc]) {
this.unvisitedCount--;
}
this.registry[loc] = ONE;
}
else {
throw new RuntimeException(
"The location " + loc + " out of bounds [0," + (this.registry.length - 1) + "]");
... | [
"public",
"void",
"markVisited",
"(",
"int",
"loc",
")",
"{",
"if",
"(",
"checkBounds",
"(",
"loc",
")",
")",
"{",
"if",
"(",
"ZERO",
"==",
"this",
".",
"registry",
"[",
"loc",
"]",
")",
"{",
"this",
".",
"unvisitedCount",
"--",
";",
"}",
"this",
... | Marks location visited. If it was unvisited, counter decremented.
@param loc The location to mark. | [
"Marks",
"location",
"visited",
".",
"If",
"it",
"was",
"unvisited",
"counter",
"decremented",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java#L48-L59 |
37,418 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java | VisitRegistry.markVisited | public void markVisited(int from, int upTo) {
if (checkBounds(from) && checkBounds(upTo - 1)) {
for (int i = from; i < upTo; i++) {
this.markVisited(i);
}
}
else {
throw new RuntimeException("The location " + from + "," + upTo + " out of bounds [0,"
+ (this.registry.lengt... | java | public void markVisited(int from, int upTo) {
if (checkBounds(from) && checkBounds(upTo - 1)) {
for (int i = from; i < upTo; i++) {
this.markVisited(i);
}
}
else {
throw new RuntimeException("The location " + from + "," + upTo + " out of bounds [0,"
+ (this.registry.lengt... | [
"public",
"void",
"markVisited",
"(",
"int",
"from",
",",
"int",
"upTo",
")",
"{",
"if",
"(",
"checkBounds",
"(",
"from",
")",
"&&",
"checkBounds",
"(",
"upTo",
"-",
"1",
")",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"from",
";",
"i",
"<",
"upTo",
... | Marks as visited a range of locations.
@param from the start of labeling (inclusive).
@param upTo the end of labeling (exclusive). | [
"Marks",
"as",
"visited",
"a",
"range",
"of",
"locations",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java#L67-L77 |
37,419 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java | VisitRegistry.getNextRandomUnvisitedPosition | public int getNextRandomUnvisitedPosition() {
// if all are visited, return -1
//
if (0 == this.unvisitedCount) {
return -1;
}
// if there is space continue with random sampling
//
int i = this.randomizer.nextInt(this.registry.length);
while (ONE == registry[i]) {
i = this.... | java | public int getNextRandomUnvisitedPosition() {
// if all are visited, return -1
//
if (0 == this.unvisitedCount) {
return -1;
}
// if there is space continue with random sampling
//
int i = this.randomizer.nextInt(this.registry.length);
while (ONE == registry[i]) {
i = this.... | [
"public",
"int",
"getNextRandomUnvisitedPosition",
"(",
")",
"{",
"// if all are visited, return -1",
"//",
"if",
"(",
"0",
"==",
"this",
".",
"unvisitedCount",
")",
"{",
"return",
"-",
"1",
";",
"}",
"// if there is space continue with random sampling",
"//",
"int",
... | Get the next random unvisited position.
@return The next unvisited position. | [
"Get",
"the",
"next",
"random",
"unvisited",
"position",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java#L84-L99 |
37,420 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java | VisitRegistry.isNotVisited | public boolean isNotVisited(int loc) {
if (checkBounds(loc)) {
return (ZERO == this.registry[loc]);
}
else {
throw new RuntimeException(
"The location " + loc + " out of bounds [0," + (this.registry.length - 1) + "]");
}
} | java | public boolean isNotVisited(int loc) {
if (checkBounds(loc)) {
return (ZERO == this.registry[loc]);
}
else {
throw new RuntimeException(
"The location " + loc + " out of bounds [0," + (this.registry.length - 1) + "]");
}
} | [
"public",
"boolean",
"isNotVisited",
"(",
"int",
"loc",
")",
"{",
"if",
"(",
"checkBounds",
"(",
"loc",
")",
")",
"{",
"return",
"(",
"ZERO",
"==",
"this",
".",
"registry",
"[",
"loc",
"]",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"RuntimeExceptio... | Check if position is not visited.
@param loc The index.
@return true if not visited. | [
"Check",
"if",
"position",
"is",
"not",
"visited",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java#L107-L115 |
37,421 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java | VisitRegistry.isVisited | public boolean isVisited(int from, int upTo) {
if (checkBounds(from) && checkBounds(upTo - 1)) {
// perform the visit check
//
for (int i = from; i < upTo; i++) {
if (ONE == this.registry[i]) {
return true;
}
}
return false;
}
else {
throw new Ru... | java | public boolean isVisited(int from, int upTo) {
if (checkBounds(from) && checkBounds(upTo - 1)) {
// perform the visit check
//
for (int i = from; i < upTo; i++) {
if (ONE == this.registry[i]) {
return true;
}
}
return false;
}
else {
throw new Ru... | [
"public",
"boolean",
"isVisited",
"(",
"int",
"from",
",",
"int",
"upTo",
")",
"{",
"if",
"(",
"checkBounds",
"(",
"from",
")",
"&&",
"checkBounds",
"(",
"upTo",
"-",
"1",
")",
")",
"{",
"// perform the visit check",
"//",
"for",
"(",
"int",
"i",
"=",
... | Check if the interval and its boundaries were visited.
@param from The interval start (inclusive).
@param upTo The interval end (exclusive).
@return True if visited. | [
"Check",
"if",
"the",
"interval",
"and",
"its",
"boundaries",
"were",
"visited",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java#L124-L139 |
37,422 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java | VisitRegistry.isVisited | public boolean isVisited(int loc) {
if (checkBounds(loc)) {
return (ONE == this.registry[loc]);
}
else {
throw new RuntimeException(
"The location " + loc + " out of bounds [0," + (this.registry.length - 1) + "]");
}
} | java | public boolean isVisited(int loc) {
if (checkBounds(loc)) {
return (ONE == this.registry[loc]);
}
else {
throw new RuntimeException(
"The location " + loc + " out of bounds [0," + (this.registry.length - 1) + "]");
}
} | [
"public",
"boolean",
"isVisited",
"(",
"int",
"loc",
")",
"{",
"if",
"(",
"checkBounds",
"(",
"loc",
")",
")",
"{",
"return",
"(",
"ONE",
"==",
"this",
".",
"registry",
"[",
"loc",
"]",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"RuntimeException",
... | Check if the location specified is visited.
@param loc the location.
@return true if visited | [
"Check",
"if",
"the",
"location",
"specified",
"is",
"visited",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java#L147-L156 |
37,423 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java | VisitRegistry.getUnvisited | public ArrayList<Integer> getUnvisited() {
if (0 == this.unvisitedCount) {
return new ArrayList<Integer>();
}
ArrayList<Integer> res = new ArrayList<Integer>(this.unvisitedCount);
for (int i = 0; i < this.registry.length; i++) {
if (ZERO == this.registry[i]) {
res.add(i);
}
... | java | public ArrayList<Integer> getUnvisited() {
if (0 == this.unvisitedCount) {
return new ArrayList<Integer>();
}
ArrayList<Integer> res = new ArrayList<Integer>(this.unvisitedCount);
for (int i = 0; i < this.registry.length; i++) {
if (ZERO == this.registry[i]) {
res.add(i);
}
... | [
"public",
"ArrayList",
"<",
"Integer",
">",
"getUnvisited",
"(",
")",
"{",
"if",
"(",
"0",
"==",
"this",
".",
"unvisitedCount",
")",
"{",
"return",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
")",
";",
"}",
"ArrayList",
"<",
"Integer",
">",
"res",
... | Get the list of unvisited positions.
@return list of unvisited positions. | [
"Get",
"the",
"list",
"of",
"unvisited",
"positions",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java#L163-L174 |
37,424 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java | VisitRegistry.getVisited | public ArrayList<Integer> getVisited() {
if (0 == (this.registry.length - this.unvisitedCount)) {
return new ArrayList<Integer>();
}
ArrayList<Integer> res = new ArrayList<Integer>(this.registry.length - this.unvisitedCount);
for (int i = 0; i < this.registry.length; i++) {
if (ONE == this.r... | java | public ArrayList<Integer> getVisited() {
if (0 == (this.registry.length - this.unvisitedCount)) {
return new ArrayList<Integer>();
}
ArrayList<Integer> res = new ArrayList<Integer>(this.registry.length - this.unvisitedCount);
for (int i = 0; i < this.registry.length; i++) {
if (ONE == this.r... | [
"public",
"ArrayList",
"<",
"Integer",
">",
"getVisited",
"(",
")",
"{",
"if",
"(",
"0",
"==",
"(",
"this",
".",
"registry",
".",
"length",
"-",
"this",
".",
"unvisitedCount",
")",
")",
"{",
"return",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
")"... | Get the list of visited positions. Returns NULL if none are visited.
@return list of visited positions. | [
"Get",
"the",
"list",
"of",
"visited",
"positions",
".",
"Returns",
"NULL",
"if",
"none",
"are",
"visited",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/registry/VisitRegistry.java#L181-L192 |
37,425 | jMotif/SAX | src/main/java/net/seninp/util/UCRUtils.java | UCRUtils.readUCRData | public static Map<String, List<double[]>> readUCRData(String fileName)
throws IOException, NumberFormatException {
Map<String, List<double[]>> res = new HashMap<String, List<double[]>>();
BufferedReader br = new BufferedReader(new FileReader(new File(fileName)));
String line = "";
while ((line =... | java | public static Map<String, List<double[]>> readUCRData(String fileName)
throws IOException, NumberFormatException {
Map<String, List<double[]>> res = new HashMap<String, List<double[]>>();
BufferedReader br = new BufferedReader(new FileReader(new File(fileName)));
String line = "";
while ((line =... | [
"public",
"static",
"Map",
"<",
"String",
",",
"List",
"<",
"double",
"[",
"]",
">",
">",
"readUCRData",
"(",
"String",
"fileName",
")",
"throws",
"IOException",
",",
"NumberFormatException",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"double",
"[",
"]... | Reads bunch of series from file. First column treats as a class label. Rest as a real-valued
series.
@param fileName the input filename.
@return time series read.
@throws IOException if error occurs.
@throws NumberFormatException if error occurs. | [
"Reads",
"bunch",
"of",
"series",
"from",
"file",
".",
"First",
"column",
"treats",
"as",
"a",
"class",
"label",
".",
"Rest",
"as",
"a",
"real",
"-",
"valued",
"series",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/UCRUtils.java#L35-L69 |
37,426 | jMotif/SAX | src/main/java/net/seninp/util/UCRUtils.java | UCRUtils.datasetStats | public static String datasetStats(Map<String, List<double[]>> data, String name) {
int globalMinLength = Integer.MAX_VALUE;
int globalMaxLength = Integer.MIN_VALUE;
double globalMinValue = Double.MAX_VALUE;
double globalMaxValue = Double.MIN_VALUE;
for (Entry<String, List<double[]>> e : data.entr... | java | public static String datasetStats(Map<String, List<double[]>> data, String name) {
int globalMinLength = Integer.MAX_VALUE;
int globalMaxLength = Integer.MIN_VALUE;
double globalMinValue = Double.MAX_VALUE;
double globalMaxValue = Double.MIN_VALUE;
for (Entry<String, List<double[]>> e : data.entr... | [
"public",
"static",
"String",
"datasetStats",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"double",
"[",
"]",
">",
">",
"data",
",",
"String",
"name",
")",
"{",
"int",
"globalMinLength",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"int",
"globalMaxLength",
"... | Prints the dataset statistics.
@param data the UCRdataset.
@param name the dataset name to use.
@return stats. | [
"Prints",
"the",
"dataset",
"statistics",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/UCRUtils.java#L78-L112 |
37,427 | jMotif/SAX | src/main/java/net/seninp/util/UCRUtils.java | UCRUtils.saveData | public static void saveData(Map<String, List<double[]>> data, File file) throws IOException {
BufferedWriter bw = new BufferedWriter(new FileWriter(file));
for (Entry<String, List<double[]>> classEntry : data.entrySet()) {
String classLabel = classEntry.getKey();
for (double[] arr : classEntry.get... | java | public static void saveData(Map<String, List<double[]>> data, File file) throws IOException {
BufferedWriter bw = new BufferedWriter(new FileWriter(file));
for (Entry<String, List<double[]>> classEntry : data.entrySet()) {
String classLabel = classEntry.getKey();
for (double[] arr : classEntry.get... | [
"public",
"static",
"void",
"saveData",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"double",
"[",
"]",
">",
">",
"data",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"BufferedWriter",
"bw",
"=",
"new",
"BufferedWriter",
"(",
"new",
"FileWrit... | Saves the dataset.
@param data the dataset.
@param file the file handler.
@throws IOException if error occurs. | [
"Saves",
"the",
"dataset",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/UCRUtils.java#L133-L146 |
37,428 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.readTS | public double[] readTS(String dataFileName, int loadLimit) throws SAXException, IOException {
Path path = Paths.get(dataFileName);
if (!(Files.exists(path))) {
throw new SAXException("unable to load data - data source not found.");
}
BufferedReader reader = Files.newBufferedReader(path, D... | java | public double[] readTS(String dataFileName, int loadLimit) throws SAXException, IOException {
Path path = Paths.get(dataFileName);
if (!(Files.exists(path))) {
throw new SAXException("unable to load data - data source not found.");
}
BufferedReader reader = Files.newBufferedReader(path, D... | [
"public",
"double",
"[",
"]",
"readTS",
"(",
"String",
"dataFileName",
",",
"int",
"loadLimit",
")",
"throws",
"SAXException",
",",
"IOException",
"{",
"Path",
"path",
"=",
"Paths",
".",
"get",
"(",
"dataFileName",
")",
";",
"if",
"(",
"!",
"(",
"Files",... | Read at least N elements from the one-column file.
@param dataFileName the file name.
@param loadLimit the load limit.
@return the read data or empty array if nothing to load.
@throws SAXException if error occurs.
@throws IOException if error occurs. | [
"Read",
"at",
"least",
"N",
"elements",
"from",
"the",
"one",
"-",
"column",
"file",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L126-L137 |
37,429 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.max | public double max(double[] series) {
double max = Double.MIN_VALUE;
for (int i = 0; i < series.length; i++) {
if (max < series[i]) {
max = series[i];
}
}
return max;
} | java | public double max(double[] series) {
double max = Double.MIN_VALUE;
for (int i = 0; i < series.length; i++) {
if (max < series[i]) {
max = series[i];
}
}
return max;
} | [
"public",
"double",
"max",
"(",
"double",
"[",
"]",
"series",
")",
"{",
"double",
"max",
"=",
"Double",
".",
"MIN_VALUE",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"series",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"max",... | Finds the maximal value in timeseries.
@param series The timeseries.
@return The max value. | [
"Finds",
"the",
"maximal",
"value",
"in",
"timeseries",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L145-L153 |
37,430 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.min | public double min(double[] series) {
double min = Double.MAX_VALUE;
for (int i = 0; i < series.length; i++) {
if (min > series[i]) {
min = series[i];
}
}
return min;
} | java | public double min(double[] series) {
double min = Double.MAX_VALUE;
for (int i = 0; i < series.length; i++) {
if (min > series[i]) {
min = series[i];
}
}
return min;
} | [
"public",
"double",
"min",
"(",
"double",
"[",
"]",
"series",
")",
"{",
"double",
"min",
"=",
"Double",
".",
"MAX_VALUE",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"series",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"min",... | Finds the minimal value in timeseries.
@param series The timeseries.
@return The min value. | [
"Finds",
"the",
"minimal",
"value",
"in",
"timeseries",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L161-L169 |
37,431 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.mean | public double mean(double[] series) {
double res = 0D;
int count = 0;
for (double tp : series) {
res += tp;
count += 1;
}
if (count > 0) {
return res / ((Integer) count).doubleValue();
}
return Double.NaN;
} | java | public double mean(double[] series) {
double res = 0D;
int count = 0;
for (double tp : series) {
res += tp;
count += 1;
}
if (count > 0) {
return res / ((Integer) count).doubleValue();
}
return Double.NaN;
} | [
"public",
"double",
"mean",
"(",
"double",
"[",
"]",
"series",
")",
"{",
"double",
"res",
"=",
"0D",
";",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"double",
"tp",
":",
"series",
")",
"{",
"res",
"+=",
"tp",
";",
"count",
"+=",
"1",
";",
"}",
... | Computes the mean value of timeseries.
@param series The timeseries.
@return The mean value. | [
"Computes",
"the",
"mean",
"value",
"of",
"timeseries",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L177-L189 |
37,432 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.median | public double median(double[] series) {
double[] clonedSeries = series.clone();
Arrays.sort(clonedSeries);
double median;
if (clonedSeries.length % 2 == 0) {
median = (clonedSeries[clonedSeries.length / 2]
+ (double) clonedSeries[clonedSeries.length / 2 - 1]) / 2;
}
els... | java | public double median(double[] series) {
double[] clonedSeries = series.clone();
Arrays.sort(clonedSeries);
double median;
if (clonedSeries.length % 2 == 0) {
median = (clonedSeries[clonedSeries.length / 2]
+ (double) clonedSeries[clonedSeries.length / 2 - 1]) / 2;
}
els... | [
"public",
"double",
"median",
"(",
"double",
"[",
"]",
"series",
")",
"{",
"double",
"[",
"]",
"clonedSeries",
"=",
"series",
".",
"clone",
"(",
")",
";",
"Arrays",
".",
"sort",
"(",
"clonedSeries",
")",
";",
"double",
"median",
";",
"if",
"(",
"clon... | Computes the median value of timeseries.
@param series The timeseries.
@return The median value. | [
"Computes",
"the",
"median",
"value",
"of",
"timeseries",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L217-L230 |
37,433 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.stDev | public double stDev(double[] series) {
double num0 = 0D;
double sum = 0D;
int count = 0;
for (double tp : series) {
num0 = num0 + tp * tp;
sum = sum + tp;
count += 1;
}
double len = ((Integer) count).doubleValue();
return Math.sqrt((len * num0 - sum * sum) / (len ... | java | public double stDev(double[] series) {
double num0 = 0D;
double sum = 0D;
int count = 0;
for (double tp : series) {
num0 = num0 + tp * tp;
sum = sum + tp;
count += 1;
}
double len = ((Integer) count).doubleValue();
return Math.sqrt((len * num0 - sum * sum) / (len ... | [
"public",
"double",
"stDev",
"(",
"double",
"[",
"]",
"series",
")",
"{",
"double",
"num0",
"=",
"0D",
";",
"double",
"sum",
"=",
"0D",
";",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"double",
"tp",
":",
"series",
")",
"{",
"num0",
"=",
"num0",
... | Speed-optimized implementation.
@param series The timeseries.
@return the standard deviation. | [
"Speed",
"-",
"optimized",
"implementation",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L258-L269 |
37,434 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.znorm | public double[] znorm(double[] series, double normalizationThreshold) {
double[] res = new double[series.length];
double sd = stDev(series);
if (sd < normalizationThreshold) {
// return series.clone();
// return array of zeros
return res;
}
double mean = mean(series);
... | java | public double[] znorm(double[] series, double normalizationThreshold) {
double[] res = new double[series.length];
double sd = stDev(series);
if (sd < normalizationThreshold) {
// return series.clone();
// return array of zeros
return res;
}
double mean = mean(series);
... | [
"public",
"double",
"[",
"]",
"znorm",
"(",
"double",
"[",
"]",
"series",
",",
"double",
"normalizationThreshold",
")",
"{",
"double",
"[",
"]",
"res",
"=",
"new",
"double",
"[",
"series",
".",
"length",
"]",
";",
"double",
"sd",
"=",
"stDev",
"(",
"... | Z-Normalize routine.
@param series the input timeseries.
@param normalizationThreshold the zNormalization threshold value.
@return Z-normalized time-series. | [
"Z",
"-",
"Normalize",
"routine",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L278-L291 |
37,435 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.ts2String | public char[] ts2String(double[] vals, double[] cuts) {
char[] res = new char[vals.length];
for (int i = 0; i < vals.length; i++) {
res[i] = num2char(vals[i], cuts);
}
return res;
} | java | public char[] ts2String(double[] vals, double[] cuts) {
char[] res = new char[vals.length];
for (int i = 0; i < vals.length; i++) {
res[i] = num2char(vals[i], cuts);
}
return res;
} | [
"public",
"char",
"[",
"]",
"ts2String",
"(",
"double",
"[",
"]",
"vals",
",",
"double",
"[",
"]",
"cuts",
")",
"{",
"char",
"[",
"]",
"res",
"=",
"new",
"char",
"[",
"vals",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i"... | Converts the timeseries into string using given cuts intervals. Useful for not-normal
distribution cuts.
@param vals The timeseries.
@param cuts The cut intervals.
@return The timeseries SAX representation. | [
"Converts",
"the",
"timeseries",
"into",
"string",
"using",
"given",
"cuts",
"intervals",
".",
"Useful",
"for",
"not",
"-",
"normal",
"distribution",
"cuts",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L363-L369 |
37,436 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.ts2Index | public int[] ts2Index(double[] series, double[] cuts) throws Exception {
int[] res = new int[series.length];
for (int i = 0; i < series.length; i++) {
res[i] = num2index(series[i], cuts);
}
return res;
} | java | public int[] ts2Index(double[] series, double[] cuts) throws Exception {
int[] res = new int[series.length];
for (int i = 0; i < series.length; i++) {
res[i] = num2index(series[i], cuts);
}
return res;
} | [
"public",
"int",
"[",
"]",
"ts2Index",
"(",
"double",
"[",
"]",
"series",
",",
"double",
"[",
"]",
"cuts",
")",
"throws",
"Exception",
"{",
"int",
"[",
"]",
"res",
"=",
"new",
"int",
"[",
"series",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",... | Convert the timeseries into the index using SAX cuts.
@param series The timeseries to convert.
@param cuts The alphabet cuts.
@return SAX cuts indices.
@throws Exception if error occurs. | [
"Convert",
"the",
"timeseries",
"into",
"the",
"index",
"using",
"SAX",
"cuts",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L379-L385 |
37,437 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.num2char | public char num2char(double value, double[] cuts) {
int idx = 0;
if (value >= 0) {
idx = cuts.length;
while ((idx > 0) && (cuts[idx - 1] > value)) {
idx--;
}
}
else {
while ((idx < cuts.length) && (cuts[idx] <= value)) {
idx++;
}
}
retur... | java | public char num2char(double value, double[] cuts) {
int idx = 0;
if (value >= 0) {
idx = cuts.length;
while ((idx > 0) && (cuts[idx - 1] > value)) {
idx--;
}
}
else {
while ((idx < cuts.length) && (cuts[idx] <= value)) {
idx++;
}
}
retur... | [
"public",
"char",
"num2char",
"(",
"double",
"value",
",",
"double",
"[",
"]",
"cuts",
")",
"{",
"int",
"idx",
"=",
"0",
";",
"if",
"(",
"value",
">=",
"0",
")",
"{",
"idx",
"=",
"cuts",
".",
"length",
";",
"while",
"(",
"(",
"idx",
">",
"0",
... | Get mapping of a number to char.
@param value the value to map.
@param cuts the array of intervals.
@return character corresponding to numeric value. | [
"Get",
"mapping",
"of",
"a",
"number",
"to",
"char",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L394-L408 |
37,438 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.num2index | public int num2index(double value, double[] cuts) {
int count = 0;
while ((count < cuts.length) && (cuts[count] <= value)) {
count++;
}
return count;
} | java | public int num2index(double value, double[] cuts) {
int count = 0;
while ((count < cuts.length) && (cuts[count] <= value)) {
count++;
}
return count;
} | [
"public",
"int",
"num2index",
"(",
"double",
"value",
",",
"double",
"[",
"]",
"cuts",
")",
"{",
"int",
"count",
"=",
"0",
";",
"while",
"(",
"(",
"count",
"<",
"cuts",
".",
"length",
")",
"&&",
"(",
"cuts",
"[",
"count",
"]",
"<=",
"value",
")",... | Get mapping of number to cut index.
@param value the value to map.
@param cuts the array of intervals.
@return character corresponding to numeric value. | [
"Get",
"mapping",
"of",
"number",
"to",
"cut",
"index",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L427-L433 |
37,439 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.subseriesByCopy | public double[] subseriesByCopy(double[] series, int start, int end)
throws IndexOutOfBoundsException {
if ((start > end) || (start < 0) || (end > series.length)) {
throw new IndexOutOfBoundsException("Unable to extract subseries, series length: "
+ series.length + ", start: " + start + ",... | java | public double[] subseriesByCopy(double[] series, int start, int end)
throws IndexOutOfBoundsException {
if ((start > end) || (start < 0) || (end > series.length)) {
throw new IndexOutOfBoundsException("Unable to extract subseries, series length: "
+ series.length + ", start: " + start + ",... | [
"public",
"double",
"[",
"]",
"subseriesByCopy",
"(",
"double",
"[",
"]",
"series",
",",
"int",
"start",
",",
"int",
"end",
")",
"throws",
"IndexOutOfBoundsException",
"{",
"if",
"(",
"(",
"start",
">",
"end",
")",
"||",
"(",
"start",
"<",
"0",
")",
... | Extract subseries out of series.
@param series The series array.
@param start the fragment start.
@param end the fragment end.
@return The subseries.
@throws IndexOutOfBoundsException If error occurs. | [
"Extract",
"subseries",
"out",
"of",
"series",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L444-L451 |
37,440 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.seriesToString | public String seriesToString(double[] series, NumberFormat df) {
StringBuffer sb = new StringBuffer();
sb.append('[');
for (double d : series) {
sb.append(df.format(d)).append(',');
}
sb.delete(sb.length() - 2, sb.length() - 1).append("]");
return sb.toString();
} | java | public String seriesToString(double[] series, NumberFormat df) {
StringBuffer sb = new StringBuffer();
sb.append('[');
for (double d : series) {
sb.append(df.format(d)).append(',');
}
sb.delete(sb.length() - 2, sb.length() - 1).append("]");
return sb.toString();
} | [
"public",
"String",
"seriesToString",
"(",
"double",
"[",
"]",
"series",
",",
"NumberFormat",
"df",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sb",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"double",
"d",
":... | Prettyfies the timeseries for screen output.
@param series the data.
@param df the number format to use.
@return The timeseries formatted for screen output. | [
"Prettyfies",
"the",
"timeseries",
"for",
"screen",
"output",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L461-L469 |
37,441 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/TSProcessor.java | TSProcessor.normOne | public double[] normOne(double[] data) {
double[] res = new double[data.length];
double max = max(data);
for (int i = 0; i < data.length; i++) {
res[i] = data[i] / max;
}
return res;
} | java | public double[] normOne(double[] data) {
double[] res = new double[data.length];
double max = max(data);
for (int i = 0; i < data.length; i++) {
res[i] = data[i] / max;
}
return res;
} | [
"public",
"double",
"[",
"]",
"normOne",
"(",
"double",
"[",
"]",
"data",
")",
"{",
"double",
"[",
"]",
"res",
"=",
"new",
"double",
"[",
"data",
".",
"length",
"]",
";",
"double",
"max",
"=",
"max",
"(",
"data",
")",
";",
"for",
"(",
"int",
"i... | Normalizes data in interval 0-1.
@param data the dataset.
@return normalized dataset. | [
"Normalizes",
"data",
"in",
"interval",
"0",
"-",
"1",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/TSProcessor.java#L477-L484 |
37,442 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/discord/DiscordRecords.java | DiscordRecords.getTopHits | public List<DiscordRecord> getTopHits(Integer num) {
if (num >= this.discords.size()) {
return this.discords;
}
List<DiscordRecord> res = this.discords.subList(this.discords.size() - num,
this.discords.size());
return res;
} | java | public List<DiscordRecord> getTopHits(Integer num) {
if (num >= this.discords.size()) {
return this.discords;
}
List<DiscordRecord> res = this.discords.subList(this.discords.size() - num,
this.discords.size());
return res;
} | [
"public",
"List",
"<",
"DiscordRecord",
">",
"getTopHits",
"(",
"Integer",
"num",
")",
"{",
"if",
"(",
"num",
">=",
"this",
".",
"discords",
".",
"size",
"(",
")",
")",
"{",
"return",
"this",
".",
"discords",
";",
"}",
"List",
"<",
"DiscordRecord",
"... | Returns the number of the top hits.
@param num The number of instances to return. If the number larger than the storage size -
returns the storage as is.
@return the top discord hits. | [
"Returns",
"the",
"number",
"of",
"the",
"top",
"hits",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/discord/DiscordRecords.java#L41-L48 |
37,443 | jMotif/SAX | src/main/java/net/seninp/util/HeatChart.java | HeatChart.setZValues | public void setZValues(double[][] zValues, double low, double high) {
this.zValues = zValues;
this.lowValue = low;
this.highValue = high;
} | java | public void setZValues(double[][] zValues, double low, double high) {
this.zValues = zValues;
this.lowValue = low;
this.highValue = high;
} | [
"public",
"void",
"setZValues",
"(",
"double",
"[",
"]",
"[",
"]",
"zValues",
",",
"double",
"low",
",",
"double",
"high",
")",
"{",
"this",
".",
"zValues",
"=",
"zValues",
";",
"this",
".",
"lowValue",
"=",
"low",
";",
"this",
".",
"highValue",
"=",... | Replaces the z-values array. The number of elements should match the number of y-values, with
each element containing a double array with an equal number of elements that matches the number
of x-values. Use this method where the minimum and maximum values possible are not contained
within the dataset.
@param zValues t... | [
"Replaces",
"the",
"z",
"-",
"values",
"array",
".",
"The",
"number",
"of",
"elements",
"should",
"match",
"the",
"number",
"of",
"y",
"-",
"values",
"with",
"each",
"element",
"containing",
"a",
"double",
"array",
"with",
"an",
"equal",
"number",
"of",
... | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/HeatChart.java#L341-L345 |
37,444 | jMotif/SAX | src/main/java/net/seninp/util/HeatChart.java | HeatChart.setBackgroundColour | public void setBackgroundColour(Color backgroundColour) {
if (backgroundColour == null) {
backgroundColour = Color.WHITE;
}
this.backgroundColour = backgroundColour;
} | java | public void setBackgroundColour(Color backgroundColour) {
if (backgroundColour == null) {
backgroundColour = Color.WHITE;
}
this.backgroundColour = backgroundColour;
} | [
"public",
"void",
"setBackgroundColour",
"(",
"Color",
"backgroundColour",
")",
"{",
"if",
"(",
"backgroundColour",
"==",
"null",
")",
"{",
"backgroundColour",
"=",
"Color",
".",
"WHITE",
";",
"}",
"this",
".",
"backgroundColour",
"=",
"backgroundColour",
";",
... | Sets the colour to be used on the background of the chart. A transparent background can be set
by setting a background colour with an alpha value. The transparency will only be effective
when the image is saved as a png or gif.
<p>
Defaults to <code>Color.WHITE</code>.
@param backgroundColour the new colour to be set... | [
"Sets",
"the",
"colour",
"to",
"be",
"used",
"on",
"the",
"background",
"of",
"the",
"chart",
".",
"A",
"transparent",
"background",
"can",
"be",
"set",
"by",
"setting",
"a",
"background",
"colour",
"with",
"an",
"alpha",
"value",
".",
"The",
"transparency... | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/HeatChart.java#L736-L742 |
37,445 | jMotif/SAX | src/main/java/net/seninp/util/HeatChart.java | HeatChart.max | public static double max(double[][] values) {
double max = 0;
for (int i = 0; i < values.length; i++) {
for (int j = 0; j < values[i].length; j++) {
max = (values[i][j] > max) ? values[i][j] : max;
}
}
return max;
} | java | public static double max(double[][] values) {
double max = 0;
for (int i = 0; i < values.length; i++) {
for (int j = 0; j < values[i].length; j++) {
max = (values[i][j] > max) ? values[i][j] : max;
}
}
return max;
} | [
"public",
"static",
"double",
"max",
"(",
"double",
"[",
"]",
"[",
"]",
"values",
")",
"{",
"double",
"max",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"values",
".",
"length",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",... | Finds and returns the maximum value in a 2-dimensional array of doubles.
@param values the data to use.
@return the largest value in the array. | [
"Finds",
"and",
"returns",
"the",
"maximum",
"value",
"in",
"a",
"2",
"-",
"dimensional",
"array",
"of",
"doubles",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/HeatChart.java#L1697-L1705 |
37,446 | jMotif/SAX | src/main/java/net/seninp/util/HeatChart.java | HeatChart.min | public static double min(double[][] values) {
double min = Double.MAX_VALUE;
for (int i = 0; i < values.length; i++) {
for (int j = 0; j < values[i].length; j++) {
min = (values[i][j] < min) ? values[i][j] : min;
}
}
return min;
} | java | public static double min(double[][] values) {
double min = Double.MAX_VALUE;
for (int i = 0; i < values.length; i++) {
for (int j = 0; j < values[i].length; j++) {
min = (values[i][j] < min) ? values[i][j] : min;
}
}
return min;
} | [
"public",
"static",
"double",
"min",
"(",
"double",
"[",
"]",
"[",
"]",
"values",
")",
"{",
"double",
"min",
"=",
"Double",
".",
"MAX_VALUE",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"values",
".",
"length",
";",
"i",
"++",
")",
"{... | Finds and returns the minimum value in a 2-dimensional array of doubles.
@param values the data to use.
@return the smallest value in the array. | [
"Finds",
"and",
"returns",
"the",
"minimum",
"value",
"in",
"a",
"2",
"-",
"dimensional",
"array",
"of",
"doubles",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/HeatChart.java#L1714-L1722 |
37,447 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/discord/DiscordRecord.java | DiscordRecord.compareTo | @Override
public int compareTo(DiscordRecord other) {
if (null == other) {
throw new NullPointerException("Unable compare to null!");
}
return Double.compare(other.getNNDistance(), this.nnDistance);
} | java | @Override
public int compareTo(DiscordRecord other) {
if (null == other) {
throw new NullPointerException("Unable compare to null!");
}
return Double.compare(other.getNNDistance(), this.nnDistance);
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"DiscordRecord",
"other",
")",
"{",
"if",
"(",
"null",
"==",
"other",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Unable compare to null!\"",
")",
";",
"}",
"return",
"Double",
".",
"compare",
... | The simple comparator based on the distance. Note that discord is "better" if the NN distance
is greater.
@param other The discord record this one is compared to.
@return True if equals. | [
"The",
"simple",
"comparator",
"based",
"on",
"the",
"distance",
".",
"Note",
"that",
"discord",
"is",
"better",
"if",
"the",
"NN",
"distance",
"is",
"greater",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/discord/DiscordRecord.java#L160-L166 |
37,448 | jMotif/SAX | src/main/java/net/seninp/util/StdRandom.java | StdRandom.gaussian | public static double gaussian() {
// use the polar form of the Box-Muller transform
double r, x, y;
do {
x = uniform(-1.0, 1.0);
y = uniform(-1.0, 1.0);
r = x * x + y * y;
}
while (r >= 1 || r == 0);
return x * Math.sqrt(-2 * Math.log(r) / r);
// Remark: y * Math.sqrt(-2 *... | java | public static double gaussian() {
// use the polar form of the Box-Muller transform
double r, x, y;
do {
x = uniform(-1.0, 1.0);
y = uniform(-1.0, 1.0);
r = x * x + y * y;
}
while (r >= 1 || r == 0);
return x * Math.sqrt(-2 * Math.log(r) / r);
// Remark: y * Math.sqrt(-2 *... | [
"public",
"static",
"double",
"gaussian",
"(",
")",
"{",
"// use the polar form of the Box-Muller transform",
"double",
"r",
",",
"x",
",",
"y",
";",
"do",
"{",
"x",
"=",
"uniform",
"(",
"-",
"1.0",
",",
"1.0",
")",
";",
"y",
"=",
"uniform",
"(",
"-",
... | Returns a real number with a standard Gaussian distribution.
@return the random value. | [
"Returns",
"a",
"real",
"number",
"with",
"a",
"standard",
"Gaussian",
"distribution",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/StdRandom.java#L192-L205 |
37,449 | jMotif/SAX | src/main/java/net/seninp/util/StdRandom.java | StdRandom.shuffle | public static void shuffle(double[] a) {
int N = a.length;
for (int i = 0; i < N; i++) {
int r = i + uniform(N - i); // between i and N-1
double temp = a[i];
a[i] = a[r];
a[r] = temp;
}
} | java | public static void shuffle(double[] a) {
int N = a.length;
for (int i = 0; i < N; i++) {
int r = i + uniform(N - i); // between i and N-1
double temp = a[i];
a[i] = a[r];
a[r] = temp;
}
} | [
"public",
"static",
"void",
"shuffle",
"(",
"double",
"[",
"]",
"a",
")",
"{",
"int",
"N",
"=",
"a",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N",
";",
"i",
"++",
")",
"{",
"int",
"r",
"=",
"i",
"+",
"uniform",
... | Rearrange the elements of a double array in random order.
@param a the array to shuffle. | [
"Rearrange",
"the",
"elements",
"of",
"a",
"double",
"array",
"in",
"random",
"order",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/util/StdRandom.java#L345-L353 |
37,450 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java | SAXRecords.dropByIndex | public void dropByIndex(int idx) {
SAXRecord entry = realTSindex.get(idx);
if (null != entry) {
realTSindex.remove(idx);
entry.removeIndex(idx);
if (entry.getIndexes().isEmpty()) {
records.remove(String.valueOf(entry.getPayload()));
}
}
} | java | public void dropByIndex(int idx) {
SAXRecord entry = realTSindex.get(idx);
if (null != entry) {
realTSindex.remove(idx);
entry.removeIndex(idx);
if (entry.getIndexes().isEmpty()) {
records.remove(String.valueOf(entry.getPayload()));
}
}
} | [
"public",
"void",
"dropByIndex",
"(",
"int",
"idx",
")",
"{",
"SAXRecord",
"entry",
"=",
"realTSindex",
".",
"get",
"(",
"idx",
")",
";",
"if",
"(",
"null",
"!=",
"entry",
")",
"{",
"realTSindex",
".",
"remove",
"(",
"idx",
")",
";",
"entry",
".",
... | Drops a single entry.
@param idx the index. | [
"Drops",
"a",
"single",
"entry",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java#L101-L110 |
37,451 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java | SAXRecords.add | public void add(char[] str, int idx) {
SAXRecord rr = records.get(String.valueOf(str));
if (null == rr) {
rr = new SAXRecord(str, idx);
this.records.put(String.valueOf(str), rr);
}
else {
rr.addIndex(idx);
}
this.realTSindex.put(idx, rr);
} | java | public void add(char[] str, int idx) {
SAXRecord rr = records.get(String.valueOf(str));
if (null == rr) {
rr = new SAXRecord(str, idx);
this.records.put(String.valueOf(str), rr);
}
else {
rr.addIndex(idx);
}
this.realTSindex.put(idx, rr);
} | [
"public",
"void",
"add",
"(",
"char",
"[",
"]",
"str",
",",
"int",
"idx",
")",
"{",
"SAXRecord",
"rr",
"=",
"records",
".",
"get",
"(",
"String",
".",
"valueOf",
"(",
"str",
")",
")",
";",
"if",
"(",
"null",
"==",
"rr",
")",
"{",
"rr",
"=",
"... | Adds a single string and index entry by creating a SAXRecord.
@param str The string.
@param idx The index. | [
"Adds",
"a",
"single",
"string",
"and",
"index",
"entry",
"by",
"creating",
"a",
"SAXRecord",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java#L118-L128 |
37,452 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java | SAXRecords.addAll | public void addAll(SAXRecords records) {
for (SAXRecord record : records) {
char[] payload = record.getPayload();
for (Integer i : record.getIndexes()) {
this.add(payload, i);
}
}
} | java | public void addAll(SAXRecords records) {
for (SAXRecord record : records) {
char[] payload = record.getPayload();
for (Integer i : record.getIndexes()) {
this.add(payload, i);
}
}
} | [
"public",
"void",
"addAll",
"(",
"SAXRecords",
"records",
")",
"{",
"for",
"(",
"SAXRecord",
"record",
":",
"records",
")",
"{",
"char",
"[",
"]",
"payload",
"=",
"record",
".",
"getPayload",
"(",
")",
";",
"for",
"(",
"Integer",
"i",
":",
"record",
... | Adds all entries from the collection.
@param records The collection. | [
"Adds",
"all",
"entries",
"from",
"the",
"collection",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java#L135-L142 |
37,453 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java | SAXRecords.addAll | public void addAll(HashMap<Integer, char[]> records) {
for (Entry<Integer, char[]> e : records.entrySet()) {
this.add(e.getValue(), e.getKey());
}
} | java | public void addAll(HashMap<Integer, char[]> records) {
for (Entry<Integer, char[]> e : records.entrySet()) {
this.add(e.getValue(), e.getKey());
}
} | [
"public",
"void",
"addAll",
"(",
"HashMap",
"<",
"Integer",
",",
"char",
"[",
"]",
">",
"records",
")",
"{",
"for",
"(",
"Entry",
"<",
"Integer",
",",
"char",
"[",
"]",
">",
"e",
":",
"records",
".",
"entrySet",
"(",
")",
")",
"{",
"this",
".",
... | This adds all to the internal store. Used by the parallel SAX conversion engine.
@param records the data to add. | [
"This",
"adds",
"all",
"to",
"the",
"internal",
"store",
".",
"Used",
"by",
"the",
"parallel",
"SAX",
"conversion",
"engine",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java#L149-L153 |
37,454 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java | SAXRecords.getSAXString | public String getSAXString(String separatorToken) {
StringBuffer sb = new StringBuffer();
ArrayList<Integer> index = new ArrayList<Integer>();
index.addAll(this.realTSindex.keySet());
Collections.sort(index, new Comparator<Integer>() {
public int compare(Integer int1, Integer int2) {
retur... | java | public String getSAXString(String separatorToken) {
StringBuffer sb = new StringBuffer();
ArrayList<Integer> index = new ArrayList<Integer>();
index.addAll(this.realTSindex.keySet());
Collections.sort(index, new Comparator<Integer>() {
public int compare(Integer int1, Integer int2) {
retur... | [
"public",
"String",
"getSAXString",
"(",
"String",
"separatorToken",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"ArrayList",
"<",
"Integer",
">",
"index",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
")",
";",
"index",... | Get the SAX string of this whole collection.
@param separatorToken The separator token to use for the string.
@return The whole data as a string. | [
"Get",
"the",
"SAX",
"string",
"of",
"this",
"whole",
"collection",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java#L198-L211 |
37,455 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java | SAXRecords.getAllIndices | public ArrayList<Integer> getAllIndices() {
ArrayList<Integer> res = new ArrayList<Integer>(this.realTSindex.size());
res.addAll(this.realTSindex.keySet());
Collections.sort(res);
return res;
} | java | public ArrayList<Integer> getAllIndices() {
ArrayList<Integer> res = new ArrayList<Integer>(this.realTSindex.size());
res.addAll(this.realTSindex.keySet());
Collections.sort(res);
return res;
} | [
"public",
"ArrayList",
"<",
"Integer",
">",
"getAllIndices",
"(",
")",
"{",
"ArrayList",
"<",
"Integer",
">",
"res",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
"this",
".",
"realTSindex",
".",
"size",
"(",
")",
")",
";",
"res",
".",
"addAll",
... | Get all indexes, sorted.
@return all the indexes. | [
"Get",
"all",
"indexes",
"sorted",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java#L218-L223 |
37,456 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java | SAXRecords.buildIndex | public void buildIndex() {
this.stringPosToRealPos = new HashMap<Integer, Integer>();
int counter = 0;
for (Integer idx : getAllIndices()) {
this.stringPosToRealPos.put(counter, idx);
counter++;
}
} | java | public void buildIndex() {
this.stringPosToRealPos = new HashMap<Integer, Integer>();
int counter = 0;
for (Integer idx : getAllIndices()) {
this.stringPosToRealPos.put(counter, idx);
counter++;
}
} | [
"public",
"void",
"buildIndex",
"(",
")",
"{",
"this",
".",
"stringPosToRealPos",
"=",
"new",
"HashMap",
"<",
"Integer",
",",
"Integer",
">",
"(",
")",
";",
"int",
"counter",
"=",
"0",
";",
"for",
"(",
"Integer",
"idx",
":",
"getAllIndices",
"(",
")",
... | This builds an index that aids in mapping of a SAX word to the real timeseries index. | [
"This",
"builds",
"an",
"index",
"that",
"aids",
"in",
"mapping",
"of",
"a",
"SAX",
"word",
"to",
"the",
"real",
"timeseries",
"index",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java#L228-L235 |
37,457 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java | SAXRecords.excludePositions | public void excludePositions(ArrayList<Integer> positions) {
for (Integer p : positions) {
if (realTSindex.containsKey(p)) {
SAXRecord rec = realTSindex.get(p);
rec.removeIndex(p);
if (rec.getIndexes().isEmpty()) {
this.records.remove(String.valueOf(rec.getPayload()));
... | java | public void excludePositions(ArrayList<Integer> positions) {
for (Integer p : positions) {
if (realTSindex.containsKey(p)) {
SAXRecord rec = realTSindex.get(p);
rec.removeIndex(p);
if (rec.getIndexes().isEmpty()) {
this.records.remove(String.valueOf(rec.getPayload()));
... | [
"public",
"void",
"excludePositions",
"(",
"ArrayList",
"<",
"Integer",
">",
"positions",
")",
"{",
"for",
"(",
"Integer",
"p",
":",
"positions",
")",
"{",
"if",
"(",
"realTSindex",
".",
"containsKey",
"(",
"p",
")",
")",
"{",
"SAXRecord",
"rec",
"=",
... | Removes saxRecord occurrences that correspond to these positions.
@param positions The positions to clear. | [
"Removes",
"saxRecord",
"occurrences",
"that",
"correspond",
"to",
"these",
"positions",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java#L252-L263 |
37,458 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java | SAXRecords.getSimpleMotifs | public ArrayList<SAXRecord> getSimpleMotifs(int num) {
ArrayList<SAXRecord> res = new ArrayList<SAXRecord>(num);
DoublyLinkedSortedList<Entry<String, SAXRecord>> list = new DoublyLinkedSortedList<Entry<String, SAXRecord>>(
num, new Comparator<Entry<String, SAXRecord>>() {
@Override
p... | java | public ArrayList<SAXRecord> getSimpleMotifs(int num) {
ArrayList<SAXRecord> res = new ArrayList<SAXRecord>(num);
DoublyLinkedSortedList<Entry<String, SAXRecord>> list = new DoublyLinkedSortedList<Entry<String, SAXRecord>>(
num, new Comparator<Entry<String, SAXRecord>>() {
@Override
p... | [
"public",
"ArrayList",
"<",
"SAXRecord",
">",
"getSimpleMotifs",
"(",
"int",
"num",
")",
"{",
"ArrayList",
"<",
"SAXRecord",
">",
"res",
"=",
"new",
"ArrayList",
"<",
"SAXRecord",
">",
"(",
"num",
")",
";",
"DoublyLinkedSortedList",
"<",
"Entry",
"<",
"Str... | Get motifs.
@param num how many motifs to report.
@return the array of motif SAXRecords. | [
"Get",
"motifs",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/datastructure/SAXRecords.java#L271-L290 |
37,459 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/parallel/ParallelSAXImplementation.java | ParallelSAXImplementation.cancel | public void cancel() {
try {
executorService.shutdown();
if (!executorService.awaitTermination(30, TimeUnit.MINUTES)) {
executorService.shutdownNow(); // Cancel currently executing tasks
if (!executorService.awaitTermination(30, TimeUnit.MINUTES)) {
LOGGER.error("Pool did not t... | java | public void cancel() {
try {
executorService.shutdown();
if (!executorService.awaitTermination(30, TimeUnit.MINUTES)) {
executorService.shutdownNow(); // Cancel currently executing tasks
if (!executorService.awaitTermination(30, TimeUnit.MINUTES)) {
LOGGER.error("Pool did not t... | [
"public",
"void",
"cancel",
"(",
")",
"{",
"try",
"{",
"executorService",
".",
"shutdown",
"(",
")",
";",
"if",
"(",
"!",
"executorService",
".",
"awaitTermination",
"(",
"30",
",",
"TimeUnit",
".",
"MINUTES",
")",
")",
"{",
"executorService",
".",
"shut... | Cancels the execution. | [
"Cancels",
"the",
"execution",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/parallel/ParallelSAXImplementation.java#L432-L453 |
37,460 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/tinker/MoviePrinter.java | MoviePrinter.main | public static void main(String[] args) throws Exception {
SAXProcessor sp = new SAXProcessor();
// data
//
double[] dat = TSProcessor.readFileColumn(DAT_FNAME, 1, 0);
// TSProcessor tp = new TSProcessor();
// double[] dat = tp.readTS("src/resources/dataset/asys40.txt", 0);
// double[] dat ... | java | public static void main(String[] args) throws Exception {
SAXProcessor sp = new SAXProcessor();
// data
//
double[] dat = TSProcessor.readFileColumn(DAT_FNAME, 1, 0);
// TSProcessor tp = new TSProcessor();
// double[] dat = tp.readTS("src/resources/dataset/asys40.txt", 0);
// double[] dat ... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"SAXProcessor",
"sp",
"=",
"new",
"SAXProcessor",
"(",
")",
";",
"// data",
"//",
"double",
"[",
"]",
"dat",
"=",
"TSProcessor",
".",
"readFileColumn",
... | -pix_fmt yuv420p daimler_man.mp4 | [
"-",
"pix_fmt",
"yuv420p",
"daimler_man",
".",
"mp4"
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/tinker/MoviePrinter.java#L60-L126 |
37,461 | jMotif/SAX | src/main/java/net/seninp/jmotif/sax/bitmap/UCRdataBitmapPrinter.java | UCRdataBitmapPrinter.toDoubleAray | private static double[] toDoubleAray(Integer[] intArray, HashSet<Integer> skipIndex) {
double[] res = new double[intArray.length - skipIndex.size()];
int skip = 0;
for (int i = 0; i < intArray.length; i++) {
if (skipIndex.contains(i)) {
skip++;
continue;
}
res[i - skip] = i... | java | private static double[] toDoubleAray(Integer[] intArray, HashSet<Integer> skipIndex) {
double[] res = new double[intArray.length - skipIndex.size()];
int skip = 0;
for (int i = 0; i < intArray.length; i++) {
if (skipIndex.contains(i)) {
skip++;
continue;
}
res[i - skip] = i... | [
"private",
"static",
"double",
"[",
"]",
"toDoubleAray",
"(",
"Integer",
"[",
"]",
"intArray",
",",
"HashSet",
"<",
"Integer",
">",
"skipIndex",
")",
"{",
"double",
"[",
"]",
"res",
"=",
"new",
"double",
"[",
"intArray",
".",
"length",
"-",
"skipIndex",
... | Converts an array into array of doubles skipping specified indeces.
@param intArray the input array.
@param skipIndex skip index list.
@return array of doubles. | [
"Converts",
"an",
"array",
"into",
"array",
"of",
"doubles",
"skipping",
"specified",
"indeces",
"."
] | 39ee07a69facaa330def5130b8790aeda85f1061 | https://github.com/jMotif/SAX/blob/39ee07a69facaa330def5130b8790aeda85f1061/src/main/java/net/seninp/jmotif/sax/bitmap/UCRdataBitmapPrinter.java#L264-L275 |
37,462 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFileAssembly.java | VirtualFileAssembly.getFile | public VirtualFile getFile(VirtualFile mountPoint, VirtualFile target) {
final String path = target.getPathNameRelativeTo(mountPoint);
return rootNode.getFile(new Path(path), mountPoint);
} | java | public VirtualFile getFile(VirtualFile mountPoint, VirtualFile target) {
final String path = target.getPathNameRelativeTo(mountPoint);
return rootNode.getFile(new Path(path), mountPoint);
} | [
"public",
"VirtualFile",
"getFile",
"(",
"VirtualFile",
"mountPoint",
",",
"VirtualFile",
"target",
")",
"{",
"final",
"String",
"path",
"=",
"target",
".",
"getPathNameRelativeTo",
"(",
"mountPoint",
")",
";",
"return",
"rootNode",
".",
"getFile",
"(",
"new",
... | Get the VirtualFile from the assembly. This will traverse VirtualFiles in assembly
to find children if needed.
@param mountPoint
@param target
@return
@throws IOException | [
"Get",
"the",
"VirtualFile",
"from",
"the",
"assembly",
".",
"This",
"will",
"traverse",
"VirtualFiles",
"in",
"assembly",
"to",
"find",
"children",
"if",
"needed",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFileAssembly.java#L95-L98 |
37,463 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFileAssembly.java | VirtualFileAssembly.getChildNames | public List<String> getChildNames(VirtualFile mountPoint, VirtualFile target) {
List<String> names = new LinkedList<String>();
AssemblyNode targetNode = null;
if (mountPoint.equals(target)) {
targetNode = rootNode;
} else {
targetNode = rootNode.find(target.getPat... | java | public List<String> getChildNames(VirtualFile mountPoint, VirtualFile target) {
List<String> names = new LinkedList<String>();
AssemblyNode targetNode = null;
if (mountPoint.equals(target)) {
targetNode = rootNode;
} else {
targetNode = rootNode.find(target.getPat... | [
"public",
"List",
"<",
"String",
">",
"getChildNames",
"(",
"VirtualFile",
"mountPoint",
",",
"VirtualFile",
"target",
")",
"{",
"List",
"<",
"String",
">",
"names",
"=",
"new",
"LinkedList",
"<",
"String",
">",
"(",
")",
";",
"AssemblyNode",
"targetNode",
... | Returns a list of all the names of the children in the assembly.
@return | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"names",
"of",
"the",
"children",
"in",
"the",
"assembly",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFileAssembly.java#L105-L119 |
37,464 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/TempDir.java | TempDir.createFile | public File createFile(String relativePath, InputStream sourceData) throws IOException {
final File tempFile = getFile(relativePath);
boolean ok = false;
try {
final FileOutputStream fos = new FileOutputStream(tempFile);
try {
VFSUtils.copyStream(sourceDat... | java | public File createFile(String relativePath, InputStream sourceData) throws IOException {
final File tempFile = getFile(relativePath);
boolean ok = false;
try {
final FileOutputStream fos = new FileOutputStream(tempFile);
try {
VFSUtils.copyStream(sourceDat... | [
"public",
"File",
"createFile",
"(",
"String",
"relativePath",
",",
"InputStream",
"sourceData",
")",
"throws",
"IOException",
"{",
"final",
"File",
"tempFile",
"=",
"getFile",
"(",
"relativePath",
")",
";",
"boolean",
"ok",
"=",
"false",
";",
"try",
"{",
"f... | Create a file within this temporary directory, prepopulating the file from the given input stream.
@param relativePath the relative path name
@param sourceData the source input stream to use
@return the file
@throws IOException if the directory was closed at the time of this invocation or an error occurs | [
"Create",
"a",
"file",
"within",
"this",
"temporary",
"directory",
"prepopulating",
"the",
"file",
"from",
"the",
"given",
"input",
"stream",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/TempDir.java#L80-L100 |
37,465 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.init | private static void init() {
String pkgs = System.getProperty("java.protocol.handler.pkgs");
if (pkgs == null || pkgs.trim().length() == 0) {
pkgs = "org.jboss.net.protocol|org.jboss.vfs.protocol";
System.setProperty("java.protocol.handler.pkgs", pkgs);
} else if (pkgs.co... | java | private static void init() {
String pkgs = System.getProperty("java.protocol.handler.pkgs");
if (pkgs == null || pkgs.trim().length() == 0) {
pkgs = "org.jboss.net.protocol|org.jboss.vfs.protocol";
System.setProperty("java.protocol.handler.pkgs", pkgs);
} else if (pkgs.co... | [
"private",
"static",
"void",
"init",
"(",
")",
"{",
"String",
"pkgs",
"=",
"System",
".",
"getProperty",
"(",
"\"java.protocol.handler.pkgs\"",
")",
";",
"if",
"(",
"pkgs",
"==",
"null",
"||",
"pkgs",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==... | Initialize VFS protocol handlers package property. | [
"Initialize",
"VFS",
"protocol",
"handlers",
"package",
"property",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L77-L87 |
37,466 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.mount | public static Closeable mount(VirtualFile mountPoint, FileSystem fileSystem) throws IOException {
final VirtualFile parent = mountPoint.getParent();
if (parent == null) {
throw VFSMessages.MESSAGES.rootFileSystemAlreadyMounted();
}
final String name = mountPoint.getName();
... | java | public static Closeable mount(VirtualFile mountPoint, FileSystem fileSystem) throws IOException {
final VirtualFile parent = mountPoint.getParent();
if (parent == null) {
throw VFSMessages.MESSAGES.rootFileSystemAlreadyMounted();
}
final String name = mountPoint.getName();
... | [
"public",
"static",
"Closeable",
"mount",
"(",
"VirtualFile",
"mountPoint",
",",
"FileSystem",
"fileSystem",
")",
"throws",
"IOException",
"{",
"final",
"VirtualFile",
"parent",
"=",
"mountPoint",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"parent",
"==",
"nu... | Mount a filesystem on a mount point in the VFS. The mount point is any valid file name, existent or non-existent.
If a relative path is given, it will be treated as relative to the VFS root.
@param mountPoint the mount point
@param fileSystem the file system to mount
@return a handle which can be used to unmount the ... | [
"Mount",
"a",
"filesystem",
"on",
"a",
"mount",
"point",
"in",
"the",
"VFS",
".",
"The",
"mount",
"point",
"is",
"any",
"valid",
"file",
"name",
"existent",
"or",
"non",
"-",
"existent",
".",
"If",
"a",
"relative",
"path",
"is",
"given",
"it",
"will",
... | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L98-L124 |
37,467 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.visit | protected static void visit(VirtualFile file, VirtualFileVisitor visitor) throws IOException {
if (file == null) {
throw VFSMessages.MESSAGES.nullArgument("file");
}
visitor.visit(file);
} | java | protected static void visit(VirtualFile file, VirtualFileVisitor visitor) throws IOException {
if (file == null) {
throw VFSMessages.MESSAGES.nullArgument("file");
}
visitor.visit(file);
} | [
"protected",
"static",
"void",
"visit",
"(",
"VirtualFile",
"file",
",",
"VirtualFileVisitor",
"visitor",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"throw",
"VFSMessages",
".",
"MESSAGES",
".",
"nullArgument",
"(",
"\"file\"... | Visit the virtual file system
@param file the file
@param visitor the visitor
@throws IOException for any problem accessing the VFS
@throws IllegalArgumentException if the file or visitor is null | [
"Visit",
"the",
"virtual",
"file",
"system"
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L248-L253 |
37,468 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.getSubmounts | static Set<String> getSubmounts(VirtualFile virtualFile) {
final ConcurrentMap<VirtualFile, Map<String, Mount>> mounts = VFS.mounts;
final Map<String, Mount> mountMap = mounts.get(virtualFile);
if (mountMap == null) {
return emptyRemovableSet();
}
return new HashSet<S... | java | static Set<String> getSubmounts(VirtualFile virtualFile) {
final ConcurrentMap<VirtualFile, Map<String, Mount>> mounts = VFS.mounts;
final Map<String, Mount> mountMap = mounts.get(virtualFile);
if (mountMap == null) {
return emptyRemovableSet();
}
return new HashSet<S... | [
"static",
"Set",
"<",
"String",
">",
"getSubmounts",
"(",
"VirtualFile",
"virtualFile",
")",
"{",
"final",
"ConcurrentMap",
"<",
"VirtualFile",
",",
"Map",
"<",
"String",
",",
"Mount",
">",
">",
"mounts",
"=",
"VFS",
".",
"mounts",
";",
"final",
"Map",
"... | Get all immediate submounts for a path.
@param virtualFile the path
@return the collection of present mount (simple) names | [
"Get",
"all",
"immediate",
"submounts",
"for",
"a",
"path",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L282-L289 |
37,469 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.mountReal | public static Closeable mountReal(File realRoot, VirtualFile mountPoint) throws IOException {
return doMount(new RealFileSystem(realRoot), mountPoint);
} | java | public static Closeable mountReal(File realRoot, VirtualFile mountPoint) throws IOException {
return doMount(new RealFileSystem(realRoot), mountPoint);
} | [
"public",
"static",
"Closeable",
"mountReal",
"(",
"File",
"realRoot",
",",
"VirtualFile",
"mountPoint",
")",
"throws",
"IOException",
"{",
"return",
"doMount",
"(",
"new",
"RealFileSystem",
"(",
"realRoot",
")",
",",
"mountPoint",
")",
";",
"}"
] | Create and mount a real file system, returning a single handle which will unmount and close the filesystem when
closed.
@param realRoot the real filesystem root
@param mountPoint the point at which the filesystem should be mounted
@return a handle
@throws IOException if an error occurs | [
"Create",
"and",
"mount",
"a",
"real",
"file",
"system",
"returning",
"a",
"single",
"handle",
"which",
"will",
"unmount",
"and",
"close",
"the",
"filesystem",
"when",
"closed",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L380-L382 |
37,470 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.mountTemp | public static Closeable mountTemp(VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
boolean ok = false;
final TempDir tempDir = tempFileProvider.createTempDir("tmpfs");
try {
final MountHandle handle = doMount(new RealFileSystem(tempDir.getRoot()), mount... | java | public static Closeable mountTemp(VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
boolean ok = false;
final TempDir tempDir = tempFileProvider.createTempDir("tmpfs");
try {
final MountHandle handle = doMount(new RealFileSystem(tempDir.getRoot()), mount... | [
"public",
"static",
"Closeable",
"mountTemp",
"(",
"VirtualFile",
"mountPoint",
",",
"TempFileProvider",
"tempFileProvider",
")",
"throws",
"IOException",
"{",
"boolean",
"ok",
"=",
"false",
";",
"final",
"TempDir",
"tempDir",
"=",
"tempFileProvider",
".",
"createTe... | Create and mount a temporary file system, returning a single handle which will unmount and close the filesystem
when closed.
@param mountPoint the point at which the filesystem should be mounted
@param tempFileProvider the temporary file provider
@return a handle
@throws IOException if an error occurs | [
"Create",
"and",
"mount",
"a",
"temporary",
"file",
"system",
"returning",
"a",
"single",
"handle",
"which",
"will",
"unmount",
"and",
"close",
"the",
"filesystem",
"when",
"closed",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L393-L405 |
37,471 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.mountZipExpanded | public static Closeable mountZipExpanded(File zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
boolean ok = false;
final TempDir tempDir = tempFileProvider.createTempDir(zipFile.getName());
try {
final File rootFile = tempDir.getRoot();
... | java | public static Closeable mountZipExpanded(File zipFile, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
boolean ok = false;
final TempDir tempDir = tempFileProvider.createTempDir(zipFile.getName());
try {
final File rootFile = tempDir.getRoot();
... | [
"public",
"static",
"Closeable",
"mountZipExpanded",
"(",
"File",
"zipFile",
",",
"VirtualFile",
"mountPoint",
",",
"TempFileProvider",
"tempFileProvider",
")",
"throws",
"IOException",
"{",
"boolean",
"ok",
"=",
"false",
";",
"final",
"TempDir",
"tempDir",
"=",
"... | Create and mount an expanded zip file in a temporary file system, returning a single handle which will unmount and
close the filesystem when closed.
@param zipFile the zip file to mount
@param mountPoint the point at which the filesystem should be mounted
@param tempFileProvider the temporary file provi... | [
"Create",
"and",
"mount",
"an",
"expanded",
"zip",
"file",
"in",
"a",
"temporary",
"file",
"system",
"returning",
"a",
"single",
"handle",
"which",
"will",
"unmount",
"and",
"close",
"the",
"filesystem",
"when",
"closed",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L417-L431 |
37,472 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.mountZipExpanded | public static Closeable mountZipExpanded(InputStream zipData, String zipName, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
try {
boolean ok = false;
final TempDir tempDir = tempFileProvider.createTempDir(zipName);
try {
final... | java | public static Closeable mountZipExpanded(InputStream zipData, String zipName, VirtualFile mountPoint, TempFileProvider tempFileProvider) throws IOException {
try {
boolean ok = false;
final TempDir tempDir = tempFileProvider.createTempDir(zipName);
try {
final... | [
"public",
"static",
"Closeable",
"mountZipExpanded",
"(",
"InputStream",
"zipData",
",",
"String",
"zipName",
",",
"VirtualFile",
"mountPoint",
",",
"TempFileProvider",
"tempFileProvider",
")",
"throws",
"IOException",
"{",
"try",
"{",
"boolean",
"ok",
"=",
"false",... | Create and mount an expanded zip file in a temporary file system, returning a single handle which will unmount and
close the filesystem when closed. The given zip data stream is closed.
@param zipData an input stream containing the zip data
@param zipName the name of the archive
@param mountPoint ... | [
"Create",
"and",
"mount",
"an",
"expanded",
"zip",
"file",
"in",
"a",
"temporary",
"file",
"system",
"returning",
"a",
"single",
"handle",
"which",
"will",
"unmount",
"and",
"close",
"the",
"filesystem",
"when",
"closed",
".",
"The",
"given",
"zip",
"data",
... | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L444-L478 |
37,473 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFS.java | VFS.mountAssembly | public static Closeable mountAssembly(VirtualFileAssembly assembly, VirtualFile mountPoint) throws IOException {
return doMount(new AssemblyFileSystem(assembly), mountPoint);
} | java | public static Closeable mountAssembly(VirtualFileAssembly assembly, VirtualFile mountPoint) throws IOException {
return doMount(new AssemblyFileSystem(assembly), mountPoint);
} | [
"public",
"static",
"Closeable",
"mountAssembly",
"(",
"VirtualFileAssembly",
"assembly",
",",
"VirtualFile",
"mountPoint",
")",
"throws",
"IOException",
"{",
"return",
"doMount",
"(",
"new",
"AssemblyFileSystem",
"(",
"assembly",
")",
",",
"mountPoint",
")",
";",
... | Create and mount an assembly file system, returning a single handle which will unmount and
close the filesystem when closed.
@param assembly an {@link VirtualFileAssembly} to mount in the VFS
@param mountPoint the point at which the filesystem should be mounted
@return a handle
@throws IOException if an error occurs | [
"Create",
"and",
"mount",
"an",
"assembly",
"file",
"system",
"returning",
"a",
"single",
"handle",
"which",
"will",
"unmount",
"and",
"close",
"the",
"filesystem",
"when",
"closed",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFS.java#L503-L505 |
37,474 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java | VirtualJarFileInputStream.closeCurrent | private void closeCurrent() throws IOException {
virtualJarInputStream.closeEntry();
currentEntry.crc = crc.getValue();
crc.reset();
} | java | private void closeCurrent() throws IOException {
virtualJarInputStream.closeEntry();
currentEntry.crc = crc.getValue();
crc.reset();
} | [
"private",
"void",
"closeCurrent",
"(",
")",
"throws",
"IOException",
"{",
"virtualJarInputStream",
".",
"closeEntry",
"(",
")",
";",
"currentEntry",
".",
"crc",
"=",
"crc",
".",
"getValue",
"(",
")",
";",
"crc",
".",
"reset",
"(",
")",
";",
"}"
] | Close the current entry, and calculate the crc value.
@throws IOException if any problems occur | [
"Close",
"the",
"current",
"entry",
"and",
"calculate",
"the",
"crc",
"value",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java#L108-L112 |
37,475 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java | VirtualJarFileInputStream.bufferLocalFileHeader | private boolean bufferLocalFileHeader() throws IOException {
buffer.reset();
JarEntry jarEntry = virtualJarInputStream.getNextJarEntry();
if (jarEntry == null) { return false; }
currentEntry = new ProcessedEntry(jarEntry, totalRead);
processedEntries.add(currentEntry);
... | java | private boolean bufferLocalFileHeader() throws IOException {
buffer.reset();
JarEntry jarEntry = virtualJarInputStream.getNextJarEntry();
if (jarEntry == null) { return false; }
currentEntry = new ProcessedEntry(jarEntry, totalRead);
processedEntries.add(currentEntry);
... | [
"private",
"boolean",
"bufferLocalFileHeader",
"(",
")",
"throws",
"IOException",
"{",
"buffer",
".",
"reset",
"(",
")",
";",
"JarEntry",
"jarEntry",
"=",
"virtualJarInputStream",
".",
"getNextJarEntry",
"(",
")",
";",
"if",
"(",
"jarEntry",
"==",
"null",
")",... | Buffer the content of the local file header for a single entry.
@return true if the next local file header was buffered
@throws IOException if any problems occur | [
"Buffer",
"the",
"content",
"of",
"the",
"local",
"file",
"header",
"for",
"a",
"single",
"entry",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java#L120-L143 |
37,476 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java | VirtualJarFileInputStream.bufferNextCentralFileHeader | private boolean bufferNextCentralFileHeader() throws IOException {
buffer.reset();
if (currentCentralEntryIdx == processedEntries.size()) { return false; }
ProcessedEntry entry = processedEntries.get(currentCentralEntryIdx++);
JarEntry jarEntry = entry.jarEntry;
bufferInt(ZipE... | java | private boolean bufferNextCentralFileHeader() throws IOException {
buffer.reset();
if (currentCentralEntryIdx == processedEntries.size()) { return false; }
ProcessedEntry entry = processedEntries.get(currentCentralEntryIdx++);
JarEntry jarEntry = entry.jarEntry;
bufferInt(ZipE... | [
"private",
"boolean",
"bufferNextCentralFileHeader",
"(",
")",
"throws",
"IOException",
"{",
"buffer",
".",
"reset",
"(",
")",
";",
"if",
"(",
"currentCentralEntryIdx",
"==",
"processedEntries",
".",
"size",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"... | Buffer the central file header record for a single entry.
@return true if the next central file header was buffered
@throws IOException if any problems occur | [
"Buffer",
"the",
"central",
"file",
"header",
"record",
"for",
"a",
"single",
"entry",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java#L151-L178 |
37,477 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java | VirtualJarFileInputStream.bufferCentralDirectoryEnd | private void bufferCentralDirectoryEnd() throws IOException {
buffer.reset();
long lengthOfCentral = totalRead - centralOffset;
int count = processedEntries.size();
bufferInt(JarEntry.ENDSIG); // End of central directory signature
bufferShort(0); // Number ... | java | private void bufferCentralDirectoryEnd() throws IOException {
buffer.reset();
long lengthOfCentral = totalRead - centralOffset;
int count = processedEntries.size();
bufferInt(JarEntry.ENDSIG); // End of central directory signature
bufferShort(0); // Number ... | [
"private",
"void",
"bufferCentralDirectoryEnd",
"(",
")",
"throws",
"IOException",
"{",
"buffer",
".",
"reset",
"(",
")",
";",
"long",
"lengthOfCentral",
"=",
"totalRead",
"-",
"centralOffset",
";",
"int",
"count",
"=",
"processedEntries",
".",
"size",
"(",
")... | Write the central file header records. This is repeated
until all entries have been added to the central file header.
@throws IOException if any problem occur | [
"Write",
"the",
"central",
"file",
"header",
"records",
".",
"This",
"is",
"repeated",
"until",
"all",
"entries",
"have",
"been",
"added",
"to",
"the",
"central",
"file",
"header",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java#L186-L199 |
37,478 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java | VirtualJarFileInputStream.bufferInt | private void bufferInt(long i) {
buffer((byte) (i & 0xff));
buffer((byte) ((i >>> 8) & 0xff));
buffer((byte) ((i >>> 16) & 0xff));
buffer((byte) ((i >>> 24) & 0xff));
} | java | private void bufferInt(long i) {
buffer((byte) (i & 0xff));
buffer((byte) ((i >>> 8) & 0xff));
buffer((byte) ((i >>> 16) & 0xff));
buffer((byte) ((i >>> 24) & 0xff));
} | [
"private",
"void",
"bufferInt",
"(",
"long",
"i",
")",
"{",
"buffer",
"(",
"(",
"byte",
")",
"(",
"i",
"&",
"0xff",
")",
")",
";",
"buffer",
"(",
"(",
"byte",
")",
"(",
"(",
"i",
">>>",
"8",
")",
"&",
"0xff",
")",
")",
";",
"buffer",
"(",
"... | Buffer a 32-bit integer in little-endian
@param i A long representation of a 32 bit int | [
"Buffer",
"a",
"32",
"-",
"bit",
"integer",
"in",
"little",
"-",
"endian"
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java#L206-L211 |
37,479 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java | VirtualJarFileInputStream.buffer | private void buffer(byte b) {
if (buffer.hasCapacity()) {
buffer.put(b);
} else {
throw VFSMessages.MESSAGES.bufferDoesntHaveEnoughCapacity();
}
} | java | private void buffer(byte b) {
if (buffer.hasCapacity()) {
buffer.put(b);
} else {
throw VFSMessages.MESSAGES.bufferDoesntHaveEnoughCapacity();
}
} | [
"private",
"void",
"buffer",
"(",
"byte",
"b",
")",
"{",
"if",
"(",
"buffer",
".",
"hasCapacity",
"(",
")",
")",
"{",
"buffer",
".",
"put",
"(",
"b",
")",
";",
"}",
"else",
"{",
"throw",
"VFSMessages",
".",
"MESSAGES",
".",
"bufferDoesntHaveEnoughCapac... | Buffer a single byte
@param b The byte | [
"Buffer",
"a",
"single",
"byte"
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualJarFileInputStream.java#L228-L234 |
37,480 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.getPathName | String getPathName(boolean url) {
if (pathName == null || pathName.isEmpty()) {
VirtualFile[] path = getParentFiles();
final StringBuilder builder = new StringBuilder(path.length * 30 + 50);
for (int i = path.length - 1; i > -1; i--) {
final VirtualFile parent... | java | String getPathName(boolean url) {
if (pathName == null || pathName.isEmpty()) {
VirtualFile[] path = getParentFiles();
final StringBuilder builder = new StringBuilder(path.length * 30 + 50);
for (int i = path.length - 1; i > -1; i--) {
final VirtualFile parent... | [
"String",
"getPathName",
"(",
"boolean",
"url",
")",
"{",
"if",
"(",
"pathName",
"==",
"null",
"||",
"pathName",
".",
"isEmpty",
"(",
")",
")",
"{",
"VirtualFile",
"[",
"]",
"path",
"=",
"getParentFiles",
"(",
")",
";",
"final",
"StringBuilder",
"builder... | Get the absolute VFS full path name. If this is a URL then directory entries will have a trailing slash.
@param url whether or not this path is being used for a URL
@return the VFS full path name | [
"Get",
"the",
"absolute",
"VFS",
"full",
"path",
"name",
".",
"If",
"this",
"is",
"a",
"URL",
"then",
"directory",
"entries",
"will",
"have",
"a",
"trailing",
"slash",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L136-L155 |
37,481 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.getLastModified | public long getLastModified() {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new VirtualFilePermission(getPathName(), "read"));
}
final VFS.Mount mount = VFS.getMount(this);
if (sm != null) {
return AccessCon... | java | public long getLastModified() {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new VirtualFilePermission(getPathName(), "read"));
}
final VFS.Mount mount = VFS.getMount(this);
if (sm != null) {
return AccessCon... | [
"public",
"long",
"getLastModified",
"(",
")",
"{",
"final",
"SecurityManager",
"sm",
"=",
"System",
".",
"getSecurityManager",
"(",
")",
";",
"if",
"(",
"sm",
"!=",
"null",
")",
"{",
"sm",
".",
"checkPermission",
"(",
"new",
"VirtualFilePermission",
"(",
... | When the file was last modified
@return the last modified time | [
"When",
"the",
"file",
"was",
"last",
"modified"
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L162-L174 |
37,482 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.openStream | public InputStream openStream() throws IOException {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new VirtualFilePermission(getPathName(), "read"));
}
if (isDirectory()) {
return new VirtualJarInputStream(this);
... | java | public InputStream openStream() throws IOException {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new VirtualFilePermission(getPathName(), "read"));
}
if (isDirectory()) {
return new VirtualJarInputStream(this);
... | [
"public",
"InputStream",
"openStream",
"(",
")",
"throws",
"IOException",
"{",
"final",
"SecurityManager",
"sm",
"=",
"System",
".",
"getSecurityManager",
"(",
")",
";",
"if",
"(",
"sm",
"!=",
"null",
")",
"{",
"sm",
".",
"checkPermission",
"(",
"new",
"Vi... | Access the file contents.
@return an InputStream for the file contents.
@throws IOException for any error accessing the file system | [
"Access",
"the",
"file",
"contents",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L280-L293 |
37,483 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.getPhysicalFile | public File getPhysicalFile() throws IOException {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new VirtualFilePermission(getPathName(), "getfile"));
}
final VFS.Mount mount = VFS.getMount(this);
if (sm != null) {
... | java | public File getPhysicalFile() throws IOException {
final SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new VirtualFilePermission(getPathName(), "getfile"));
}
final VFS.Mount mount = VFS.getMount(this);
if (sm != null) {
... | [
"public",
"File",
"getPhysicalFile",
"(",
")",
"throws",
"IOException",
"{",
"final",
"SecurityManager",
"sm",
"=",
"System",
".",
"getSecurityManager",
"(",
")",
";",
"if",
"(",
"sm",
"!=",
"null",
")",
"{",
"sm",
".",
"checkPermission",
"(",
"new",
"Virt... | Get a physical file for this virtual file. Depending on the underlying file system type, this may simply return
an already-existing file; it may create a copy of a file; or it may reuse a preexisting copy of the file.
Furthermore, the returned file may or may not have any relationship to other files from the same or a... | [
"Get",
"a",
"physical",
"file",
"for",
"this",
"virtual",
"file",
".",
"Depending",
"on",
"the",
"underlying",
"file",
"system",
"type",
"this",
"may",
"simply",
"return",
"an",
"already",
"-",
"existing",
"file",
";",
"it",
"may",
"create",
"a",
"copy",
... | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L323-L333 |
37,484 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.getChildren | public List<VirtualFile> getChildren() {
// isDirectory does the read security check
if (!isDirectory()) { return Collections.emptyList(); }
final VFS.Mount mount = VFS.getMount(this);
final Set<String> submounts = VFS.getSubmounts(this);
final List<String> names = mount.getFileS... | java | public List<VirtualFile> getChildren() {
// isDirectory does the read security check
if (!isDirectory()) { return Collections.emptyList(); }
final VFS.Mount mount = VFS.getMount(this);
final Set<String> submounts = VFS.getSubmounts(this);
final List<String> names = mount.getFileS... | [
"public",
"List",
"<",
"VirtualFile",
">",
"getChildren",
"(",
")",
"{",
"// isDirectory does the read security check",
"if",
"(",
"!",
"isDirectory",
"(",
")",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"final",
"VFS",
".",
"Mo... | Get the children. This is the combined list of real children within this directory, as well as virtual children
created by submounts.
@return the children | [
"Get",
"the",
"children",
".",
"This",
"is",
"the",
"combined",
"list",
"of",
"real",
"children",
"within",
"this",
"directory",
"as",
"well",
"as",
"virtual",
"children",
"created",
"by",
"submounts",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L395-L412 |
37,485 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.getChildren | public List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException {
// isDirectory does the read security check
if (!isDirectory()) { return Collections.emptyList(); }
if (filter == null) { filter = MatchAllVirtualFileFilter.INSTANCE; }
FilterVirtualFileVisitor visitor = ... | java | public List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException {
// isDirectory does the read security check
if (!isDirectory()) { return Collections.emptyList(); }
if (filter == null) { filter = MatchAllVirtualFileFilter.INSTANCE; }
FilterVirtualFileVisitor visitor = ... | [
"public",
"List",
"<",
"VirtualFile",
">",
"getChildren",
"(",
"VirtualFileFilter",
"filter",
")",
"throws",
"IOException",
"{",
"// isDirectory does the read security check",
"if",
"(",
"!",
"isDirectory",
"(",
")",
")",
"{",
"return",
"Collections",
".",
"emptyLis... | Get the children
@param filter to filter the children
@return the children
@throws IOException for any problem accessing the virtual file system
@throws IllegalStateException if the file is closed or it is a leaf node | [
"Get",
"the",
"children"
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L422-L429 |
37,486 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VirtualFile.java | VirtualFile.getChild | public VirtualFile getChild(String path) {
if (path == null) {
throw VFSMessages.MESSAGES.nullArgument("path");
}
final List<String> pathParts = PathTokenizer.getTokens(path);
VirtualFile current = this;
for (String part : pathParts) {
if (PathTokenizer.is... | java | public VirtualFile getChild(String path) {
if (path == null) {
throw VFSMessages.MESSAGES.nullArgument("path");
}
final List<String> pathParts = PathTokenizer.getTokens(path);
VirtualFile current = this;
for (String part : pathParts) {
if (PathTokenizer.is... | [
"public",
"VirtualFile",
"getChild",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"throw",
"VFSMessages",
".",
"MESSAGES",
".",
"nullArgument",
"(",
"\"path\"",
")",
";",
"}",
"final",
"List",
"<",
"String",
">",
"pathParts... | Get a child virtual file. The child may or may not exist in the virtual filesystem.
@param path the path
@return the child
@throws IllegalArgumentException if the path is null | [
"Get",
"a",
"child",
"virtual",
"file",
".",
"The",
"child",
"may",
"or",
"may",
"not",
"exist",
"in",
"the",
"virtual",
"filesystem",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VirtualFile.java#L494-L509 |
37,487 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/util/PathTokenizer.java | PathTokenizer.getTokens | public static List<String> getTokens(String path) {
if (path == null) {
throw MESSAGES.nullArgument("path");
}
List<String> list = new ArrayList<String>();
getTokens(list, path);
return list;
} | java | public static List<String> getTokens(String path) {
if (path == null) {
throw MESSAGES.nullArgument("path");
}
List<String> list = new ArrayList<String>();
getTokens(list, path);
return list;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"getTokens",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"throw",
"MESSAGES",
".",
"nullArgument",
"(",
"\"path\"",
")",
";",
"}",
"List",
"<",
"String",
">",
"list",
"="... | Get the tokens that comprise this path.
@param path the path
@return the tokens or null if the path is empty
@throws IllegalArgumentException if the path is null | [
"Get",
"the",
"tokens",
"that",
"comprise",
"this",
"path",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/PathTokenizer.java#L93-L100 |
37,488 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/util/PathTokenizer.java | PathTokenizer.getTokens | public static void getTokens(List<String> list, String path) {
int start = -1, length = path.length(), state = STATE_INITIAL;
char ch;
for (int index = 0; index < length; index++) {
ch = path.charAt(index);
switch (ch) {
case '/':
case '\\'... | java | public static void getTokens(List<String> list, String path) {
int start = -1, length = path.length(), state = STATE_INITIAL;
char ch;
for (int index = 0; index < length; index++) {
ch = path.charAt(index);
switch (ch) {
case '/':
case '\\'... | [
"public",
"static",
"void",
"getTokens",
"(",
"List",
"<",
"String",
">",
"list",
",",
"String",
"path",
")",
"{",
"int",
"start",
"=",
"-",
"1",
",",
"length",
"=",
"path",
".",
"length",
"(",
")",
",",
"state",
"=",
"STATE_INITIAL",
";",
"char",
... | Get the tokens that comprise this path and append them to the list.
@param path the path
@return the tokens or null if the path is empty
@throws IllegalArgumentException if the path is null | [
"Get",
"the",
"tokens",
"that",
"comprise",
"this",
"path",
"and",
"append",
"them",
"to",
"the",
"list",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/PathTokenizer.java#L109-L199 |
37,489 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/util/PathTokenizer.java | PathTokenizer.applySpecialPaths | public static String applySpecialPaths(String path) throws IllegalArgumentException {
List<String> tokens = getTokens(path);
if (tokens == null) { return null; }
int i = 0;
for (int j = 0; j < tokens.size(); j++) {
String token = tokens.get(j);
if (isCurrentToken(... | java | public static String applySpecialPaths(String path) throws IllegalArgumentException {
List<String> tokens = getTokens(path);
if (tokens == null) { return null; }
int i = 0;
for (int j = 0; j < tokens.size(); j++) {
String token = tokens.get(j);
if (isCurrentToken(... | [
"public",
"static",
"String",
"applySpecialPaths",
"(",
"String",
"path",
")",
"throws",
"IllegalArgumentException",
"{",
"List",
"<",
"String",
">",
"tokens",
"=",
"getTokens",
"(",
"path",
")",
";",
"if",
"(",
"tokens",
"==",
"null",
")",
"{",
"return",
... | Apply any . or .. paths in the path param.
@param path the path
@return simple path, containing no . or .. paths | [
"Apply",
"any",
".",
"or",
"..",
"paths",
"in",
"the",
"path",
"param",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/PathTokenizer.java#L222-L234 |
37,490 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/util/PathTokenizer.java | PathTokenizer.applySpecialPaths | public static List<String> applySpecialPaths(List<String> pathTokens) throws IllegalArgumentException {
final ArrayList<String> newTokens = new ArrayList<String>();
for (String pathToken : pathTokens) {
if (isCurrentToken(pathToken)) { continue; } else if (isReverseToken(pathToken)) {
... | java | public static List<String> applySpecialPaths(List<String> pathTokens) throws IllegalArgumentException {
final ArrayList<String> newTokens = new ArrayList<String>();
for (String pathToken : pathTokens) {
if (isCurrentToken(pathToken)) { continue; } else if (isReverseToken(pathToken)) {
... | [
"public",
"static",
"List",
"<",
"String",
">",
"applySpecialPaths",
"(",
"List",
"<",
"String",
">",
"pathTokens",
")",
"throws",
"IllegalArgumentException",
"{",
"final",
"ArrayList",
"<",
"String",
">",
"newTokens",
"=",
"new",
"ArrayList",
"<",
"String",
"... | Apply any . or .. paths in the pathTokens parameter, returning the minimal token list.
@param pathTokens the path tokens
@return the simple path tokens
@throws IllegalArgumentException if reverse path goes over the top path | [
"Apply",
"any",
".",
"or",
"..",
"paths",
"in",
"the",
"pathTokens",
"parameter",
"returning",
"the",
"minimal",
"token",
"list",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/PathTokenizer.java#L243-L255 |
37,491 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.getPathsString | public static String getPathsString(Collection<VirtualFile> paths) {
if (paths == null) {
throw MESSAGES.nullArgument("paths");
}
StringBuilder buffer = new StringBuilder();
boolean first = true;
for (VirtualFile path : paths) {
if (path == null) { throw n... | java | public static String getPathsString(Collection<VirtualFile> paths) {
if (paths == null) {
throw MESSAGES.nullArgument("paths");
}
StringBuilder buffer = new StringBuilder();
boolean first = true;
for (VirtualFile path : paths) {
if (path == null) { throw n... | [
"public",
"static",
"String",
"getPathsString",
"(",
"Collection",
"<",
"VirtualFile",
">",
"paths",
")",
"{",
"if",
"(",
"paths",
"==",
"null",
")",
"{",
"throw",
"MESSAGES",
".",
"nullArgument",
"(",
"\"paths\"",
")",
";",
"}",
"StringBuilder",
"buffer",
... | Get the paths string for a collection of virtual files
@param paths the paths
@return the string
@throws IllegalArgumentException for null paths | [
"Get",
"the",
"paths",
"string",
"for",
"a",
"collection",
"of",
"virtual",
"files"
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L129-L148 |
37,492 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.addManifestLocations | public static void addManifestLocations(VirtualFile file, List<VirtualFile> paths) throws IOException {
if (file == null) {
throw MESSAGES.nullArgument("file");
}
if (paths == null) {
throw MESSAGES.nullArgument("paths");
}
boolean trace = VFSLogger.ROOT_L... | java | public static void addManifestLocations(VirtualFile file, List<VirtualFile> paths) throws IOException {
if (file == null) {
throw MESSAGES.nullArgument("file");
}
if (paths == null) {
throw MESSAGES.nullArgument("paths");
}
boolean trace = VFSLogger.ROOT_L... | [
"public",
"static",
"void",
"addManifestLocations",
"(",
"VirtualFile",
"file",
",",
"List",
"<",
"VirtualFile",
">",
"paths",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"throw",
"MESSAGES",
".",
"nullArgument",
"(",
"\"fil... | Add manifest paths
@param file the file
@param paths the paths to add to
@throws IOException if there is an error reading the manifest or the virtual file is closed
@throws IllegalStateException if the file has no parent
@throws IllegalArgumentException for a null file or paths | [
"Add",
"manifest",
"paths"
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L159-L206 |
37,493 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.getManifest | public static Manifest getManifest(VirtualFile archive) throws IOException {
if (archive == null) {
throw MESSAGES.nullArgument("archive");
}
VirtualFile manifest = archive.getChild(JarFile.MANIFEST_NAME);
if (manifest == null || !manifest.exists()) {
if (VFSLogge... | java | public static Manifest getManifest(VirtualFile archive) throws IOException {
if (archive == null) {
throw MESSAGES.nullArgument("archive");
}
VirtualFile manifest = archive.getChild(JarFile.MANIFEST_NAME);
if (manifest == null || !manifest.exists()) {
if (VFSLogge... | [
"public",
"static",
"Manifest",
"getManifest",
"(",
"VirtualFile",
"archive",
")",
"throws",
"IOException",
"{",
"if",
"(",
"archive",
"==",
"null",
")",
"{",
"throw",
"MESSAGES",
".",
"nullArgument",
"(",
"\"archive\"",
")",
";",
"}",
"VirtualFile",
"manifest... | Get a manifest from a virtual file, assuming the virtual file is the root of an archive
@param archive the root the archive
@return the manifest or null if not found
@throws IOException if there is an error reading the manifest or the virtual file is closed
@throws IllegalArgumentException for a null arch... | [
"Get",
"a",
"manifest",
"from",
"a",
"virtual",
"file",
"assuming",
"the",
"virtual",
"file",
"is",
"the",
"root",
"of",
"an",
"archive"
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L216-L228 |
37,494 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.readManifest | public static Manifest readManifest(VirtualFile manifest) throws IOException {
if (manifest == null) {
throw MESSAGES.nullArgument("manifest file");
}
InputStream stream = new PaddedManifestStream(manifest.openStream());
try {
return new Manifest(stream);
... | java | public static Manifest readManifest(VirtualFile manifest) throws IOException {
if (manifest == null) {
throw MESSAGES.nullArgument("manifest file");
}
InputStream stream = new PaddedManifestStream(manifest.openStream());
try {
return new Manifest(stream);
... | [
"public",
"static",
"Manifest",
"readManifest",
"(",
"VirtualFile",
"manifest",
")",
"throws",
"IOException",
"{",
"if",
"(",
"manifest",
"==",
"null",
")",
"{",
"throw",
"MESSAGES",
".",
"nullArgument",
"(",
"\"manifest file\"",
")",
";",
"}",
"InputStream",
... | Read the manifest from given manifest VirtualFile.
@param manifest the VF to read from
@return JAR's manifest
@throws IOException if problems while opening VF stream occur | [
"Read",
"the",
"manifest",
"from",
"given",
"manifest",
"VirtualFile",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L237-L247 |
37,495 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.decode | public static String decode(String path, String encoding) {
try {
return URLDecoder.decode(path, encoding);
} catch (UnsupportedEncodingException e) {
throw MESSAGES.cannotDecode(path,encoding,e);
}
} | java | public static String decode(String path, String encoding) {
try {
return URLDecoder.decode(path, encoding);
} catch (UnsupportedEncodingException e) {
throw MESSAGES.cannotDecode(path,encoding,e);
}
} | [
"public",
"static",
"String",
"decode",
"(",
"String",
"path",
",",
"String",
"encoding",
")",
"{",
"try",
"{",
"return",
"URLDecoder",
".",
"decode",
"(",
"path",
",",
"encoding",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{",... | Decode the path.
@param path the path to decode
@param encoding the encoding
@return decoded path | [
"Decode",
"the",
"path",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L283-L289 |
37,496 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.getName | public static String getName(URI uri) {
if (uri == null) {
throw MESSAGES.nullArgument("uri");
}
String name = uri.getPath();
if (name != null) {
// TODO: Not correct for certain uris like jar:...!/
int lastSlash = name.lastIndexOf('/');
if... | java | public static String getName(URI uri) {
if (uri == null) {
throw MESSAGES.nullArgument("uri");
}
String name = uri.getPath();
if (name != null) {
// TODO: Not correct for certain uris like jar:...!/
int lastSlash = name.lastIndexOf('/');
if... | [
"public",
"static",
"String",
"getName",
"(",
"URI",
"uri",
")",
"{",
"if",
"(",
"uri",
"==",
"null",
")",
"{",
"throw",
"MESSAGES",
".",
"nullArgument",
"(",
"\"uri\"",
")",
";",
"}",
"String",
"name",
"=",
"uri",
".",
"getPath",
"(",
")",
";",
"i... | Get the name.
@param uri the uri
@return name from uri's path | [
"Get",
"the",
"name",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L297-L308 |
37,497 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.toURI | public static URI toURI(URL url) throws URISyntaxException {
if (url == null) {
throw MESSAGES.nullArgument("url");
}
try {
return url.toURI();
} catch (URISyntaxException e) {
String urispec = url.toExternalForm();
// Escape percent sign a... | java | public static URI toURI(URL url) throws URISyntaxException {
if (url == null) {
throw MESSAGES.nullArgument("url");
}
try {
return url.toURI();
} catch (URISyntaxException e) {
String urispec = url.toExternalForm();
// Escape percent sign a... | [
"public",
"static",
"URI",
"toURI",
"(",
"URL",
"url",
")",
"throws",
"URISyntaxException",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"throw",
"MESSAGES",
".",
"nullArgument",
"(",
"\"url\"",
")",
";",
"}",
"try",
"{",
"return",
"url",
".",
"toURI... | Deal with urls that may include spaces.
@param url the url
@return uri the uri
@throws URISyntaxException for any error | [
"Deal",
"with",
"urls",
"that",
"may",
"include",
"spaces",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L318-L331 |
37,498 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.safeClose | public static void safeClose(final Iterable<? extends Closeable> ci) {
if (ci != null) {
for (Closeable closeable : ci) {
safeClose(closeable);
}
}
} | java | public static void safeClose(final Iterable<? extends Closeable> ci) {
if (ci != null) {
for (Closeable closeable : ci) {
safeClose(closeable);
}
}
} | [
"public",
"static",
"void",
"safeClose",
"(",
"final",
"Iterable",
"<",
"?",
"extends",
"Closeable",
">",
"ci",
")",
"{",
"if",
"(",
"ci",
"!=",
"null",
")",
"{",
"for",
"(",
"Closeable",
"closeable",
":",
"ci",
")",
"{",
"safeClose",
"(",
"closeable",... | Safely close some resources without throwing an exception. Any exception will be logged at TRACE level.
@param ci the resources | [
"Safely",
"close",
"some",
"resources",
"without",
"throwing",
"an",
"exception",
".",
"Any",
"exception",
"will",
"be",
"logged",
"at",
"TRACE",
"level",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L616-L622 |
37,499 | jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | VFSUtils.exists | public static boolean exists(File file) {
try {
boolean fileExists = file.exists();
if(!forceCaseSensitive || !fileExists) {
return fileExists;
}
String absPath = canonicalize(file.getAbsolutePath());
String canPath = canonicalize(file... | java | public static boolean exists(File file) {
try {
boolean fileExists = file.exists();
if(!forceCaseSensitive || !fileExists) {
return fileExists;
}
String absPath = canonicalize(file.getAbsolutePath());
String canPath = canonicalize(file... | [
"public",
"static",
"boolean",
"exists",
"(",
"File",
"file",
")",
"{",
"try",
"{",
"boolean",
"fileExists",
"=",
"file",
".",
"exists",
"(",
")",
";",
"if",
"(",
"!",
"forceCaseSensitive",
"||",
"!",
"fileExists",
")",
"{",
"return",
"fileExists",
";",
... | In case the file system is not case sensitive we compare the canonical path with
the absolute path of the file after normalized.
@param file
@return | [
"In",
"case",
"the",
"file",
"system",
"is",
"not",
"case",
"sensitive",
"we",
"compare",
"the",
"canonical",
"path",
"with",
"the",
"absolute",
"path",
"of",
"the",
"file",
"after",
"normalized",
"."
] | 420f4b896d6178ee5f6758f3421e9f350d2b8ab5 | https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/VFSUtils.java#L649-L662 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.