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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
101,800 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java | AbstractDomainQuery.TRAVERSE_FROM | public Traverse TRAVERSE_FROM(DomainObjectMatch<?> start) {
DomainObjectMatch<?> delegate = APIAccess.getDelegate(start);
DomainObjectMatch<?> match = delegate != null ? delegate : start;
TraversalExpression te = new TraversalExpression(match, this.queryExecutor);
this.queryExecutor.addAstObject(te);
Traverse... | java | public Traverse TRAVERSE_FROM(DomainObjectMatch<?> start) {
DomainObjectMatch<?> delegate = APIAccess.getDelegate(start);
DomainObjectMatch<?> match = delegate != null ? delegate : start;
TraversalExpression te = new TraversalExpression(match, this.queryExecutor);
this.queryExecutor.addAstObject(te);
Traverse... | [
"public",
"Traverse",
"TRAVERSE_FROM",
"(",
"DomainObjectMatch",
"<",
"?",
">",
"start",
")",
"{",
"DomainObjectMatch",
"<",
"?",
">",
"delegate",
"=",
"APIAccess",
".",
"getDelegate",
"(",
"start",
")",
";",
"DomainObjectMatch",
"<",
"?",
">",
"match",
"=",... | Start traversing the graph of domain objects.
@param start a DomainObjectMatch form where to start the traversal.
@return | [
"Start",
"traversing",
"the",
"graph",
"of",
"domain",
"objects",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L284-L292 |
101,801 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java | AbstractDomainQuery.SELECT_FROM | public <T> Select<T> SELECT_FROM(DomainObjectMatch<T> start) {
DomainObjectMatch<?> delegate = APIAccess.getDelegate(start);
DomainObjectMatch<?> match = delegate != null ? delegate : start;
SelectExpression<T> se = new SelectExpression<T>(APIAccess.getDomainObjectType(start),
match, this.getIntAccess());
t... | java | public <T> Select<T> SELECT_FROM(DomainObjectMatch<T> start) {
DomainObjectMatch<?> delegate = APIAccess.getDelegate(start);
DomainObjectMatch<?> match = delegate != null ? delegate : start;
SelectExpression<T> se = new SelectExpression<T>(APIAccess.getDomainObjectType(start),
match, this.getIntAccess());
t... | [
"public",
"<",
"T",
">",
"Select",
"<",
"T",
">",
"SELECT_FROM",
"(",
"DomainObjectMatch",
"<",
"T",
">",
"start",
")",
"{",
"DomainObjectMatch",
"<",
"?",
">",
"delegate",
"=",
"APIAccess",
".",
"getDelegate",
"(",
"start",
")",
";",
"DomainObjectMatch",
... | Select domain objects out of a set of other domain objects.
@param start with a DomainObjectMatch representing the initial set.
@return | [
"Select",
"domain",
"objects",
"out",
"of",
"a",
"set",
"of",
"other",
"domain",
"objects",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L299-L309 |
101,802 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java | AbstractDomainQuery.COLLECT | public Collect COLLECT(JcProperty attribute) {
CollectExpression ce = new CollectExpression(attribute, this.getIntAccess());
Collect coll = APIAccess.createCollect(ce);
this.queryExecutor.addAstObject(ce);
QueryRecorder.recordInvocation(this, "COLLECT", coll, QueryRecorder.placeHolder(attribute));
return coll... | java | public Collect COLLECT(JcProperty attribute) {
CollectExpression ce = new CollectExpression(attribute, this.getIntAccess());
Collect coll = APIAccess.createCollect(ce);
this.queryExecutor.addAstObject(ce);
QueryRecorder.recordInvocation(this, "COLLECT", coll, QueryRecorder.placeHolder(attribute));
return coll... | [
"public",
"Collect",
"COLLECT",
"(",
"JcProperty",
"attribute",
")",
"{",
"CollectExpression",
"ce",
"=",
"new",
"CollectExpression",
"(",
"attribute",
",",
"this",
".",
"getIntAccess",
"(",
")",
")",
";",
"Collect",
"coll",
"=",
"APIAccess",
".",
"createColle... | Collect the specified attribute from all objects in a DomainObjectMatch
@param attribute
@return | [
"Collect",
"the",
"specified",
"attribute",
"from",
"all",
"objects",
"in",
"a",
"DomainObjectMatch"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L334-L340 |
101,803 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java | AbstractDomainQuery.INTERSECTION | @SuppressWarnings("unchecked")
public <T> DomainObjectMatch<T> INTERSECTION(DomainObjectMatch<T>... set) {
DomainObjectMatch<T> ret = this.union_Intersection(false, set);
Object[] placeHolders = new Object[set.length];
DomainObjectMatch<?> delegate;
DomainObjectMatch<?> match;
for (int i = 0; i < set.length;... | java | @SuppressWarnings("unchecked")
public <T> DomainObjectMatch<T> INTERSECTION(DomainObjectMatch<T>... set) {
DomainObjectMatch<T> ret = this.union_Intersection(false, set);
Object[] placeHolders = new Object[set.length];
DomainObjectMatch<?> delegate;
DomainObjectMatch<?> match;
for (int i = 0; i < set.length;... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"DomainObjectMatch",
"<",
"T",
">",
"INTERSECTION",
"(",
"DomainObjectMatch",
"<",
"T",
">",
"...",
"set",
")",
"{",
"DomainObjectMatch",
"<",
"T",
">",
"ret",
"=",
"this",
".",
... | Build the intersection of the specified sets
@param set
@return | [
"Build",
"the",
"intersection",
"of",
"the",
"specified",
"sets"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L369-L384 |
101,804 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java | AbstractDomainQuery.execute | public DomainQueryResult execute() {
DomainQueryResult ret = new DomainQueryResult(this);
Object so = this.queryExecutor.getMappingInfo().getInternalDomainAccess().getSyncObject();
if (so != null) {
synchronized (so) {
this.queryExecutor.execute();
}
} else
this.queryExecutor.execute();
return re... | java | public DomainQueryResult execute() {
DomainQueryResult ret = new DomainQueryResult(this);
Object so = this.queryExecutor.getMappingInfo().getInternalDomainAccess().getSyncObject();
if (so != null) {
synchronized (so) {
this.queryExecutor.execute();
}
} else
this.queryExecutor.execute();
return re... | [
"public",
"DomainQueryResult",
"execute",
"(",
")",
"{",
"DomainQueryResult",
"ret",
"=",
"new",
"DomainQueryResult",
"(",
"this",
")",
";",
"Object",
"so",
"=",
"this",
".",
"queryExecutor",
".",
"getMappingInfo",
"(",
")",
".",
"getInternalDomainAccess",
"(",
... | Execute the domain query
@return a DomainQueryResult | [
"Execute",
"the",
"domain",
"query"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L390-L400 |
101,805 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java | AbstractDomainQuery.executeCount | public CountQueryResult executeCount() {
CountQueryResult ret = new CountQueryResult(this);
Object so = this.queryExecutor.getMappingInfo().getInternalDomainAccess().getSyncObject();
if (so != null) {
synchronized (so) {
this.queryExecutor.executeCount();
}
} else
this.queryExecutor.executeCount();... | java | public CountQueryResult executeCount() {
CountQueryResult ret = new CountQueryResult(this);
Object so = this.queryExecutor.getMappingInfo().getInternalDomainAccess().getSyncObject();
if (so != null) {
synchronized (so) {
this.queryExecutor.executeCount();
}
} else
this.queryExecutor.executeCount();... | [
"public",
"CountQueryResult",
"executeCount",
"(",
")",
"{",
"CountQueryResult",
"ret",
"=",
"new",
"CountQueryResult",
"(",
"this",
")",
";",
"Object",
"so",
"=",
"this",
".",
"queryExecutor",
".",
"getMappingInfo",
"(",
")",
".",
"getInternalDomainAccess",
"("... | Retrieve the count for every DomainObjectMatch of the query
in order to support pagination
@return a CountQueryResult | [
"Retrieve",
"the",
"count",
"for",
"every",
"DomainObjectMatch",
"of",
"the",
"query",
"in",
"order",
"to",
"support",
"pagination"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/AbstractDomainQuery.java#L407-L417 |
101,806 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/internal/JSONConverter.java | JSONConverter.toJSON | public String toJSON(RecordedQuery query) {
StringWriter sw = new StringWriter();
JsonGenerator generator;
if (this.prettyFormat != Format.NONE) {
JsonGeneratorFactory gf = JSONWriter.getPrettyGeneratorFactory();
generator = gf.createGenerator(sw);
} else
generator = Json.createGenerator(sw);
gene... | java | public String toJSON(RecordedQuery query) {
StringWriter sw = new StringWriter();
JsonGenerator generator;
if (this.prettyFormat != Format.NONE) {
JsonGeneratorFactory gf = JSONWriter.getPrettyGeneratorFactory();
generator = gf.createGenerator(sw);
} else
generator = Json.createGenerator(sw);
gene... | [
"public",
"String",
"toJSON",
"(",
"RecordedQuery",
"query",
")",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"JsonGenerator",
"generator",
";",
"if",
"(",
"this",
".",
"prettyFormat",
"!=",
"Format",
".",
"NONE",
")",
"{",
"JsonG... | Answer a JSON representation of a recorded query
@param query
@return | [
"Answer",
"a",
"JSON",
"representation",
"of",
"a",
"recorded",
"query"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/internal/JSONConverter.java#L87-L102 |
101,807 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/internal/JSONConverter.java | JSONConverter.fromJSON | public RecordedQuery fromJSON(String json) {
RecordedQuery ret = new RecordedQuery(false);
StringReader sr = new StringReader(json);
JsonReader reader = Json.createReader(sr);
JsonObject jsonResult = reader.readObject();
ret.setGeneric(jsonResult.getBoolean(GENERIC));
JsonArray augmentations = jsonResult... | java | public RecordedQuery fromJSON(String json) {
RecordedQuery ret = new RecordedQuery(false);
StringReader sr = new StringReader(json);
JsonReader reader = Json.createReader(sr);
JsonObject jsonResult = reader.readObject();
ret.setGeneric(jsonResult.getBoolean(GENERIC));
JsonArray augmentations = jsonResult... | [
"public",
"RecordedQuery",
"fromJSON",
"(",
"String",
"json",
")",
"{",
"RecordedQuery",
"ret",
"=",
"new",
"RecordedQuery",
"(",
"false",
")",
";",
"StringReader",
"sr",
"=",
"new",
"StringReader",
"(",
"json",
")",
";",
"JsonReader",
"reader",
"=",
"Json",... | Build a recorded query from it's JSON representation
@param json
@return | [
"Build",
"a",
"recorded",
"query",
"from",
"it",
"s",
"JSON",
"representation"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/internal/JSONConverter.java#L109-L134 |
101,808 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/graph/GrPropertyContainer.java | GrPropertyContainer.getProperty | public GrProperty getProperty(String propertyName) {
for (GrProperty prop : getProperties()) {
if (prop.getName().equals(propertyName))
return prop;
}
return null;
} | java | public GrProperty getProperty(String propertyName) {
for (GrProperty prop : getProperties()) {
if (prop.getName().equals(propertyName))
return prop;
}
return null;
} | [
"public",
"GrProperty",
"getProperty",
"(",
"String",
"propertyName",
")",
"{",
"for",
"(",
"GrProperty",
"prop",
":",
"getProperties",
"(",
")",
")",
"{",
"if",
"(",
"prop",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"propertyName",
")",
")",
"return... | return a property
@param propertyName
@return a GrProperty | [
"return",
"a",
"property"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/graph/GrPropertyContainer.java#L59-L65 |
101,809 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/graph/GrPropertyContainer.java | GrPropertyContainer.addProperty | public GrProperty addProperty(String name, Object value) {
GrProperty prop = GrAccess.createProperty(name);
prop.setValue(value);
return getPropertiesContainer().addElement(prop);
} | java | public GrProperty addProperty(String name, Object value) {
GrProperty prop = GrAccess.createProperty(name);
prop.setValue(value);
return getPropertiesContainer().addElement(prop);
} | [
"public",
"GrProperty",
"addProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"GrProperty",
"prop",
"=",
"GrAccess",
".",
"createProperty",
"(",
"name",
")",
";",
"prop",
".",
"setValue",
"(",
"value",
")",
";",
"return",
"getPropertiesCont... | add a new property, throw a RuntimeException if the property already exists
@param name of the property
@param value of the property
@return the added property | [
"add",
"a",
"new",
"property",
"throw",
"a",
"RuntimeException",
"if",
"the",
"property",
"already",
"exists"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/graph/GrPropertyContainer.java#L73-L77 |
101,810 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/CountQueryResult.java | CountQueryResult.countOf | public long countOf(DomainObjectMatch<?> match) {
long ret;
Object so = InternalAccess.getQueryExecutor(this.domainQuery).getMappingInfo()
.getInternalDomainAccess().getSyncObject();
if (so != null) {
synchronized (so) {
ret = intCountOf(match);
}
} else
ret = intCountOf(match);
return ret;
... | java | public long countOf(DomainObjectMatch<?> match) {
long ret;
Object so = InternalAccess.getQueryExecutor(this.domainQuery).getMappingInfo()
.getInternalDomainAccess().getSyncObject();
if (so != null) {
synchronized (so) {
ret = intCountOf(match);
}
} else
ret = intCountOf(match);
return ret;
... | [
"public",
"long",
"countOf",
"(",
"DomainObjectMatch",
"<",
"?",
">",
"match",
")",
"{",
"long",
"ret",
";",
"Object",
"so",
"=",
"InternalAccess",
".",
"getQueryExecutor",
"(",
"this",
".",
"domainQuery",
")",
".",
"getMappingInfo",
"(",
")",
".",
"getInt... | Answer the number of domain objects
@param match
@return the number of domain objects | [
"Answer",
"the",
"number",
"of",
"domain",
"objects"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/CountQueryResult.java#L37-L48 |
101,811 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/util/Util.java | Util.writePretty | public static String writePretty(JsonObject jsonObject) {
JsonWriterFactory factory = createPrettyWriterFactory();
StringWriter sw = new StringWriter();
JsonWriter writer = factory.createWriter(sw);
writer.writeObject(jsonObject);
String ret = sw.toString();
writer.close();
return ret;
} | java | public static String writePretty(JsonObject jsonObject) {
JsonWriterFactory factory = createPrettyWriterFactory();
StringWriter sw = new StringWriter();
JsonWriter writer = factory.createWriter(sw);
writer.writeObject(jsonObject);
String ret = sw.toString();
writer.close();
return ret;
} | [
"public",
"static",
"String",
"writePretty",
"(",
"JsonObject",
"jsonObject",
")",
"{",
"JsonWriterFactory",
"factory",
"=",
"createPrettyWriterFactory",
"(",
")",
";",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"JsonWriter",
"writer",
"=",
... | write a JsonObject formatted in a pretty way into a String
@param jsonObject
@return a String containing the JSON | [
"write",
"a",
"JsonObject",
"formatted",
"in",
"a",
"pretty",
"way",
"into",
"a",
"String"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/util/Util.java#L49-L57 |
101,812 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/util/Util.java | Util.printQuery | public static void printQuery(JcQuery query, QueryToObserve toObserve, Format format) {
boolean titlePrinted = false;
ContentToObserve tob = QueriesPrintObserver.contentToObserve(toObserve);
if (tob == ContentToObserve.CYPHER || tob == ContentToObserve.CYPHER_JSON) {
titlePrinted = true;
QueriesPrintObserve... | java | public static void printQuery(JcQuery query, QueryToObserve toObserve, Format format) {
boolean titlePrinted = false;
ContentToObserve tob = QueriesPrintObserver.contentToObserve(toObserve);
if (tob == ContentToObserve.CYPHER || tob == ContentToObserve.CYPHER_JSON) {
titlePrinted = true;
QueriesPrintObserve... | [
"public",
"static",
"void",
"printQuery",
"(",
"JcQuery",
"query",
",",
"QueryToObserve",
"toObserve",
",",
"Format",
"format",
")",
"{",
"boolean",
"titlePrinted",
"=",
"false",
";",
"ContentToObserve",
"tob",
"=",
"QueriesPrintObserver",
".",
"contentToObserve",
... | map to CYPHER statements and map to JSON, print the mapping results to System.out
@param queries
@param toObserve
@param format | [
"map",
"to",
"CYPHER",
"statements",
"and",
"map",
"to",
"JSON",
"print",
"the",
"mapping",
"results",
"to",
"System",
".",
"out"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/util/Util.java#L72-L95 |
101,813 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/util/Util.java | Util.printQueries | public static void printQueries(List<JcQuery> queries, QueryToObserve toObserve, Format format) {
boolean titlePrinted = false;
ContentToObserve tob = QueriesPrintObserver.contentToObserve(toObserve);
if (tob == ContentToObserve.CYPHER || tob == ContentToObserve.CYPHER_JSON) {
titlePrinted = true;
QueriesPr... | java | public static void printQueries(List<JcQuery> queries, QueryToObserve toObserve, Format format) {
boolean titlePrinted = false;
ContentToObserve tob = QueriesPrintObserver.contentToObserve(toObserve);
if (tob == ContentToObserve.CYPHER || tob == ContentToObserve.CYPHER_JSON) {
titlePrinted = true;
QueriesPr... | [
"public",
"static",
"void",
"printQueries",
"(",
"List",
"<",
"JcQuery",
">",
"queries",
",",
"QueryToObserve",
"toObserve",
",",
"Format",
"format",
")",
"{",
"boolean",
"titlePrinted",
"=",
"false",
";",
"ContentToObserve",
"tob",
"=",
"QueriesPrintObserver",
... | map to CYPHER statements and map to JSON, print the mapping results
to the output streams configured in QueriesPrintObserver
@param queries
@param toObserve
@param format | [
"map",
"to",
"CYPHER",
"statements",
"and",
"map",
"to",
"JSON",
"print",
"the",
"mapping",
"results",
"to",
"the",
"output",
"streams",
"configured",
"in",
"QueriesPrintObserver"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/util/Util.java#L104-L129 |
101,814 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/DomainInformation.java | DomainInformation.availableDomains | public static List<String> availableDomains(IDBAccess dbAccess) {
List<GrNode> resultList = loadAllDomainInfoNodes(dbAccess);
List<String> domains = new ArrayList<String>();
for (GrNode rNode : resultList) {
domains.add(rNode.getProperty(DomainInfoNameProperty).getValue().toString());
}
return domain... | java | public static List<String> availableDomains(IDBAccess dbAccess) {
List<GrNode> resultList = loadAllDomainInfoNodes(dbAccess);
List<String> domains = new ArrayList<String>();
for (GrNode rNode : resultList) {
domains.add(rNode.getProperty(DomainInfoNameProperty).getValue().toString());
}
return domain... | [
"public",
"static",
"List",
"<",
"String",
">",
"availableDomains",
"(",
"IDBAccess",
"dbAccess",
")",
"{",
"List",
"<",
"GrNode",
">",
"resultList",
"=",
"loadAllDomainInfoNodes",
"(",
"dbAccess",
")",
";",
"List",
"<",
"String",
">",
"domains",
"=",
"new",... | answer the names of available domains.
@param dbAccess
@return a list of names of available domains
in the graph database accessed through dbAccess. | [
"answer",
"the",
"names",
"of",
"available",
"domains",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/DomainInformation.java#L63-L70 |
101,815 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/DomainInformation.java | DomainInformation.getDomainObjectTypes | public List<DomainObjectType> getDomainObjectTypes() {
List<DomainObjectType> resultList = new ArrayList<DomainObjectType>();
GrNode infoNode = loadDomainInfoNode();
GrProperty prop = infoNode.getProperty(DomainInfoLabel2ClassProperty);
if (prop != null) {
@SuppressWarnings("unchecked")
List<String>... | java | public List<DomainObjectType> getDomainObjectTypes() {
List<DomainObjectType> resultList = new ArrayList<DomainObjectType>();
GrNode infoNode = loadDomainInfoNode();
GrProperty prop = infoNode.getProperty(DomainInfoLabel2ClassProperty);
if (prop != null) {
@SuppressWarnings("unchecked")
List<String>... | [
"public",
"List",
"<",
"DomainObjectType",
">",
"getDomainObjectTypes",
"(",
")",
"{",
"List",
"<",
"DomainObjectType",
">",
"resultList",
"=",
"new",
"ArrayList",
"<",
"DomainObjectType",
">",
"(",
")",
";",
"GrNode",
"infoNode",
"=",
"loadDomainInfoNode",
"(",... | answer a list of DomainObjectTypes stored in the domain graph
@return a list of DomainObjectTypes | [
"answer",
"a",
"list",
"of",
"DomainObjectTypes",
"stored",
"in",
"the",
"domain",
"graph"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/DomainInformation.java#L87-L100 |
101,816 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/DomainInformation.java | DomainInformation.getDomainObjectTypeNames | public List<String> getDomainObjectTypeNames() {
List<DomainObjectType> types = getDomainObjectTypes();
List<String> typeNames = new ArrayList<String>(types.size());
for (DomainObjectType typ : types) {
typeNames.add(typ.getTypeName());
}
return typeNames;
} | java | public List<String> getDomainObjectTypeNames() {
List<DomainObjectType> types = getDomainObjectTypes();
List<String> typeNames = new ArrayList<String>(types.size());
for (DomainObjectType typ : types) {
typeNames.add(typ.getTypeName());
}
return typeNames;
} | [
"public",
"List",
"<",
"String",
">",
"getDomainObjectTypeNames",
"(",
")",
"{",
"List",
"<",
"DomainObjectType",
">",
"types",
"=",
"getDomainObjectTypes",
"(",
")",
";",
"List",
"<",
"String",
">",
"typeNames",
"=",
"new",
"ArrayList",
"<",
"String",
">",
... | answer a list of names of DomainObjectTypes stored in the domain graph
@return a list of DomainObjectTypes | [
"answer",
"a",
"list",
"of",
"names",
"of",
"DomainObjectTypes",
"stored",
"in",
"the",
"domain",
"graph"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/DomainInformation.java#L106-L113 |
101,817 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/graph/PersistableItemsContainer.java | PersistableItemsContainer.addElement | public T addElement(T element) {
// make sure that elements are initialized
getElements();
if (!containsElement(this.elements, element)) {
this.elements.add(element);
element.addChangeListener(this.elementChangeListener);
element.notifyState();
return element;
}
throw new RuntimeException... | java | public T addElement(T element) {
// make sure that elements are initialized
getElements();
if (!containsElement(this.elements, element)) {
this.elements.add(element);
element.addChangeListener(this.elementChangeListener);
element.notifyState();
return element;
}
throw new RuntimeException... | [
"public",
"T",
"addElement",
"(",
"T",
"element",
")",
"{",
"// make sure that elements are initialized\r",
"getElements",
"(",
")",
";",
"if",
"(",
"!",
"containsElement",
"(",
"this",
".",
"elements",
",",
"element",
")",
")",
"{",
"this",
".",
"elements",
... | add a new element, throw a RuntimeException if the element already exists
@param element
@return the added element | [
"add",
"a",
"new",
"element",
"throw",
"a",
"RuntimeException",
"if",
"the",
"element",
"already",
"exists"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/graph/PersistableItemsContainer.java#L105-L115 |
101,818 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/graph/PersistableItemsContainer.java | PersistableItemsContainer.checkForElementStates | private SyncState checkForElementStates(SyncState... states) {
if (this.elements != null) {
for (T elem : this.elements) {
for (SyncState state : states) {
if (elem.getSyncState() != state)
return elem.getSyncState();
}
}
}
return null;
} | java | private SyncState checkForElementStates(SyncState... states) {
if (this.elements != null) {
for (T elem : this.elements) {
for (SyncState state : states) {
if (elem.getSyncState() != state)
return elem.getSyncState();
}
}
}
return null;
} | [
"private",
"SyncState",
"checkForElementStates",
"(",
"SyncState",
"...",
"states",
")",
"{",
"if",
"(",
"this",
".",
"elements",
"!=",
"null",
")",
"{",
"for",
"(",
"T",
"elem",
":",
"this",
".",
"elements",
")",
"{",
"for",
"(",
"SyncState",
"state",
... | check all elements, if their state is one of the given states
@param states to check against
@return null, if all elements have a state out of the requested states,
else return the first element state that differs | [
"check",
"all",
"elements",
"if",
"their",
"state",
"is",
"one",
"of",
"the",
"given",
"states"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/graph/PersistableItemsContainer.java#L130-L140 |
101,819 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/genericmodel/DomainObject.java | DomainObject.addListFieldValue | public void addListFieldValue(String fieldName, Object value) {
Object val = value;
if (value instanceof DomainObject)
val = ((DomainObject)value).getRawObject();
Object lst = getFieldValue(fieldName, true); // internal
DOField fld = getDomainObjectType().getFieldByName(fieldName);
String ctn = f... | java | public void addListFieldValue(String fieldName, Object value) {
Object val = value;
if (value instanceof DomainObject)
val = ((DomainObject)value).getRawObject();
Object lst = getFieldValue(fieldName, true); // internal
DOField fld = getDomainObjectType().getFieldByName(fieldName);
String ctn = f... | [
"public",
"void",
"addListFieldValue",
"(",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"Object",
"val",
"=",
"value",
";",
"if",
"(",
"value",
"instanceof",
"DomainObject",
")",
"val",
"=",
"(",
"(",
"DomainObject",
")",
"value",
")",
".",
... | Add a value to a list or array field
@param fieldName
@param value | [
"Add",
"a",
"value",
"to",
"a",
"list",
"or",
"array",
"field"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/genericmodel/DomainObject.java#L76-L111 |
101,820 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/genericmodel/DomainObject.java | DomainObject.getListFieldValue | public Object getListFieldValue(String fieldName, int index) {
Object ret = null;
Object val = getFieldValue(fieldName, true); // internal
if (val instanceof List<?>) {
List<?> list = (List<?>)val;
Object cval = list.get(index);
DomainObject gdo = getForRawObject(cval);
if (gdo != null)
re... | java | public Object getListFieldValue(String fieldName, int index) {
Object ret = null;
Object val = getFieldValue(fieldName, true); // internal
if (val instanceof List<?>) {
List<?> list = (List<?>)val;
Object cval = list.get(index);
DomainObject gdo = getForRawObject(cval);
if (gdo != null)
re... | [
"public",
"Object",
"getListFieldValue",
"(",
"String",
"fieldName",
",",
"int",
"index",
")",
"{",
"Object",
"ret",
"=",
"null",
";",
"Object",
"val",
"=",
"getFieldValue",
"(",
"fieldName",
",",
"true",
")",
";",
"// internal\r",
"if",
"(",
"val",
"insta... | if the field is a list or array, answer the value at the given index.
@param fieldName
@param index
@return | [
"if",
"the",
"field",
"is",
"a",
"list",
"or",
"array",
"answer",
"the",
"value",
"at",
"the",
"given",
"index",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/genericmodel/DomainObject.java#L190-L215 |
101,821 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/genericmodel/DomainObject.java | DomainObject.getIndexOfValue | public int getIndexOfValue(String fieldName, Object value) {
int ret = -1;
Object val = value;
if (value instanceof DomainObject)
val = ((DomainObject)value).getRawObject();
Object lst = getFieldValue(fieldName, true); // internal
if (lst instanceof List<?>) {
List<?> list = (List<?>)lst;
for... | java | public int getIndexOfValue(String fieldName, Object value) {
int ret = -1;
Object val = value;
if (value instanceof DomainObject)
val = ((DomainObject)value).getRawObject();
Object lst = getFieldValue(fieldName, true); // internal
if (lst instanceof List<?>) {
List<?> list = (List<?>)lst;
for... | [
"public",
"int",
"getIndexOfValue",
"(",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"int",
"ret",
"=",
"-",
"1",
";",
"Object",
"val",
"=",
"value",
";",
"if",
"(",
"value",
"instanceof",
"DomainObject",
")",
"val",
"=",
"(",
"(",
"Domain... | Returns the index of the first occurrence of the specified value
in the list field, or -1 if the list field does not contain the value.
@param fieldName
@param value
@return | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"value",
"in",
"the",
"list",
"field",
"or",
"-",
"1",
"if",
"the",
"list",
"field",
"does",
"not",
"contain",
"the",
"value",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/genericmodel/DomainObject.java#L224-L255 |
101,822 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/genericmodel/DomainObject.java | DomainObject.clearListField | public void clearListField(String fieldName) {
Object val = getFieldValue(fieldName, true); // internal
if (val instanceof List<?>)
((List<?>)val).clear();
else if (val != null && val.getClass().isArray()) {
DOField fld = getDomainObjectType().getFieldByName(fieldName);
String ctn = fld.getComponen... | java | public void clearListField(String fieldName) {
Object val = getFieldValue(fieldName, true); // internal
if (val instanceof List<?>)
((List<?>)val).clear();
else if (val != null && val.getClass().isArray()) {
DOField fld = getDomainObjectType().getFieldByName(fieldName);
String ctn = fld.getComponen... | [
"public",
"void",
"clearListField",
"(",
"String",
"fieldName",
")",
"{",
"Object",
"val",
"=",
"getFieldValue",
"(",
"fieldName",
",",
"true",
")",
";",
"// internal\r",
"if",
"(",
"val",
"instanceof",
"List",
"<",
"?",
">",
")",
"(",
"(",
"List",
"<",
... | Removes all of the elements from the list field.
@param fieldName | [
"Removes",
"all",
"of",
"the",
"elements",
"from",
"the",
"list",
"field",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/genericmodel/DomainObject.java#L261-L281 |
101,823 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/genericmodel/DomainObject.java | DomainObject.getListFieldLength | public int getListFieldLength(String fieldName) {
int ret = -1;
Object val = getFieldValue(fieldName, true); // internal
if (val instanceof List<?>)
ret = ((List<?>)val).size();
else if (val != null && val.getClass().isArray()) {
ret = Array.getLength(val);
} else {
if (!getDomainObjectType()... | java | public int getListFieldLength(String fieldName) {
int ret = -1;
Object val = getFieldValue(fieldName, true); // internal
if (val instanceof List<?>)
ret = ((List<?>)val).size();
else if (val != null && val.getClass().isArray()) {
ret = Array.getLength(val);
} else {
if (!getDomainObjectType()... | [
"public",
"int",
"getListFieldLength",
"(",
"String",
"fieldName",
")",
"{",
"int",
"ret",
"=",
"-",
"1",
";",
"Object",
"val",
"=",
"getFieldValue",
"(",
"fieldName",
",",
"true",
")",
";",
"// internal\r",
"if",
"(",
"val",
"instanceof",
"List",
"<",
"... | Answer the length of a list field
@param fieldName
@return | [
"Answer",
"the",
"length",
"of",
"a",
"list",
"field"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/genericmodel/DomainObject.java#L325-L339 |
101,824 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/api/Select.java | Select.ELEMENTS | @SuppressWarnings("unchecked")
public DomainObjectMatch<T> ELEMENTS(TerminalResult... where) {
DomainObjectMatch<T> ret;
// all where expressions have already been added to the astObjects list
// of the SelectExpression
SelectExpression<T> se = this.getSelectExpression();
// create match for the true typ... | java | @SuppressWarnings("unchecked")
public DomainObjectMatch<T> ELEMENTS(TerminalResult... where) {
DomainObjectMatch<T> ret;
// all where expressions have already been added to the astObjects list
// of the SelectExpression
SelectExpression<T> se = this.getSelectExpression();
// create match for the true typ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"DomainObjectMatch",
"<",
"T",
">",
"ELEMENTS",
"(",
"TerminalResult",
"...",
"where",
")",
"{",
"DomainObjectMatch",
"<",
"T",
">",
"ret",
";",
"// all where expressions have already been added to the astObj... | Specify one or more predicate expressions to constrain the set of domain objects
@param where one or more predicate expressions | [
"Specify",
"one",
"or",
"more",
"predicate",
"expressions",
"to",
"constrain",
"the",
"set",
"of",
"domain",
"objects"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/api/Select.java#L48-L99 |
101,825 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/result/util/ResultHandler.java | ResultHandler.checkLockingError | private JcError checkLockingError(List<JcQueryResult> results, boolean hasCreateQuery, List<ElemId2Query> elemIds2Query) {
JcError error = null;
if (this.lockingStrategy == Locking.OPTIMISTIC) {
JcNumber lockV = new JcNumber("lockV");
JcNumber nSum = new JcNumber("sum");
int to = hasCreateQuery ? results.s... | java | private JcError checkLockingError(List<JcQueryResult> results, boolean hasCreateQuery, List<ElemId2Query> elemIds2Query) {
JcError error = null;
if (this.lockingStrategy == Locking.OPTIMISTIC) {
JcNumber lockV = new JcNumber("lockV");
JcNumber nSum = new JcNumber("sum");
int to = hasCreateQuery ? results.s... | [
"private",
"JcError",
"checkLockingError",
"(",
"List",
"<",
"JcQueryResult",
">",
"results",
",",
"boolean",
"hasCreateQuery",
",",
"List",
"<",
"ElemId2Query",
">",
"elemIds2Query",
")",
"{",
"JcError",
"error",
"=",
"null",
";",
"if",
"(",
"this",
".",
"l... | in case of error return the element's id, or if not available return -2 in case of change or -3 in case of delete,
in case of ok return -1
@param results
@param hasCreateQuery
@param elemIds2Query
@return | [
"in",
"case",
"of",
"error",
"return",
"the",
"element",
"s",
"id",
"or",
"if",
"not",
"available",
"return",
"-",
"2",
"in",
"case",
"of",
"change",
"or",
"-",
"3",
"in",
"case",
"of",
"delete",
"in",
"case",
"of",
"ok",
"return",
"-",
"1"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/result/util/ResultHandler.java#L609-L648 |
101,826 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/internal/RecordedQuery.java | RecordedQuery.getCreateParameter | Parameter getCreateParameter(String name) {
if (this.parameters == null)
this.parameters = new HashMap<String, Parameter>();
Parameter param = this.parameters.get(name);
if (param == null) {
param = new Parameter(name);
this.parameters.put(name, param);
}
return param;
} | java | Parameter getCreateParameter(String name) {
if (this.parameters == null)
this.parameters = new HashMap<String, Parameter>();
Parameter param = this.parameters.get(name);
if (param == null) {
param = new Parameter(name);
this.parameters.put(name, param);
}
return param;
} | [
"Parameter",
"getCreateParameter",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"this",
".",
"parameters",
"==",
"null",
")",
"this",
".",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Parameter",
">",
"(",
")",
";",
"Parameter",
"param",
"=",... | Get or create, if not exists, a query parameter.
@param name of the parameter
@return a query parameter | [
"Get",
"or",
"create",
"if",
"not",
"exists",
"a",
"query",
"parameter",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/internal/RecordedQuery.java#L106-L115 |
101,827 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/facade/JSONDBFacade.java | JSONDBFacade.getDomains | public String getDomains() {
StringWriter sw = new StringWriter();
JsonGenerator generator;
if (this.prettyFormat != Format.NONE) {
JsonGeneratorFactory gf = JSONWriter.getPrettyGeneratorFactory();
generator = gf.createGenerator(sw);
} else
generator = Json.createGenerator(sw);
generator.writeStar... | java | public String getDomains() {
StringWriter sw = new StringWriter();
JsonGenerator generator;
if (this.prettyFormat != Format.NONE) {
JsonGeneratorFactory gf = JSONWriter.getPrettyGeneratorFactory();
generator = gf.createGenerator(sw);
} else
generator = Json.createGenerator(sw);
generator.writeStar... | [
"public",
"String",
"getDomains",
"(",
")",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"JsonGenerator",
"generator",
";",
"if",
"(",
"this",
".",
"prettyFormat",
"!=",
"Format",
".",
"NONE",
")",
"{",
"JsonGeneratorFactory",
"gf",
... | Answer a JSON representation of the available domains in the database
@return | [
"Answer",
"a",
"JSON",
"representation",
"of",
"the",
"available",
"domains",
"in",
"the",
"database"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/facade/JSONDBFacade.java#L48-L66 |
101,828 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/mapping/CompoundObjectType.java | CompoundObjectType.getTypes | public List<Class<?>> getTypes(boolean noAbstractTypes) {
List<Class<?>> typeList = new ArrayList<Class<?>>();
this.addType(typeList, noAbstractTypes);
return typeList;
} | java | public List<Class<?>> getTypes(boolean noAbstractTypes) {
List<Class<?>> typeList = new ArrayList<Class<?>>();
this.addType(typeList, noAbstractTypes);
return typeList;
} | [
"public",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"getTypes",
"(",
"boolean",
"noAbstractTypes",
")",
"{",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"typeList",
"=",
"new",
"ArrayList",
"<",
"Class",
"<",
"?",
">",
">",
"(",
")",
";",
"this",
"... | Answer a list of types of this CompoundObjectType.
@param noAbstractTypes if true, no abstract types and no interfaces are answered,
else all types of the CompoundObjectType are answered.
@return a list of java Classes | [
"Answer",
"a",
"list",
"of",
"types",
"of",
"this",
"CompoundObjectType",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/mapping/CompoundObjectType.java#L73-L77 |
101,829 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/JcQueryResult.java | JcQueryResult.resultMapListOf | public LiteralMapList resultMapListOf(JcPrimitive... key) {
List<List<?>> results = new ArrayList<List<?>>();
LiteralMapList ret = new LiteralMapList();
int size = -1;
ResultHandler.includeNullValues.set(Boolean.TRUE);
try {
for (JcPrimitive k : key) {
List<?> r = this.resultOf(k);
if (size == -1)
... | java | public LiteralMapList resultMapListOf(JcPrimitive... key) {
List<List<?>> results = new ArrayList<List<?>>();
LiteralMapList ret = new LiteralMapList();
int size = -1;
ResultHandler.includeNullValues.set(Boolean.TRUE);
try {
for (JcPrimitive k : key) {
List<?> r = this.resultOf(k);
if (size == -1)
... | [
"public",
"LiteralMapList",
"resultMapListOf",
"(",
"JcPrimitive",
"...",
"key",
")",
"{",
"List",
"<",
"List",
"<",
"?",
">",
">",
"results",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"?",
">",
">",
"(",
")",
";",
"LiteralMapList",
"ret",
"=",
"new",... | answer a list of literal maps containing result values for the given keys
@param key a variable number of keys which are used to calculate result-values to fill the resulting maps
@return a list of LiteralMap(s) | [
"answer",
"a",
"list",
"of",
"literal",
"maps",
"containing",
"result",
"values",
"for",
"the",
"given",
"keys"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/JcQueryResult.java#L119-L144 |
101,830 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/mapping/FieldMapping.java | FieldMapping.getComponentType | protected Class<?> getComponentType(GrNode rNode) {
// do nothing in this implementation except for primitive arrays
// overwritten by subclasses
Class<?> compType;
if (this.getFieldType().isArray() && (compType = this.getFieldType().getComponentType()).isPrimitive()) {
return compType;
}
return null;
} | java | protected Class<?> getComponentType(GrNode rNode) {
// do nothing in this implementation except for primitive arrays
// overwritten by subclasses
Class<?> compType;
if (this.getFieldType().isArray() && (compType = this.getFieldType().getComponentType()).isPrimitive()) {
return compType;
}
return null;
} | [
"protected",
"Class",
"<",
"?",
">",
"getComponentType",
"(",
"GrNode",
"rNode",
")",
"{",
"// do nothing in this implementation except for primitive arrays",
"// overwritten by subclasses",
"Class",
"<",
"?",
">",
"compType",
";",
"if",
"(",
"this",
".",
"getFieldType"... | only called when to check for a concrete simple component type
@return | [
"only",
"called",
"when",
"to",
"check",
"for",
"a",
"concrete",
"simple",
"component",
"type"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/mapping/FieldMapping.java#L311-L319 |
101,831 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/graph/GrNode.java | GrNode.getLabel | public GrLabel getLabel(String labelName) {
for (GrLabel lab : getLabels()) {
if (lab.getName().equals(labelName))
return lab;
}
return null;
} | java | public GrLabel getLabel(String labelName) {
for (GrLabel lab : getLabels()) {
if (lab.getName().equals(labelName))
return lab;
}
return null;
} | [
"public",
"GrLabel",
"getLabel",
"(",
"String",
"labelName",
")",
"{",
"for",
"(",
"GrLabel",
"lab",
":",
"getLabels",
"(",
")",
")",
"{",
"if",
"(",
"lab",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"labelName",
")",
")",
"return",
"lab",
";",
... | return a label
@param labelName
@return a GrLabel | [
"return",
"a",
"label"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/graph/GrNode.java#L44-L50 |
101,832 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/graph/GrNode.java | GrNode.addLabel | public GrLabel addLabel(String name) {
GrLabel lab = GrAccess.createLabel(name);
return getLabelsContainer().addElement(lab);
} | java | public GrLabel addLabel(String name) {
GrLabel lab = GrAccess.createLabel(name);
return getLabelsContainer().addElement(lab);
} | [
"public",
"GrLabel",
"addLabel",
"(",
"String",
"name",
")",
"{",
"GrLabel",
"lab",
"=",
"GrAccess",
".",
"createLabel",
"(",
"name",
")",
";",
"return",
"getLabelsContainer",
"(",
")",
".",
"addElement",
"(",
"lab",
")",
";",
"}"
] | add a new label, throw a RuntimeException if the label already exists
@param name of the label
@return the added label | [
"add",
"a",
"new",
"label",
"throw",
"a",
"RuntimeException",
"if",
"the",
"label",
"already",
"exists"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/graph/GrNode.java#L57-L60 |
101,833 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/api/TraversalStep.java | TraversalStep.FORTH | public TraversalStep FORTH(String attributeName) {
TraversalExpression te = (TraversalExpression)this.astObject;
te.step(attributeName, 0);
TraversalStep ret = new TraversalStep(te);
QueryRecorder.recordInvocation(this, "FORTH", ret, QueryRecorder.literal(attributeName));
return ret;
} | java | public TraversalStep FORTH(String attributeName) {
TraversalExpression te = (TraversalExpression)this.astObject;
te.step(attributeName, 0);
TraversalStep ret = new TraversalStep(te);
QueryRecorder.recordInvocation(this, "FORTH", ret, QueryRecorder.literal(attributeName));
return ret;
} | [
"public",
"TraversalStep",
"FORTH",
"(",
"String",
"attributeName",
")",
"{",
"TraversalExpression",
"te",
"=",
"(",
"TraversalExpression",
")",
"this",
".",
"astObject",
";",
"te",
".",
"step",
"(",
"attributeName",
",",
"0",
")",
";",
"TraversalStep",
"ret",... | Traverse forward via an attribute
@param attributeName
@return | [
"Traverse",
"forward",
"via",
"an",
"attribute"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/api/TraversalStep.java#L36-L42 |
101,834 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/api/TraversalStep.java | TraversalStep.TO | public <T> DomainObjectMatch<T> TO(Class<T> domainObjectType) {
TraversalExpression te = (TraversalExpression)this.astObject;
DomainObjectMatch<T> ret =APIAccess.createDomainObjectMatch(domainObjectType,
te.getQueryExecutor().getDomainObjectMatches().size(),
te.getQueryExecutor().getMappingInfo());
te.get... | java | public <T> DomainObjectMatch<T> TO(Class<T> domainObjectType) {
TraversalExpression te = (TraversalExpression)this.astObject;
DomainObjectMatch<T> ret =APIAccess.createDomainObjectMatch(domainObjectType,
te.getQueryExecutor().getDomainObjectMatches().size(),
te.getQueryExecutor().getMappingInfo());
te.get... | [
"public",
"<",
"T",
">",
"DomainObjectMatch",
"<",
"T",
">",
"TO",
"(",
"Class",
"<",
"T",
">",
"domainObjectType",
")",
"{",
"TraversalExpression",
"te",
"=",
"(",
"TraversalExpression",
")",
"this",
".",
"astObject",
";",
"DomainObjectMatch",
"<",
"T",
"... | End the traversal of the domain object graph matching a specific type of domain objects
@param domainObjectType
@return a DomainObjectMatch | [
"End",
"the",
"traversal",
"of",
"the",
"domain",
"object",
"graph",
"matching",
"a",
"specific",
"type",
"of",
"domain",
"objects"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/api/TraversalStep.java#L80-L89 |
101,835 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/graph/PersistableItem.java | PersistableItem.remove | public void remove() {
SyncState oldState = this.syncState;
if (this.syncState == SyncState.NEW || this.syncState == SyncState.NEW_REMOVED)
this.syncState = SyncState.NEW_REMOVED;
else
this.syncState = SyncState.REMOVED;
if (oldState != this.syncState)
fireChanged(oldState, this.syncState);
} | java | public void remove() {
SyncState oldState = this.syncState;
if (this.syncState == SyncState.NEW || this.syncState == SyncState.NEW_REMOVED)
this.syncState = SyncState.NEW_REMOVED;
else
this.syncState = SyncState.REMOVED;
if (oldState != this.syncState)
fireChanged(oldState, this.syncState);
} | [
"public",
"void",
"remove",
"(",
")",
"{",
"SyncState",
"oldState",
"=",
"this",
".",
"syncState",
";",
"if",
"(",
"this",
".",
"syncState",
"==",
"SyncState",
".",
"NEW",
"||",
"this",
".",
"syncState",
"==",
"SyncState",
".",
"NEW_REMOVED",
")",
"this"... | removes this item | [
"removes",
"this",
"item"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/graph/PersistableItem.java#L32-L40 |
101,836 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java | DomainObjectMatch.atttribute | public JcProperty atttribute(String name) {
if (this.delegate != null)
return this.delegate.atttribute(name);
JcProperty ret = checkField_getJcVal(name, JcProperty.class);
QueryRecorder.recordInvocationReplace(this, ret, "atttribute");
return ret;
} | java | public JcProperty atttribute(String name) {
if (this.delegate != null)
return this.delegate.atttribute(name);
JcProperty ret = checkField_getJcVal(name, JcProperty.class);
QueryRecorder.recordInvocationReplace(this, ret, "atttribute");
return ret;
} | [
"public",
"JcProperty",
"atttribute",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"this",
".",
"delegate",
"!=",
"null",
")",
"return",
"this",
".",
"delegate",
".",
"atttribute",
"(",
"name",
")",
";",
"JcProperty",
"ret",
"=",
"checkField_getJcVal",
"(",... | Access an attribute, don't rely on a specific attribute type
@param name the attribute name
@return | [
"Access",
"an",
"attribute",
"don",
"t",
"rely",
"on",
"a",
"specific",
"attribute",
"type"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java#L118-L124 |
101,837 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java | DomainObjectMatch.stringAtttribute | public JcString stringAtttribute(String name) {
if (this.delegate != null)
return this.delegate.stringAtttribute(name);
JcString ret = checkField_getJcVal(name, JcString.class);
QueryRecorder.recordInvocationReplace(this, ret, "stringAtttribute");
return ret;
} | java | public JcString stringAtttribute(String name) {
if (this.delegate != null)
return this.delegate.stringAtttribute(name);
JcString ret = checkField_getJcVal(name, JcString.class);
QueryRecorder.recordInvocationReplace(this, ret, "stringAtttribute");
return ret;
} | [
"public",
"JcString",
"stringAtttribute",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"this",
".",
"delegate",
"!=",
"null",
")",
"return",
"this",
".",
"delegate",
".",
"stringAtttribute",
"(",
"name",
")",
";",
"JcString",
"ret",
"=",
"checkField_getJcVal"... | Access a string attribute
@param name the attribute name
@return a JcString | [
"Access",
"a",
"string",
"attribute"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java#L131-L137 |
101,838 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java | DomainObjectMatch.numberAtttribute | public JcNumber numberAtttribute(String name) {
if (this.delegate != null)
return this.delegate.numberAtttribute(name);
JcNumber ret = checkField_getJcVal(name, JcNumber.class);
QueryRecorder.recordInvocationReplace(this, ret, "numberAtttribute");
return ret;
} | java | public JcNumber numberAtttribute(String name) {
if (this.delegate != null)
return this.delegate.numberAtttribute(name);
JcNumber ret = checkField_getJcVal(name, JcNumber.class);
QueryRecorder.recordInvocationReplace(this, ret, "numberAtttribute");
return ret;
} | [
"public",
"JcNumber",
"numberAtttribute",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"this",
".",
"delegate",
"!=",
"null",
")",
"return",
"this",
".",
"delegate",
".",
"numberAtttribute",
"(",
"name",
")",
";",
"JcNumber",
"ret",
"=",
"checkField_getJcVal"... | Access a number attribute
@param name the attribute name
@return a JcNumber | [
"Access",
"a",
"number",
"attribute"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java#L144-L150 |
101,839 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java | DomainObjectMatch.booleanAtttribute | public JcBoolean booleanAtttribute(String name) {
if (this.delegate != null)
return this.delegate.booleanAtttribute(name);
JcBoolean ret = checkField_getJcVal(name, JcBoolean.class);
QueryRecorder.recordInvocationReplace(this, ret, "booleanAtttribute");
return ret;
} | java | public JcBoolean booleanAtttribute(String name) {
if (this.delegate != null)
return this.delegate.booleanAtttribute(name);
JcBoolean ret = checkField_getJcVal(name, JcBoolean.class);
QueryRecorder.recordInvocationReplace(this, ret, "booleanAtttribute");
return ret;
} | [
"public",
"JcBoolean",
"booleanAtttribute",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"this",
".",
"delegate",
"!=",
"null",
")",
"return",
"this",
".",
"delegate",
".",
"booleanAtttribute",
"(",
"name",
")",
";",
"JcBoolean",
"ret",
"=",
"checkField_getJc... | Access a boolean attribute
@param name the attribute name
@return a JcBoolean | [
"Access",
"a",
"boolean",
"attribute"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java#L157-L163 |
101,840 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java | DomainObjectMatch.collectionAtttribute | public JcCollection collectionAtttribute(String name) {
if (this.delegate != null)
return this.delegate.collectionAtttribute(name);
JcCollection ret = checkField_getJcVal(name, JcCollection.class);
QueryRecorder.recordInvocationReplace(this, ret, "collectionAtttribute");
return ret;
} | java | public JcCollection collectionAtttribute(String name) {
if (this.delegate != null)
return this.delegate.collectionAtttribute(name);
JcCollection ret = checkField_getJcVal(name, JcCollection.class);
QueryRecorder.recordInvocationReplace(this, ret, "collectionAtttribute");
return ret;
} | [
"public",
"JcCollection",
"collectionAtttribute",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"this",
".",
"delegate",
"!=",
"null",
")",
"return",
"this",
".",
"delegate",
".",
"collectionAtttribute",
"(",
"name",
")",
";",
"JcCollection",
"ret",
"=",
"chec... | Access a collection attribute
@param name the attribute name
@return a JcCollection | [
"Access",
"a",
"collection",
"attribute"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/api/DomainObjectMatch.java#L170-L176 |
101,841 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/DomainAccessFactory.java | DomainAccessFactory.createDomainAccess | public static IDomainAccess createDomainAccess(IDBAccess dbAccess, String domainName) {
return IDomainAccessFactory.INSTANCE.createDomainAccess(dbAccess, domainName);
} | java | public static IDomainAccess createDomainAccess(IDBAccess dbAccess, String domainName) {
return IDomainAccessFactory.INSTANCE.createDomainAccess(dbAccess, domainName);
} | [
"public",
"static",
"IDomainAccess",
"createDomainAccess",
"(",
"IDBAccess",
"dbAccess",
",",
"String",
"domainName",
")",
"{",
"return",
"IDomainAccessFactory",
".",
"INSTANCE",
".",
"createDomainAccess",
"(",
"dbAccess",
",",
"domainName",
")",
";",
"}"
] | Create a domain accessor.
@param dbAccess the graph database connection
@param domainName
@return | [
"Create",
"a",
"domain",
"accessor",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/DomainAccessFactory.java#L34-L36 |
101,842 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/DomainAccessFactory.java | DomainAccessFactory.createGenericDomainAccess | public static IGenericDomainAccess createGenericDomainAccess(IDBAccess dbAccess, String domainName,
DomainLabelUse domainLabelUse) {
return IDomainAccessFactory.INSTANCE.createGenericDomainAccess(dbAccess, domainName, domainLabelUse);
} | java | public static IGenericDomainAccess createGenericDomainAccess(IDBAccess dbAccess, String domainName,
DomainLabelUse domainLabelUse) {
return IDomainAccessFactory.INSTANCE.createGenericDomainAccess(dbAccess, domainName, domainLabelUse);
} | [
"public",
"static",
"IGenericDomainAccess",
"createGenericDomainAccess",
"(",
"IDBAccess",
"dbAccess",
",",
"String",
"domainName",
",",
"DomainLabelUse",
"domainLabelUse",
")",
"{",
"return",
"IDomainAccessFactory",
".",
"INSTANCE",
".",
"createGenericDomainAccess",
"(",
... | Create a domain accessor which works with a generic domain model.
@param dbAccess the graph database connection
@param domainName
@param domainLabelUse --<b>Note:</b> Consistency may be corrupted, if you change domainLabelUse
on different creations of DomainAccess to the same domain.
@return | [
"Create",
"a",
"domain",
"accessor",
"which",
"works",
"with",
"a",
"generic",
"domain",
"model",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/DomainAccessFactory.java#L69-L72 |
101,843 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/api/Order.java | Order.BY | public OrderDirection BY(String attributeName) {
OrderBy ob = this.orderExpression.getCreateOrderCriteriaFor(attributeName);
OrderDirection ret = new OrderDirection(ob);
QueryRecorder.recordInvocation(this, "BY", ret, QueryRecorder.literal(attributeName));
return ret;
} | java | public OrderDirection BY(String attributeName) {
OrderBy ob = this.orderExpression.getCreateOrderCriteriaFor(attributeName);
OrderDirection ret = new OrderDirection(ob);
QueryRecorder.recordInvocation(this, "BY", ret, QueryRecorder.literal(attributeName));
return ret;
} | [
"public",
"OrderDirection",
"BY",
"(",
"String",
"attributeName",
")",
"{",
"OrderBy",
"ob",
"=",
"this",
".",
"orderExpression",
".",
"getCreateOrderCriteriaFor",
"(",
"attributeName",
")",
";",
"OrderDirection",
"ret",
"=",
"new",
"OrderDirection",
"(",
"ob",
... | Specify the attribute to be used for sorting
@param attributeName
@return | [
"Specify",
"the",
"attribute",
"to",
"be",
"used",
"for",
"sorting"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/api/Order.java#L37-L42 |
101,844 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/facade/JSONDomainFacade.java | JSONDomainFacade.getDomainName | public String getDomainName() {
DomainModel model = ((IIntDomainAccess)this.domainAccess).getInternalDomainAccess().getDomainModel();
StringWriter sw = new StringWriter();
JsonGenerator generator;
if (this.prettyFormat != Format.NONE) {
JsonGeneratorFactory gf = JSONWriter.getPrettyGeneratorFactory();
gen... | java | public String getDomainName() {
DomainModel model = ((IIntDomainAccess)this.domainAccess).getInternalDomainAccess().getDomainModel();
StringWriter sw = new StringWriter();
JsonGenerator generator;
if (this.prettyFormat != Format.NONE) {
JsonGeneratorFactory gf = JSONWriter.getPrettyGeneratorFactory();
gen... | [
"public",
"String",
"getDomainName",
"(",
")",
"{",
"DomainModel",
"model",
"=",
"(",
"(",
"IIntDomainAccess",
")",
"this",
".",
"domainAccess",
")",
".",
"getInternalDomainAccess",
"(",
")",
".",
"getDomainModel",
"(",
")",
";",
"StringWriter",
"sw",
"=",
"... | Answer a JSON object containing the domain name
@return | [
"Answer",
"a",
"JSON",
"object",
"containing",
"the",
"domain",
"name"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/facade/JSONDomainFacade.java#L78-L94 |
101,845 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/graph/Graph.java | Graph.create | public static Graph create(IDBAccess dbAccess) {
ResultHandler rh = new ResultHandler(dbAccess);
Graph ret = rh.getGraph();
ret.setSyncState(SyncState.NEW);
return ret;
} | java | public static Graph create(IDBAccess dbAccess) {
ResultHandler rh = new ResultHandler(dbAccess);
Graph ret = rh.getGraph();
ret.setSyncState(SyncState.NEW);
return ret;
} | [
"public",
"static",
"Graph",
"create",
"(",
"IDBAccess",
"dbAccess",
")",
"{",
"ResultHandler",
"rh",
"=",
"new",
"ResultHandler",
"(",
"dbAccess",
")",
";",
"Graph",
"ret",
"=",
"rh",
".",
"getGraph",
"(",
")",
";",
"ret",
".",
"setSyncState",
"(",
"Syn... | create an empty graph
@param dbAccess the database on which to perform updates of the graph
@return the empty graph model | [
"create",
"an",
"empty",
"graph"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/graph/Graph.java#L45-L50 |
101,846 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/graph/Graph.java | Graph.createRelation | public GrRelation createRelation(String type, GrNode startNode, GrNode endNode) {
return this.resultHandler.getLocalElements().createRelation(type, startNode, endNode);
} | java | public GrRelation createRelation(String type, GrNode startNode, GrNode endNode) {
return this.resultHandler.getLocalElements().createRelation(type, startNode, endNode);
} | [
"public",
"GrRelation",
"createRelation",
"(",
"String",
"type",
",",
"GrNode",
"startNode",
",",
"GrNode",
"endNode",
")",
"{",
"return",
"this",
".",
"resultHandler",
".",
"getLocalElements",
"(",
")",
".",
"createRelation",
"(",
"type",
",",
"startNode",
",... | create a relation in the graph
@param type
@param startNode
@param endNode
@return a GrRelation | [
"create",
"a",
"relation",
"in",
"the",
"graph"
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/graph/Graph.java#L77-L79 |
101,847 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/internal/RecordedQueryPlayer.java | RecordedQueryPlayer.replayQuery | public DomainQuery replayQuery(RecordedQuery recordedQuery, IDomainAccess domainAccess) {
Boolean br_old = null;
DomainQuery query;
try {
if (!Settings.TEST_MODE) {
br_old = QueryRecorder.blockRecording.get();
if (this.createNew)
QueryRecorder.blockRecording.set(Boolean.FALSE);
else
Query... | java | public DomainQuery replayQuery(RecordedQuery recordedQuery, IDomainAccess domainAccess) {
Boolean br_old = null;
DomainQuery query;
try {
if (!Settings.TEST_MODE) {
br_old = QueryRecorder.blockRecording.get();
if (this.createNew)
QueryRecorder.blockRecording.set(Boolean.FALSE);
else
Query... | [
"public",
"DomainQuery",
"replayQuery",
"(",
"RecordedQuery",
"recordedQuery",
",",
"IDomainAccess",
"domainAccess",
")",
"{",
"Boolean",
"br_old",
"=",
"null",
";",
"DomainQuery",
"query",
";",
"try",
"{",
"if",
"(",
"!",
"Settings",
".",
"TEST_MODE",
")",
"{... | Create a domain query from a recorded query.
@param recordedQuery
@param domainAccess
@return | [
"Create",
"a",
"domain",
"query",
"from",
"a",
"recorded",
"query",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/internal/RecordedQueryPlayer.java#L64-L99 |
101,848 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domainquery/internal/RecordedQueryPlayer.java | RecordedQueryPlayer.replayGenericQuery | public GDomainQuery replayGenericQuery(RecordedQuery recordedQuery, IGenericDomainAccess domainAccess) {
Boolean br_old = null;
GDomainQuery query;
try {
if (!Settings.TEST_MODE) {
br_old = QueryRecorder.blockRecording.get();
if (this.createNew)
QueryRecorder.blockRecording.set(Boolean.FALSE);
... | java | public GDomainQuery replayGenericQuery(RecordedQuery recordedQuery, IGenericDomainAccess domainAccess) {
Boolean br_old = null;
GDomainQuery query;
try {
if (!Settings.TEST_MODE) {
br_old = QueryRecorder.blockRecording.get();
if (this.createNew)
QueryRecorder.blockRecording.set(Boolean.FALSE);
... | [
"public",
"GDomainQuery",
"replayGenericQuery",
"(",
"RecordedQuery",
"recordedQuery",
",",
"IGenericDomainAccess",
"domainAccess",
")",
"{",
"Boolean",
"br_old",
"=",
"null",
";",
"GDomainQuery",
"query",
";",
"try",
"{",
"if",
"(",
"!",
"Settings",
".",
"TEST_MO... | Create a generic domain query from a recorded query.
@param recordedQuery
@param domainAccess
@return | [
"Create",
"a",
"generic",
"domain",
"query",
"from",
"a",
"recorded",
"query",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domainquery/internal/RecordedQueryPlayer.java#L107-L133 |
101,849 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/mapping/MappingUtil.java | MappingUtil.fromType | public static JcPrimitive fromType(Class<?> type, String name) {
// TODO what about dates and arrays
if (type.equals(String.class))
return new JcString(name);
else if (type.equals(Number.class))
return new JcNumber(name);
else if (type.equals(Boolean.class))
return new JcBoolean(name);
return null;
... | java | public static JcPrimitive fromType(Class<?> type, String name) {
// TODO what about dates and arrays
if (type.equals(String.class))
return new JcString(name);
else if (type.equals(Number.class))
return new JcNumber(name);
else if (type.equals(Boolean.class))
return new JcBoolean(name);
return null;
... | [
"public",
"static",
"JcPrimitive",
"fromType",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
")",
"{",
"// TODO what about dates and arrays",
"if",
"(",
"type",
".",
"equals",
"(",
"String",
".",
"class",
")",
")",
"return",
"new",
"JcString",
... | Answer an appropriate instance of a JcPrimitive for the given simple-type and name.
E.g. given a type java.lang.String, a JcString instance will be returned.
@param type
@param name
@return | [
"Answer",
"an",
"appropriate",
"instance",
"of",
"a",
"JcPrimitive",
"for",
"the",
"given",
"simple",
"-",
"type",
"and",
"name",
".",
"E",
".",
"g",
".",
"given",
"a",
"type",
"java",
".",
"lang",
".",
"String",
"a",
"JcString",
"instance",
"will",
"b... | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/mapping/MappingUtil.java#L234-L243 |
101,850 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/mapping/MappingUtil.java | MappingUtil.getEnumValues | public static Object[] getEnumValues(Class<? extends Enum<?>> clazz) {
Object[] enums=clazz.getEnumConstants();
if (enums == null) {
Method[] mthds = clazz.getDeclaredMethods();
Method mthd = null;
for (Method mth : mthds) {
if (mth.getName().equals("values")) {
mthd = mth;
break;
}
}
... | java | public static Object[] getEnumValues(Class<? extends Enum<?>> clazz) {
Object[] enums=clazz.getEnumConstants();
if (enums == null) {
Method[] mthds = clazz.getDeclaredMethods();
Method mthd = null;
for (Method mth : mthds) {
if (mth.getName().equals("values")) {
mthd = mth;
break;
}
}
... | [
"public",
"static",
"Object",
"[",
"]",
"getEnumValues",
"(",
"Class",
"<",
"?",
"extends",
"Enum",
"<",
"?",
">",
">",
"clazz",
")",
"{",
"Object",
"[",
"]",
"enums",
"=",
"clazz",
".",
"getEnumConstants",
"(",
")",
";",
"if",
"(",
"enums",
"==",
... | finds enum values in normal enum classes and in dynamically created ones.
@param clazz
@return | [
"finds",
"enum",
"values",
"in",
"normal",
"enum",
"classes",
"and",
"in",
"dynamically",
"created",
"ones",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/mapping/MappingUtil.java#L250-L269 |
101,851 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/genericmodel/DOType.java | DOType.getDeclaredFieldNames | public List<String> getDeclaredFieldNames() {
if (this.declaredFieldNames == null) {
this.declaredFieldNames = new ArrayList<String>(this.declaredFields.size());
for (DOField f : this.declaredFields) {
this.declaredFieldNames.add(f.getName());
}
}
return this.declaredFieldNames;
} | java | public List<String> getDeclaredFieldNames() {
if (this.declaredFieldNames == null) {
this.declaredFieldNames = new ArrayList<String>(this.declaredFields.size());
for (DOField f : this.declaredFields) {
this.declaredFieldNames.add(f.getName());
}
}
return this.declaredFieldNames;
} | [
"public",
"List",
"<",
"String",
">",
"getDeclaredFieldNames",
"(",
")",
"{",
"if",
"(",
"this",
".",
"declaredFieldNames",
"==",
"null",
")",
"{",
"this",
".",
"declaredFieldNames",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"this",
".",
"declaredF... | Answer a list of all field names declared by this type.
@return | [
"Answer",
"a",
"list",
"of",
"all",
"field",
"names",
"declared",
"by",
"this",
"type",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/genericmodel/DOType.java#L100-L108 |
101,852 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/genericmodel/DOType.java | DOType.getFieldNames | public List<String> getFieldNames() {
List<String> ret = new ArrayList<String>();
DOType typ = this;
while(typ != null) {
ret.addAll(typ.getDeclaredFieldNames());
typ = typ.getSuperType();
}
return ret;
} | java | public List<String> getFieldNames() {
List<String> ret = new ArrayList<String>();
DOType typ = this;
while(typ != null) {
ret.addAll(typ.getDeclaredFieldNames());
typ = typ.getSuperType();
}
return ret;
} | [
"public",
"List",
"<",
"String",
">",
"getFieldNames",
"(",
")",
"{",
"List",
"<",
"String",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"DOType",
"typ",
"=",
"this",
";",
"while",
"(",
"typ",
"!=",
"null",
")",
"{",
"... | Answer a list of all field names declared by this type and all it's super types.
@return | [
"Answer",
"a",
"list",
"of",
"all",
"field",
"names",
"declared",
"by",
"this",
"type",
"and",
"all",
"it",
"s",
"super",
"types",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/genericmodel/DOType.java#L114-L122 |
101,853 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/genericmodel/DOType.java | DOType.getEnumValue | public Object getEnumValue(String name) {
if (this.kind != Kind.ENUM)
throw new RuntimeException("getEnumValue(..) can only be called on an enum");
Object[] vals = getEnumValues();
if (vals != null) {
for (Object val : vals) {
if (((Enum<?>)val).name().equals(name))
return val;
}
}
return nu... | java | public Object getEnumValue(String name) {
if (this.kind != Kind.ENUM)
throw new RuntimeException("getEnumValue(..) can only be called on an enum");
Object[] vals = getEnumValues();
if (vals != null) {
for (Object val : vals) {
if (((Enum<?>)val).name().equals(name))
return val;
}
}
return nu... | [
"public",
"Object",
"getEnumValue",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"this",
".",
"kind",
"!=",
"Kind",
".",
"ENUM",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"getEnumValue(..) can only be called on an enum\"",
")",
";",
"Object",
"[",
"]",
"v... | Answer an enum value with the given name.
@param name
@return | [
"Answer",
"an",
"enum",
"value",
"with",
"the",
"given",
"name",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/genericmodel/DOType.java#L182-L193 |
101,854 | Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/domain/genericmodel/DOType.java | DOType.getEnumValues | @SuppressWarnings("unchecked")
public Object[] getEnumValues() {
if (this.kind != Kind.ENUM)
throw new RuntimeException("getEnumValues() can only be called on an enum");
try {
return MappingUtil.getEnumValues((Class<? extends Enum<?>>) getRawType());
} catch (ClassNotFoundException e) {
throw new Runtim... | java | @SuppressWarnings("unchecked")
public Object[] getEnumValues() {
if (this.kind != Kind.ENUM)
throw new RuntimeException("getEnumValues() can only be called on an enum");
try {
return MappingUtil.getEnumValues((Class<? extends Enum<?>>) getRawType());
} catch (ClassNotFoundException e) {
throw new Runtim... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Object",
"[",
"]",
"getEnumValues",
"(",
")",
"{",
"if",
"(",
"this",
".",
"kind",
"!=",
"Kind",
".",
"ENUM",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"getEnumValues() can only be called on an... | Answer the list of enum values of this enum.
@return | [
"Answer",
"the",
"list",
"of",
"enum",
"values",
"of",
"this",
"enum",
"."
] | 0f36914b4d6993a004cc235bb18dd3e02a59d253 | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/domain/genericmodel/DOType.java#L199-L208 |
101,855 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.findInputStreamForResource | @Nullable
public static InputStream findInputStreamForResource(@Nonnull final ZipFile zipFile, @Nonnull final String resourcePath) throws IOException {
final ZipEntry entry = zipFile.getEntry(resourcePath);
InputStream result = null;
if (entry != null && !entry.isDirectory()) {
result = zipFile.ge... | java | @Nullable
public static InputStream findInputStreamForResource(@Nonnull final ZipFile zipFile, @Nonnull final String resourcePath) throws IOException {
final ZipEntry entry = zipFile.getEntry(resourcePath);
InputStream result = null;
if (entry != null && !entry.isDirectory()) {
result = zipFile.ge... | [
"@",
"Nullable",
"public",
"static",
"InputStream",
"findInputStreamForResource",
"(",
"@",
"Nonnull",
"final",
"ZipFile",
"zipFile",
",",
"@",
"Nonnull",
"final",
"String",
"resourcePath",
")",
"throws",
"IOException",
"{",
"final",
"ZipEntry",
"entry",
"=",
"zip... | Get input stream for resource in zip file.
@param zipFile zip file
@param resourcePath path to resource
@return input stream for resource or null if not found or directory
@throws IOException if there is any transport error | [
"Get",
"input",
"stream",
"for",
"resource",
"in",
"zip",
"file",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L99-L110 |
101,856 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.toByteArray | @Nullable
public static byte[] toByteArray(@Nonnull final ZipFile zipFile, @Nonnull final String path) throws IOException {
final InputStream in = findInputStreamForResource(zipFile, path);
byte[] result = null;
if (in != null) {
try {
result = IOUtils.toByteArray(in);
} finally {
... | java | @Nullable
public static byte[] toByteArray(@Nonnull final ZipFile zipFile, @Nonnull final String path) throws IOException {
final InputStream in = findInputStreamForResource(zipFile, path);
byte[] result = null;
if (in != null) {
try {
result = IOUtils.toByteArray(in);
} finally {
... | [
"@",
"Nullable",
"public",
"static",
"byte",
"[",
"]",
"toByteArray",
"(",
"@",
"Nonnull",
"final",
"ZipFile",
"zipFile",
",",
"@",
"Nonnull",
"final",
"String",
"path",
")",
"throws",
"IOException",
"{",
"final",
"InputStream",
"in",
"=",
"findInputStreamForR... | Read who;e zip item into byte array.
@param zipFile zip file
@param path path to resource
@return byte array or null if not found
@throws IOException thrown if there is any transport error | [
"Read",
"who",
";",
"e",
"zip",
"item",
"into",
"byte",
"array",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L120-L135 |
101,857 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.loadXmlDocument | @Nonnull
public static Document loadXmlDocument(@Nonnull final InputStream inStream, @Nullable final String charset, final boolean autoClose) throws SAXException, IOException, ParserConfigurationException {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
factory.setFe... | java | @Nonnull
public static Document loadXmlDocument(@Nonnull final InputStream inStream, @Nullable final String charset, final boolean autoClose) throws SAXException, IOException, ParserConfigurationException {
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
factory.setFe... | [
"@",
"Nonnull",
"public",
"static",
"Document",
"loadXmlDocument",
"(",
"@",
"Nonnull",
"final",
"InputStream",
"inStream",
",",
"@",
"Nullable",
"final",
"String",
"charset",
",",
"final",
"boolean",
"autoClose",
")",
"throws",
"SAXException",
",",
"IOException",... | Load and parse XML document from input stream.
@param inStream stream to read document
@param autoClose true if stream must be closed, false otherwise
@return parsed document
@throws IOException
@throws ParserConfigurationException
@throws SAXException
@since 1.4.0 | [
"Load",
"and",
"parse",
"XML",
"document",
"from",
"input",
"stream",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L160-L199 |
101,858 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.findFirstElement | @Nullable
public static Element findFirstElement(@Nonnull final Element node, @Nonnull final String elementName) {
Element result = null;
for (final Element l : Utils.findDirectChildrenForName(node, elementName)) {
result = l;
break;
}
return result;
} | java | @Nullable
public static Element findFirstElement(@Nonnull final Element node, @Nonnull final String elementName) {
Element result = null;
for (final Element l : Utils.findDirectChildrenForName(node, elementName)) {
result = l;
break;
}
return result;
} | [
"@",
"Nullable",
"public",
"static",
"Element",
"findFirstElement",
"(",
"@",
"Nonnull",
"final",
"Element",
"node",
",",
"@",
"Nonnull",
"final",
"String",
"elementName",
")",
"{",
"Element",
"result",
"=",
"null",
";",
"for",
"(",
"final",
"Element",
"l",
... | Get first direct child for name.
@param node element to find children
@param elementName name of child element
@return found first child or null if not found
@since 1.4.0 | [
"Get",
"first",
"direct",
"child",
"for",
"name",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L209-L217 |
101,859 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.findDirectChildrenForName | @Nonnull
@MustNotContainNull
public static List<Element> findDirectChildrenForName(@Nonnull final Element element, @Nonnull final String childElementname) {
final List<Element> resultList = new ArrayList<Element>();
final NodeList list = element.getChildNodes();
for (int i = 0; i < list.getLength(); i++... | java | @Nonnull
@MustNotContainNull
public static List<Element> findDirectChildrenForName(@Nonnull final Element element, @Nonnull final String childElementname) {
final List<Element> resultList = new ArrayList<Element>();
final NodeList list = element.getChildNodes();
for (int i = 0; i < list.getLength(); i++... | [
"@",
"Nonnull",
"@",
"MustNotContainNull",
"public",
"static",
"List",
"<",
"Element",
">",
"findDirectChildrenForName",
"(",
"@",
"Nonnull",
"final",
"Element",
"element",
",",
"@",
"Nonnull",
"final",
"String",
"childElementname",
")",
"{",
"final",
"List",
"<... | Find all direct children with defined name.
@param element parent element
@param childElementname child element name
@return list of found elements
@since 1.4.0 | [
"Find",
"all",
"direct",
"children",
"with",
"defined",
"name",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L227-L239 |
101,860 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.getMaxImageSize | public static int getMaxImageSize() {
int result = MAX_IMAGE_SIDE_SIZE_IN_PIXELS;
try {
final String defined = System.getProperty(PROPERTY_MAX_EMBEDDED_IMAGE_SIDE_SIZE);
if (defined != null) {
LOGGER.info("Detected redefined max size for embedded image side : " + defined); //NOI18N
r... | java | public static int getMaxImageSize() {
int result = MAX_IMAGE_SIDE_SIZE_IN_PIXELS;
try {
final String defined = System.getProperty(PROPERTY_MAX_EMBEDDED_IMAGE_SIDE_SIZE);
if (defined != null) {
LOGGER.info("Detected redefined max size for embedded image side : " + defined); //NOI18N
r... | [
"public",
"static",
"int",
"getMaxImageSize",
"(",
")",
"{",
"int",
"result",
"=",
"MAX_IMAGE_SIDE_SIZE_IN_PIXELS",
";",
"try",
"{",
"final",
"String",
"defined",
"=",
"System",
".",
"getProperty",
"(",
"PROPERTY_MAX_EMBEDDED_IMAGE_SIDE_SIZE",
")",
";",
"if",
"(",... | Get max image size.
@return max image size
@see #MAX_IMAGE_SIDE_SIZE_IN_PIXELS
@see #PROPERTY_MAX_EMBEDDED_IMAGE_SIDE_SIZE | [
"Get",
"max",
"image",
"size",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L258-L270 |
101,861 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.rescaleImageAndEncodeAsBase64 | @Nullable
public static String rescaleImageAndEncodeAsBase64(@Nonnull final InputStream in, final int maxSize) throws IOException {
final Image image = ImageIO.read(in);
String result = null;
if (image != null) {
result = rescaleImageAndEncodeAsBase64(image, maxSize);
}
return result;
} | java | @Nullable
public static String rescaleImageAndEncodeAsBase64(@Nonnull final InputStream in, final int maxSize) throws IOException {
final Image image = ImageIO.read(in);
String result = null;
if (image != null) {
result = rescaleImageAndEncodeAsBase64(image, maxSize);
}
return result;
} | [
"@",
"Nullable",
"public",
"static",
"String",
"rescaleImageAndEncodeAsBase64",
"(",
"@",
"Nonnull",
"final",
"InputStream",
"in",
",",
"final",
"int",
"maxSize",
")",
"throws",
"IOException",
"{",
"final",
"Image",
"image",
"=",
"ImageIO",
".",
"read",
"(",
"... | Load and encode image into Base64.
@param in stream to read image
@param maxSize max size of image, if less or zero then don't rescale
@return null if it was impossible to load image for its format, loaded
prepared image
@throws IOException if any error during conversion or loading
@since 1.4.0 | [
"Load",
"and",
"encode",
"image",
"into",
"Base64",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L282-L290 |
101,862 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.rescaleImageAndEncodeAsBase64 | @Nonnull
public static String rescaleImageAndEncodeAsBase64(@Nonnull final File file, final int maxSize) throws IOException {
final Image image = ImageIO.read(file);
if (image == null) {
throw new IllegalArgumentException("Can't load image file : " + file); //NOI18N
}
return rescaleImageAndEncod... | java | @Nonnull
public static String rescaleImageAndEncodeAsBase64(@Nonnull final File file, final int maxSize) throws IOException {
final Image image = ImageIO.read(file);
if (image == null) {
throw new IllegalArgumentException("Can't load image file : " + file); //NOI18N
}
return rescaleImageAndEncod... | [
"@",
"Nonnull",
"public",
"static",
"String",
"rescaleImageAndEncodeAsBase64",
"(",
"@",
"Nonnull",
"final",
"File",
"file",
",",
"final",
"int",
"maxSize",
")",
"throws",
"IOException",
"{",
"final",
"Image",
"image",
"=",
"ImageIO",
".",
"read",
"(",
"file",... | Load and encode image into Base64 from file.
@param file image file
@param maxSize max size of image, if less or zero then don't rescale
@return image
@throws IOException if any error during conversion or loading
@since 1.4.0 | [
"Load",
"and",
"encode",
"image",
"into",
"Base64",
"from",
"file",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L301-L308 |
101,863 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java | Utils.getDefaultRenderQialityForOs | @Nonnull
public static RenderQuality getDefaultRenderQialityForOs() {
RenderQuality result = RenderQuality.DEFAULT;
if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_WINDOWS) {
result = RenderQuality.QUALITY;
}
return result;
} | java | @Nonnull
public static RenderQuality getDefaultRenderQialityForOs() {
RenderQuality result = RenderQuality.DEFAULT;
if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_WINDOWS) {
result = RenderQuality.QUALITY;
}
return result;
} | [
"@",
"Nonnull",
"public",
"static",
"RenderQuality",
"getDefaultRenderQialityForOs",
"(",
")",
"{",
"RenderQuality",
"result",
"=",
"RenderQuality",
".",
"DEFAULT",
";",
"if",
"(",
"SystemUtils",
".",
"IS_OS_MAC",
"||",
"SystemUtils",
".",
"IS_OS_WINDOWS",
")",
"{... | Get default render quality for host OS.
@return the render quality for host OS, must not be null
@since 1.4.5 | [
"Get",
"default",
"render",
"quality",
"for",
"host",
"OS",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/Utils.java#L315-L322 |
101,864 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/print/MMDPrintOptions.java | MMDPrintOptions.setScaleType | @Nonnull
public MMDPrintOptions setScaleType(@Nonnull final ScaleType scaleOption) {
this.scaleOption = Assertions.assertNotNull(scaleOption);
return this;
} | java | @Nonnull
public MMDPrintOptions setScaleType(@Nonnull final ScaleType scaleOption) {
this.scaleOption = Assertions.assertNotNull(scaleOption);
return this;
} | [
"@",
"Nonnull",
"public",
"MMDPrintOptions",
"setScaleType",
"(",
"@",
"Nonnull",
"final",
"ScaleType",
"scaleOption",
")",
"{",
"this",
".",
"scaleOption",
"=",
"Assertions",
".",
"assertNotNull",
"(",
"scaleOption",
")",
";",
"return",
"this",
";",
"}"
] | Set the selected scale option.
@param scaleOption option, must not be null
@return this instance | [
"Set",
"the",
"selected",
"scale",
"option",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/print/MMDPrintOptions.java#L130-L134 |
101,865 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java | MindMapPanel.getSessionObject | @Nullable
public <T> T getSessionObject(@Nonnull final String key, @Nonnull final Class<T> klazz, @Nullable final T def) {
this.lock();
try {
T result = klazz.cast(this.sessionObjects.get(key));
return result == null ? def : result;
} finally {
this.unlock();
}
} | java | @Nullable
public <T> T getSessionObject(@Nonnull final String key, @Nonnull final Class<T> klazz, @Nullable final T def) {
this.lock();
try {
T result = klazz.cast(this.sessionObjects.get(key));
return result == null ? def : result;
} finally {
this.unlock();
}
} | [
"@",
"Nullable",
"public",
"<",
"T",
">",
"T",
"getSessionObject",
"(",
"@",
"Nonnull",
"final",
"String",
"key",
",",
"@",
"Nonnull",
"final",
"Class",
"<",
"T",
">",
"klazz",
",",
"@",
"Nullable",
"final",
"T",
"def",
")",
"{",
"this",
".",
"lock",... | Get saved session object. Object is presented and saved only for the
current panel and only in memory.
@param <T> type of object
@param key key of object, must not be null
@param klazz object type, must not be null
@param def default value will be returned as result if object not
presented, can be null
@return null if... | [
"Get",
"saved",
"session",
"object",
".",
"Object",
"is",
"presented",
"and",
"saved",
"only",
"for",
"the",
"current",
"panel",
"and",
"only",
"in",
"memory",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java#L1264-L1273 |
101,866 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java | MindMapPanel.putSessionObject | public void putSessionObject(@Nonnull final String key, @Nullable final Object obj) {
this.lock();
try {
if (obj == null) {
this.sessionObjects.remove(key);
} else {
this.sessionObjects.put(key, obj);
}
} finally {
this.unlock();
}
} | java | public void putSessionObject(@Nonnull final String key, @Nullable final Object obj) {
this.lock();
try {
if (obj == null) {
this.sessionObjects.remove(key);
} else {
this.sessionObjects.put(key, obj);
}
} finally {
this.unlock();
}
} | [
"public",
"void",
"putSessionObject",
"(",
"@",
"Nonnull",
"final",
"String",
"key",
",",
"@",
"Nullable",
"final",
"Object",
"obj",
")",
"{",
"this",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"this",
".",
"s... | Put session object for key.
@param key key of he object, must not be null
@param obj object to be placed, if null then object will be removed
@since 1.4.2 | [
"Put",
"session",
"object",
"for",
"key",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java#L1282-L1293 |
101,867 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java | MindMapPanel.executeModelJobs | public void executeModelJobs(@Nonnull @MustNotContainNull final ModelJob... jobs) {
Utils.safeSwingCall(new Runnable() {
@Override
public void run() {
for (final ModelJob j : jobs) {
try {
if (!j.doChangeModel(model)) {
break;
}
} catch (... | java | public void executeModelJobs(@Nonnull @MustNotContainNull final ModelJob... jobs) {
Utils.safeSwingCall(new Runnable() {
@Override
public void run() {
for (final ModelJob j : jobs) {
try {
if (!j.doChangeModel(model)) {
break;
}
} catch (... | [
"public",
"void",
"executeModelJobs",
"(",
"@",
"Nonnull",
"@",
"MustNotContainNull",
"final",
"ModelJob",
"...",
"jobs",
")",
"{",
"Utils",
".",
"safeSwingCall",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{... | Safe Swing thread execution sequence of some jobs over model with model
changed notification in the end
@param jobs sequence of jobs to be executed
@since 1.3.1 | [
"Safe",
"Swing",
"thread",
"execution",
"sequence",
"of",
"some",
"jobs",
"over",
"model",
"with",
"model",
"changed",
"notification",
"in",
"the",
"end"
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java#L1574-L1590 |
101,868 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java | MindMapPanel.setModel | public void setModel(@Nonnull final MindMap model, final boolean notifyModelChangeListeners) {
this.lock();
try {
if (this.elementUnderEdit != null) {
Utils.safeSwingBlockingCall(new Runnable() {
@Override
public void run() {
endEdit(false);
}
});
... | java | public void setModel(@Nonnull final MindMap model, final boolean notifyModelChangeListeners) {
this.lock();
try {
if (this.elementUnderEdit != null) {
Utils.safeSwingBlockingCall(new Runnable() {
@Override
public void run() {
endEdit(false);
}
});
... | [
"public",
"void",
"setModel",
"(",
"@",
"Nonnull",
"final",
"MindMap",
"model",
",",
"final",
"boolean",
"notifyModelChangeListeners",
")",
"{",
"this",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"this",
".",
"elementUnderEdit",
"!=",
"null",
")",
... | Set model for the panel, allows to notify listeners optionally.
@param model model to be set
@param notifyModelChangeListeners true if to notify model change listeners,
false otherwise
@since 1.3.0 | [
"Set",
"model",
"for",
"the",
"panel",
"allows",
"to",
"notify",
"listeners",
"optionally",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java#L2112-L2160 |
101,869 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java | MindMapPanel.lockIfNotDisposed | public boolean lockIfNotDisposed() {
boolean result = false;
if (this.panelLocker != null) {
this.panelLocker.lock();
if (this.disposed.get()) {
this.panelLocker.unlock();
} else {
result = true;
}
}
return result;
} | java | public boolean lockIfNotDisposed() {
boolean result = false;
if (this.panelLocker != null) {
this.panelLocker.lock();
if (this.disposed.get()) {
this.panelLocker.unlock();
} else {
result = true;
}
}
return result;
} | [
"public",
"boolean",
"lockIfNotDisposed",
"(",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"this",
".",
"panelLocker",
"!=",
"null",
")",
"{",
"this",
".",
"panelLocker",
".",
"lock",
"(",
")",
";",
"if",
"(",
"this",
".",
"disposed",
... | Try lock the panel if it is not disposed.
@return true if the panel is locked successfully, false if the panel has
been disposed. | [
"Try",
"lock",
"the",
"panel",
"if",
"it",
"is",
"not",
"disposed",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java#L2589-L2600 |
101,870 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java | MindMapPanel.lock | @Nonnull
public MindMapPanel lock() {
if (this.panelLocker != null) {
this.panelLocker.lock();
if (this.isDisposed()) {
this.panelLocker.unlock();
throw new IllegalStateException("Mind map has been already disposed!");
}
}
return this;
} | java | @Nonnull
public MindMapPanel lock() {
if (this.panelLocker != null) {
this.panelLocker.lock();
if (this.isDisposed()) {
this.panelLocker.unlock();
throw new IllegalStateException("Mind map has been already disposed!");
}
}
return this;
} | [
"@",
"Nonnull",
"public",
"MindMapPanel",
"lock",
"(",
")",
"{",
"if",
"(",
"this",
".",
"panelLocker",
"!=",
"null",
")",
"{",
"this",
".",
"panelLocker",
".",
"lock",
"(",
")",
";",
"if",
"(",
"this",
".",
"isDisposed",
"(",
")",
")",
"{",
"this"... | Lock the panel.
@return the panel
@throws IllegalStateException it will be thrown if the panel is disposed | [
"Lock",
"the",
"panel",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java#L2608-L2618 |
101,871 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java | MindMapPanel.copyTopicsToClipboard | public boolean copyTopicsToClipboard(final boolean cut, @Nonnull @MustNotContainNull final Topic... topics) {
boolean result = false;
if (this.lockIfNotDisposed()) {
try {
if (topics.length > 0) {
final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
cl... | java | public boolean copyTopicsToClipboard(final boolean cut, @Nonnull @MustNotContainNull final Topic... topics) {
boolean result = false;
if (this.lockIfNotDisposed()) {
try {
if (topics.length > 0) {
final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
cl... | [
"public",
"boolean",
"copyTopicsToClipboard",
"(",
"final",
"boolean",
"cut",
",",
"@",
"Nonnull",
"@",
"MustNotContainNull",
"final",
"Topic",
"...",
"topics",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"this",
".",
"lockIfNotDisposed",
"(",... | Create transferable topic list in system clipboard.
@param cut true shows that remove topics after placing into clipboard
@param topics topics to be placed into clipboard, if there are successors
and ancestors then successors will be removed
@return true if topic array is not empty and operation completed
successfully... | [
"Create",
"transferable",
"topic",
"list",
"in",
"system",
"clipboard",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java#L2647-L2668 |
101,872 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java | MindMapPanel.pasteTopicsFromClipboard | public boolean pasteTopicsFromClipboard() {
boolean result = false;
if (this.lockIfNotDisposed()) {
try {
final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
if (Utils.isDataFlavorAvailable(clipboard, MMDTopicsTransferable.MMD_DATA_FLAVOR)) {
try {
... | java | public boolean pasteTopicsFromClipboard() {
boolean result = false;
if (this.lockIfNotDisposed()) {
try {
final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
if (Utils.isDataFlavorAvailable(clipboard, MMDTopicsTransferable.MMD_DATA_FLAVOR)) {
try {
... | [
"public",
"boolean",
"pasteTopicsFromClipboard",
"(",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"this",
".",
"lockIfNotDisposed",
"(",
")",
")",
"{",
"try",
"{",
"final",
"Clipboard",
"clipboard",
"=",
"Toolkit",
".",
"getDefaultToolkit",
... | Paste topics from clipboard to currently selected ones.
@return true if there detected topic list in clipboard and these topics
added to selected ones, false otherwise
@since 1.3.1 | [
"Paste",
"topics",
"from",
"clipboard",
"to",
"currently",
"selected",
"ones",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java#L2677-L2761 |
101,873 | raydac/netbeans-mmd-plugin | mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/MindMapUtils.java | MindMapUtils.removeSuccessorsAndDuplications | @Nonnull
@MustNotContainNull
public static Topic[] removeSuccessorsAndDuplications(@Nonnull @MustNotContainNull final Topic... topics) {
final List<Topic> result = new ArrayList<Topic>();
for (final Topic t : topics) {
final Iterator<Topic> iterator = result.iterator();
while (iterator.hasNext(... | java | @Nonnull
@MustNotContainNull
public static Topic[] removeSuccessorsAndDuplications(@Nonnull @MustNotContainNull final Topic... topics) {
final List<Topic> result = new ArrayList<Topic>();
for (final Topic t : topics) {
final Iterator<Topic> iterator = result.iterator();
while (iterator.hasNext(... | [
"@",
"Nonnull",
"@",
"MustNotContainNull",
"public",
"static",
"Topic",
"[",
"]",
"removeSuccessorsAndDuplications",
"(",
"@",
"Nonnull",
"@",
"MustNotContainNull",
"final",
"Topic",
"...",
"topics",
")",
"{",
"final",
"List",
"<",
"Topic",
">",
"result",
"=",
... | Remove duplications and successors for presented topics in array.
@param topics array to be processed
@return resulted array
@since 1.3.1 | [
"Remove",
"duplications",
"and",
"successors",
"for",
"presented",
"topics",
"in",
"array",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/utils/MindMapUtils.java#L315-L331 |
101,874 | raydac/netbeans-mmd-plugin | mind-map/mind-map-ide-common/src/main/java/com/igormaznitsa/mindmap/ide/commons/Misc.java | Misc.string2pattern | @Nonnull
public static Pattern string2pattern(@Nonnull final String text, final int patternFlags) {
final StringBuilder result = new StringBuilder();
for (final char c : text.toCharArray()) {
result.append("\\u"); //NOI18N
final String code = Integer.toHexString(c).toUpperCase(Locale.ENGLISH);
... | java | @Nonnull
public static Pattern string2pattern(@Nonnull final String text, final int patternFlags) {
final StringBuilder result = new StringBuilder();
for (final char c : text.toCharArray()) {
result.append("\\u"); //NOI18N
final String code = Integer.toHexString(c).toUpperCase(Locale.ENGLISH);
... | [
"@",
"Nonnull",
"public",
"static",
"Pattern",
"string2pattern",
"(",
"@",
"Nonnull",
"final",
"String",
"text",
",",
"final",
"int",
"patternFlags",
")",
"{",
"final",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"final... | Create pattern from string.
@param text text to be converted into pattern.
@param patternFlags flags to be used
@return formed pattern | [
"Create",
"pattern",
"from",
"string",
"."
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/mind-map-ide-common/src/main/java/com/igormaznitsa/mindmap/ide/commons/Misc.java#L54-L65 |
101,875 | treasure-data/td-logger-java | modules/core/src/main/java/com/treasure_data/logger/TreasureDataLogger.java | TreasureDataLogger.lookupApiKey | private static String lookupApiKey(Properties props) {
String apiKey = null;
// lookup from system property td.logger.api.key. If it exists, writes/updates td.api.key.
if (props.containsKey(Config.TD_LOGGER_API_KEY)) {
apiKey = props.getProperty(Config.TD_LOGGER_API_KEY);
... | java | private static String lookupApiKey(Properties props) {
String apiKey = null;
// lookup from system property td.logger.api.key. If it exists, writes/updates td.api.key.
if (props.containsKey(Config.TD_LOGGER_API_KEY)) {
apiKey = props.getProperty(Config.TD_LOGGER_API_KEY);
... | [
"private",
"static",
"String",
"lookupApiKey",
"(",
"Properties",
"props",
")",
"{",
"String",
"apiKey",
"=",
"null",
";",
"// lookup from system property td.logger.api.key. If it exists, writes/updates td.api.key.",
"if",
"(",
"props",
".",
"containsKey",
"(",
"Config",
... | Define order for API key lookup.
1. lookup props's 'td.logger.api.key' | [
"Define",
"order",
"for",
"API",
"key",
"lookup",
".",
"1",
".",
"lookup",
"props",
"s",
"td",
".",
"logger",
".",
"api",
".",
"key"
] | 11a414b65cc2541fabe24facaef68eb62d4f19e4 | https://github.com/treasure-data/td-logger-java/blob/11a414b65cc2541fabe24facaef68eb62d4f19e4/modules/core/src/main/java/com/treasure_data/logger/TreasureDataLogger.java#L47-L55 |
101,876 | treasure-data/td-logger-java | modules/core/src/main/java/com/treasure_data/logger/TreasureDataLogger.java | TreasureDataLogger.lookupHost | private static String lookupHost(Properties props) {
String host = null;
// 1. lookup system property 'td.logger.api.server.host'
if (props.containsKey(Config.TD_LOGGER_API_SERVER_HOST)) {
host = props.getProperty(Config.TD_LOGGER_API_SERVER_HOST);
}
// if not exist... | java | private static String lookupHost(Properties props) {
String host = null;
// 1. lookup system property 'td.logger.api.server.host'
if (props.containsKey(Config.TD_LOGGER_API_SERVER_HOST)) {
host = props.getProperty(Config.TD_LOGGER_API_SERVER_HOST);
}
// if not exist... | [
"private",
"static",
"String",
"lookupHost",
"(",
"Properties",
"props",
")",
"{",
"String",
"host",
"=",
"null",
";",
"// 1. lookup system property 'td.logger.api.server.host'",
"if",
"(",
"props",
".",
"containsKey",
"(",
"Config",
".",
"TD_LOGGER_API_SERVER_HOST",
... | Define order for hostname lookup.
1. lookup props's td.logger.api.server.host | [
"Define",
"order",
"for",
"hostname",
"lookup",
".",
"1",
".",
"lookup",
"props",
"s",
"td",
".",
"logger",
".",
"api",
".",
"server",
".",
"host"
] | 11a414b65cc2541fabe24facaef68eb62d4f19e4 | https://github.com/treasure-data/td-logger-java/blob/11a414b65cc2541fabe24facaef68eb62d4f19e4/modules/core/src/main/java/com/treasure_data/logger/TreasureDataLogger.java#L61-L77 |
101,877 | treasure-data/td-logger-java | modules/core/src/main/java/com/treasure_data/logger/TreasureDataLogger.java | TreasureDataLogger.lookupPort | private static String lookupPort(Properties props) {
String port = null;
// 1. lookup system property 'td.logger.api.server.port'
if (props.containsKey(Config.TD_LOGGER_API_SERVER_PORT)) {
port = props.getProperty(Config.TD_LOGGER_API_SERVER_PORT);
}
// if not exist... | java | private static String lookupPort(Properties props) {
String port = null;
// 1. lookup system property 'td.logger.api.server.port'
if (props.containsKey(Config.TD_LOGGER_API_SERVER_PORT)) {
port = props.getProperty(Config.TD_LOGGER_API_SERVER_PORT);
}
// if not exist... | [
"private",
"static",
"String",
"lookupPort",
"(",
"Properties",
"props",
")",
"{",
"String",
"port",
"=",
"null",
";",
"// 1. lookup system property 'td.logger.api.server.port'",
"if",
"(",
"props",
".",
"containsKey",
"(",
"Config",
".",
"TD_LOGGER_API_SERVER_PORT",
... | Define order for port num lookup.
1. lookup props's td.logger.api.server.port | [
"Define",
"order",
"for",
"port",
"num",
"lookup",
".",
"1",
".",
"lookup",
"props",
"s",
"td",
".",
"logger",
".",
"api",
".",
"server",
".",
"port"
] | 11a414b65cc2541fabe24facaef68eb62d4f19e4 | https://github.com/treasure-data/td-logger-java/blob/11a414b65cc2541fabe24facaef68eb62d4f19e4/modules/core/src/main/java/com/treasure_data/logger/TreasureDataLogger.java#L98-L114 |
101,878 | treasure-data/td-logger-java | modules/core/src/main/java/com/treasure_data/logger/TreasureDataLogger.java | TreasureDataLogger.lookupScheme | private static String lookupScheme(Properties props) {
String scheme = null;
// 1. lookup system property 'td.logger.api.server.scheme'
if (props.containsKey(Config.TD_LOGGER_API_SERVER_SCHEME)) {
scheme = props.getProperty(Config.TD_LOGGER_API_SERVER_SCHEME);
}
// ... | java | private static String lookupScheme(Properties props) {
String scheme = null;
// 1. lookup system property 'td.logger.api.server.scheme'
if (props.containsKey(Config.TD_LOGGER_API_SERVER_SCHEME)) {
scheme = props.getProperty(Config.TD_LOGGER_API_SERVER_SCHEME);
}
// ... | [
"private",
"static",
"String",
"lookupScheme",
"(",
"Properties",
"props",
")",
"{",
"String",
"scheme",
"=",
"null",
";",
"// 1. lookup system property 'td.logger.api.server.scheme'",
"if",
"(",
"props",
".",
"containsKey",
"(",
"Config",
".",
"TD_LOGGER_API_SERVER_SCH... | Define order for scheme lookup.
1. lookup props's td.logger.api.server.scheme | [
"Define",
"order",
"for",
"scheme",
"lookup",
".",
"1",
".",
"lookup",
"props",
"s",
"td",
".",
"logger",
".",
"api",
".",
"server",
".",
"scheme"
] | 11a414b65cc2541fabe24facaef68eb62d4f19e4 | https://github.com/treasure-data/td-logger-java/blob/11a414b65cc2541fabe24facaef68eb62d4f19e4/modules/core/src/main/java/com/treasure_data/logger/TreasureDataLogger.java#L134-L150 |
101,879 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.newInstance | public static OptionalHeader newInstance(byte[] headerbytes, long offset)
throws IOException {
OptionalHeader header = new OptionalHeader(headerbytes, offset);
header.read();
return header;
} | java | public static OptionalHeader newInstance(byte[] headerbytes, long offset)
throws IOException {
OptionalHeader header = new OptionalHeader(headerbytes, offset);
header.read();
return header;
} | [
"public",
"static",
"OptionalHeader",
"newInstance",
"(",
"byte",
"[",
"]",
"headerbytes",
",",
"long",
"offset",
")",
"throws",
"IOException",
"{",
"OptionalHeader",
"header",
"=",
"new",
"OptionalHeader",
"(",
"headerbytes",
",",
"offset",
")",
";",
"header",
... | Creates and returns a new instance of the optional header.
@param headerbytes
the bytes that make up the optional header
@param offset
the file offset to the beginning of the optional header
@return instance of the optional header
@throws IOException
if headerbytes can not be read | [
"Creates",
"and",
"returns",
"a",
"new",
"instance",
"of",
"the",
"optional",
"header",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L177-L182 |
101,880 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.maybeGetDataDirEntry | public Optional<DataDirEntry> maybeGetDataDirEntry(DataDirectoryKey key) {
return Optional.fromNullable(dataDirectory.get(key));
} | java | public Optional<DataDirEntry> maybeGetDataDirEntry(DataDirectoryKey key) {
return Optional.fromNullable(dataDirectory.get(key));
} | [
"public",
"Optional",
"<",
"DataDirEntry",
">",
"maybeGetDataDirEntry",
"(",
"DataDirectoryKey",
"key",
")",
"{",
"return",
"Optional",
".",
"fromNullable",
"(",
"dataDirectory",
".",
"get",
"(",
"key",
")",
")",
";",
"}"
] | Returns the optional data directory entry for the given key or absent if
entry doesn't exist.
@param key
@return the data directory entry for the given key or absent if entry
doesn't exist. | [
"Returns",
"the",
"optional",
"data",
"directory",
"entry",
"for",
"the",
"given",
"key",
"or",
"absent",
"if",
"entry",
"doesn",
"t",
"exist",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L239-L241 |
101,881 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.maybeGetStandardFieldEntry | public Optional<StandardField> maybeGetStandardFieldEntry(
StandardFieldEntryKey key) {
return Optional.fromNullable(standardFields.get(key));
} | java | public Optional<StandardField> maybeGetStandardFieldEntry(
StandardFieldEntryKey key) {
return Optional.fromNullable(standardFields.get(key));
} | [
"public",
"Optional",
"<",
"StandardField",
">",
"maybeGetStandardFieldEntry",
"(",
"StandardFieldEntryKey",
"key",
")",
"{",
"return",
"Optional",
".",
"fromNullable",
"(",
"standardFields",
".",
"get",
"(",
"key",
")",
")",
";",
"}"
] | Returns maybe the standard field entry for the given key.
If the file is a PE32+, it will not have a base of data field and return
absent for the base of data key.
@param key the key of the standard field
@return the standard field entry for the given key | [
"Returns",
"maybe",
"the",
"standard",
"field",
"entry",
"for",
"the",
"given",
"key",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L272-L275 |
101,882 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.getStandardFieldEntry | public StandardField getStandardFieldEntry(StandardFieldEntryKey key) {
if (!standardFields.containsKey(key)) {
throw new IllegalArgumentException("standard field " + key
+ " does not exist!");
}
return standardFields.get(key);
} | java | public StandardField getStandardFieldEntry(StandardFieldEntryKey key) {
if (!standardFields.containsKey(key)) {
throw new IllegalArgumentException("standard field " + key
+ " does not exist!");
}
return standardFields.get(key);
} | [
"public",
"StandardField",
"getStandardFieldEntry",
"(",
"StandardFieldEntryKey",
"key",
")",
"{",
"if",
"(",
"!",
"standardFields",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"standard field \"",
"+",
"key",
... | Returns the standard field entry for the given key.
@param key the key of the standard field
@return the standard field entry for the given key
@throws IllegalArgumentException if key is base of data for a PE32+ | [
"Returns",
"the",
"standard",
"field",
"entry",
"for",
"the",
"given",
"key",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L284-L290 |
101,883 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.getDataDirInfo | public String getDataDirInfo() {
StringBuilder b = new StringBuilder();
for (DataDirEntry entry : dataDirectory.values()) {
b.append(entry.getKey() + ": " + entry.getVirtualAddress() + "(0x"
+ Long.toHexString(entry.getVirtualAddress()) + ")/"
+ entry.getDirectorySize() + "(0x"
+ Long.toHexString(... | java | public String getDataDirInfo() {
StringBuilder b = new StringBuilder();
for (DataDirEntry entry : dataDirectory.values()) {
b.append(entry.getKey() + ": " + entry.getVirtualAddress() + "(0x"
+ Long.toHexString(entry.getVirtualAddress()) + ")/"
+ entry.getDirectorySize() + "(0x"
+ Long.toHexString(... | [
"public",
"String",
"getDataDirInfo",
"(",
")",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"DataDirEntry",
"entry",
":",
"dataDirectory",
".",
"values",
"(",
")",
")",
"{",
"b",
".",
"append",
"(",
"entry",
".",
... | Returns a description of all data directories.
@return description of all data directories. | [
"Returns",
"a",
"description",
"of",
"all",
"data",
"directories",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L393-L402 |
101,884 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.getWindowsSpecificInfo | public String getWindowsSpecificInfo() {
StringBuilder b = new StringBuilder();
for (StandardField entry : windowsFields.values()) {
long value = entry.getValue();
HeaderKey key = entry.getKey();
String description = entry.getDescription();
if (key.equals(IMAGE_BASE)) {
b.append(description + ": " +... | java | public String getWindowsSpecificInfo() {
StringBuilder b = new StringBuilder();
for (StandardField entry : windowsFields.values()) {
long value = entry.getValue();
HeaderKey key = entry.getKey();
String description = entry.getDescription();
if (key.equals(IMAGE_BASE)) {
b.append(description + ": " +... | [
"public",
"String",
"getWindowsSpecificInfo",
"(",
")",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"StandardField",
"entry",
":",
"windowsFields",
".",
"values",
"(",
")",
")",
"{",
"long",
"value",
"=",
"entry",
"."... | Returns a string with description of the windows specific header fields.
Magic number must be set.
@return string with windows specific fields | [
"Returns",
"a",
"string",
"with",
"description",
"of",
"the",
"windows",
"specific",
"header",
"fields",
".",
"Magic",
"number",
"must",
"be",
"set",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L410-L438 |
101,885 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.getRelocatedImageBase | public long getRelocatedImageBase() {
long imageBase = get(WindowsEntryKey.IMAGE_BASE);
long sizeOfImage = get(WindowsEntryKey.SIZE_OF_IMAGE);
if (imageBase + sizeOfImage >= 0x80000000L || imageBase == 0L) {
return 0x10000L;
}
return imageBase;
} | java | public long getRelocatedImageBase() {
long imageBase = get(WindowsEntryKey.IMAGE_BASE);
long sizeOfImage = get(WindowsEntryKey.SIZE_OF_IMAGE);
if (imageBase + sizeOfImage >= 0x80000000L || imageBase == 0L) {
return 0x10000L;
}
return imageBase;
} | [
"public",
"long",
"getRelocatedImageBase",
"(",
")",
"{",
"long",
"imageBase",
"=",
"get",
"(",
"WindowsEntryKey",
".",
"IMAGE_BASE",
")",
";",
"long",
"sizeOfImage",
"=",
"get",
"(",
"WindowsEntryKey",
".",
"SIZE_OF_IMAGE",
")",
";",
"if",
"(",
"imageBase",
... | Checks if image base is too large or zero and relocates it accordingly.
Otherwise the usual image base is returned.
see: @see <a
href="https://code.google.com/p/corkami/wiki/PE#ImageBase">corkami</a>
@return relocated image base | [
"Checks",
"if",
"image",
"base",
"is",
"too",
"large",
"or",
"zero",
"and",
"relocates",
"it",
"accordingly",
".",
"Otherwise",
"the",
"usual",
"image",
"base",
"is",
"returned",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L525-L532 |
101,886 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.getDllCharacteristics | public List<DllCharacteristic> getDllCharacteristics() {
long value = get(DLL_CHARACTERISTICS);
List<DllCharacteristic> dllChs = DllCharacteristic.getAllFor(value);
return dllChs;
} | java | public List<DllCharacteristic> getDllCharacteristics() {
long value = get(DLL_CHARACTERISTICS);
List<DllCharacteristic> dllChs = DllCharacteristic.getAllFor(value);
return dllChs;
} | [
"public",
"List",
"<",
"DllCharacteristic",
">",
"getDllCharacteristics",
"(",
")",
"{",
"long",
"value",
"=",
"get",
"(",
"DLL_CHARACTERISTICS",
")",
";",
"List",
"<",
"DllCharacteristic",
">",
"dllChs",
"=",
"DllCharacteristic",
".",
"getAllFor",
"(",
"value",... | Returns a list of the DllCharacteristics that are set in the file.
@return list of DllCharacteristics | [
"Returns",
"a",
"list",
"of",
"the",
"DllCharacteristics",
"that",
"are",
"set",
"in",
"the",
"file",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L539-L543 |
101,887 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.getAdjustedFileAlignment | public long getAdjustedFileAlignment() {
long fileAlign = get(FILE_ALIGNMENT);
if (isLowAlignmentMode()) {
return 1;
}
if (fileAlign < 512) { // TODO correct?
fileAlign = 512;
}
// TODO what happens for too big alignment?
// TODO this is just a test, verify
if (fileAlign % 512 != 0) {
long rest... | java | public long getAdjustedFileAlignment() {
long fileAlign = get(FILE_ALIGNMENT);
if (isLowAlignmentMode()) {
return 1;
}
if (fileAlign < 512) { // TODO correct?
fileAlign = 512;
}
// TODO what happens for too big alignment?
// TODO this is just a test, verify
if (fileAlign % 512 != 0) {
long rest... | [
"public",
"long",
"getAdjustedFileAlignment",
"(",
")",
"{",
"long",
"fileAlign",
"=",
"get",
"(",
"FILE_ALIGNMENT",
")",
";",
"if",
"(",
"isLowAlignmentMode",
"(",
")",
")",
"{",
"return",
"1",
";",
"}",
"if",
"(",
"fileAlign",
"<",
"512",
")",
"{",
"... | Adjusts the file alignment to low alignment mode if necessary.
@return 1 if low alignment mode, file alignment value otherwise | [
"Adjusts",
"the",
"file",
"alignment",
"to",
"low",
"alignment",
"mode",
"if",
"necessary",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L593-L608 |
101,888 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.isLowAlignmentMode | public boolean isLowAlignmentMode() {
long fileAlign = get(FILE_ALIGNMENT);
long sectionAlign = get(SECTION_ALIGNMENT);
return 1 <= fileAlign && fileAlign == sectionAlign
&& fileAlign <= 0x800;
} | java | public boolean isLowAlignmentMode() {
long fileAlign = get(FILE_ALIGNMENT);
long sectionAlign = get(SECTION_ALIGNMENT);
return 1 <= fileAlign && fileAlign == sectionAlign
&& fileAlign <= 0x800;
} | [
"public",
"boolean",
"isLowAlignmentMode",
"(",
")",
"{",
"long",
"fileAlign",
"=",
"get",
"(",
"FILE_ALIGNMENT",
")",
";",
"long",
"sectionAlign",
"=",
"get",
"(",
"SECTION_ALIGNMENT",
")",
";",
"return",
"1",
"<=",
"fileAlign",
"&&",
"fileAlign",
"==",
"se... | Determines if the file is in low alignment mode.
@see <a
href="https://code.google.com/p/corkami/wiki/PE#SectionAlignment_/_FileAlignment">corkami
Wiki PE</a>
@return true iff file is in low alignment mode | [
"Determines",
"if",
"the",
"file",
"is",
"in",
"low",
"alignment",
"mode",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L618-L623 |
101,889 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java | OptionalHeader.isStandardAlignmentMode | public boolean isStandardAlignmentMode() {
long fileAlign = get(FILE_ALIGNMENT);
long sectionAlign = get(SECTION_ALIGNMENT);
return 0x200 <= fileAlign && fileAlign <= sectionAlign
&& 0x1000 <= sectionAlign;
} | java | public boolean isStandardAlignmentMode() {
long fileAlign = get(FILE_ALIGNMENT);
long sectionAlign = get(SECTION_ALIGNMENT);
return 0x200 <= fileAlign && fileAlign <= sectionAlign
&& 0x1000 <= sectionAlign;
} | [
"public",
"boolean",
"isStandardAlignmentMode",
"(",
")",
"{",
"long",
"fileAlign",
"=",
"get",
"(",
"FILE_ALIGNMENT",
")",
";",
"long",
"sectionAlign",
"=",
"get",
"(",
"SECTION_ALIGNMENT",
")",
";",
"return",
"0x200",
"<=",
"fileAlign",
"&&",
"fileAlign",
"<... | Determines if the file is in standard alignment mode.
@see <a
href="https://code.google.com/p/corkami/wiki/PE#SectionAlignment_/_FileAlignment">corkami
Wiki PE</a>
@return true iff file is in standard alignment mode | [
"Determines",
"if",
"the",
"file",
"is",
"in",
"standard",
"alignment",
"mode",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/optheader/OptionalHeader.java#L633-L638 |
101,890 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/coffheader/COFFFileHeader.java | COFFFileHeader.read | private void read() {
// define the specification format
final int key = 0;
final int description = 1;
final int offset = 2;
final int length = 3;
SpecificationFormat format = new SpecificationFormat(key, description,
offset, length);
// read the h... | java | private void read() {
// define the specification format
final int key = 0;
final int description = 1;
final int offset = 2;
final int length = 3;
SpecificationFormat format = new SpecificationFormat(key, description,
offset, length);
// read the h... | [
"private",
"void",
"read",
"(",
")",
"{",
"// define the specification format",
"final",
"int",
"key",
"=",
"0",
";",
"final",
"int",
"description",
"=",
"1",
";",
"final",
"int",
"offset",
"=",
"2",
";",
"final",
"int",
"length",
"=",
"3",
";",
"Specifi... | Reads the header's fields. | [
"Reads",
"the",
"header",
"s",
"fields",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/coffheader/COFFFileHeader.java#L87-L102 |
101,891 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/coffheader/COFFFileHeader.java | COFFFileHeader.getMachineType | public MachineType getMachineType() {
long value = get(MACHINE);
try {
return MachineType.getForValue(value);
} catch (IllegalArgumentException e) {
logger.error("Unable to resolve machine type for value: " + value);
return MachineType.UNKNOWN;
}
} | java | public MachineType getMachineType() {
long value = get(MACHINE);
try {
return MachineType.getForValue(value);
} catch (IllegalArgumentException e) {
logger.error("Unable to resolve machine type for value: " + value);
return MachineType.UNKNOWN;
}
} | [
"public",
"MachineType",
"getMachineType",
"(",
")",
"{",
"long",
"value",
"=",
"get",
"(",
"MACHINE",
")",
";",
"try",
"{",
"return",
"MachineType",
".",
"getForValue",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
")",
"{",
... | Returns the enum that denotes the machine type.
@return MachineType | [
"Returns",
"the",
"enum",
"that",
"denotes",
"the",
"machine",
"type",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/coffheader/COFFFileHeader.java#L220-L228 |
101,892 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/coffheader/COFFFileHeader.java | COFFFileHeader.newInstance | public static COFFFileHeader newInstance(byte[] headerbytes, long offset) {
COFFFileHeader header = new COFFFileHeader(headerbytes, offset);
header.read();
return header;
} | java | public static COFFFileHeader newInstance(byte[] headerbytes, long offset) {
COFFFileHeader header = new COFFFileHeader(headerbytes, offset);
header.read();
return header;
} | [
"public",
"static",
"COFFFileHeader",
"newInstance",
"(",
"byte",
"[",
"]",
"headerbytes",
",",
"long",
"offset",
")",
"{",
"COFFFileHeader",
"header",
"=",
"new",
"COFFFileHeader",
"(",
"headerbytes",
",",
"offset",
")",
";",
"header",
".",
"read",
"(",
")"... | Creates an instance of the COFF File Header based on headerbytes and
offset.
@param headerbytes
the bytes that make up the COFF File Header
@param offset
the file offset to the beginning of the header
@return COFFFileHeader instance | [
"Creates",
"an",
"instance",
"of",
"the",
"COFF",
"File",
"Header",
"based",
"on",
"headerbytes",
"and",
"offset",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/coffheader/COFFFileHeader.java#L280-L284 |
101,893 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/sections/PESection.java | PESection.getBytes | public byte[] getBytes() throws IOException {
if (sectionbytes.isPresent()) {
return sectionbytes.get().clone();
}
loadSectionBytes();
byte[] result = sectionbytes.get();
assert result != null;
return result;
} | java | public byte[] getBytes() throws IOException {
if (sectionbytes.isPresent()) {
return sectionbytes.get().clone();
}
loadSectionBytes();
byte[] result = sectionbytes.get();
assert result != null;
return result;
} | [
"public",
"byte",
"[",
"]",
"getBytes",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"sectionbytes",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
"sectionbytes",
".",
"get",
"(",
")",
".",
"clone",
"(",
")",
";",
"}",
"loadSectionBytes",
"(",
... | Returns the section bytes. The file is read if the bytes aren't
already loaded.
@return bytes of the section
@throws IOException
if file can not be read
@throws IllegalStateException
if section is too large to fit into a byte array. This
happens if the size is larger than int can hold. | [
"Returns",
"the",
"section",
"bytes",
".",
"The",
"file",
"is",
"read",
"if",
"the",
"bytes",
"aren",
"t",
"already",
"loaded",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/sections/PESection.java#L126-L134 |
101,894 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/sections/PESection.java | PESection.loadSectionBytes | private void loadSectionBytes() throws IOException {
Preconditions.checkState(size == (int) size,
"section is too large to dump into byte array");
try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
raf.seek(offset);
byte[] bytes = new byte[(int) size];... | java | private void loadSectionBytes() throws IOException {
Preconditions.checkState(size == (int) size,
"section is too large to dump into byte array");
try (RandomAccessFile raf = new RandomAccessFile(file, "r")) {
raf.seek(offset);
byte[] bytes = new byte[(int) size];... | [
"private",
"void",
"loadSectionBytes",
"(",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkState",
"(",
"size",
"==",
"(",
"int",
")",
"size",
",",
"\"section is too large to dump into byte array\"",
")",
";",
"try",
"(",
"RandomAccessFile",
"raf",
... | Loads the section bytes from the file using offset and size.
@throws IOException
if file can not be read
@throws IllegalStateException
if section is too large to fit into a byte array. This
happens if the size is larger than int can hold. | [
"Loads",
"the",
"section",
"bytes",
"from",
"the",
"file",
"using",
"offset",
"and",
"size",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/sections/PESection.java#L145-L154 |
101,895 | katjahahn/PortEx | src/main/java/com/github/katjahahn/tools/visualizer/VisualizerBuilder.java | VisualizerBuilder.setColor | public VisualizerBuilder setColor(ColorableItem key, Color color) {
settings.colorMap.put(key, color);
return this;
} | java | public VisualizerBuilder setColor(ColorableItem key, Color color) {
settings.colorMap.put(key, color);
return this;
} | [
"public",
"VisualizerBuilder",
"setColor",
"(",
"ColorableItem",
"key",
",",
"Color",
"color",
")",
"{",
"settings",
".",
"colorMap",
".",
"put",
"(",
"key",
",",
"color",
")",
";",
"return",
"this",
";",
"}"
] | Sets the color for a colorable item.
@param key
the item to be colored
@param color
the color of the item
@return this VisualizerBuilder | [
"Sets",
"the",
"color",
"for",
"a",
"colorable",
"item",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/tools/visualizer/VisualizerBuilder.java#L175-L178 |
101,896 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/IOUtil.java | IOUtil.dumpLocationToFile | public static void dumpLocationToFile(PhysicalLocation loc, File inFile,
File outFile) throws IOException {
Preconditions.checkArgument(!outFile.exists());
Preconditions.checkArgument(inFile.exists(), inFile.isFile());
final int BUFFER_SIZE = 2048;
try (RandomAccessFile raf = new RandomAccessFile(inFile, "... | java | public static void dumpLocationToFile(PhysicalLocation loc, File inFile,
File outFile) throws IOException {
Preconditions.checkArgument(!outFile.exists());
Preconditions.checkArgument(inFile.exists(), inFile.isFile());
final int BUFFER_SIZE = 2048;
try (RandomAccessFile raf = new RandomAccessFile(inFile, "... | [
"public",
"static",
"void",
"dumpLocationToFile",
"(",
"PhysicalLocation",
"loc",
",",
"File",
"inFile",
",",
"File",
"outFile",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"outFile",
".",
"exists",
"(",
")",
")",
";",
... | Dumps the given part of the inFile to outFile. The part to dump is
represented by loc. This will read safely from inFile which means
locations outside of inFile are written as zero bytes to outFile.
outFile must not exist yet.
inFile must exist and must not be a directory.
@param loc
@param file
@throws IOException | [
"Dumps",
"the",
"given",
"part",
"of",
"the",
"inFile",
"to",
"outFile",
".",
"The",
"part",
"to",
"dump",
"is",
"represented",
"by",
"loc",
".",
"This",
"will",
"read",
"safely",
"from",
"inFile",
"which",
"means",
"locations",
"outside",
"of",
"inFile",
... | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/IOUtil.java#L91-L115 |
101,897 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/IOUtil.java | IOUtil.loadBytesSafely | public static byte[] loadBytesSafely(long offset, int length,
RandomAccessFile raf) throws IOException {
Preconditions.checkArgument(length >= 0);
if (offset < 0)
return new byte[0];
raf.seek(offset);
int readsize = length;
if (readsize + offset > raf.length()) {
readsize = (int) (raf.length() - offs... | java | public static byte[] loadBytesSafely(long offset, int length,
RandomAccessFile raf) throws IOException {
Preconditions.checkArgument(length >= 0);
if (offset < 0)
return new byte[0];
raf.seek(offset);
int readsize = length;
if (readsize + offset > raf.length()) {
readsize = (int) (raf.length() - offs... | [
"public",
"static",
"byte",
"[",
"]",
"loadBytesSafely",
"(",
"long",
"offset",
",",
"int",
"length",
",",
"RandomAccessFile",
"raf",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"length",
">=",
"0",
")",
";",
"if",
"(",
"... | Loads the bytes at the offset into a byte array with the given length
using the raf. If EOF, the byte array is zero padded. If offset < 0 it
will return a zero sized array.
@param offset
to seek
@param length
of the byte array, equals number of bytes read
@param raf
the random access file
@return byte array
@throws IO... | [
"Loads",
"the",
"bytes",
"at",
"the",
"offset",
"into",
"a",
"byte",
"array",
"with",
"the",
"given",
"length",
"using",
"the",
"raf",
".",
"If",
"EOF",
"the",
"byte",
"array",
"is",
"zero",
"padded",
".",
"If",
"offset",
"<",
"0",
"it",
"will",
"ret... | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/IOUtil.java#L132-L150 |
101,898 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/IOUtil.java | IOUtil.padBytes | private static byte[] padBytes(byte[] bytes, int length) {
byte[] padded = new byte[length];
for (int i = 0; i < bytes.length; i++) {
padded[i] = bytes[i];
}
return padded;
} | java | private static byte[] padBytes(byte[] bytes, int length) {
byte[] padded = new byte[length];
for (int i = 0; i < bytes.length; i++) {
padded[i] = bytes[i];
}
return padded;
} | [
"private",
"static",
"byte",
"[",
"]",
"padBytes",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"length",
")",
"{",
"byte",
"[",
"]",
"padded",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"bytes"... | Return array with length size, if length is greater than the previous
size, the array is zero-padded at the end.
@param bytes
@param length
@return zero-padded array with length size | [
"Return",
"array",
"with",
"length",
"size",
"if",
"length",
"is",
"greater",
"than",
"the",
"previous",
"size",
"the",
"array",
"is",
"zero",
"-",
"padded",
"at",
"the",
"end",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/IOUtil.java#L160-L166 |
101,899 | katjahahn/PortEx | src/main/java/com/github/katjahahn/parser/IOUtil.java | IOUtil.loadBytes | public static byte[] loadBytes(long offset, int length, RandomAccessFile raf)
throws IOException {
if (length < 0) {
length = 0;
logger.error("Negative length: " + length);
}
if (offset < 0) {
offset = 0;
logger.error("Negative offset: " + offset);
}
// stay within file bounds
offset = Math.m... | java | public static byte[] loadBytes(long offset, int length, RandomAccessFile raf)
throws IOException {
if (length < 0) {
length = 0;
logger.error("Negative length: " + length);
}
if (offset < 0) {
offset = 0;
logger.error("Negative offset: " + offset);
}
// stay within file bounds
offset = Math.m... | [
"public",
"static",
"byte",
"[",
"]",
"loadBytes",
"(",
"long",
"offset",
",",
"int",
"length",
",",
"RandomAccessFile",
"raf",
")",
"throws",
"IOException",
"{",
"if",
"(",
"length",
"<",
"0",
")",
"{",
"length",
"=",
"0",
";",
"logger",
".",
"error",... | Loads the bytes at the offset into a byte array with the given length
using the raf.
@param offset
to seek
@param length
of the byte array, equals number of bytes read
@param raf
the random access file
@return byte array
@throws IOException
if unable to read the bytes | [
"Loads",
"the",
"bytes",
"at",
"the",
"offset",
"into",
"a",
"byte",
"array",
"with",
"the",
"given",
"length",
"using",
"the",
"raf",
"."
] | 319f08560aa58e3d5d7abe346ffdf623d6dc6990 | https://github.com/katjahahn/PortEx/blob/319f08560aa58e3d5d7abe346ffdf623d6dc6990/src/main/java/com/github/katjahahn/parser/IOUtil.java#L182-L200 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.