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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
141,500 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/RootVisitor.java | RootVisitor.visit | @Override
public void visit(final Root root) {
final Map<String, GedObject> objectMap = root.getObjects();
final Collection<GedObject> objects = objectMap.values();
for (final GedObject gob : objects) {
gob.accept(this);
}
} | java | @Override
public void visit(final Root root) {
final Map<String, GedObject> objectMap = root.getObjects();
final Collection<GedObject> objects = objectMap.values();
for (final GedObject gob : objects) {
gob.accept(this);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"final",
"Root",
"root",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"GedObject",
">",
"objectMap",
"=",
"root",
".",
"getObjects",
"(",
")",
";",
"final",
"Collection",
"<",
"GedObject",
">",
"objects",
"=",
"objectMap",
".",
"values",
"(",
")",
";",
"for",
"(",
"final",
"GedObject",
"gob",
":",
"objects",
")",
"{",
"gob",
".",
"accept",
"(",
"this",
")",
";",
"}",
"}"
] | Visit the Root. From here we will look through the top level objects for
Persons.
@see GedObjectVisitor#visit(Root) | [
"Visit",
"the",
"Root",
".",
"From",
"here",
"we",
"will",
"look",
"through",
"the",
"top",
"level",
"objects",
"for",
"Persons",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/RootVisitor.java#L64-L71 |
141,501 | dickschoeller/gedbrowser | gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/datamodel/ApiObject.java | ApiObject.isType | public boolean isType(final String t) {
final String dt = decode(t);
if (dt.equals(getType())) {
return true;
}
return "attribute".equals(getType())
&& dt.equalsIgnoreCase(getString());
} | java | public boolean isType(final String t) {
final String dt = decode(t);
if (dt.equals(getType())) {
return true;
}
return "attribute".equals(getType())
&& dt.equalsIgnoreCase(getString());
} | [
"public",
"boolean",
"isType",
"(",
"final",
"String",
"t",
")",
"{",
"final",
"String",
"dt",
"=",
"decode",
"(",
"t",
")",
";",
"if",
"(",
"dt",
".",
"equals",
"(",
"getType",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"\"attribute\"",
".",
"equals",
"(",
"getType",
"(",
")",
")",
"&&",
"dt",
".",
"equalsIgnoreCase",
"(",
"getString",
"(",
")",
")",
";",
"}"
] | Check this object against a sought after type string.
@param t type we want to match
@return true if this object matches | [
"Check",
"this",
"object",
"against",
"a",
"sought",
"after",
"type",
"string",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/datamodel/ApiObject.java#L116-L123 |
141,502 | dickschoeller/gedbrowser | gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/users/UsersWriter.java | UsersWriter.write | public void write() {
logger.info("writing " + users.size() + " users in " + userfilename);
try {
Backup.backup(userfilename);
} catch (IOException e) {
logger.error("Problem backing up old copy of user file", e);
}
try (FileOutputStream fstream = new FileOutputStream(userfilename);
BufferedOutputStream bstream = new BufferedOutputStream(
fstream)) {
writeTheLines(bstream);
} catch (IOException e) {
logger.error("Problem writing user file", e);
}
} | java | public void write() {
logger.info("writing " + users.size() + " users in " + userfilename);
try {
Backup.backup(userfilename);
} catch (IOException e) {
logger.error("Problem backing up old copy of user file", e);
}
try (FileOutputStream fstream = new FileOutputStream(userfilename);
BufferedOutputStream bstream = new BufferedOutputStream(
fstream)) {
writeTheLines(bstream);
} catch (IOException e) {
logger.error("Problem writing user file", e);
}
} | [
"public",
"void",
"write",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"writing \"",
"+",
"users",
".",
"size",
"(",
")",
"+",
"\" users in \"",
"+",
"userfilename",
")",
";",
"try",
"{",
"Backup",
".",
"backup",
"(",
"userfilename",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"logger",
".",
"error",
"(",
"\"Problem backing up old copy of user file\"",
",",
"e",
")",
";",
"}",
"try",
"(",
"FileOutputStream",
"fstream",
"=",
"new",
"FileOutputStream",
"(",
"userfilename",
")",
";",
"BufferedOutputStream",
"bstream",
"=",
"new",
"BufferedOutputStream",
"(",
"fstream",
")",
")",
"{",
"writeTheLines",
"(",
"bstream",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"logger",
".",
"error",
"(",
"\"Problem writing user file\"",
",",
"e",
")",
";",
"}",
"}"
] | Write the users file. | [
"Write",
"the",
"users",
"file",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/users/UsersWriter.java#L41-L55 |
141,503 | dickschoeller/gedbrowser | gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/users/UsersWriter.java | UsersWriter.appendUserInfoFields | private void appendUserInfoFields(final StringBuilder builder,
final User user) {
append(builder, user.getUsername(), ",");
append(builder, user.getFirstname(), ",");
append(builder, user.getLastname(), ",");
append(builder, user.getEmail(), ",");
append(builder, user.getPassword(), "");
} | java | private void appendUserInfoFields(final StringBuilder builder,
final User user) {
append(builder, user.getUsername(), ",");
append(builder, user.getFirstname(), ",");
append(builder, user.getLastname(), ",");
append(builder, user.getEmail(), ",");
append(builder, user.getPassword(), "");
} | [
"private",
"void",
"appendUserInfoFields",
"(",
"final",
"StringBuilder",
"builder",
",",
"final",
"User",
"user",
")",
"{",
"append",
"(",
"builder",
",",
"user",
".",
"getUsername",
"(",
")",
",",
"\",\"",
")",
";",
"append",
"(",
"builder",
",",
"user",
".",
"getFirstname",
"(",
")",
",",
"\",\"",
")",
";",
"append",
"(",
"builder",
",",
"user",
".",
"getLastname",
"(",
")",
",",
"\",\"",
")",
";",
"append",
"(",
"builder",
",",
"user",
".",
"getEmail",
"(",
")",
",",
"\",\"",
")",
";",
"append",
"(",
"builder",
",",
"user",
".",
"getPassword",
"(",
")",
",",
"\"\"",
")",
";",
"}"
] | Append the core fields of the user to the string.
@param builder the string builder
@param user the user whose core fields we'll add to the string | [
"Append",
"the",
"core",
"fields",
"of",
"the",
"user",
"to",
"the",
"string",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/users/UsersWriter.java#L92-L99 |
141,504 | dickschoeller/gedbrowser | gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/users/UsersWriter.java | UsersWriter.append | private void append(final StringBuilder builder, final String string,
final String separator) {
if (string != null) {
builder.append(string);
}
builder.append(separator);
} | java | private void append(final StringBuilder builder, final String string,
final String separator) {
if (string != null) {
builder.append(string);
}
builder.append(separator);
} | [
"private",
"void",
"append",
"(",
"final",
"StringBuilder",
"builder",
",",
"final",
"String",
"string",
",",
"final",
"String",
"separator",
")",
"{",
"if",
"(",
"string",
"!=",
"null",
")",
"{",
"builder",
".",
"append",
"(",
"string",
")",
";",
"}",
"builder",
".",
"append",
"(",
"separator",
")",
";",
"}"
] | Append a token and separator to the builder.
@param builder the builder
@param string the token
@param separator the separator | [
"Append",
"a",
"token",
"and",
"separator",
"to",
"the",
"builder",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/users/UsersWriter.java#L108-L114 |
141,505 | dickschoeller/gedbrowser | gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/users/UsersWriter.java | UsersWriter.appendRoles | private void appendRoles(final StringBuilder builder, final User user) {
for (final UserRoleName role : user.getRoles()) {
append(builder, ",", role.name());
}
} | java | private void appendRoles(final StringBuilder builder, final User user) {
for (final UserRoleName role : user.getRoles()) {
append(builder, ",", role.name());
}
} | [
"private",
"void",
"appendRoles",
"(",
"final",
"StringBuilder",
"builder",
",",
"final",
"User",
"user",
")",
"{",
"for",
"(",
"final",
"UserRoleName",
"role",
":",
"user",
".",
"getRoles",
"(",
")",
")",
"{",
"append",
"(",
"builder",
",",
"\",\"",
",",
"role",
".",
"name",
"(",
")",
")",
";",
"}",
"}"
] | Append roles to the builder.
@param builder the builder
@param user the user whose roles are appended | [
"Append",
"roles",
"to",
"the",
"builder",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/users/UsersWriter.java#L122-L126 |
141,506 | dickschoeller/gedbrowser | gedbrowser-mongo-dao/src/main/java/org/schoellerfamily/gedbrowser/persistence/mongo/loader/GedDocumentFileLoader.java | GedDocumentFileLoader.save | private RootDocument save(final Root root) {
final RootDocumentMongo rootdoc =
(RootDocumentMongo) toDocConverter.createGedDocument(root);
try {
repositoryManager.getRootDocumentRepository().save(rootdoc);
} catch (DataAccessException e) {
logger.error("Could not save root: " + root.getDbName(), e);
return null;
}
return rootdoc;
} | java | private RootDocument save(final Root root) {
final RootDocumentMongo rootdoc =
(RootDocumentMongo) toDocConverter.createGedDocument(root);
try {
repositoryManager.getRootDocumentRepository().save(rootdoc);
} catch (DataAccessException e) {
logger.error("Could not save root: " + root.getDbName(), e);
return null;
}
return rootdoc;
} | [
"private",
"RootDocument",
"save",
"(",
"final",
"Root",
"root",
")",
"{",
"final",
"RootDocumentMongo",
"rootdoc",
"=",
"(",
"RootDocumentMongo",
")",
"toDocConverter",
".",
"createGedDocument",
"(",
"root",
")",
";",
"try",
"{",
"repositoryManager",
".",
"getRootDocumentRepository",
"(",
")",
".",
"save",
"(",
"rootdoc",
")",
";",
"}",
"catch",
"(",
"DataAccessException",
"e",
")",
"{",
"logger",
".",
"error",
"(",
"\"Could not save root: \"",
"+",
"root",
".",
"getDbName",
"(",
")",
",",
"e",
")",
";",
"return",
"null",
";",
"}",
"return",
"rootdoc",
";",
"}"
] | Save the root to the database.
@param root the root GED object
@return the root document | [
"Save",
"the",
"root",
"to",
"the",
"database",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-mongo-dao/src/main/java/org/schoellerfamily/gedbrowser/persistence/mongo/loader/GedDocumentFileLoader.java#L141-L151 |
141,507 | dickschoeller/gedbrowser | gedbrowser-mongo-dao/src/main/java/org/schoellerfamily/gedbrowser/persistence/mongo/loader/GedDocumentFileLoader.java | GedDocumentFileLoader.reloadAll | public final void reloadAll() {
final List<String> list = new ArrayList<>();
for (final RootDocument mongo : repositoryManager
.getRootDocumentRepository().findAll()) {
list.add(mongo.getDbName());
}
reset();
for (final String dbname : list) {
loadDocument(dbname);
}
} | java | public final void reloadAll() {
final List<String> list = new ArrayList<>();
for (final RootDocument mongo : repositoryManager
.getRootDocumentRepository().findAll()) {
list.add(mongo.getDbName());
}
reset();
for (final String dbname : list) {
loadDocument(dbname);
}
} | [
"public",
"final",
"void",
"reloadAll",
"(",
")",
"{",
"final",
"List",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"RootDocument",
"mongo",
":",
"repositoryManager",
".",
"getRootDocumentRepository",
"(",
")",
".",
"findAll",
"(",
")",
")",
"{",
"list",
".",
"add",
"(",
"mongo",
".",
"getDbName",
"(",
")",
")",
";",
"}",
"reset",
"(",
")",
";",
"for",
"(",
"final",
"String",
"dbname",
":",
"list",
")",
"{",
"loadDocument",
"(",
"dbname",
")",
";",
"}",
"}"
] | Reload all of the data sets. | [
"Reload",
"all",
"of",
"the",
"data",
"sets",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-mongo-dao/src/main/java/org/schoellerfamily/gedbrowser/persistence/mongo/loader/GedDocumentFileLoader.java#L163-L173 |
141,508 | dickschoeller/gedbrowser | geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/GeoServiceBounds.java | GeoServiceBounds.createBounds | public static Feature createBounds(final String id) {
final Feature feature = new Feature();
feature.setId(id);
feature.setGeometry(new Polygon());
return feature;
} | java | public static Feature createBounds(final String id) {
final Feature feature = new Feature();
feature.setId(id);
feature.setGeometry(new Polygon());
return feature;
} | [
"public",
"static",
"Feature",
"createBounds",
"(",
"final",
"String",
"id",
")",
"{",
"final",
"Feature",
"feature",
"=",
"new",
"Feature",
"(",
")",
";",
"feature",
".",
"setId",
"(",
"id",
")",
";",
"feature",
".",
"setGeometry",
"(",
"new",
"Polygon",
"(",
")",
")",
";",
"return",
"feature",
";",
"}"
] | Build a bounding box feature.
In this case, it has a name but is empty.
@param id the ID string
@return the Feature for the new bounds | [
"Build",
"a",
"bounding",
"box",
"feature",
".",
"In",
"this",
"case",
"it",
"has",
"a",
"name",
"but",
"is",
"empty",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/GeoServiceBounds.java#L39-L44 |
141,509 | dickschoeller/gedbrowser | geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/GeoServiceBounds.java | GeoServiceBounds.createBounds | public static Feature createBounds(final String id,
final LngLatAlt southwest,
final LngLatAlt northeast) {
final Feature feature = new Feature();
feature.setId(id);
if (northeast == null || southwest == null) {
throw new IllegalArgumentException(
"Must have a proper bounding box");
}
final double[] bbox = {
southwest.getLongitude(),
southwest.getLatitude(),
northeast.getLongitude(),
northeast.getLatitude()
};
final Polygon polygon = new Polygon();
feature.setGeometry(polygon);
polygon.setBbox(bbox);
final List<LngLatAlt> elements = new ArrayList<>(5);
elements.add(new LngLatAlt(bbox[SW_LNG], bbox[SW_LAT]));
elements.add(new LngLatAlt(bbox[NE_LNG], bbox[SW_LAT]));
elements.add(new LngLatAlt(bbox[NE_LNG], bbox[NE_LAT]));
elements.add(new LngLatAlt(bbox[SW_LNG], bbox[NE_LAT]));
elements.add(new LngLatAlt(bbox[SW_LNG], bbox[SW_LAT]));
polygon.add(elements);
feature.setBbox(bbox);
return feature;
} | java | public static Feature createBounds(final String id,
final LngLatAlt southwest,
final LngLatAlt northeast) {
final Feature feature = new Feature();
feature.setId(id);
if (northeast == null || southwest == null) {
throw new IllegalArgumentException(
"Must have a proper bounding box");
}
final double[] bbox = {
southwest.getLongitude(),
southwest.getLatitude(),
northeast.getLongitude(),
northeast.getLatitude()
};
final Polygon polygon = new Polygon();
feature.setGeometry(polygon);
polygon.setBbox(bbox);
final List<LngLatAlt> elements = new ArrayList<>(5);
elements.add(new LngLatAlt(bbox[SW_LNG], bbox[SW_LAT]));
elements.add(new LngLatAlt(bbox[NE_LNG], bbox[SW_LAT]));
elements.add(new LngLatAlt(bbox[NE_LNG], bbox[NE_LAT]));
elements.add(new LngLatAlt(bbox[SW_LNG], bbox[NE_LAT]));
elements.add(new LngLatAlt(bbox[SW_LNG], bbox[SW_LAT]));
polygon.add(elements);
feature.setBbox(bbox);
return feature;
} | [
"public",
"static",
"Feature",
"createBounds",
"(",
"final",
"String",
"id",
",",
"final",
"LngLatAlt",
"southwest",
",",
"final",
"LngLatAlt",
"northeast",
")",
"{",
"final",
"Feature",
"feature",
"=",
"new",
"Feature",
"(",
")",
";",
"feature",
".",
"setId",
"(",
"id",
")",
";",
"if",
"(",
"northeast",
"==",
"null",
"||",
"southwest",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Must have a proper bounding box\"",
")",
";",
"}",
"final",
"double",
"[",
"]",
"bbox",
"=",
"{",
"southwest",
".",
"getLongitude",
"(",
")",
",",
"southwest",
".",
"getLatitude",
"(",
")",
",",
"northeast",
".",
"getLongitude",
"(",
")",
",",
"northeast",
".",
"getLatitude",
"(",
")",
"}",
";",
"final",
"Polygon",
"polygon",
"=",
"new",
"Polygon",
"(",
")",
";",
"feature",
".",
"setGeometry",
"(",
"polygon",
")",
";",
"polygon",
".",
"setBbox",
"(",
"bbox",
")",
";",
"final",
"List",
"<",
"LngLatAlt",
">",
"elements",
"=",
"new",
"ArrayList",
"<>",
"(",
"5",
")",
";",
"elements",
".",
"add",
"(",
"new",
"LngLatAlt",
"(",
"bbox",
"[",
"SW_LNG",
"]",
",",
"bbox",
"[",
"SW_LAT",
"]",
")",
")",
";",
"elements",
".",
"add",
"(",
"new",
"LngLatAlt",
"(",
"bbox",
"[",
"NE_LNG",
"]",
",",
"bbox",
"[",
"SW_LAT",
"]",
")",
")",
";",
"elements",
".",
"add",
"(",
"new",
"LngLatAlt",
"(",
"bbox",
"[",
"NE_LNG",
"]",
",",
"bbox",
"[",
"NE_LAT",
"]",
")",
")",
";",
"elements",
".",
"add",
"(",
"new",
"LngLatAlt",
"(",
"bbox",
"[",
"SW_LNG",
"]",
",",
"bbox",
"[",
"NE_LAT",
"]",
")",
")",
";",
"elements",
".",
"add",
"(",
"new",
"LngLatAlt",
"(",
"bbox",
"[",
"SW_LNG",
"]",
",",
"bbox",
"[",
"SW_LAT",
"]",
")",
")",
";",
"polygon",
".",
"add",
"(",
"elements",
")",
";",
"feature",
".",
"setBbox",
"(",
"bbox",
")",
";",
"return",
"feature",
";",
"}"
] | Build a bounding box feature.
@param id the ID string
@param southwest the southwest corner of the bounding box
@param northeast the northeast corner of the bounding box
@return the Feature for the new bounds | [
"Build",
"a",
"bounding",
"box",
"feature",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/GeoServiceBounds.java#L54-L81 |
141,510 | dickschoeller/gedbrowser | gedbrowser-mongo-dao/src/main/java/org/schoellerfamily/gedbrowser/persistence/mongo/repository/RepositoryManagerMongo.java | RepositoryManagerMongo.get | @SuppressWarnings("unchecked")
public final FindableDocument<? extends GedObject, ? extends GedDocument<?>>
get(final Class<? extends GedObject> clazz) {
return (FindableDocument<? extends GedObject, ? extends GedDocument<?>>)
classToRepoMap .get(clazz);
} | java | @SuppressWarnings("unchecked")
public final FindableDocument<? extends GedObject, ? extends GedDocument<?>>
get(final Class<? extends GedObject> clazz) {
return (FindableDocument<? extends GedObject, ? extends GedDocument<?>>)
classToRepoMap .get(clazz);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"FindableDocument",
"<",
"?",
"extends",
"GedObject",
",",
"?",
"extends",
"GedDocument",
"<",
"?",
">",
">",
"get",
"(",
"final",
"Class",
"<",
"?",
"extends",
"GedObject",
">",
"clazz",
")",
"{",
"return",
"(",
"FindableDocument",
"<",
"?",
"extends",
"GedObject",
",",
"?",
"extends",
"GedDocument",
"<",
"?",
">",
">",
")",
"classToRepoMap",
".",
"get",
"(",
"clazz",
")",
";",
"}"
] | Get a repository based on the class of ged object we are working with.
@param clazz the class of ged object
@return the repository | [
"Get",
"a",
"repository",
"based",
"on",
"the",
"class",
"of",
"ged",
"object",
"we",
"are",
"working",
"with",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-mongo-dao/src/main/java/org/schoellerfamily/gedbrowser/persistence/mongo/repository/RepositoryManagerMongo.java#L195-L200 |
141,511 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/NameableVisitor.java | NameableVisitor.visit | @Override
public void visit(final Person person) {
visitedNameable = person;
for (final GedObject gob : person.getAttributes()) {
gob.accept(this);
}
} | java | @Override
public void visit(final Person person) {
visitedNameable = person;
for (final GedObject gob : person.getAttributes()) {
gob.accept(this);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"final",
"Person",
"person",
")",
"{",
"visitedNameable",
"=",
"person",
";",
"for",
"(",
"final",
"GedObject",
"gob",
":",
"person",
".",
"getAttributes",
"(",
")",
")",
"{",
"gob",
".",
"accept",
"(",
"this",
")",
";",
"}",
"}"
] | Visit a Person. This is could be primary focus of the visitation.
From here, interesting information is gathered from the attributes.
@see GedObjectVisitor#visit(Person) | [
"Visit",
"a",
"Person",
".",
"This",
"is",
"could",
"be",
"primary",
"focus",
"of",
"the",
"visitation",
".",
"From",
"here",
"interesting",
"information",
"is",
"gathered",
"from",
"the",
"attributes",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/NameableVisitor.java#L67-L73 |
141,512 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/NameableVisitor.java | NameableVisitor.visit | @Override
public void visit(final Submitter submitter) {
visitedNameable = submitter;
for (final GedObject gob : submitter.getAttributes()) {
gob.accept(this);
}
} | java | @Override
public void visit(final Submitter submitter) {
visitedNameable = submitter;
for (final GedObject gob : submitter.getAttributes()) {
gob.accept(this);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"final",
"Submitter",
"submitter",
")",
"{",
"visitedNameable",
"=",
"submitter",
";",
"for",
"(",
"final",
"GedObject",
"gob",
":",
"submitter",
".",
"getAttributes",
"(",
")",
")",
"{",
"gob",
".",
"accept",
"(",
"this",
")",
";",
"}",
"}"
] | Visit a Submitter. This is could be primary focus of the visitation.
From here, interesting information is gathered from the attributes.
@see GedObjectVisitor#visit(Submitter) | [
"Visit",
"a",
"Submitter",
".",
"This",
"is",
"could",
"be",
"primary",
"focus",
"of",
"the",
"visitation",
".",
"From",
"here",
"interesting",
"information",
"is",
"gathered",
"from",
"the",
"attributes",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/NameableVisitor.java#L81-L87 |
141,513 | dickschoeller/gedbrowser | gedbrowser-mongo-dao/src/main/java/org/schoellerfamily/gedbrowser/persistence/mongo/repository/PersonDocumentRepositoryMongoImpl.java | PersonDocumentRepositoryMongoImpl.copy | private Collection<PersonDocument> copy(
final Collection<PersonDocumentMongo> in) {
final List<PersonDocument> out = new ArrayList<>(in);
Collections.sort(out, new PersonDocumentComparator());
return out;
} | java | private Collection<PersonDocument> copy(
final Collection<PersonDocumentMongo> in) {
final List<PersonDocument> out = new ArrayList<>(in);
Collections.sort(out, new PersonDocumentComparator());
return out;
} | [
"private",
"Collection",
"<",
"PersonDocument",
">",
"copy",
"(",
"final",
"Collection",
"<",
"PersonDocumentMongo",
">",
"in",
")",
"{",
"final",
"List",
"<",
"PersonDocument",
">",
"out",
"=",
"new",
"ArrayList",
"<>",
"(",
"in",
")",
";",
"Collections",
".",
"sort",
"(",
"out",
",",
"new",
"PersonDocumentComparator",
"(",
")",
")",
";",
"return",
"out",
";",
"}"
] | Correct the type of the collection.
@param in input collection
@return output collection | [
"Correct",
"the",
"type",
"of",
"the",
"collection",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-mongo-dao/src/main/java/org/schoellerfamily/gedbrowser/persistence/mongo/repository/PersonDocumentRepositoryMongoImpl.java#L200-L205 |
141,514 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/Child.java | Child.getChild | public Person getChild() {
final Person toPerson = (Person) find(getToString());
if (toPerson == null) {
return new Person();
}
return toPerson;
} | java | public Person getChild() {
final Person toPerson = (Person) find(getToString());
if (toPerson == null) {
return new Person();
}
return toPerson;
} | [
"public",
"Person",
"getChild",
"(",
")",
"{",
"final",
"Person",
"toPerson",
"=",
"(",
"Person",
")",
"find",
"(",
"getToString",
"(",
")",
")",
";",
"if",
"(",
"toPerson",
"==",
"null",
")",
"{",
"return",
"new",
"Person",
"(",
")",
";",
"}",
"return",
"toPerson",
";",
"}"
] | Get the person that this object points to. If not found, return an unset
Person object.
@return the child | [
"Get",
"the",
"person",
"that",
"this",
"object",
"points",
"to",
".",
"If",
"not",
"found",
"return",
"an",
"unset",
"Person",
"object",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/Child.java#L33-L39 |
141,515 | dickschoeller/gedbrowser | gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/RenderingContextRenderer.java | RenderingContextRenderer.escapeString | public static final String escapeString(final String delimiter,
final String input) {
final String escaped = escapeString(input);
if (escaped.isEmpty()) {
return escaped;
}
return delimiter + escaped;
} | java | public static final String escapeString(final String delimiter,
final String input) {
final String escaped = escapeString(input);
if (escaped.isEmpty()) {
return escaped;
}
return delimiter + escaped;
} | [
"public",
"static",
"final",
"String",
"escapeString",
"(",
"final",
"String",
"delimiter",
",",
"final",
"String",
"input",
")",
"{",
"final",
"String",
"escaped",
"=",
"escapeString",
"(",
"input",
")",
";",
"if",
"(",
"escaped",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"escaped",
";",
"}",
"return",
"delimiter",
"+",
"escaped",
";",
"}"
] | Convert the string for use in HTML or URLs.
@param delimiter a spacer string to add
@param input unescaped string.
@return the escaped string. | [
"Convert",
"the",
"string",
"for",
"use",
"in",
"HTML",
"or",
"URLs",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/RenderingContextRenderer.java#L116-L123 |
141,516 | dickschoeller/gedbrowser | gedbrowser-reader/src/main/java/org/schoellerfamily/gedbrowser/reader/CharsetScanner.java | CharsetScanner.findCharsetInHeader | private String findCharsetInHeader(final GedObject gob) {
for (final GedObject hgob : gob.getAttributes()) {
if ("Character Set".equals(hgob.getString())) {
return ((Attribute) hgob).getTail();
}
}
return "UTF-8";
} | java | private String findCharsetInHeader(final GedObject gob) {
for (final GedObject hgob : gob.getAttributes()) {
if ("Character Set".equals(hgob.getString())) {
return ((Attribute) hgob).getTail();
}
}
return "UTF-8";
} | [
"private",
"String",
"findCharsetInHeader",
"(",
"final",
"GedObject",
"gob",
")",
"{",
"for",
"(",
"final",
"GedObject",
"hgob",
":",
"gob",
".",
"getAttributes",
"(",
")",
")",
"{",
"if",
"(",
"\"Character Set\"",
".",
"equals",
"(",
"hgob",
".",
"getString",
"(",
")",
")",
")",
"{",
"return",
"(",
"(",
"Attribute",
")",
"hgob",
")",
".",
"getTail",
"(",
")",
";",
"}",
"}",
"return",
"\"UTF-8\"",
";",
"}"
] | Find the GEDCOM charset in the attributes of the header.
@param gob the header ged object
@return the GEDCOM charset | [
"Find",
"the",
"GEDCOM",
"charset",
"in",
"the",
"attributes",
"of",
"the",
"header",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-reader/src/main/java/org/schoellerfamily/gedbrowser/reader/CharsetScanner.java#L97-L104 |
141,517 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/navigator/FamilyNavigator.java | FamilyNavigator.findFamily | private static Family findFamily(final Child child) {
if (!child.isSet()) {
return new Family();
}
final Family foundFamily = (Family) child.find(child.getFromString());
if (foundFamily == null) {
return new Family();
}
return foundFamily;
} | java | private static Family findFamily(final Child child) {
if (!child.isSet()) {
return new Family();
}
final Family foundFamily = (Family) child.find(child.getFromString());
if (foundFamily == null) {
return new Family();
}
return foundFamily;
} | [
"private",
"static",
"Family",
"findFamily",
"(",
"final",
"Child",
"child",
")",
"{",
"if",
"(",
"!",
"child",
".",
"isSet",
"(",
")",
")",
"{",
"return",
"new",
"Family",
"(",
")",
";",
"}",
"final",
"Family",
"foundFamily",
"=",
"(",
"Family",
")",
"child",
".",
"find",
"(",
"child",
".",
"getFromString",
"(",
")",
")",
";",
"if",
"(",
"foundFamily",
"==",
"null",
")",
"{",
"return",
"new",
"Family",
"(",
")",
";",
"}",
"return",
"foundFamily",
";",
"}"
] | Get the family for this child to build the navigator with.
@param child the child
@return the family | [
"Get",
"the",
"family",
"for",
"this",
"child",
"to",
"build",
"the",
"navigator",
"with",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/navigator/FamilyNavigator.java#L52-L61 |
141,518 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/navigator/FamilyNavigator.java | FamilyNavigator.findFamily | private static Family findFamily(final FamC famc) {
if (!famc.isSet()) {
return new Family();
}
final Family foundFamily = (Family) famc.find(famc.getToString());
if (foundFamily == null) {
return new Family();
}
return foundFamily;
} | java | private static Family findFamily(final FamC famc) {
if (!famc.isSet()) {
return new Family();
}
final Family foundFamily = (Family) famc.find(famc.getToString());
if (foundFamily == null) {
return new Family();
}
return foundFamily;
} | [
"private",
"static",
"Family",
"findFamily",
"(",
"final",
"FamC",
"famc",
")",
"{",
"if",
"(",
"!",
"famc",
".",
"isSet",
"(",
")",
")",
"{",
"return",
"new",
"Family",
"(",
")",
";",
"}",
"final",
"Family",
"foundFamily",
"=",
"(",
"Family",
")",
"famc",
".",
"find",
"(",
"famc",
".",
"getToString",
"(",
")",
")",
";",
"if",
"(",
"foundFamily",
"==",
"null",
")",
"{",
"return",
"new",
"Family",
"(",
")",
";",
"}",
"return",
"foundFamily",
";",
"}"
] | Get the family for this famc to build the navigator with.
@param famc the famc
@return the family | [
"Get",
"the",
"family",
"for",
"this",
"famc",
"to",
"build",
"the",
"navigator",
"with",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/navigator/FamilyNavigator.java#L79-L88 |
141,519 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/navigator/FamilyNavigator.java | FamilyNavigator.findFamily | private static Family findFamily(final FamS fams) {
if (!fams.isSet()) {
return new Family();
}
final Family foundFamily = (Family) fams.find(fams.getToString());
if (foundFamily == null) {
return new Family();
}
return foundFamily;
} | java | private static Family findFamily(final FamS fams) {
if (!fams.isSet()) {
return new Family();
}
final Family foundFamily = (Family) fams.find(fams.getToString());
if (foundFamily == null) {
return new Family();
}
return foundFamily;
} | [
"private",
"static",
"Family",
"findFamily",
"(",
"final",
"FamS",
"fams",
")",
"{",
"if",
"(",
"!",
"fams",
".",
"isSet",
"(",
")",
")",
"{",
"return",
"new",
"Family",
"(",
")",
";",
"}",
"final",
"Family",
"foundFamily",
"=",
"(",
"Family",
")",
"fams",
".",
"find",
"(",
"fams",
".",
"getToString",
"(",
")",
")",
";",
"if",
"(",
"foundFamily",
"==",
"null",
")",
"{",
"return",
"new",
"Family",
"(",
")",
";",
"}",
"return",
"foundFamily",
";",
"}"
] | Get the family for this fams to build the navigator with.
@param fams the fams
@return the family | [
"Get",
"the",
"family",
"for",
"this",
"fams",
"to",
"build",
"the",
"navigator",
"with",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/navigator/FamilyNavigator.java#L106-L115 |
141,520 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/navigator/FamilyNavigator.java | FamilyNavigator.getSpouse | public Person getSpouse(final GedObject person) {
final List<Person> spouses = visitor.getSpouses();
if (person != null && !spouses.contains(person)) {
return new Person();
}
for (final Person spouse : spouses) {
if (!spouse.equals(person)) {
return spouse;
}
}
return new Person();
} | java | public Person getSpouse(final GedObject person) {
final List<Person> spouses = visitor.getSpouses();
if (person != null && !spouses.contains(person)) {
return new Person();
}
for (final Person spouse : spouses) {
if (!spouse.equals(person)) {
return spouse;
}
}
return new Person();
} | [
"public",
"Person",
"getSpouse",
"(",
"final",
"GedObject",
"person",
")",
"{",
"final",
"List",
"<",
"Person",
">",
"spouses",
"=",
"visitor",
".",
"getSpouses",
"(",
")",
";",
"if",
"(",
"person",
"!=",
"null",
"&&",
"!",
"spouses",
".",
"contains",
"(",
"person",
")",
")",
"{",
"return",
"new",
"Person",
"(",
")",
";",
"}",
"for",
"(",
"final",
"Person",
"spouse",
":",
"spouses",
")",
"{",
"if",
"(",
"!",
"spouse",
".",
"equals",
"(",
"person",
")",
")",
"{",
"return",
"spouse",
";",
"}",
"}",
"return",
"new",
"Person",
"(",
")",
";",
"}"
] | Get the person in this family who is the spouse of the person passed in.
@param person the person whose spouse we are looking for.
@return the spouse. | [
"Get",
"the",
"person",
"in",
"this",
"family",
"who",
"is",
"the",
"spouse",
"of",
"the",
"person",
"passed",
"in",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/navigator/FamilyNavigator.java#L133-L144 |
141,521 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/order/AbstractOrderAnalyzer.java | AbstractOrderAnalyzer.createLocalDate | protected final LocalDate createLocalDate(final Attribute attribute) {
final GetDateVisitor visitor = new GetDateVisitor();
attribute.accept(visitor);
return createLocalDate(visitor.getDate());
} | java | protected final LocalDate createLocalDate(final Attribute attribute) {
final GetDateVisitor visitor = new GetDateVisitor();
attribute.accept(visitor);
return createLocalDate(visitor.getDate());
} | [
"protected",
"final",
"LocalDate",
"createLocalDate",
"(",
"final",
"Attribute",
"attribute",
")",
"{",
"final",
"GetDateVisitor",
"visitor",
"=",
"new",
"GetDateVisitor",
"(",
")",
";",
"attribute",
".",
"accept",
"(",
"visitor",
")",
";",
"return",
"createLocalDate",
"(",
"visitor",
".",
"getDate",
"(",
")",
")",
";",
"}"
] | Create a local date from the attribute's date.
@param attribute the attribute
@return the local date | [
"Create",
"a",
"local",
"date",
"from",
"the",
"attribute",
"s",
"date",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/order/AbstractOrderAnalyzer.java#L104-L108 |
141,522 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/order/AbstractOrderAnalyzer.java | AbstractOrderAnalyzer.minDate | public static LocalDate minDate(final LocalDate date0,
final LocalDate date1) {
if (date1 == null) {
return date0;
}
if (date0 == null) {
return date1;
}
if (date1.isBefore(date0)) {
return date1;
} else {
return date0;
}
} | java | public static LocalDate minDate(final LocalDate date0,
final LocalDate date1) {
if (date1 == null) {
return date0;
}
if (date0 == null) {
return date1;
}
if (date1.isBefore(date0)) {
return date1;
} else {
return date0;
}
} | [
"public",
"static",
"LocalDate",
"minDate",
"(",
"final",
"LocalDate",
"date0",
",",
"final",
"LocalDate",
"date1",
")",
"{",
"if",
"(",
"date1",
"==",
"null",
")",
"{",
"return",
"date0",
";",
"}",
"if",
"(",
"date0",
"==",
"null",
")",
"{",
"return",
"date1",
";",
"}",
"if",
"(",
"date1",
".",
"isBefore",
"(",
"date0",
")",
")",
"{",
"return",
"date1",
";",
"}",
"else",
"{",
"return",
"date0",
";",
"}",
"}"
] | Return the earlier of the 2 dates. If either is null return the other.
@param date0 a date
@param date1 another date
@return the earlier of the 2 dates | [
"Return",
"the",
"earlier",
"of",
"the",
"2",
"dates",
".",
"If",
"either",
"is",
"null",
"return",
"the",
"other",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/order/AbstractOrderAnalyzer.java#L165-L178 |
141,523 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/TokenTableInitializer.java | TokenTableInitializer.initLevel0FactoryTokens | private void initLevel0FactoryTokens() {
put("ROOT", "Root", AbstractGedObjectFactory.ROOT_FACTORY);
put("HEAD", "Header", AbstractGedObjectFactory.HEAD_FACTORY);
put("FAM", "Family", AbstractGedObjectFactory.FAMILY_FACTORY);
put("INDI", "Person", AbstractGedObjectFactory.PERSON_FACTORY);
put("NOTE", "Note", AbstractGedObjectFactory.NOTE_FACTORY);
put("OBJE", "Multimedia", AbstractGedObjectFactory.MULTIMEDIA_FACTORY);
put("SOUR", "Source", AbstractGedObjectFactory.SOURCE_FACTORY);
put("SUBM", "Submitter", AbstractGedObjectFactory.SUBMITTER_FACTORY);
put("SUBN", "Submission", AbstractGedObjectFactory.SUBMISSION_FACTORY);
put("TRLR", "Trailer", AbstractGedObjectFactory.TRAILER_FACTORY);
} | java | private void initLevel0FactoryTokens() {
put("ROOT", "Root", AbstractGedObjectFactory.ROOT_FACTORY);
put("HEAD", "Header", AbstractGedObjectFactory.HEAD_FACTORY);
put("FAM", "Family", AbstractGedObjectFactory.FAMILY_FACTORY);
put("INDI", "Person", AbstractGedObjectFactory.PERSON_FACTORY);
put("NOTE", "Note", AbstractGedObjectFactory.NOTE_FACTORY);
put("OBJE", "Multimedia", AbstractGedObjectFactory.MULTIMEDIA_FACTORY);
put("SOUR", "Source", AbstractGedObjectFactory.SOURCE_FACTORY);
put("SUBM", "Submitter", AbstractGedObjectFactory.SUBMITTER_FACTORY);
put("SUBN", "Submission", AbstractGedObjectFactory.SUBMISSION_FACTORY);
put("TRLR", "Trailer", AbstractGedObjectFactory.TRAILER_FACTORY);
} | [
"private",
"void",
"initLevel0FactoryTokens",
"(",
")",
"{",
"put",
"(",
"\"ROOT\"",
",",
"\"Root\"",
",",
"AbstractGedObjectFactory",
".",
"ROOT_FACTORY",
")",
";",
"put",
"(",
"\"HEAD\"",
",",
"\"Header\"",
",",
"AbstractGedObjectFactory",
".",
"HEAD_FACTORY",
")",
";",
"put",
"(",
"\"FAM\"",
",",
"\"Family\"",
",",
"AbstractGedObjectFactory",
".",
"FAMILY_FACTORY",
")",
";",
"put",
"(",
"\"INDI\"",
",",
"\"Person\"",
",",
"AbstractGedObjectFactory",
".",
"PERSON_FACTORY",
")",
";",
"put",
"(",
"\"NOTE\"",
",",
"\"Note\"",
",",
"AbstractGedObjectFactory",
".",
"NOTE_FACTORY",
")",
";",
"put",
"(",
"\"OBJE\"",
",",
"\"Multimedia\"",
",",
"AbstractGedObjectFactory",
".",
"MULTIMEDIA_FACTORY",
")",
";",
"put",
"(",
"\"SOUR\"",
",",
"\"Source\"",
",",
"AbstractGedObjectFactory",
".",
"SOURCE_FACTORY",
")",
";",
"put",
"(",
"\"SUBM\"",
",",
"\"Submitter\"",
",",
"AbstractGedObjectFactory",
".",
"SUBMITTER_FACTORY",
")",
";",
"put",
"(",
"\"SUBN\"",
",",
"\"Submission\"",
",",
"AbstractGedObjectFactory",
".",
"SUBMISSION_FACTORY",
")",
";",
"put",
"(",
"\"TRLR\"",
",",
"\"Trailer\"",
",",
"AbstractGedObjectFactory",
".",
"TRAILER_FACTORY",
")",
";",
"}"
] | Method to initialize the tokens for top level items. | [
"Method",
"to",
"initialize",
"the",
"tokens",
"for",
"top",
"level",
"items",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/TokenTableInitializer.java#L210-L221 |
141,524 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/TokenTableInitializer.java | TokenTableInitializer.initSpecialFactoryTokens | private void initSpecialFactoryTokens() {
put("CHIL", "Child", AbstractGedObjectFactory.CHILD_FACTORY);
put("CONC", "Concatenate", AbstractGedObjectFactory.CONCAT_FACTORY);
put("CONT", "Continuation", AbstractGedObjectFactory.CONTIN_FACTORY);
put("DATE", "Date", AbstractGedObjectFactory.DATE_FACTORY);
put("FAMC", "Child of Family", AbstractGedObjectFactory.FAMC_FACTORY);
put("FAMS", "Spouse of Family", AbstractGedObjectFactory.FAMS_FACTORY);
put("HUSB", "Husband", AbstractGedObjectFactory.HUSBAND_FACTORY);
put("LINK", "Link", AbstractGedObjectFactory.LINK_FACTORY);
put("NAME", "Name", AbstractGedObjectFactory.NAME_FACTORY);
put("PLAC", "Place", AbstractGedObjectFactory.PLACE_FACTORY);
put("PLACE", "Place", AbstractGedObjectFactory.PLACE_FACTORY);
put("WIFE", "Wife", AbstractGedObjectFactory.WIFE_FACTORY);
} | java | private void initSpecialFactoryTokens() {
put("CHIL", "Child", AbstractGedObjectFactory.CHILD_FACTORY);
put("CONC", "Concatenate", AbstractGedObjectFactory.CONCAT_FACTORY);
put("CONT", "Continuation", AbstractGedObjectFactory.CONTIN_FACTORY);
put("DATE", "Date", AbstractGedObjectFactory.DATE_FACTORY);
put("FAMC", "Child of Family", AbstractGedObjectFactory.FAMC_FACTORY);
put("FAMS", "Spouse of Family", AbstractGedObjectFactory.FAMS_FACTORY);
put("HUSB", "Husband", AbstractGedObjectFactory.HUSBAND_FACTORY);
put("LINK", "Link", AbstractGedObjectFactory.LINK_FACTORY);
put("NAME", "Name", AbstractGedObjectFactory.NAME_FACTORY);
put("PLAC", "Place", AbstractGedObjectFactory.PLACE_FACTORY);
put("PLACE", "Place", AbstractGedObjectFactory.PLACE_FACTORY);
put("WIFE", "Wife", AbstractGedObjectFactory.WIFE_FACTORY);
} | [
"private",
"void",
"initSpecialFactoryTokens",
"(",
")",
"{",
"put",
"(",
"\"CHIL\"",
",",
"\"Child\"",
",",
"AbstractGedObjectFactory",
".",
"CHILD_FACTORY",
")",
";",
"put",
"(",
"\"CONC\"",
",",
"\"Concatenate\"",
",",
"AbstractGedObjectFactory",
".",
"CONCAT_FACTORY",
")",
";",
"put",
"(",
"\"CONT\"",
",",
"\"Continuation\"",
",",
"AbstractGedObjectFactory",
".",
"CONTIN_FACTORY",
")",
";",
"put",
"(",
"\"DATE\"",
",",
"\"Date\"",
",",
"AbstractGedObjectFactory",
".",
"DATE_FACTORY",
")",
";",
"put",
"(",
"\"FAMC\"",
",",
"\"Child of Family\"",
",",
"AbstractGedObjectFactory",
".",
"FAMC_FACTORY",
")",
";",
"put",
"(",
"\"FAMS\"",
",",
"\"Spouse of Family\"",
",",
"AbstractGedObjectFactory",
".",
"FAMS_FACTORY",
")",
";",
"put",
"(",
"\"HUSB\"",
",",
"\"Husband\"",
",",
"AbstractGedObjectFactory",
".",
"HUSBAND_FACTORY",
")",
";",
"put",
"(",
"\"LINK\"",
",",
"\"Link\"",
",",
"AbstractGedObjectFactory",
".",
"LINK_FACTORY",
")",
";",
"put",
"(",
"\"NAME\"",
",",
"\"Name\"",
",",
"AbstractGedObjectFactory",
".",
"NAME_FACTORY",
")",
";",
"put",
"(",
"\"PLAC\"",
",",
"\"Place\"",
",",
"AbstractGedObjectFactory",
".",
"PLACE_FACTORY",
")",
";",
"put",
"(",
"\"PLACE\"",
",",
"\"Place\"",
",",
"AbstractGedObjectFactory",
".",
"PLACE_FACTORY",
")",
";",
"put",
"(",
"\"WIFE\"",
",",
"\"Wife\"",
",",
"AbstractGedObjectFactory",
".",
"WIFE_FACTORY",
")",
";",
"}"
] | Method to initialize the tokens that use something other than the
attribute factory. | [
"Method",
"to",
"initialize",
"the",
"tokens",
"that",
"use",
"something",
"other",
"than",
"the",
"attribute",
"factory",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/TokenTableInitializer.java#L227-L240 |
141,525 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/order/ChildrenOrderAnalyzer.java | ChildrenOrderAnalyzer.analyzeFamily | private void analyzeFamily(final Family family) {
Person prevChild = null;
final FamilyNavigator navigator = new FamilyNavigator(family);
for (final Person child : navigator.getChildren()) {
prevChild = analyzeChild(child, prevChild);
}
} | java | private void analyzeFamily(final Family family) {
Person prevChild = null;
final FamilyNavigator navigator = new FamilyNavigator(family);
for (final Person child : navigator.getChildren()) {
prevChild = analyzeChild(child, prevChild);
}
} | [
"private",
"void",
"analyzeFamily",
"(",
"final",
"Family",
"family",
")",
"{",
"Person",
"prevChild",
"=",
"null",
";",
"final",
"FamilyNavigator",
"navigator",
"=",
"new",
"FamilyNavigator",
"(",
"family",
")",
";",
"for",
"(",
"final",
"Person",
"child",
":",
"navigator",
".",
"getChildren",
"(",
")",
")",
"{",
"prevChild",
"=",
"analyzeChild",
"(",
"child",
",",
"prevChild",
")",
";",
"}",
"}"
] | Analyze the order of children in one family.
@param family the family | [
"Analyze",
"the",
"order",
"of",
"children",
"in",
"one",
"family",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/order/ChildrenOrderAnalyzer.java#L54-L60 |
141,526 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/order/ChildrenOrderAnalyzer.java | ChildrenOrderAnalyzer.analyzeChild | private Person analyzeChild(final Person child, final Person prevChild) {
Person retChild = prevChild;
if (retChild == null) {
return child;
}
final LocalDate birthDate = getNearBirthEventDate(child);
if (birthDate == null) {
return retChild;
}
final LocalDate prevDate = getNearBirthEventDate(prevChild);
if (prevDate == null) {
return child;
}
if (birthDate.isBefore(prevDate)) {
final String message = String.format(CHILD_ORDER_FORMAT,
child.getName().getString(), birthDate,
prevChild.getName().getString(), prevDate);
getResult().addMismatch(message);
}
retChild = child;
return retChild;
} | java | private Person analyzeChild(final Person child, final Person prevChild) {
Person retChild = prevChild;
if (retChild == null) {
return child;
}
final LocalDate birthDate = getNearBirthEventDate(child);
if (birthDate == null) {
return retChild;
}
final LocalDate prevDate = getNearBirthEventDate(prevChild);
if (prevDate == null) {
return child;
}
if (birthDate.isBefore(prevDate)) {
final String message = String.format(CHILD_ORDER_FORMAT,
child.getName().getString(), birthDate,
prevChild.getName().getString(), prevDate);
getResult().addMismatch(message);
}
retChild = child;
return retChild;
} | [
"private",
"Person",
"analyzeChild",
"(",
"final",
"Person",
"child",
",",
"final",
"Person",
"prevChild",
")",
"{",
"Person",
"retChild",
"=",
"prevChild",
";",
"if",
"(",
"retChild",
"==",
"null",
")",
"{",
"return",
"child",
";",
"}",
"final",
"LocalDate",
"birthDate",
"=",
"getNearBirthEventDate",
"(",
"child",
")",
";",
"if",
"(",
"birthDate",
"==",
"null",
")",
"{",
"return",
"retChild",
";",
"}",
"final",
"LocalDate",
"prevDate",
"=",
"getNearBirthEventDate",
"(",
"prevChild",
")",
";",
"if",
"(",
"prevDate",
"==",
"null",
")",
"{",
"return",
"child",
";",
"}",
"if",
"(",
"birthDate",
".",
"isBefore",
"(",
"prevDate",
")",
")",
"{",
"final",
"String",
"message",
"=",
"String",
".",
"format",
"(",
"CHILD_ORDER_FORMAT",
",",
"child",
".",
"getName",
"(",
")",
".",
"getString",
"(",
")",
",",
"birthDate",
",",
"prevChild",
".",
"getName",
"(",
")",
".",
"getString",
"(",
")",
",",
"prevDate",
")",
";",
"getResult",
"(",
")",
".",
"addMismatch",
"(",
"message",
")",
";",
"}",
"retChild",
"=",
"child",
";",
"return",
"retChild",
";",
"}"
] | Check the order of one child against the previous dated child.
@param child the child
@param prevChild the previous child
@return the current child if dated | [
"Check",
"the",
"order",
"of",
"one",
"child",
"against",
"the",
"previous",
"dated",
"child",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/order/ChildrenOrderAnalyzer.java#L69-L90 |
141,527 | dickschoeller/gedbrowser | gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/SubmitterNameIndexRenderer.java | SubmitterNameIndexRenderer.getNameHtml | private String getNameHtml(final Submitter submitter) {
final GedRenderer<? extends GedObject> renderer =
new SimpleNameRenderer(submitter.getName(),
submitterRenderer.getRendererFactory(),
submitterRenderer.getRenderingContext());
return renderer.getNameHtml();
} | java | private String getNameHtml(final Submitter submitter) {
final GedRenderer<? extends GedObject> renderer =
new SimpleNameRenderer(submitter.getName(),
submitterRenderer.getRendererFactory(),
submitterRenderer.getRenderingContext());
return renderer.getNameHtml();
} | [
"private",
"String",
"getNameHtml",
"(",
"final",
"Submitter",
"submitter",
")",
"{",
"final",
"GedRenderer",
"<",
"?",
"extends",
"GedObject",
">",
"renderer",
"=",
"new",
"SimpleNameRenderer",
"(",
"submitter",
".",
"getName",
"(",
")",
",",
"submitterRenderer",
".",
"getRendererFactory",
"(",
")",
",",
"submitterRenderer",
".",
"getRenderingContext",
"(",
")",
")",
";",
"return",
"renderer",
".",
"getNameHtml",
"(",
")",
";",
"}"
] | Handle the messy getting of the name ready for HTML formatting.
@param submitter the submitter whose name we are doing
@return the string | [
"Handle",
"the",
"messy",
"getting",
"of",
"the",
"name",
"ready",
"for",
"HTML",
"formatting",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/SubmitterNameIndexRenderer.java#L45-L51 |
141,528 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/SourceVisitor.java | SourceVisitor.visit | @Override
public void visit(final Attribute attribute) {
if ("Title".equals(attribute.getString())) {
titleString = attribute.getTail();
}
} | java | @Override
public void visit(final Attribute attribute) {
if ("Title".equals(attribute.getString())) {
titleString = attribute.getTail();
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"final",
"Attribute",
"attribute",
")",
"{",
"if",
"(",
"\"Title\"",
".",
"equals",
"(",
"attribute",
".",
"getString",
"(",
")",
")",
")",
"{",
"titleString",
"=",
"attribute",
".",
"getTail",
"(",
")",
";",
"}",
"}"
] | Visit an Attribute. Specific Attributes provide interesting data for
the Source that is the primary focus.
@see GedObjectVisitor#visit(Attribute) | [
"Visit",
"an",
"Attribute",
".",
"Specific",
"Attributes",
"provide",
"interesting",
"data",
"for",
"the",
"Source",
"that",
"is",
"the",
"primary",
"focus",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/SourceVisitor.java#L30-L35 |
141,529 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/SourceVisitor.java | SourceVisitor.visit | @Override
public void visit(final Source source) {
titleString = source.getString();
for (final GedObject gob : source.getAttributes()) {
gob.accept(this);
}
} | java | @Override
public void visit(final Source source) {
titleString = source.getString();
for (final GedObject gob : source.getAttributes()) {
gob.accept(this);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"final",
"Source",
"source",
")",
"{",
"titleString",
"=",
"source",
".",
"getString",
"(",
")",
";",
"for",
"(",
"final",
"GedObject",
"gob",
":",
"source",
".",
"getAttributes",
"(",
")",
")",
"{",
"gob",
".",
"accept",
"(",
"this",
")",
";",
"}",
"}"
] | Visit a Source. This is the primary focus of the visitation. From
here, interesting information is gathered.
@see GedObjectVisitor#visit(Source) | [
"Visit",
"a",
"Source",
".",
"This",
"is",
"the",
"primary",
"focus",
"of",
"the",
"visitation",
".",
"From",
"here",
"interesting",
"information",
"is",
"gathered",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/SourceVisitor.java#L43-L49 |
141,530 | dickschoeller/gedbrowser | geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/GeoServiceGeocodingResult.java | GeoServiceGeocodingResult.getLocation | @Transient
private Feature getLocation() {
if (geometry == null) {
return null;
}
final List<Feature> features = geometry.getFeatures();
if (features == null || features.isEmpty()) {
return null;
}
return features.get(0);
} | java | @Transient
private Feature getLocation() {
if (geometry == null) {
return null;
}
final List<Feature> features = geometry.getFeatures();
if (features == null || features.isEmpty()) {
return null;
}
return features.get(0);
} | [
"@",
"Transient",
"private",
"Feature",
"getLocation",
"(",
")",
"{",
"if",
"(",
"geometry",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"List",
"<",
"Feature",
">",
"features",
"=",
"geometry",
".",
"getFeatures",
"(",
")",
";",
"if",
"(",
"features",
"==",
"null",
"||",
"features",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"features",
".",
"get",
"(",
"0",
")",
";",
"}"
] | Return the location. It is in the form of a GeoJSON feature.
Much of the descriptive data from Google is in the properties
of that feature.
@return the location feature | [
"Return",
"the",
"location",
".",
"It",
"is",
"in",
"the",
"form",
"of",
"a",
"GeoJSON",
"feature",
".",
"Much",
"of",
"the",
"descriptive",
"data",
"from",
"Google",
"is",
"in",
"the",
"properties",
"of",
"that",
"feature",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/geoservice-persistence/src/main/java/org/schoellerfamily/geoservice/model/GeoServiceGeocodingResult.java#L225-L235 |
141,531 | dickschoeller/gedbrowser | gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/util/Backup.java | Backup.backup | public static void backup(final String filename) throws IOException {
final File dest = createFile(filename);
if (dest.exists()) {
final File backupFile = generateBackupFilename(filename);
LOGGER.debug("backing up file from " + filename + " to "
+ backupFile.getName());
if (!dest.renameTo(backupFile)) {
throw new IOException("Could not rename file from "
+ dest.getName() + " to " + backupFile.getName());
}
}
} | java | public static void backup(final String filename) throws IOException {
final File dest = createFile(filename);
if (dest.exists()) {
final File backupFile = generateBackupFilename(filename);
LOGGER.debug("backing up file from " + filename + " to "
+ backupFile.getName());
if (!dest.renameTo(backupFile)) {
throw new IOException("Could not rename file from "
+ dest.getName() + " to " + backupFile.getName());
}
}
} | [
"public",
"static",
"void",
"backup",
"(",
"final",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"final",
"File",
"dest",
"=",
"createFile",
"(",
"filename",
")",
";",
"if",
"(",
"dest",
".",
"exists",
"(",
")",
")",
"{",
"final",
"File",
"backupFile",
"=",
"generateBackupFilename",
"(",
"filename",
")",
";",
"LOGGER",
".",
"debug",
"(",
"\"backing up file from \"",
"+",
"filename",
"+",
"\" to \"",
"+",
"backupFile",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"!",
"dest",
".",
"renameTo",
"(",
"backupFile",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Could not rename file from \"",
"+",
"dest",
".",
"getName",
"(",
")",
"+",
"\" to \"",
"+",
"backupFile",
".",
"getName",
"(",
")",
")",
";",
"}",
"}",
"}"
] | Save the existing version of the file by renaming it to something ending
with .<number>.
@param filename the full path to create
@throws IOException if the rename fails | [
"Save",
"the",
"existing",
"version",
"of",
"the",
"file",
"by",
"renaming",
"it",
"to",
"something",
"ending",
"with",
".",
"<",
";",
"number>",
";",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/util/Backup.java#L30-L41 |
141,532 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/BirthDateFromParentsEstimator.java | BirthDateFromParentsEstimator.parentDateIncrement | private LocalDate parentDateIncrement(final LocalDate date) {
final int years = typicals.ageAtMarriage()
+ typicals.gapBetweenChildren();
return plusYearsAdjustToBegin(date, years);
} | java | private LocalDate parentDateIncrement(final LocalDate date) {
final int years = typicals.ageAtMarriage()
+ typicals.gapBetweenChildren();
return plusYearsAdjustToBegin(date, years);
} | [
"private",
"LocalDate",
"parentDateIncrement",
"(",
"final",
"LocalDate",
"date",
")",
"{",
"final",
"int",
"years",
"=",
"typicals",
".",
"ageAtMarriage",
"(",
")",
"+",
"typicals",
".",
"gapBetweenChildren",
"(",
")",
";",
"return",
"plusYearsAdjustToBegin",
"(",
"date",
",",
"years",
")",
";",
"}"
] | Adjust the given date by age of parent at first child.
@param date the input date
@return the adjusted date | [
"Adjust",
"the",
"given",
"date",
"by",
"age",
"of",
"parent",
"at",
"first",
"child",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/BirthDateFromParentsEstimator.java#L71-L75 |
141,533 | dickschoeller/gedbrowser | gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/GedWriter.java | GedWriter.write | public void write() {
root.accept(visitor);
try {
Backup.backup(root.getFilename());
} catch (IOException e) {
logger.error("Problem backing up old copy of GEDCOM file", e);
}
final String filename = root.getFilename();
final String charset = new CharsetScanner().charset(root);
try (FileOutputStream fstream = new FileOutputStream(filename);
BufferedOutputStream bstream = new BufferedOutputStream(
fstream)) {
writeTheLines(bstream, charset);
} catch (IOException e) {
logger.error("Problem writing GEDCOM file", e);
}
} | java | public void write() {
root.accept(visitor);
try {
Backup.backup(root.getFilename());
} catch (IOException e) {
logger.error("Problem backing up old copy of GEDCOM file", e);
}
final String filename = root.getFilename();
final String charset = new CharsetScanner().charset(root);
try (FileOutputStream fstream = new FileOutputStream(filename);
BufferedOutputStream bstream = new BufferedOutputStream(
fstream)) {
writeTheLines(bstream, charset);
} catch (IOException e) {
logger.error("Problem writing GEDCOM file", e);
}
} | [
"public",
"void",
"write",
"(",
")",
"{",
"root",
".",
"accept",
"(",
"visitor",
")",
";",
"try",
"{",
"Backup",
".",
"backup",
"(",
"root",
".",
"getFilename",
"(",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"logger",
".",
"error",
"(",
"\"Problem backing up old copy of GEDCOM file\"",
",",
"e",
")",
";",
"}",
"final",
"String",
"filename",
"=",
"root",
".",
"getFilename",
"(",
")",
";",
"final",
"String",
"charset",
"=",
"new",
"CharsetScanner",
"(",
")",
".",
"charset",
"(",
"root",
")",
";",
"try",
"(",
"FileOutputStream",
"fstream",
"=",
"new",
"FileOutputStream",
"(",
"filename",
")",
";",
"BufferedOutputStream",
"bstream",
"=",
"new",
"BufferedOutputStream",
"(",
"fstream",
")",
")",
"{",
"writeTheLines",
"(",
"bstream",
",",
"charset",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"logger",
".",
"error",
"(",
"\"Problem writing GEDCOM file\"",
",",
"e",
")",
";",
"}",
"}"
] | Write the file as directed. | [
"Write",
"the",
"file",
"as",
"directed",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-writer/src/main/java/org/schoellerfamily/gedbrowser/writer/GedWriter.java#L38-L54 |
141,534 | dickschoeller/gedbrowser | gedbrowser-reader/src/main/java/org/schoellerfamily/gedbrowser/reader/AbstractGedLine.java | AbstractGedLine.createGedLine | public static AbstractGedLine createGedLine(
final AbstractGedLine parent, final String inLine) {
GedLineSource sour;
if (parent == null) {
sour = new NullSource();
} else {
sour = parent.source;
}
return sour.createGedLine(parent, inLine);
} | java | public static AbstractGedLine createGedLine(
final AbstractGedLine parent, final String inLine) {
GedLineSource sour;
if (parent == null) {
sour = new NullSource();
} else {
sour = parent.source;
}
return sour.createGedLine(parent, inLine);
} | [
"public",
"static",
"AbstractGedLine",
"createGedLine",
"(",
"final",
"AbstractGedLine",
"parent",
",",
"final",
"String",
"inLine",
")",
"{",
"GedLineSource",
"sour",
";",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"sour",
"=",
"new",
"NullSource",
"(",
")",
";",
"}",
"else",
"{",
"sour",
"=",
"parent",
".",
"source",
";",
"}",
"return",
"sour",
".",
"createGedLine",
"(",
"parent",
",",
"inLine",
")",
";",
"}"
] | Create a GedLine from the provided string.
@param parent the current parent.
@param inLine the line of GEDCOM data
@return the GedLine | [
"Create",
"a",
"GedLine",
"from",
"the",
"provided",
"string",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-reader/src/main/java/org/schoellerfamily/gedbrowser/reader/AbstractGedLine.java#L73-L82 |
141,535 | dickschoeller/gedbrowser | gedbrowser-reader/src/main/java/org/schoellerfamily/gedbrowser/reader/AbstractGedLine.java | AbstractGedLine.readToNext | public final AbstractGedLine readToNext() throws IOException {
AbstractGedLine gedLine = source.createGedLine(this);
while (true) {
if (gedLine == null || gedLine.getLevel() == -1) {
break;
}
if (gedLine.getLevel() <= this.getLevel()) {
return gedLine;
}
children.add(gedLine);
gedLine = gedLine.readToNext();
}
return null;
} | java | public final AbstractGedLine readToNext() throws IOException {
AbstractGedLine gedLine = source.createGedLine(this);
while (true) {
if (gedLine == null || gedLine.getLevel() == -1) {
break;
}
if (gedLine.getLevel() <= this.getLevel()) {
return gedLine;
}
children.add(gedLine);
gedLine = gedLine.readToNext();
}
return null;
} | [
"public",
"final",
"AbstractGedLine",
"readToNext",
"(",
")",
"throws",
"IOException",
"{",
"AbstractGedLine",
"gedLine",
"=",
"source",
".",
"createGedLine",
"(",
"this",
")",
";",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"gedLine",
"==",
"null",
"||",
"gedLine",
".",
"getLevel",
"(",
")",
"==",
"-",
"1",
")",
"{",
"break",
";",
"}",
"if",
"(",
"gedLine",
".",
"getLevel",
"(",
")",
"<=",
"this",
".",
"getLevel",
"(",
")",
")",
"{",
"return",
"gedLine",
";",
"}",
"children",
".",
"add",
"(",
"gedLine",
")",
";",
"gedLine",
"=",
"gedLine",
".",
"readToNext",
"(",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Read the source data until the a line is encountered at the same level as
this one. That allows the reading of children.
@return The GedLine at the current level. Null if the end of data is
reached first.
@throws IOException If this is a file source and we encounter a problem. | [
"Read",
"the",
"source",
"data",
"until",
"the",
"a",
"line",
"is",
"encountered",
"at",
"the",
"same",
"level",
"as",
"this",
"one",
".",
"That",
"allows",
"the",
"reading",
"of",
"children",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-reader/src/main/java/org/schoellerfamily/gedbrowser/reader/AbstractGedLine.java#L92-L109 |
141,536 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java | FamilyBuilderImpl.createFamily | public Family createFamily(final String idString) {
if (idString == null) {
return new Family();
}
final Family family = new Family(getRoot(), new ObjectId(idString));
getRoot().insert(family);
return family;
} | java | public Family createFamily(final String idString) {
if (idString == null) {
return new Family();
}
final Family family = new Family(getRoot(), new ObjectId(idString));
getRoot().insert(family);
return family;
} | [
"public",
"Family",
"createFamily",
"(",
"final",
"String",
"idString",
")",
"{",
"if",
"(",
"idString",
"==",
"null",
")",
"{",
"return",
"new",
"Family",
"(",
")",
";",
"}",
"final",
"Family",
"family",
"=",
"new",
"Family",
"(",
"getRoot",
"(",
")",
",",
"new",
"ObjectId",
"(",
"idString",
")",
")",
";",
"getRoot",
"(",
")",
".",
"insert",
"(",
"family",
")",
";",
"return",
"family",
";",
"}"
] | Encapsulate creating family with the given ID.
@param idString the id string for the family
@return the family | [
"Encapsulate",
"creating",
"family",
"with",
"the",
"given",
"ID",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java#L54-L61 |
141,537 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java | FamilyBuilderImpl.createFamilyEvent | public Attribute createFamilyEvent(final Family family, final String type,
final String dateString) {
if (family == null || type == null || dateString == null) {
return gedObjectBuilder.createAttribute();
}
final Attribute event = gedObjectBuilder.createAttribute(family, type);
event.insert(new Date(event, dateString));
return event;
} | java | public Attribute createFamilyEvent(final Family family, final String type,
final String dateString) {
if (family == null || type == null || dateString == null) {
return gedObjectBuilder.createAttribute();
}
final Attribute event = gedObjectBuilder.createAttribute(family, type);
event.insert(new Date(event, dateString));
return event;
} | [
"public",
"Attribute",
"createFamilyEvent",
"(",
"final",
"Family",
"family",
",",
"final",
"String",
"type",
",",
"final",
"String",
"dateString",
")",
"{",
"if",
"(",
"family",
"==",
"null",
"||",
"type",
"==",
"null",
"||",
"dateString",
"==",
"null",
")",
"{",
"return",
"gedObjectBuilder",
".",
"createAttribute",
"(",
")",
";",
"}",
"final",
"Attribute",
"event",
"=",
"gedObjectBuilder",
".",
"createAttribute",
"(",
"family",
",",
"type",
")",
";",
"event",
".",
"insert",
"(",
"new",
"Date",
"(",
"event",
",",
"dateString",
")",
")",
";",
"return",
"event",
";",
"}"
] | Create a dated event.
@param family the family the event is for
@param type the type of event
@param dateString the date of the event
@return the created event | [
"Create",
"a",
"dated",
"event",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java#L71-L79 |
141,538 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java | FamilyBuilderImpl.createFamilyEvent | public Attribute createFamilyEvent(final Family family,
final String type) {
return gedObjectBuilder.createAttribute(family, type);
} | java | public Attribute createFamilyEvent(final Family family,
final String type) {
return gedObjectBuilder.createAttribute(family, type);
} | [
"public",
"Attribute",
"createFamilyEvent",
"(",
"final",
"Family",
"family",
",",
"final",
"String",
"type",
")",
"{",
"return",
"gedObjectBuilder",
".",
"createAttribute",
"(",
"family",
",",
"type",
")",
";",
"}"
] | Create an undated event.
@param family the family the event is for
@param type the type of event
@return the created event | [
"Create",
"an",
"undated",
"event",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java#L88-L91 |
141,539 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java | FamilyBuilderImpl.addWifeToFamily | public Wife addWifeToFamily(final Family family, final Person person) {
if (family == null || person == null) {
return new Wife();
}
final FamS famS = new FamS(person, "FAMS",
new ObjectId(family.getString()));
final Wife wife = new Wife(family, "Wife",
new ObjectId(person.getString()));
family.insert(wife);
person.insert(famS);
return wife;
} | java | public Wife addWifeToFamily(final Family family, final Person person) {
if (family == null || person == null) {
return new Wife();
}
final FamS famS = new FamS(person, "FAMS",
new ObjectId(family.getString()));
final Wife wife = new Wife(family, "Wife",
new ObjectId(person.getString()));
family.insert(wife);
person.insert(famS);
return wife;
} | [
"public",
"Wife",
"addWifeToFamily",
"(",
"final",
"Family",
"family",
",",
"final",
"Person",
"person",
")",
"{",
"if",
"(",
"family",
"==",
"null",
"||",
"person",
"==",
"null",
")",
"{",
"return",
"new",
"Wife",
"(",
")",
";",
"}",
"final",
"FamS",
"famS",
"=",
"new",
"FamS",
"(",
"person",
",",
"\"FAMS\"",
",",
"new",
"ObjectId",
"(",
"family",
".",
"getString",
"(",
")",
")",
")",
";",
"final",
"Wife",
"wife",
"=",
"new",
"Wife",
"(",
"family",
",",
"\"Wife\"",
",",
"new",
"ObjectId",
"(",
"person",
".",
"getString",
"(",
")",
")",
")",
";",
"family",
".",
"insert",
"(",
"wife",
")",
";",
"person",
".",
"insert",
"(",
"famS",
")",
";",
"return",
"wife",
";",
"}"
] | Add a person as the wife in a family.
@param family the family
@param person the person
@return the wife object | [
"Add",
"a",
"person",
"as",
"the",
"wife",
"in",
"a",
"family",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java#L121-L132 |
141,540 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java | FamilyBuilderImpl.addChildToFamily | public Child addChildToFamily(final Family family, final Person person) {
if (family == null || person == null) {
return new Child();
}
final FamC famC = new FamC(person, "FAMC",
new ObjectId(family.getString()));
final Child child = new Child(family, "Child",
new ObjectId(person.getString()));
family.insert(child);
person.insert(famC);
return child;
} | java | public Child addChildToFamily(final Family family, final Person person) {
if (family == null || person == null) {
return new Child();
}
final FamC famC = new FamC(person, "FAMC",
new ObjectId(family.getString()));
final Child child = new Child(family, "Child",
new ObjectId(person.getString()));
family.insert(child);
person.insert(famC);
return child;
} | [
"public",
"Child",
"addChildToFamily",
"(",
"final",
"Family",
"family",
",",
"final",
"Person",
"person",
")",
"{",
"if",
"(",
"family",
"==",
"null",
"||",
"person",
"==",
"null",
")",
"{",
"return",
"new",
"Child",
"(",
")",
";",
"}",
"final",
"FamC",
"famC",
"=",
"new",
"FamC",
"(",
"person",
",",
"\"FAMC\"",
",",
"new",
"ObjectId",
"(",
"family",
".",
"getString",
"(",
")",
")",
")",
";",
"final",
"Child",
"child",
"=",
"new",
"Child",
"(",
"family",
",",
"\"Child\"",
",",
"new",
"ObjectId",
"(",
"person",
".",
"getString",
"(",
")",
")",
")",
";",
"family",
".",
"insert",
"(",
"child",
")",
";",
"person",
".",
"insert",
"(",
"famC",
")",
";",
"return",
"child",
";",
"}"
] | Add a person as a child in a family.
@param person the person
@param family the family
@return the Child object | [
"Add",
"a",
"person",
"as",
"a",
"child",
"in",
"a",
"family",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/FamilyBuilderImpl.java#L141-L152 |
141,541 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/GedObjectBuilder.java | GedObjectBuilder.createTrailer | public Trailer createTrailer() {
final Trailer trailer = new Trailer(getRoot(), "Trailer");
getRoot().insert(trailer);
return trailer;
} | java | public Trailer createTrailer() {
final Trailer trailer = new Trailer(getRoot(), "Trailer");
getRoot().insert(trailer);
return trailer;
} | [
"public",
"Trailer",
"createTrailer",
"(",
")",
"{",
"final",
"Trailer",
"trailer",
"=",
"new",
"Trailer",
"(",
"getRoot",
"(",
")",
",",
"\"Trailer\"",
")",
";",
"getRoot",
"(",
")",
".",
"insert",
"(",
"trailer",
")",
";",
"return",
"trailer",
";",
"}"
] | Create a trailer for the data set.
@return the created trailer | [
"Create",
"a",
"trailer",
"for",
"the",
"data",
"set",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/GedObjectBuilder.java#L180-L184 |
141,542 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/GedObjectBuilder.java | GedObjectBuilder.createHead | public Head createHead() {
final Head head = new Head(getRoot(), "Head");
getRoot().insert(head);
return head;
} | java | public Head createHead() {
final Head head = new Head(getRoot(), "Head");
getRoot().insert(head);
return head;
} | [
"public",
"Head",
"createHead",
"(",
")",
"{",
"final",
"Head",
"head",
"=",
"new",
"Head",
"(",
"getRoot",
"(",
")",
",",
"\"Head\"",
")",
";",
"getRoot",
"(",
")",
".",
"insert",
"(",
"head",
")",
";",
"return",
"head",
";",
"}"
] | Create a head for the data set.
@return the created trailer | [
"Create",
"a",
"head",
"for",
"the",
"data",
"set",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/GedObjectBuilder.java#L191-L195 |
141,543 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/GedObjectBuilder.java | GedObjectBuilder.createSubmissionLink | public SubmissionLink createSubmissionLink(final Submission submission) {
Head head = getRoot().find("Head", Head.class);
if (head == null) {
head = createHead();
}
final SubmissionLink submissionLink =
new SubmissionLink(head, "Submission",
new ObjectId(submission.getString()));
head.insert(submissionLink);
return submissionLink;
} | java | public SubmissionLink createSubmissionLink(final Submission submission) {
Head head = getRoot().find("Head", Head.class);
if (head == null) {
head = createHead();
}
final SubmissionLink submissionLink =
new SubmissionLink(head, "Submission",
new ObjectId(submission.getString()));
head.insert(submissionLink);
return submissionLink;
} | [
"public",
"SubmissionLink",
"createSubmissionLink",
"(",
"final",
"Submission",
"submission",
")",
"{",
"Head",
"head",
"=",
"getRoot",
"(",
")",
".",
"find",
"(",
"\"Head\"",
",",
"Head",
".",
"class",
")",
";",
"if",
"(",
"head",
"==",
"null",
")",
"{",
"head",
"=",
"createHead",
"(",
")",
";",
"}",
"final",
"SubmissionLink",
"submissionLink",
"=",
"new",
"SubmissionLink",
"(",
"head",
",",
"\"Submission\"",
",",
"new",
"ObjectId",
"(",
"submission",
".",
"getString",
"(",
")",
")",
")",
";",
"head",
".",
"insert",
"(",
"submissionLink",
")",
";",
"return",
"submissionLink",
";",
"}"
] | Create a link to the submission in the head. If head doesn't already
exist create it.
@param submission
the submission to link
@return the submission link | [
"Create",
"a",
"link",
"to",
"the",
"submission",
"in",
"the",
"head",
".",
"If",
"head",
"doesn",
"t",
"already",
"exist",
"create",
"it",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/GedObjectBuilder.java#L216-L226 |
141,544 | dickschoeller/gedbrowser | gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/transformers/TopLevelDocumentToApiModelVisitor.java | TopLevelDocumentToApiModelVisitor.addAttributes | protected void addAttributes(final GedDocument<?> document) {
for (final GedDocument<? extends GedObject> attribute : document
.getAttributes()) {
final DocumentToApiModelVisitor v = createVisitor();
attribute.accept(v);
baseObject.getAttributes()
.add(convertToAttribute(v.getBaseObject()));
}
} | java | protected void addAttributes(final GedDocument<?> document) {
for (final GedDocument<? extends GedObject> attribute : document
.getAttributes()) {
final DocumentToApiModelVisitor v = createVisitor();
attribute.accept(v);
baseObject.getAttributes()
.add(convertToAttribute(v.getBaseObject()));
}
} | [
"protected",
"void",
"addAttributes",
"(",
"final",
"GedDocument",
"<",
"?",
">",
"document",
")",
"{",
"for",
"(",
"final",
"GedDocument",
"<",
"?",
"extends",
"GedObject",
">",
"attribute",
":",
"document",
".",
"getAttributes",
"(",
")",
")",
"{",
"final",
"DocumentToApiModelVisitor",
"v",
"=",
"createVisitor",
"(",
")",
";",
"attribute",
".",
"accept",
"(",
"v",
")",
";",
"baseObject",
".",
"getAttributes",
"(",
")",
".",
"add",
"(",
"convertToAttribute",
"(",
"v",
".",
"getBaseObject",
"(",
")",
")",
")",
";",
"}",
"}"
] | Recurse into the child documents converting and adding to the list.
@param document the current document | [
"Recurse",
"into",
"the",
"child",
"documents",
"converting",
"and",
"adding",
"to",
"the",
"list",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/transformers/TopLevelDocumentToApiModelVisitor.java#L149-L157 |
141,545 | dickschoeller/gedbrowser | gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/transformers/TopLevelDocumentToApiModelVisitor.java | TopLevelDocumentToApiModelVisitor.addSplitAttributes | protected void addSplitAttributes(final GedDocument<?> document) {
for (final GedDocument<? extends GedObject> attribute : document
.getAttributes()) {
final DocumentToApiModelVisitor v = createVisitor();
attribute.accept(v);
((ApiHasImages) baseObject)
.addAttribute(convertToAttribute(v.getBaseObject()));
}
} | java | protected void addSplitAttributes(final GedDocument<?> document) {
for (final GedDocument<? extends GedObject> attribute : document
.getAttributes()) {
final DocumentToApiModelVisitor v = createVisitor();
attribute.accept(v);
((ApiHasImages) baseObject)
.addAttribute(convertToAttribute(v.getBaseObject()));
}
} | [
"protected",
"void",
"addSplitAttributes",
"(",
"final",
"GedDocument",
"<",
"?",
">",
"document",
")",
"{",
"for",
"(",
"final",
"GedDocument",
"<",
"?",
"extends",
"GedObject",
">",
"attribute",
":",
"document",
".",
"getAttributes",
"(",
")",
")",
"{",
"final",
"DocumentToApiModelVisitor",
"v",
"=",
"createVisitor",
"(",
")",
";",
"attribute",
".",
"accept",
"(",
"v",
")",
";",
"(",
"(",
"ApiHasImages",
")",
"baseObject",
")",
".",
"addAttribute",
"(",
"convertToAttribute",
"(",
"v",
".",
"getBaseObject",
"(",
")",
")",
")",
";",
"}",
"}"
] | Recurse into the child documents converting and adding to the list.
Several document types require special processing because they have
split lists.
@param document the current document | [
"Recurse",
"into",
"the",
"child",
"documents",
"converting",
"and",
"adding",
"to",
"the",
"list",
".",
"Several",
"document",
"types",
"require",
"special",
"processing",
"because",
"they",
"have",
"split",
"lists",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/transformers/TopLevelDocumentToApiModelVisitor.java#L166-L174 |
141,546 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/visitor/IgnoreableProcessor.java | IgnoreableProcessor.ignoreable | protected final boolean ignoreable(final Attribute event) {
// Layed out like this because it is easier to understand
// coverage. No performance differences expected compared
// to tighter layout.
if ("Sex".equals(event.getString())) {
return true;
}
if ("Changed".equals(event.getString())) {
return true;
}
if ("Ancestral File Number".equals(event.getString())) {
return true;
}
if ("Title".equals(event.getString())) {
return true;
}
if ("Attribute".equals(event.getString())) {
// Only care about random attributes if they are dated
final GetDateVisitor visitor = new GetDateVisitor();
event.accept(visitor);
return "".equals(visitor.getDate());
}
if ("Note".equals(event.getString())) {
// Only care about notes if they are dated
final GetDateVisitor visitor = new GetDateVisitor();
event.accept(visitor);
return "".equals(visitor.getDate());
}
return "Reference Number".equals(event.getString());
} | java | protected final boolean ignoreable(final Attribute event) {
// Layed out like this because it is easier to understand
// coverage. No performance differences expected compared
// to tighter layout.
if ("Sex".equals(event.getString())) {
return true;
}
if ("Changed".equals(event.getString())) {
return true;
}
if ("Ancestral File Number".equals(event.getString())) {
return true;
}
if ("Title".equals(event.getString())) {
return true;
}
if ("Attribute".equals(event.getString())) {
// Only care about random attributes if they are dated
final GetDateVisitor visitor = new GetDateVisitor();
event.accept(visitor);
return "".equals(visitor.getDate());
}
if ("Note".equals(event.getString())) {
// Only care about notes if they are dated
final GetDateVisitor visitor = new GetDateVisitor();
event.accept(visitor);
return "".equals(visitor.getDate());
}
return "Reference Number".equals(event.getString());
} | [
"protected",
"final",
"boolean",
"ignoreable",
"(",
"final",
"Attribute",
"event",
")",
"{",
"// Layed out like this because it is easier to understand",
"// coverage. No performance differences expected compared",
"// to tighter layout.",
"if",
"(",
"\"Sex\"",
".",
"equals",
"(",
"event",
".",
"getString",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"\"Changed\"",
".",
"equals",
"(",
"event",
".",
"getString",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"\"Ancestral File Number\"",
".",
"equals",
"(",
"event",
".",
"getString",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"\"Title\"",
".",
"equals",
"(",
"event",
".",
"getString",
"(",
")",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"\"Attribute\"",
".",
"equals",
"(",
"event",
".",
"getString",
"(",
")",
")",
")",
"{",
"// Only care about random attributes if they are dated",
"final",
"GetDateVisitor",
"visitor",
"=",
"new",
"GetDateVisitor",
"(",
")",
";",
"event",
".",
"accept",
"(",
"visitor",
")",
";",
"return",
"\"\"",
".",
"equals",
"(",
"visitor",
".",
"getDate",
"(",
")",
")",
";",
"}",
"if",
"(",
"\"Note\"",
".",
"equals",
"(",
"event",
".",
"getString",
"(",
")",
")",
")",
"{",
"// Only care about notes if they are dated",
"final",
"GetDateVisitor",
"visitor",
"=",
"new",
"GetDateVisitor",
"(",
")",
";",
"event",
".",
"accept",
"(",
"visitor",
")",
";",
"return",
"\"\"",
".",
"equals",
"(",
"visitor",
".",
"getDate",
"(",
")",
")",
";",
"}",
"return",
"\"Reference Number\"",
".",
"equals",
"(",
"event",
".",
"getString",
"(",
")",
")",
";",
"}"
] | Certain events have no time basis on the person.
@param event the event
@return true if it is non-time event | [
"Certain",
"events",
"have",
"no",
"time",
"basis",
"on",
"the",
"person",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/visitor/IgnoreableProcessor.java#L16-L45 |
141,547 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/MultimediaVisitor.java | MultimediaVisitor.visit | @Override
public void visit(final Attribute attribute) {
final String string = attribute.getString();
if ("File".equals(string)) {
filePath = attribute.getTail();
for (final GedObject subObject : attribute.getAttributes()) {
subObject.accept(this);
}
}
if ("Format".equals(string)) {
format = attribute.getTail();
}
if ("Title".equals(string)) {
title = attribute.getTail();
}
} | java | @Override
public void visit(final Attribute attribute) {
final String string = attribute.getString();
if ("File".equals(string)) {
filePath = attribute.getTail();
for (final GedObject subObject : attribute.getAttributes()) {
subObject.accept(this);
}
}
if ("Format".equals(string)) {
format = attribute.getTail();
}
if ("Title".equals(string)) {
title = attribute.getTail();
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"final",
"Attribute",
"attribute",
")",
"{",
"final",
"String",
"string",
"=",
"attribute",
".",
"getString",
"(",
")",
";",
"if",
"(",
"\"File\"",
".",
"equals",
"(",
"string",
")",
")",
"{",
"filePath",
"=",
"attribute",
".",
"getTail",
"(",
")",
";",
"for",
"(",
"final",
"GedObject",
"subObject",
":",
"attribute",
".",
"getAttributes",
"(",
")",
")",
"{",
"subObject",
".",
"accept",
"(",
"this",
")",
";",
"}",
"}",
"if",
"(",
"\"Format\"",
".",
"equals",
"(",
"string",
")",
")",
"{",
"format",
"=",
"attribute",
".",
"getTail",
"(",
")",
";",
"}",
"if",
"(",
"\"Title\"",
".",
"equals",
"(",
"string",
")",
")",
"{",
"title",
"=",
"attribute",
".",
"getTail",
"(",
")",
";",
"}",
"}"
] | Visit an Attribute. The values of specific attributes are gathered for
later use.
@see GedObjectVisitor#visit(Attribute) | [
"Visit",
"an",
"Attribute",
".",
"The",
"values",
"of",
"specific",
"attributes",
"are",
"gathered",
"for",
"later",
"use",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/MultimediaVisitor.java#L58-L73 |
141,548 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/MultimediaVisitor.java | MultimediaVisitor.visit | @Override
public void visit(final Multimedia multimedia) {
for (final GedObject gedObject : multimedia.getAttributes()) {
gedObject.accept(this);
}
} | java | @Override
public void visit(final Multimedia multimedia) {
for (final GedObject gedObject : multimedia.getAttributes()) {
gedObject.accept(this);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"final",
"Multimedia",
"multimedia",
")",
"{",
"for",
"(",
"final",
"GedObject",
"gedObject",
":",
"multimedia",
".",
"getAttributes",
"(",
")",
")",
"{",
"gedObject",
".",
"accept",
"(",
"this",
")",
";",
"}",
"}"
] | Visit a Multimedia. This is the primary focus of the visitation. From
here, interesting information is gathered from the attributes.
@see GedObjectVisitor#visit(Multimedia) | [
"Visit",
"a",
"Multimedia",
".",
"This",
"is",
"the",
"primary",
"focus",
"of",
"the",
"visitation",
".",
"From",
"here",
"interesting",
"information",
"is",
"gathered",
"from",
"the",
"attributes",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/MultimediaVisitor.java#L81-L86 |
141,549 | dickschoeller/gedbrowser | gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/service/storage/FileSystemStorageService.java | FileSystemStorageService.validateFile | private String validateFile(final MultipartFile file) {
final String filename = StringUtils
.cleanPath(file.getOriginalFilename());
if (file.isEmpty()) {
throw new StorageException(
"Failed to store empty file " + filename);
}
if (filename.contains("..")) {
// This is a security check
throw new StorageException(
"Cannot store file with relative path outside current"
+ " directory "
+ filename);
}
return filename;
} | java | private String validateFile(final MultipartFile file) {
final String filename = StringUtils
.cleanPath(file.getOriginalFilename());
if (file.isEmpty()) {
throw new StorageException(
"Failed to store empty file " + filename);
}
if (filename.contains("..")) {
// This is a security check
throw new StorageException(
"Cannot store file with relative path outside current"
+ " directory "
+ filename);
}
return filename;
} | [
"private",
"String",
"validateFile",
"(",
"final",
"MultipartFile",
"file",
")",
"{",
"final",
"String",
"filename",
"=",
"StringUtils",
".",
"cleanPath",
"(",
"file",
".",
"getOriginalFilename",
"(",
")",
")",
";",
"if",
"(",
"file",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"StorageException",
"(",
"\"Failed to store empty file \"",
"+",
"filename",
")",
";",
"}",
"if",
"(",
"filename",
".",
"contains",
"(",
"\"..\"",
")",
")",
"{",
"// This is a security check",
"throw",
"new",
"StorageException",
"(",
"\"Cannot store file with relative path outside current\"",
"+",
"\" directory \"",
"+",
"filename",
")",
";",
"}",
"return",
"filename",
";",
"}"
] | Extract the filename and validate it.
@param file the input file
@return the filename | [
"Extract",
"the",
"filename",
"and",
"validate",
"it",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/service/storage/FileSystemStorageService.java#L58-L73 |
141,550 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/GetStringComparator.java | GetStringComparator.compareChunks | private int compareChunks(final String thisChunk, final String thatChunk) {
final int thisChunkLength = thisChunk.length();
for (int i = 0; i < thisChunkLength; i++) {
final int result = thisChunk.charAt(i) - thatChunk.charAt(i);
if (result != 0) {
return result;
}
}
return 0;
} | java | private int compareChunks(final String thisChunk, final String thatChunk) {
final int thisChunkLength = thisChunk.length();
for (int i = 0; i < thisChunkLength; i++) {
final int result = thisChunk.charAt(i) - thatChunk.charAt(i);
if (result != 0) {
return result;
}
}
return 0;
} | [
"private",
"int",
"compareChunks",
"(",
"final",
"String",
"thisChunk",
",",
"final",
"String",
"thatChunk",
")",
"{",
"final",
"int",
"thisChunkLength",
"=",
"thisChunk",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"thisChunkLength",
";",
"i",
"++",
")",
"{",
"final",
"int",
"result",
"=",
"thisChunk",
".",
"charAt",
"(",
"i",
")",
"-",
"thatChunk",
".",
"charAt",
"(",
"i",
")",
";",
"if",
"(",
"result",
"!=",
"0",
")",
"{",
"return",
"result",
";",
"}",
"}",
"return",
"0",
";",
"}"
] | Compare two chunks based on assumed same length. 0 if the same.
@param thisChunk the first chunk to be compared
@param thatChunk the second chunk to be compared
@return the difference in length (l1 - l2) | [
"Compare",
"two",
"chunks",
"based",
"on",
"assumed",
"same",
"length",
".",
"0",
"if",
"the",
"same",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/GetStringComparator.java#L117-L126 |
141,551 | dickschoeller/gedbrowser | gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/WebSecurityConfig.java | WebSecurityConfig.handleCsrf | private HttpSecurity handleCsrf(final HttpSecurity http)
throws Exception {
if ("test".equals(activeProfile)) {
return http.csrf().disable();
} else {
return http.csrf().ignoringAntMatchers(
"/gedbrowserng/v1/login",
"/gedbrowserng/v1/signup")
.csrfTokenRepository(
CookieCsrfTokenRepository.withHttpOnlyFalse())
.and();
}
} | java | private HttpSecurity handleCsrf(final HttpSecurity http)
throws Exception {
if ("test".equals(activeProfile)) {
return http.csrf().disable();
} else {
return http.csrf().ignoringAntMatchers(
"/gedbrowserng/v1/login",
"/gedbrowserng/v1/signup")
.csrfTokenRepository(
CookieCsrfTokenRepository.withHttpOnlyFalse())
.and();
}
} | [
"private",
"HttpSecurity",
"handleCsrf",
"(",
"final",
"HttpSecurity",
"http",
")",
"throws",
"Exception",
"{",
"if",
"(",
"\"test\"",
".",
"equals",
"(",
"activeProfile",
")",
")",
"{",
"return",
"http",
".",
"csrf",
"(",
")",
".",
"disable",
"(",
")",
";",
"}",
"else",
"{",
"return",
"http",
".",
"csrf",
"(",
")",
".",
"ignoringAntMatchers",
"(",
"\"/gedbrowserng/v1/login\"",
",",
"\"/gedbrowserng/v1/signup\"",
")",
".",
"csrfTokenRepository",
"(",
"CookieCsrfTokenRepository",
".",
"withHttpOnlyFalse",
"(",
")",
")",
".",
"and",
"(",
")",
";",
"}",
"}"
] | Work from the http security object and enable or disable CSRF handling,
as requested in the application properties.
@param http the http security object
@return the http security object
@throws Exception if there is a problem | [
"Work",
"from",
"the",
"http",
"security",
"object",
"and",
"enable",
"or",
"disable",
"CSRF",
"handling",
"as",
"requested",
"in",
"the",
"application",
"properties",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/WebSecurityConfig.java#L164-L176 |
141,552 | dickschoeller/gedbrowser | gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/transformers/AttributeListHelper.java | AttributeListHelper.addByType | private void addByType(final ApiAttribute apiParent, final String string) {
for (final ApiAttribute object : apiParent.getAttributes()) {
if (object.isType(string)) {
final ApiModelToGedObjectVisitor visitor = createVisitor();
object.accept(visitor);
}
}
} | java | private void addByType(final ApiAttribute apiParent, final String string) {
for (final ApiAttribute object : apiParent.getAttributes()) {
if (object.isType(string)) {
final ApiModelToGedObjectVisitor visitor = createVisitor();
object.accept(visitor);
}
}
} | [
"private",
"void",
"addByType",
"(",
"final",
"ApiAttribute",
"apiParent",
",",
"final",
"String",
"string",
")",
"{",
"for",
"(",
"final",
"ApiAttribute",
"object",
":",
"apiParent",
".",
"getAttributes",
"(",
")",
")",
"{",
"if",
"(",
"object",
".",
"isType",
"(",
"string",
")",
")",
"{",
"final",
"ApiModelToGedObjectVisitor",
"visitor",
"=",
"createVisitor",
"(",
")",
";",
"object",
".",
"accept",
"(",
"visitor",
")",
";",
"}",
"}",
"}"
] | Add the attributes if they match the given type.
@param apiParent the parent attribute
@param string the type we want to match | [
"Add",
"the",
"attributes",
"if",
"they",
"match",
"the",
"given",
"type",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/transformers/AttributeListHelper.java#L42-L49 |
141,553 | dickschoeller/gedbrowser | gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/transformers/AttributeListHelper.java | AttributeListHelper.addIfNotTypes | private void addIfNotTypes(final ApiAttribute apiParent,
final String... types) {
for (final ApiAttribute object : apiParent.getAttributes()) {
if (!matchOne(object, types)) {
final ApiModelToGedObjectVisitor visitor = createVisitor();
object.accept(visitor);
}
}
} | java | private void addIfNotTypes(final ApiAttribute apiParent,
final String... types) {
for (final ApiAttribute object : apiParent.getAttributes()) {
if (!matchOne(object, types)) {
final ApiModelToGedObjectVisitor visitor = createVisitor();
object.accept(visitor);
}
}
} | [
"private",
"void",
"addIfNotTypes",
"(",
"final",
"ApiAttribute",
"apiParent",
",",
"final",
"String",
"...",
"types",
")",
"{",
"for",
"(",
"final",
"ApiAttribute",
"object",
":",
"apiParent",
".",
"getAttributes",
"(",
")",
")",
"{",
"if",
"(",
"!",
"matchOne",
"(",
"object",
",",
"types",
")",
")",
"{",
"final",
"ApiModelToGedObjectVisitor",
"visitor",
"=",
"createVisitor",
"(",
")",
";",
"object",
".",
"accept",
"(",
"visitor",
")",
";",
"}",
"}",
"}"
] | Add the attributes that don't match any of the selected types.
@param apiParent the parent attribute
@param types the types to check | [
"Add",
"the",
"attributes",
"that",
"don",
"t",
"match",
"any",
"of",
"the",
"selected",
"types",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/transformers/AttributeListHelper.java#L57-L65 |
141,554 | dickschoeller/gedbrowser | gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/transformers/AttributeListHelper.java | AttributeListHelper.addToAttributes | private void addToAttributes(final List<ApiAttribute> attributes) {
for (final ApiObject object : attributes) {
final ApiModelToGedObjectVisitor visitor = createVisitor();
object.accept(visitor);
}
} | java | private void addToAttributes(final List<ApiAttribute> attributes) {
for (final ApiObject object : attributes) {
final ApiModelToGedObjectVisitor visitor = createVisitor();
object.accept(visitor);
}
} | [
"private",
"void",
"addToAttributes",
"(",
"final",
"List",
"<",
"ApiAttribute",
">",
"attributes",
")",
"{",
"for",
"(",
"final",
"ApiObject",
"object",
":",
"attributes",
")",
"{",
"final",
"ApiModelToGedObjectVisitor",
"visitor",
"=",
"createVisitor",
"(",
")",
";",
"object",
".",
"accept",
"(",
"visitor",
")",
";",
"}",
"}"
] | Add to the attributes of the parent for saving.
@param attributes some attributes to add to the list | [
"Add",
"to",
"the",
"attributes",
"of",
"the",
"parent",
"for",
"saving",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/transformers/AttributeListHelper.java#L117-L122 |
141,555 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/Date.java | Date.getSortCalendar | private Calendar getSortCalendar() {
if (sortDate == null) {
final DateParser parser = new DateParser(getDate());
sortDate = parser.getSortCalendar();
}
return sortDate;
} | java | private Calendar getSortCalendar() {
if (sortDate == null) {
final DateParser parser = new DateParser(getDate());
sortDate = parser.getSortCalendar();
}
return sortDate;
} | [
"private",
"Calendar",
"getSortCalendar",
"(",
")",
"{",
"if",
"(",
"sortDate",
"==",
"null",
")",
"{",
"final",
"DateParser",
"parser",
"=",
"new",
"DateParser",
"(",
"getDate",
"(",
")",
")",
";",
"sortDate",
"=",
"parser",
".",
"getSortCalendar",
"(",
")",
";",
"}",
"return",
"sortDate",
";",
"}"
] | Return the sortable date in the form of a Calendar.
@return the calendar | [
"Return",
"the",
"sortable",
"date",
"in",
"the",
"form",
"of",
"a",
"Calendar",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/Date.java#L74-L80 |
141,556 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/Date.java | Date.getEstimateDate | public String getEstimateDate() {
final DateParser parser = new DateParser(getDate());
if (estimateDate == null) {
estimateDate = parser.getEstimateCalendar();
}
final SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd",
Locale.US);
return format(formatter, estimateDate);
} | java | public String getEstimateDate() {
final DateParser parser = new DateParser(getDate());
if (estimateDate == null) {
estimateDate = parser.getEstimateCalendar();
}
final SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd",
Locale.US);
return format(formatter, estimateDate);
} | [
"public",
"String",
"getEstimateDate",
"(",
")",
"{",
"final",
"DateParser",
"parser",
"=",
"new",
"DateParser",
"(",
"getDate",
"(",
")",
")",
";",
"if",
"(",
"estimateDate",
"==",
"null",
")",
"{",
"estimateDate",
"=",
"parser",
".",
"getEstimateCalendar",
"(",
")",
";",
"}",
"final",
"SimpleDateFormat",
"formatter",
"=",
"new",
"SimpleDateFormat",
"(",
"\"yyyyMMdd\"",
",",
"Locale",
".",
"US",
")",
";",
"return",
"format",
"(",
"formatter",
",",
"estimateDate",
")",
";",
"}"
] | Like sort date only we are starting in on correcting the problems with
approximations.
@return string in the form yyyymmdd | [
"Like",
"sort",
"date",
"only",
"we",
"are",
"starting",
"in",
"on",
"correcting",
"the",
"problems",
"with",
"approximations",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/Date.java#L88-L96 |
141,557 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/AbstractGedObjectFactory.java | AbstractGedObjectFactory.create | public final GedObject create(final GedObject parent, final String xref,
final String tag, final String tail) {
return getFactory(tag).create(parent, new ObjectId(xref),
fullstring(tag), tail);
} | java | public final GedObject create(final GedObject parent, final String xref,
final String tag, final String tail) {
return getFactory(tag).create(parent, new ObjectId(xref),
fullstring(tag), tail);
} | [
"public",
"final",
"GedObject",
"create",
"(",
"final",
"GedObject",
"parent",
",",
"final",
"String",
"xref",
",",
"final",
"String",
"tag",
",",
"final",
"String",
"tail",
")",
"{",
"return",
"getFactory",
"(",
"tag",
")",
".",
"create",
"(",
"parent",
",",
"new",
"ObjectId",
"(",
"xref",
")",
",",
"fullstring",
"(",
"tag",
")",
",",
"tail",
")",
";",
"}"
] | Factory method creates the appropriate GedObject from the provided
strings.
@param parent the parent GedObject
@param xref an optional ID string
@param tag the GEDCOM tag
@param tail the rest of the line
@return the GedObject | [
"Factory",
"method",
"creates",
"the",
"appropriate",
"GedObject",
"from",
"the",
"provided",
"strings",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/AbstractGedObjectFactory.java#L580-L584 |
141,558 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/AbstractGedObjectFactory.java | AbstractGedObjectFactory.getToken | private GedToken getToken(final String tag) {
GedToken gedToken = tokens.get(tag);
if (gedToken == null) {
// Any unknown token is an attribute, retaining its tag.
gedToken = new GedToken(tag, ATTR_FACTORY);
}
return gedToken;
} | java | private GedToken getToken(final String tag) {
GedToken gedToken = tokens.get(tag);
if (gedToken == null) {
// Any unknown token is an attribute, retaining its tag.
gedToken = new GedToken(tag, ATTR_FACTORY);
}
return gedToken;
} | [
"private",
"GedToken",
"getToken",
"(",
"final",
"String",
"tag",
")",
"{",
"GedToken",
"gedToken",
"=",
"tokens",
".",
"get",
"(",
"tag",
")",
";",
"if",
"(",
"gedToken",
"==",
"null",
")",
"{",
"// Any unknown token is an attribute, retaining its tag.",
"gedToken",
"=",
"new",
"GedToken",
"(",
"tag",
",",
"ATTR_FACTORY",
")",
";",
"}",
"return",
"gedToken",
";",
"}"
] | Find the token processor for this tag. Defaults to attribute.
@param tag the tag.
@return the token processor. | [
"Find",
"the",
"token",
"processor",
"for",
"this",
"tag",
".",
"Defaults",
"to",
"attribute",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/AbstractGedObjectFactory.java#L615-L622 |
141,559 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/AbstractGedObjectFactory.java | AbstractGedObjectFactory.fullstring | public final String fullstring(final String tag) {
String fullstring = getToken(tag).getFullString();
if (fullstring == null) {
fullstring = tag;
}
return fullstring;
} | java | public final String fullstring(final String tag) {
String fullstring = getToken(tag).getFullString();
if (fullstring == null) {
fullstring = tag;
}
return fullstring;
} | [
"public",
"final",
"String",
"fullstring",
"(",
"final",
"String",
"tag",
")",
"{",
"String",
"fullstring",
"=",
"getToken",
"(",
"tag",
")",
".",
"getFullString",
"(",
")",
";",
"if",
"(",
"fullstring",
"==",
"null",
")",
"{",
"fullstring",
"=",
"tag",
";",
"}",
"return",
"fullstring",
";",
"}"
] | Get the full string for this tag. If not found, return the tag.
@param tag
the tag.
@return the full string. | [
"Get",
"the",
"full",
"string",
"for",
"this",
"tag",
".",
"If",
"not",
"found",
"return",
"the",
"tag",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedobject/datamodel/factory/AbstractGedObjectFactory.java#L631-L637 |
141,560 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/BirthDateFromSiblingsEstimator.java | BirthDateFromSiblingsEstimator.estimateFromSiblings | public LocalDate estimateFromSiblings(final LocalDate localDate) {
if (localDate != null) {
return localDate;
}
boolean beforePerson = true;
LocalDate date = null;
int increment = typicals.gapBetweenChildren();
final PersonNavigator navigator = new PersonNavigator(person);
final List<Family> families = navigator.getFamiliesC();
for (final Family family : families) {
for (final Person sibling : getChildren(family)) {
if (person.equals(sibling)) {
beforePerson = false;
if (date != null) {
break;
}
increment = 0;
continue;
}
final String siblingString = getBirthDate(sibling);
if (!validDateString(siblingString)) {
increment = incrementWhenEmptyDate(beforePerson, increment);
continue;
}
date = createLocalDate(siblingString);
increment = incrementWhenDate(beforePerson, increment);
if (!beforePerson) {
break;
}
}
}
if (date != null) {
date = firstDayOfMonth(plusYears(date, increment));
}
return date;
} | java | public LocalDate estimateFromSiblings(final LocalDate localDate) {
if (localDate != null) {
return localDate;
}
boolean beforePerson = true;
LocalDate date = null;
int increment = typicals.gapBetweenChildren();
final PersonNavigator navigator = new PersonNavigator(person);
final List<Family> families = navigator.getFamiliesC();
for (final Family family : families) {
for (final Person sibling : getChildren(family)) {
if (person.equals(sibling)) {
beforePerson = false;
if (date != null) {
break;
}
increment = 0;
continue;
}
final String siblingString = getBirthDate(sibling);
if (!validDateString(siblingString)) {
increment = incrementWhenEmptyDate(beforePerson, increment);
continue;
}
date = createLocalDate(siblingString);
increment = incrementWhenDate(beforePerson, increment);
if (!beforePerson) {
break;
}
}
}
if (date != null) {
date = firstDayOfMonth(plusYears(date, increment));
}
return date;
} | [
"public",
"LocalDate",
"estimateFromSiblings",
"(",
"final",
"LocalDate",
"localDate",
")",
"{",
"if",
"(",
"localDate",
"!=",
"null",
")",
"{",
"return",
"localDate",
";",
"}",
"boolean",
"beforePerson",
"=",
"true",
";",
"LocalDate",
"date",
"=",
"null",
";",
"int",
"increment",
"=",
"typicals",
".",
"gapBetweenChildren",
"(",
")",
";",
"final",
"PersonNavigator",
"navigator",
"=",
"new",
"PersonNavigator",
"(",
"person",
")",
";",
"final",
"List",
"<",
"Family",
">",
"families",
"=",
"navigator",
".",
"getFamiliesC",
"(",
")",
";",
"for",
"(",
"final",
"Family",
"family",
":",
"families",
")",
"{",
"for",
"(",
"final",
"Person",
"sibling",
":",
"getChildren",
"(",
"family",
")",
")",
"{",
"if",
"(",
"person",
".",
"equals",
"(",
"sibling",
")",
")",
"{",
"beforePerson",
"=",
"false",
";",
"if",
"(",
"date",
"!=",
"null",
")",
"{",
"break",
";",
"}",
"increment",
"=",
"0",
";",
"continue",
";",
"}",
"final",
"String",
"siblingString",
"=",
"getBirthDate",
"(",
"sibling",
")",
";",
"if",
"(",
"!",
"validDateString",
"(",
"siblingString",
")",
")",
"{",
"increment",
"=",
"incrementWhenEmptyDate",
"(",
"beforePerson",
",",
"increment",
")",
";",
"continue",
";",
"}",
"date",
"=",
"createLocalDate",
"(",
"siblingString",
")",
";",
"increment",
"=",
"incrementWhenDate",
"(",
"beforePerson",
",",
"increment",
")",
";",
"if",
"(",
"!",
"beforePerson",
")",
"{",
"break",
";",
"}",
"}",
"}",
"if",
"(",
"date",
"!=",
"null",
")",
"{",
"date",
"=",
"firstDayOfMonth",
"(",
"plusYears",
"(",
"date",
",",
"increment",
")",
")",
";",
"}",
"return",
"date",
";",
"}"
] | Try estimating from sibling dates. Null if no siblings or siblings
also don't have dates.
@param localDate if not null we already have a better estimate
@return the estimate from siblings | [
"Try",
"estimating",
"from",
"sibling",
"dates",
".",
"Null",
"if",
"no",
"siblings",
"or",
"siblings",
"also",
"don",
"t",
"have",
"dates",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/BirthDateFromSiblingsEstimator.java#L38-L74 |
141,561 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java | DateParser.getEstimateCalendar | public Calendar getEstimateCalendar() {
final String dateString = stripApproximationKeywords();
if (dateString.isEmpty()) {
return null;
}
return applyEstimationRules(dateString);
} | java | public Calendar getEstimateCalendar() {
final String dateString = stripApproximationKeywords();
if (dateString.isEmpty()) {
return null;
}
return applyEstimationRules(dateString);
} | [
"public",
"Calendar",
"getEstimateCalendar",
"(",
")",
"{",
"final",
"String",
"dateString",
"=",
"stripApproximationKeywords",
"(",
")",
";",
"if",
"(",
"dateString",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"applyEstimationRules",
"(",
"dateString",
")",
";",
"}"
] | Returns a sortable version of this date with estimation rules applied.
@return the calendar object representing the estimated date | [
"Returns",
"a",
"sortable",
"version",
"of",
"this",
"date",
"with",
"estimation",
"rules",
"applied",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java#L57-L63 |
141,562 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java | DateParser.getSortCalendar | public Calendar getSortCalendar() {
final String dateString = stripApproximationKeywords();
if (dateString.isEmpty()) {
return null;
}
return parseCalendar(dateString);
} | java | public Calendar getSortCalendar() {
final String dateString = stripApproximationKeywords();
if (dateString.isEmpty()) {
return null;
}
return parseCalendar(dateString);
} | [
"public",
"Calendar",
"getSortCalendar",
"(",
")",
"{",
"final",
"String",
"dateString",
"=",
"stripApproximationKeywords",
"(",
")",
";",
"if",
"(",
"dateString",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"parseCalendar",
"(",
"dateString",
")",
";",
"}"
] | Returns the sort version of the date. Does not have
estimation rules applied.
@return return the sort string for this date | [
"Returns",
"the",
"sort",
"version",
"of",
"the",
"date",
".",
"Does",
"not",
"have",
"estimation",
"rules",
"applied",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java#L71-L77 |
141,563 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java | DateParser.startsWithIgnoreCase | private boolean startsWithIgnoreCase(final String dateString,
final String startString) {
final String prefix = dateString.substring(0, startString.length());
return prefix.equalsIgnoreCase(startString);
} | java | private boolean startsWithIgnoreCase(final String dateString,
final String startString) {
final String prefix = dateString.substring(0, startString.length());
return prefix.equalsIgnoreCase(startString);
} | [
"private",
"boolean",
"startsWithIgnoreCase",
"(",
"final",
"String",
"dateString",
",",
"final",
"String",
"startString",
")",
"{",
"final",
"String",
"prefix",
"=",
"dateString",
".",
"substring",
"(",
"0",
",",
"startString",
".",
"length",
"(",
")",
")",
";",
"return",
"prefix",
".",
"equalsIgnoreCase",
"(",
"startString",
")",
";",
"}"
] | Does startsWith but ignoring the case.
@param dateString the input string
@param startString the prefix we are checking for
@return true if dateString starts with a case insensitive match to start | [
"Does",
"startsWith",
"but",
"ignoring",
"the",
"case",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java#L128-L132 |
141,564 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java | DateParser.handleFTMBizzareDateFormat | private String handleFTMBizzareDateFormat(final String dateString) {
approximation = DateParser.Approximation.BETWEEN;
String string = stripPrefix(dateString, "(").trim();
string = stripSuffix(string, ")").trim();
if ("BIC".equals(string)) {
// BIC refers to LDS status "born in the covenant". Such a date can
// be treated as a plain string with no approximation semantics.
return "";
}
if (startsWithIgnoreCase(string, ABT)) {
string = stripPrefix(string, ABT).trim();
approximation = DateParser.Approximation.ABOUT;
}
if (startsWithIgnoreCase(string, AFT)) {
string = stripPrefix(string, AFT).trim();
approximation = DateParser.Approximation.AFTER;
}
if (startsWithIgnoreCase(string, BEF)) {
string = stripPrefix(string, BEF).trim();
approximation = DateParser.Approximation.BEFORE;
}
if (startsWithIgnoreCase(string, FROM)) {
string = stripPrefix(string, FROM).trim();
}
string = truncateAt(string, "-");
string = truncateAt(string, " TO ");
if (string.length() <= 2) {
// Probably like 10-11 Nov 2017
string = stripPrefix(dateString, "(").trim();
string = stripSuffix(string, ")").trim();
string = removeBeginningAt(string, "-");
string = removeBeginningAt(string, " TO ");
}
return string;
} | java | private String handleFTMBizzareDateFormat(final String dateString) {
approximation = DateParser.Approximation.BETWEEN;
String string = stripPrefix(dateString, "(").trim();
string = stripSuffix(string, ")").trim();
if ("BIC".equals(string)) {
// BIC refers to LDS status "born in the covenant". Such a date can
// be treated as a plain string with no approximation semantics.
return "";
}
if (startsWithIgnoreCase(string, ABT)) {
string = stripPrefix(string, ABT).trim();
approximation = DateParser.Approximation.ABOUT;
}
if (startsWithIgnoreCase(string, AFT)) {
string = stripPrefix(string, AFT).trim();
approximation = DateParser.Approximation.AFTER;
}
if (startsWithIgnoreCase(string, BEF)) {
string = stripPrefix(string, BEF).trim();
approximation = DateParser.Approximation.BEFORE;
}
if (startsWithIgnoreCase(string, FROM)) {
string = stripPrefix(string, FROM).trim();
}
string = truncateAt(string, "-");
string = truncateAt(string, " TO ");
if (string.length() <= 2) {
// Probably like 10-11 Nov 2017
string = stripPrefix(dateString, "(").trim();
string = stripSuffix(string, ")").trim();
string = removeBeginningAt(string, "-");
string = removeBeginningAt(string, " TO ");
}
return string;
} | [
"private",
"String",
"handleFTMBizzareDateFormat",
"(",
"final",
"String",
"dateString",
")",
"{",
"approximation",
"=",
"DateParser",
".",
"Approximation",
".",
"BETWEEN",
";",
"String",
"string",
"=",
"stripPrefix",
"(",
"dateString",
",",
"\"(\"",
")",
".",
"trim",
"(",
")",
";",
"string",
"=",
"stripSuffix",
"(",
"string",
",",
"\")\"",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"\"BIC\"",
".",
"equals",
"(",
"string",
")",
")",
"{",
"// BIC refers to LDS status \"born in the covenant\". Such a date can",
"// be treated as a plain string with no approximation semantics.",
"return",
"\"\"",
";",
"}",
"if",
"(",
"startsWithIgnoreCase",
"(",
"string",
",",
"ABT",
")",
")",
"{",
"string",
"=",
"stripPrefix",
"(",
"string",
",",
"ABT",
")",
".",
"trim",
"(",
")",
";",
"approximation",
"=",
"DateParser",
".",
"Approximation",
".",
"ABOUT",
";",
"}",
"if",
"(",
"startsWithIgnoreCase",
"(",
"string",
",",
"AFT",
")",
")",
"{",
"string",
"=",
"stripPrefix",
"(",
"string",
",",
"AFT",
")",
".",
"trim",
"(",
")",
";",
"approximation",
"=",
"DateParser",
".",
"Approximation",
".",
"AFTER",
";",
"}",
"if",
"(",
"startsWithIgnoreCase",
"(",
"string",
",",
"BEF",
")",
")",
"{",
"string",
"=",
"stripPrefix",
"(",
"string",
",",
"BEF",
")",
".",
"trim",
"(",
")",
";",
"approximation",
"=",
"DateParser",
".",
"Approximation",
".",
"BEFORE",
";",
"}",
"if",
"(",
"startsWithIgnoreCase",
"(",
"string",
",",
"FROM",
")",
")",
"{",
"string",
"=",
"stripPrefix",
"(",
"string",
",",
"FROM",
")",
".",
"trim",
"(",
")",
";",
"}",
"string",
"=",
"truncateAt",
"(",
"string",
",",
"\"-\"",
")",
";",
"string",
"=",
"truncateAt",
"(",
"string",
",",
"\" TO \"",
")",
";",
"if",
"(",
"string",
".",
"length",
"(",
")",
"<=",
"2",
")",
"{",
"// Probably like 10-11 Nov 2017",
"string",
"=",
"stripPrefix",
"(",
"dateString",
",",
"\"(\"",
")",
".",
"trim",
"(",
")",
";",
"string",
"=",
"stripSuffix",
"(",
"string",
",",
"\")\"",
")",
".",
"trim",
"(",
")",
";",
"string",
"=",
"removeBeginningAt",
"(",
"string",
",",
"\"-\"",
")",
";",
"string",
"=",
"removeBeginningAt",
"(",
"string",
",",
"\" TO \"",
")",
";",
"}",
"return",
"string",
";",
"}"
] | Handle some odd dates from family tree maker.
@param dateString the input string
@return the stripped string | [
"Handle",
"some",
"odd",
"dates",
"from",
"family",
"tree",
"maker",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java#L140-L174 |
141,565 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java | DateParser.handleBetween | private String handleBetween(final String input) {
final String outString = input.replace("BETWEEN ", "")
.replace("BET ", "").replace("FROM ", "");
return truncateAt(truncateAt(outString, " AND "), " TO ").trim();
} | java | private String handleBetween(final String input) {
final String outString = input.replace("BETWEEN ", "")
.replace("BET ", "").replace("FROM ", "");
return truncateAt(truncateAt(outString, " AND "), " TO ").trim();
} | [
"private",
"String",
"handleBetween",
"(",
"final",
"String",
"input",
")",
"{",
"final",
"String",
"outString",
"=",
"input",
".",
"replace",
"(",
"\"BETWEEN \"",
",",
"\"\"",
")",
".",
"replace",
"(",
"\"BET \"",
",",
"\"\"",
")",
".",
"replace",
"(",
"\"FROM \"",
",",
"\"\"",
")",
";",
"return",
"truncateAt",
"(",
"truncateAt",
"(",
"outString",
",",
"\" AND \"",
")",
",",
"\" TO \"",
")",
".",
"trim",
"(",
")",
";",
"}"
] | Process between syntax. Just leave the beginning date.
@param input the source string
@return the stripped result | [
"Process",
"between",
"syntax",
".",
"Just",
"leave",
"the",
"beginning",
"date",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java#L205-L209 |
141,566 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java | DateParser.truncateAt | private String truncateAt(final String input, final String searchString) {
final int i = input.indexOf(searchString);
if (i != -1) {
return input.substring(0, i);
}
return input;
} | java | private String truncateAt(final String input, final String searchString) {
final int i = input.indexOf(searchString);
if (i != -1) {
return input.substring(0, i);
}
return input;
} | [
"private",
"String",
"truncateAt",
"(",
"final",
"String",
"input",
",",
"final",
"String",
"searchString",
")",
"{",
"final",
"int",
"i",
"=",
"input",
".",
"indexOf",
"(",
"searchString",
")",
";",
"if",
"(",
"i",
"!=",
"-",
"1",
")",
"{",
"return",
"input",
".",
"substring",
"(",
"0",
",",
"i",
")",
";",
"}",
"return",
"input",
";",
"}"
] | Truncate the input string after the first occurrence of the
searchString.
@param input the source string
@param searchString the string to look for in the source
@return the truncated string | [
"Truncate",
"the",
"input",
"string",
"after",
"the",
"first",
"occurrence",
"of",
"the",
"searchString",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java#L219-L225 |
141,567 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java | DateParser.removeBeginningAt | private String removeBeginningAt(final String input,
final String searchString) {
final int i = input.indexOf(searchString);
if (i != -1) {
return input.substring(i + 1, input.length());
}
return input;
} | java | private String removeBeginningAt(final String input,
final String searchString) {
final int i = input.indexOf(searchString);
if (i != -1) {
return input.substring(i + 1, input.length());
}
return input;
} | [
"private",
"String",
"removeBeginningAt",
"(",
"final",
"String",
"input",
",",
"final",
"String",
"searchString",
")",
"{",
"final",
"int",
"i",
"=",
"input",
".",
"indexOf",
"(",
"searchString",
")",
";",
"if",
"(",
"i",
"!=",
"-",
"1",
")",
"{",
"return",
"input",
".",
"substring",
"(",
"i",
"+",
"1",
",",
"input",
".",
"length",
"(",
")",
")",
";",
"}",
"return",
"input",
";",
"}"
] | Lop off the beginning of the string up through the searchString.
@param input the source string
@param searchString the string to look for in the source
@return the truncated string | [
"Lop",
"off",
"the",
"beginning",
"of",
"the",
"string",
"up",
"through",
"the",
"searchString",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/DateParser.java#L234-L241 |
141,568 | dickschoeller/gedbrowser | gedbrowser-security/src/main/java/org/schoellerfamily/gedbrowser/security/token/TokenHelper.java | TokenHelper.getCookieValueByName | public Cookie getCookieValueByName(final HttpServletRequest request,
final String name) {
if (request.getCookies() == null) {
return null;
}
for (int i = 0; i < request.getCookies().length; i++) {
if (request.getCookies()[i].getName().equals(name)) {
return request.getCookies()[i];
}
}
return null;
} | java | public Cookie getCookieValueByName(final HttpServletRequest request,
final String name) {
if (request.getCookies() == null) {
return null;
}
for (int i = 0; i < request.getCookies().length; i++) {
if (request.getCookies()[i].getName().equals(name)) {
return request.getCookies()[i];
}
}
return null;
} | [
"public",
"Cookie",
"getCookieValueByName",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"request",
".",
"getCookies",
"(",
")",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"request",
".",
"getCookies",
"(",
")",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"request",
".",
"getCookies",
"(",
")",
"[",
"i",
"]",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"name",
")",
")",
"{",
"return",
"request",
".",
"getCookies",
"(",
")",
"[",
"i",
"]",
";",
"}",
"}",
"return",
"null",
";",
"}"
] | Find a specific HTTP cookie in a request.
@param request The HTTP request object.
@param name The cookie name to look for.
@return The cookie, or <code>null</code> if not found. | [
"Find",
"a",
"specific",
"HTTP",
"cookie",
"in",
"a",
"request",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-security/src/main/java/org/schoellerfamily/gedbrowser/security/token/TokenHelper.java#L193-L204 |
141,569 | dickschoeller/gedbrowser | gedbrowser/src/main/java/org/schoellerfamily/gedbrowser/controller/SaveController.java | SaveController.setHeaders | private void setHeaders(final HttpServletResponse response,
final Root root) {
response.setHeader("content-type", "application/octet-stream");
response.setHeader("content-disposition",
"attachment; filename=" + getSaveFilename(root));
} | java | private void setHeaders(final HttpServletResponse response,
final Root root) {
response.setHeader("content-type", "application/octet-stream");
response.setHeader("content-disposition",
"attachment; filename=" + getSaveFilename(root));
} | [
"private",
"void",
"setHeaders",
"(",
"final",
"HttpServletResponse",
"response",
",",
"final",
"Root",
"root",
")",
"{",
"response",
".",
"setHeader",
"(",
"\"content-type\"",
",",
"\"application/octet-stream\"",
")",
";",
"response",
".",
"setHeader",
"(",
"\"content-disposition\"",
",",
"\"attachment; filename=\"",
"+",
"getSaveFilename",
"(",
"root",
")",
")",
";",
"}"
] | Fill in response headers to make this save the file instead of
displaying it.
@param response the servlet response
@param root the root of the dataset being saved | [
"Fill",
"in",
"response",
"headers",
"to",
"make",
"this",
"save",
"the",
"file",
"instead",
"of",
"displaying",
"it",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser/src/main/java/org/schoellerfamily/gedbrowser/controller/SaveController.java#L63-L68 |
141,570 | dickschoeller/gedbrowser | gedbrowser/src/main/java/org/schoellerfamily/gedbrowser/controller/GeoDataController.java | GeoDataController.logPlaces | private void logPlaces(final List<PlaceInfo> places) {
if (logger.isDebugEnabled()) {
for (final PlaceInfo place : places) {
this.logger.debug(place);
}
}
} | java | private void logPlaces(final List<PlaceInfo> places) {
if (logger.isDebugEnabled()) {
for (final PlaceInfo place : places) {
this.logger.debug(place);
}
}
} | [
"private",
"void",
"logPlaces",
"(",
"final",
"List",
"<",
"PlaceInfo",
">",
"places",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"for",
"(",
"final",
"PlaceInfo",
"place",
":",
"places",
")",
"{",
"this",
".",
"logger",
".",
"debug",
"(",
"place",
")",
";",
"}",
"}",
"}"
] | Dump the places to debug log.
@param places the places | [
"Dump",
"the",
"places",
"to",
"debug",
"log",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser/src/main/java/org/schoellerfamily/gedbrowser/controller/GeoDataController.java#L50-L56 |
141,571 | dickschoeller/gedbrowser | gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/controller/DatasetsController.java | DatasetsController.dbs | @GetMapping(value = "/v1/dbs")
@ResponseBody
public List<String> dbs() {
logger.info("Gettting list of DBs");
final List<String> list = new ArrayList<>();
for (final RootDocument mongo : repositoryManager
.getRootDocumentRepository().findAll()) {
list.add(mongo.getDbName());
}
logger.info("length: " + list.size());
return list;
} | java | @GetMapping(value = "/v1/dbs")
@ResponseBody
public List<String> dbs() {
logger.info("Gettting list of DBs");
final List<String> list = new ArrayList<>();
for (final RootDocument mongo : repositoryManager
.getRootDocumentRepository().findAll()) {
list.add(mongo.getDbName());
}
logger.info("length: " + list.size());
return list;
} | [
"@",
"GetMapping",
"(",
"value",
"=",
"\"/v1/dbs\"",
")",
"@",
"ResponseBody",
"public",
"List",
"<",
"String",
">",
"dbs",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"Gettting list of DBs\"",
")",
";",
"final",
"List",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"RootDocument",
"mongo",
":",
"repositoryManager",
".",
"getRootDocumentRepository",
"(",
")",
".",
"findAll",
"(",
")",
")",
"{",
"list",
".",
"add",
"(",
"mongo",
".",
"getDbName",
"(",
")",
")",
";",
"}",
"logger",
".",
"info",
"(",
"\"length: \"",
"+",
"list",
".",
"size",
"(",
")",
")",
";",
"return",
"list",
";",
"}"
] | Controller to get the currently loaded data sets.
@return a list of the names of the data sets | [
"Controller",
"to",
"get",
"the",
"currently",
"loaded",
"data",
"sets",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/controller/DatasetsController.java#L34-L45 |
141,572 | dickschoeller/gedbrowser | gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/SimpleNameNameIndexRenderer.java | SimpleNameNameIndexRenderer.wrap | private String wrap(final String before, final String string,
final String after) {
if (string.isEmpty()) {
return "";
}
return before + string + after;
} | java | private String wrap(final String before, final String string,
final String after) {
if (string.isEmpty()) {
return "";
}
return before + string + after;
} | [
"private",
"String",
"wrap",
"(",
"final",
"String",
"before",
",",
"final",
"String",
"string",
",",
"final",
"String",
"after",
")",
"{",
"if",
"(",
"string",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"\"\"",
";",
"}",
"return",
"before",
"+",
"string",
"+",
"after",
";",
"}"
] | If the middle string has contents, append the strings.
@param before the before string
@param string the middle string
@param after the after string
@return the combined strings | [
"If",
"the",
"middle",
"string",
"has",
"contents",
"append",
"the",
"strings",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/SimpleNameNameIndexRenderer.java#L66-L72 |
141,573 | dickschoeller/gedbrowser | gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/RenderingContext.java | RenderingContext.anonymous | public static RenderingContext anonymous(final ApplicationInfo appInfo,
final CalendarProvider provider) {
final UserImpl user2 = new UserImpl();
user2.setUsername("Anonymous");
user2.setFirstname("Al");
user2.setLastname("Anonymous");
user2.clearRoles();
user2.setEmail("anon@gmail.com");
return new RenderingContext(user2, appInfo, provider);
} | java | public static RenderingContext anonymous(final ApplicationInfo appInfo,
final CalendarProvider provider) {
final UserImpl user2 = new UserImpl();
user2.setUsername("Anonymous");
user2.setFirstname("Al");
user2.setLastname("Anonymous");
user2.clearRoles();
user2.setEmail("anon@gmail.com");
return new RenderingContext(user2, appInfo, provider);
} | [
"public",
"static",
"RenderingContext",
"anonymous",
"(",
"final",
"ApplicationInfo",
"appInfo",
",",
"final",
"CalendarProvider",
"provider",
")",
"{",
"final",
"UserImpl",
"user2",
"=",
"new",
"UserImpl",
"(",
")",
";",
"user2",
".",
"setUsername",
"(",
"\"Anonymous\"",
")",
";",
"user2",
".",
"setFirstname",
"(",
"\"Al\"",
")",
";",
"user2",
".",
"setLastname",
"(",
"\"Anonymous\"",
")",
";",
"user2",
".",
"clearRoles",
"(",
")",
";",
"user2",
".",
"setEmail",
"(",
"\"anon@gmail.com\"",
")",
";",
"return",
"new",
"RenderingContext",
"(",
"user2",
",",
"appInfo",
",",
"provider",
")",
";",
"}"
] | Special case anonymous context.
@param appInfo the application info to use in the context
@param provider the calendar provider to use in this context
@return the created context | [
"Special",
"case",
"anonymous",
"context",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/RenderingContext.java#L46-L55 |
141,574 | dickschoeller/gedbrowser | gedbrowser/src/main/java/org/schoellerfamily/gedbrowser/controller/PersonController.java | PersonController.nameHtml | private String nameHtml(final RenderingContext context,
final Person person) {
return nameRenderer(context, person).getNameHtml();
} | java | private String nameHtml(final RenderingContext context,
final Person person) {
return nameRenderer(context, person).getNameHtml();
} | [
"private",
"String",
"nameHtml",
"(",
"final",
"RenderingContext",
"context",
",",
"final",
"Person",
"person",
")",
"{",
"return",
"nameRenderer",
"(",
"context",
",",
"person",
")",
".",
"getNameHtml",
"(",
")",
";",
"}"
] | Get the name string in an html fragment format.
@param context the rendering context
@param person the person being rendered
@return the name string | [
"Get",
"the",
"name",
"string",
"in",
"an",
"html",
"fragment",
"format",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser/src/main/java/org/schoellerfamily/gedbrowser/controller/PersonController.java#L113-L116 |
141,575 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java | PersonVisitor.getFamilies | public List<Family> getFamilies() {
final List<Family> families = new ArrayList<>();
for (final FamilyNavigator nav : familySNavigators) {
families.add(nav.getFamily());
}
return families;
} | java | public List<Family> getFamilies() {
final List<Family> families = new ArrayList<>();
for (final FamilyNavigator nav : familySNavigators) {
families.add(nav.getFamily());
}
return families;
} | [
"public",
"List",
"<",
"Family",
">",
"getFamilies",
"(",
")",
"{",
"final",
"List",
"<",
"Family",
">",
"families",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"FamilyNavigator",
"nav",
":",
"familySNavigators",
")",
"{",
"families",
".",
"add",
"(",
"nav",
".",
"getFamily",
"(",
")",
")",
";",
"}",
"return",
"families",
";",
"}"
] | Get the families that the person is a spouse of.
@return the list of families | [
"Get",
"the",
"families",
"that",
"the",
"person",
"is",
"a",
"spouse",
"of",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java#L62-L68 |
141,576 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java | PersonVisitor.getFather | public Person getFather() {
if (familyCNavigators == null || familyCNavigators.isEmpty()) {
return new Person();
}
return familyCNavigators.get(0).getFather();
} | java | public Person getFather() {
if (familyCNavigators == null || familyCNavigators.isEmpty()) {
return new Person();
}
return familyCNavigators.get(0).getFather();
} | [
"public",
"Person",
"getFather",
"(",
")",
"{",
"if",
"(",
"familyCNavigators",
"==",
"null",
"||",
"familyCNavigators",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"new",
"Person",
"(",
")",
";",
"}",
"return",
"familyCNavigators",
".",
"get",
"(",
"0",
")",
".",
"getFather",
"(",
")",
";",
"}"
] | Find the father of this person. If not found, return an unset Person.
@return the father. | [
"Find",
"the",
"father",
"of",
"this",
"person",
".",
"If",
"not",
"found",
"return",
"an",
"unset",
"Person",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java#L75-L80 |
141,577 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java | PersonVisitor.getMother | public Person getMother() {
if (familyCNavigators == null || familyCNavigators.isEmpty()) {
return new Person();
}
return familyCNavigators.get(0).getMother();
} | java | public Person getMother() {
if (familyCNavigators == null || familyCNavigators.isEmpty()) {
return new Person();
}
return familyCNavigators.get(0).getMother();
} | [
"public",
"Person",
"getMother",
"(",
")",
"{",
"if",
"(",
"familyCNavigators",
"==",
"null",
"||",
"familyCNavigators",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"new",
"Person",
"(",
")",
";",
"}",
"return",
"familyCNavigators",
".",
"get",
"(",
"0",
")",
".",
"getMother",
"(",
")",
";",
"}"
] | Find the mother of this person. If not found, return an unset Person.
@return the mother. | [
"Find",
"the",
"mother",
"of",
"this",
"person",
".",
"If",
"not",
"found",
"return",
"an",
"unset",
"Person",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java#L87-L92 |
141,578 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java | PersonVisitor.getChildren | public List<Person> getChildren() {
final List<Person> children = new ArrayList<>();
for (final FamilyNavigator nav : familySNavigators) {
children.addAll(nav.getChildren());
}
return children;
} | java | public List<Person> getChildren() {
final List<Person> children = new ArrayList<>();
for (final FamilyNavigator nav : familySNavigators) {
children.addAll(nav.getChildren());
}
return children;
} | [
"public",
"List",
"<",
"Person",
">",
"getChildren",
"(",
")",
"{",
"final",
"List",
"<",
"Person",
">",
"children",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"FamilyNavigator",
"nav",
":",
"familySNavigators",
")",
"{",
"children",
".",
"addAll",
"(",
"nav",
".",
"getChildren",
"(",
")",
")",
";",
"}",
"return",
"children",
";",
"}"
] | Get the list of all of children of this person.
@return the list of children | [
"Get",
"the",
"list",
"of",
"all",
"of",
"children",
"of",
"this",
"person",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java#L99-L105 |
141,579 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java | PersonVisitor.getSpouses | public List<Person> getSpouses() {
final List<Person> spouses = new ArrayList<>();
for (final FamilyNavigator nav : familySNavigators) {
final Person spouse = nav.getSpouse(visitedPerson);
if (spouse.isSet()) {
spouses.add(spouse);
}
}
return spouses;
} | java | public List<Person> getSpouses() {
final List<Person> spouses = new ArrayList<>();
for (final FamilyNavigator nav : familySNavigators) {
final Person spouse = nav.getSpouse(visitedPerson);
if (spouse.isSet()) {
spouses.add(spouse);
}
}
return spouses;
} | [
"public",
"List",
"<",
"Person",
">",
"getSpouses",
"(",
")",
"{",
"final",
"List",
"<",
"Person",
">",
"spouses",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"FamilyNavigator",
"nav",
":",
"familySNavigators",
")",
"{",
"final",
"Person",
"spouse",
"=",
"nav",
".",
"getSpouse",
"(",
"visitedPerson",
")",
";",
"if",
"(",
"spouse",
".",
"isSet",
"(",
")",
")",
"{",
"spouses",
".",
"add",
"(",
"spouse",
")",
";",
"}",
"}",
"return",
"spouses",
";",
"}"
] | Get the list of all of the spouses of this person.
@return the list of spouses. | [
"Get",
"the",
"list",
"of",
"all",
"of",
"the",
"spouses",
"of",
"this",
"person",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java#L112-L121 |
141,580 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java | PersonVisitor.visit | @Override
public void visit(final FamS fams) {
final FamilyNavigator navigator = new FamilyNavigator(fams);
final Family family = navigator.getFamily();
if (family.isSet()) {
familySNavigators.add(navigator);
}
} | java | @Override
public void visit(final FamS fams) {
final FamilyNavigator navigator = new FamilyNavigator(fams);
final Family family = navigator.getFamily();
if (family.isSet()) {
familySNavigators.add(navigator);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"final",
"FamS",
"fams",
")",
"{",
"final",
"FamilyNavigator",
"navigator",
"=",
"new",
"FamilyNavigator",
"(",
"fams",
")",
";",
"final",
"Family",
"family",
"=",
"navigator",
".",
"getFamily",
"(",
")",
";",
"if",
"(",
"family",
".",
"isSet",
"(",
")",
")",
"{",
"familySNavigators",
".",
"add",
"(",
"navigator",
")",
";",
"}",
"}"
] | Visit a FamS. We will build up a collection of Navigators to the FamSs.
@see GedObjectVisitor#visit(FamS) | [
"Visit",
"a",
"FamS",
".",
"We",
"will",
"build",
"up",
"a",
"collection",
"of",
"Navigators",
"to",
"the",
"FamSs",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/PersonVisitor.java#L182-L189 |
141,581 | dickschoeller/gedbrowser | gedbrowser-security/src/main/java/org/schoellerfamily/gedbrowser/security/controller/PublicController.java | PublicController.getFoo | @RequestMapping(method = GET, value = "/foo")
public Map<String, String> getFoo() {
final Map<String, String> fooObj = new HashMap<>();
fooObj.put("foo", "bar");
return fooObj;
} | java | @RequestMapping(method = GET, value = "/foo")
public Map<String, String> getFoo() {
final Map<String, String> fooObj = new HashMap<>();
fooObj.put("foo", "bar");
return fooObj;
} | [
"@",
"RequestMapping",
"(",
"method",
"=",
"GET",
",",
"value",
"=",
"\"/foo\"",
")",
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getFoo",
"(",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"fooObj",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"fooObj",
".",
"put",
"(",
"\"foo\"",
",",
"\"bar\"",
")",
";",
"return",
"fooObj",
";",
"}"
] | Controller to just support pinging.
@return map of foo to bar | [
"Controller",
"to",
"just",
"support",
"pinging",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-security/src/main/java/org/schoellerfamily/gedbrowser/security/controller/PublicController.java#L23-L28 |
141,582 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/GetDateVisitor.java | GetDateVisitor.visit | @Override
public void visit(final Date date) {
dateString = date.getDate();
yearString = date.getYear();
sortDateString = date.getSortDate();
final GetTimeVisitor timeVisitor = new GetTimeVisitor();
for (final GedObject gob : date.getAttributes()) {
gob.accept(timeVisitor);
if (!timeVisitor.getTimeString().isEmpty()) {
dateString += " " + timeVisitor.getTimeString();
break;
}
}
} | java | @Override
public void visit(final Date date) {
dateString = date.getDate();
yearString = date.getYear();
sortDateString = date.getSortDate();
final GetTimeVisitor timeVisitor = new GetTimeVisitor();
for (final GedObject gob : date.getAttributes()) {
gob.accept(timeVisitor);
if (!timeVisitor.getTimeString().isEmpty()) {
dateString += " " + timeVisitor.getTimeString();
break;
}
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"final",
"Date",
"date",
")",
"{",
"dateString",
"=",
"date",
".",
"getDate",
"(",
")",
";",
"yearString",
"=",
"date",
".",
"getYear",
"(",
")",
";",
"sortDateString",
"=",
"date",
".",
"getSortDate",
"(",
")",
";",
"final",
"GetTimeVisitor",
"timeVisitor",
"=",
"new",
"GetTimeVisitor",
"(",
")",
";",
"for",
"(",
"final",
"GedObject",
"gob",
":",
"date",
".",
"getAttributes",
"(",
")",
")",
"{",
"gob",
".",
"accept",
"(",
"timeVisitor",
")",
";",
"if",
"(",
"!",
"timeVisitor",
".",
"getTimeString",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"dateString",
"+=",
"\" \"",
"+",
"timeVisitor",
".",
"getTimeString",
"(",
")",
";",
"break",
";",
"}",
"}",
"}"
] | Visit a Date. Record the interesting information from that date.
@see GedObjectVisitor#visit(Date) | [
"Visit",
"a",
"Date",
".",
"Record",
"the",
"interesting",
"information",
"from",
"that",
"date",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/GetDateVisitor.java#L94-L107 |
141,583 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/GetDateVisitor.java | GetDateVisitor.visit | @Override
public void visit(final Person person) {
for (final GedObject gob : person.getAttributes()) {
gob.accept(this);
if (!dateString.isEmpty()) {
break;
}
}
} | java | @Override
public void visit(final Person person) {
for (final GedObject gob : person.getAttributes()) {
gob.accept(this);
if (!dateString.isEmpty()) {
break;
}
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"final",
"Person",
"person",
")",
"{",
"for",
"(",
"final",
"GedObject",
"gob",
":",
"person",
".",
"getAttributes",
"(",
")",
")",
"{",
"gob",
".",
"accept",
"(",
"this",
")",
";",
"if",
"(",
"!",
"dateString",
".",
"isEmpty",
"(",
")",
")",
"{",
"break",
";",
"}",
"}",
"}"
] | Visit a Person. This is the primary focus of the visitation. From
here, interesting information is gathered from the attributes. Once a
date string is found, quit.
@see GedObjectVisitor#visit(Person) | [
"Visit",
"a",
"Person",
".",
"This",
"is",
"the",
"primary",
"focus",
"of",
"the",
"visitation",
".",
"From",
"here",
"interesting",
"information",
"is",
"gathered",
"from",
"the",
"attributes",
".",
"Once",
"a",
"date",
"string",
"is",
"found",
"quit",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/visitor/GetDateVisitor.java#L116-L124 |
141,584 | dickschoeller/gedbrowser | gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/IndexByPlaceRenderer.java | IndexByPlaceRenderer.createWholeIndex | private Map<String, Set<PersonRenderer>> createWholeIndex() {
logger.info("In getWholeIndex");
final Map<String, Set<PersonRenderer>> aMap = new TreeMap<>();
if (!getRenderingContext().isUser()) {
logger.info("Leaving getWholeIndex not logged in");
return aMap;
}
final Collection<Person> persons = getGedObject().find(Person.class);
for (final Person person : persons) {
if (isHidden(person)) {
continue;
}
locatePerson(aMap, person);
}
logger.info("Leaving getWholeIndex");
return aMap;
} | java | private Map<String, Set<PersonRenderer>> createWholeIndex() {
logger.info("In getWholeIndex");
final Map<String, Set<PersonRenderer>> aMap = new TreeMap<>();
if (!getRenderingContext().isUser()) {
logger.info("Leaving getWholeIndex not logged in");
return aMap;
}
final Collection<Person> persons = getGedObject().find(Person.class);
for (final Person person : persons) {
if (isHidden(person)) {
continue;
}
locatePerson(aMap, person);
}
logger.info("Leaving getWholeIndex");
return aMap;
} | [
"private",
"Map",
"<",
"String",
",",
"Set",
"<",
"PersonRenderer",
">",
">",
"createWholeIndex",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"\"In getWholeIndex\"",
")",
";",
"final",
"Map",
"<",
"String",
",",
"Set",
"<",
"PersonRenderer",
">",
">",
"aMap",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"if",
"(",
"!",
"getRenderingContext",
"(",
")",
".",
"isUser",
"(",
")",
")",
"{",
"logger",
".",
"info",
"(",
"\"Leaving getWholeIndex not logged in\"",
")",
";",
"return",
"aMap",
";",
"}",
"final",
"Collection",
"<",
"Person",
">",
"persons",
"=",
"getGedObject",
"(",
")",
".",
"find",
"(",
"Person",
".",
"class",
")",
";",
"for",
"(",
"final",
"Person",
"person",
":",
"persons",
")",
"{",
"if",
"(",
"isHidden",
"(",
"person",
")",
")",
"{",
"continue",
";",
"}",
"locatePerson",
"(",
"aMap",
",",
"person",
")",
";",
"}",
"logger",
".",
"info",
"(",
"\"Leaving getWholeIndex\"",
")",
";",
"return",
"aMap",
";",
"}"
] | Build the index.
@return the complete index | [
"Build",
"the",
"index",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/IndexByPlaceRenderer.java#L62-L78 |
141,585 | dickschoeller/gedbrowser | gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/IndexByPlaceRenderer.java | IndexByPlaceRenderer.locatePerson | private void locatePerson(final Map<String, Set<PersonRenderer>> aMap,
final Person person) {
final PersonRenderer renderer = new PersonRenderer(person,
getRendererFactory(), getRenderingContext());
for (final String place : getPlaces(person)) {
placePerson(aMap, renderer, place);
}
} | java | private void locatePerson(final Map<String, Set<PersonRenderer>> aMap,
final Person person) {
final PersonRenderer renderer = new PersonRenderer(person,
getRendererFactory(), getRenderingContext());
for (final String place : getPlaces(person)) {
placePerson(aMap, renderer, place);
}
} | [
"private",
"void",
"locatePerson",
"(",
"final",
"Map",
"<",
"String",
",",
"Set",
"<",
"PersonRenderer",
">",
">",
"aMap",
",",
"final",
"Person",
"person",
")",
"{",
"final",
"PersonRenderer",
"renderer",
"=",
"new",
"PersonRenderer",
"(",
"person",
",",
"getRendererFactory",
"(",
")",
",",
"getRenderingContext",
"(",
")",
")",
";",
"for",
"(",
"final",
"String",
"place",
":",
"getPlaces",
"(",
"person",
")",
")",
"{",
"placePerson",
"(",
"aMap",
",",
"renderer",
",",
"place",
")",
";",
"}",
"}"
] | Add a person's locations to the map.
@param aMap the map
@param person the person | [
"Add",
"a",
"person",
"s",
"locations",
"to",
"the",
"map",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/IndexByPlaceRenderer.java#L86-L93 |
141,586 | dickschoeller/gedbrowser | gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/IndexByPlaceRenderer.java | IndexByPlaceRenderer.placePerson | private void placePerson(final Map<String, Set<PersonRenderer>> aMap,
final PersonRenderer renderer, final String place) {
final Set<PersonRenderer> locatedPersons =
personRendererSet(aMap, place);
locatedPersons.add(renderer);
} | java | private void placePerson(final Map<String, Set<PersonRenderer>> aMap,
final PersonRenderer renderer, final String place) {
final Set<PersonRenderer> locatedPersons =
personRendererSet(aMap, place);
locatedPersons.add(renderer);
} | [
"private",
"void",
"placePerson",
"(",
"final",
"Map",
"<",
"String",
",",
"Set",
"<",
"PersonRenderer",
">",
">",
"aMap",
",",
"final",
"PersonRenderer",
"renderer",
",",
"final",
"String",
"place",
")",
"{",
"final",
"Set",
"<",
"PersonRenderer",
">",
"locatedPersons",
"=",
"personRendererSet",
"(",
"aMap",
",",
"place",
")",
";",
"locatedPersons",
".",
"add",
"(",
"renderer",
")",
";",
"}"
] | Add a person to a particular location in the map.
@param aMap the map
@param renderer the PersonRenderer
@param place the current place | [
"Add",
"a",
"person",
"to",
"a",
"particular",
"location",
"in",
"the",
"map",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-renderer/src/main/java/org/schoellerfamily/gedbrowser/renderer/IndexByPlaceRenderer.java#L120-L125 |
141,587 | dickschoeller/gedbrowser | gedbrowser/src/main/java/org/schoellerfamily/gedbrowser/Application.java | Application.main | public static void main(final String[] args) throws InterruptedException {
SpringApplication.run(Application.class, args);
Thread.sleep(TWENTY_SECONDS);
} | java | public static void main(final String[] args) throws InterruptedException {
SpringApplication.run(Application.class, args);
Thread.sleep(TWENTY_SECONDS);
} | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"InterruptedException",
"{",
"SpringApplication",
".",
"run",
"(",
"Application",
".",
"class",
",",
"args",
")",
";",
"Thread",
".",
"sleep",
"(",
"TWENTY_SECONDS",
")",
";",
"}"
] | Allow us to run gedbrowser as a standalone application with an embedded
application server.
@param args command line arguments
@throws InterruptedException if thread sleep fails at end | [
"Allow",
"us",
"to",
"run",
"gedbrowser",
"as",
"a",
"standalone",
"application",
"with",
"an",
"embedded",
"application",
"server",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser/src/main/java/org/schoellerfamily/gedbrowser/Application.java#L23-L26 |
141,588 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/SimpleDateParser.java | SimpleDateParser.beginOfMonth | protected final void beginOfMonth(final Calendar c) {
c.set(Calendar.DAY_OF_MONTH,
c.getActualMinimum(Calendar.DAY_OF_MONTH));
} | java | protected final void beginOfMonth(final Calendar c) {
c.set(Calendar.DAY_OF_MONTH,
c.getActualMinimum(Calendar.DAY_OF_MONTH));
} | [
"protected",
"final",
"void",
"beginOfMonth",
"(",
"final",
"Calendar",
"c",
")",
"{",
"c",
".",
"set",
"(",
"Calendar",
".",
"DAY_OF_MONTH",
",",
"c",
".",
"getActualMinimum",
"(",
"Calendar",
".",
"DAY_OF_MONTH",
")",
")",
";",
"}"
] | Adjust calendar to the beginning of the current month.
@param c the calendar | [
"Adjust",
"calendar",
"to",
"the",
"beginning",
"of",
"the",
"current",
"month",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/SimpleDateParser.java#L94-L97 |
141,589 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/SimpleDateParser.java | SimpleDateParser.endOfMonth | protected final void endOfMonth(final Calendar c) {
c.set(Calendar.DAY_OF_MONTH,
c.getActualMaximum(Calendar.DAY_OF_MONTH));
} | java | protected final void endOfMonth(final Calendar c) {
c.set(Calendar.DAY_OF_MONTH,
c.getActualMaximum(Calendar.DAY_OF_MONTH));
} | [
"protected",
"final",
"void",
"endOfMonth",
"(",
"final",
"Calendar",
"c",
")",
"{",
"c",
".",
"set",
"(",
"Calendar",
".",
"DAY_OF_MONTH",
",",
"c",
".",
"getActualMaximum",
"(",
"Calendar",
".",
"DAY_OF_MONTH",
")",
")",
";",
"}"
] | Adjust calendar to the end of the current month.
@param c the calendar | [
"Adjust",
"calendar",
"to",
"the",
"end",
"of",
"the",
"current",
"month",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/SimpleDateParser.java#L104-L107 |
141,590 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/SimpleDateParser.java | SimpleDateParser.firstMonth | protected final void firstMonth(final Calendar c) {
c.set(Calendar.MONTH, c.getMinimum(Calendar.MONTH));
} | java | protected final void firstMonth(final Calendar c) {
c.set(Calendar.MONTH, c.getMinimum(Calendar.MONTH));
} | [
"protected",
"final",
"void",
"firstMonth",
"(",
"final",
"Calendar",
"c",
")",
"{",
"c",
".",
"set",
"(",
"Calendar",
".",
"MONTH",
",",
"c",
".",
"getMinimum",
"(",
"Calendar",
".",
"MONTH",
")",
")",
";",
"}"
] | Adjust calendar to the first month of the year.
@param c the calendar | [
"Adjust",
"calendar",
"to",
"the",
"first",
"month",
"of",
"the",
"year",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/SimpleDateParser.java#L114-L116 |
141,591 | dickschoeller/gedbrowser | gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/SimpleDateParser.java | SimpleDateParser.lastMonth | protected final void lastMonth(final Calendar c) {
c.set(Calendar.MONTH, c.getMaximum(Calendar.MONTH));
} | java | protected final void lastMonth(final Calendar c) {
c.set(Calendar.MONTH, c.getMaximum(Calendar.MONTH));
} | [
"protected",
"final",
"void",
"lastMonth",
"(",
"final",
"Calendar",
"c",
")",
"{",
"c",
".",
"set",
"(",
"Calendar",
".",
"MONTH",
",",
"c",
".",
"getMaximum",
"(",
"Calendar",
".",
"MONTH",
")",
")",
";",
"}"
] | Adjust calendar to the last month of the year.
@param c the calendar | [
"Adjust",
"calendar",
"to",
"the",
"last",
"month",
"of",
"the",
"year",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-datamodel/src/main/java/org/schoellerfamily/gedbrowser/datamodel/util/SimpleDateParser.java#L123-L125 |
141,592 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java | Estimator.getChildren | protected final List<Person> getChildren(final Family family) {
final FamilyNavigator navigator = new FamilyNavigator(family);
return navigator.getChildren();
} | java | protected final List<Person> getChildren(final Family family) {
final FamilyNavigator navigator = new FamilyNavigator(family);
return navigator.getChildren();
} | [
"protected",
"final",
"List",
"<",
"Person",
">",
"getChildren",
"(",
"final",
"Family",
"family",
")",
"{",
"final",
"FamilyNavigator",
"navigator",
"=",
"new",
"FamilyNavigator",
"(",
"family",
")",
";",
"return",
"navigator",
".",
"getChildren",
"(",
")",
";",
"}"
] | Get the list of children from a family.
@param family the family
@return the children | [
"Get",
"the",
"list",
"of",
"children",
"from",
"a",
"family",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java#L30-L33 |
141,593 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java | Estimator.getFather | protected final Person getFather(final Family family) {
final FamilyNavigator navigator = new FamilyNavigator(family);
return navigator.getFather();
} | java | protected final Person getFather(final Family family) {
final FamilyNavigator navigator = new FamilyNavigator(family);
return navigator.getFather();
} | [
"protected",
"final",
"Person",
"getFather",
"(",
"final",
"Family",
"family",
")",
"{",
"final",
"FamilyNavigator",
"navigator",
"=",
"new",
"FamilyNavigator",
"(",
"family",
")",
";",
"return",
"navigator",
".",
"getFather",
"(",
")",
";",
"}"
] | Get the father from a family.
@param family the family
@return the father | [
"Get",
"the",
"father",
"from",
"a",
"family",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java#L41-L44 |
141,594 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java | Estimator.getMother | protected final Person getMother(final Family family) {
final FamilyNavigator navigator = new FamilyNavigator(family);
return navigator.getMother();
} | java | protected final Person getMother(final Family family) {
final FamilyNavigator navigator = new FamilyNavigator(family);
return navigator.getMother();
} | [
"protected",
"final",
"Person",
"getMother",
"(",
"final",
"Family",
"family",
")",
"{",
"final",
"FamilyNavigator",
"navigator",
"=",
"new",
"FamilyNavigator",
"(",
"family",
")",
";",
"return",
"navigator",
".",
"getMother",
"(",
")",
";",
"}"
] | Get the mother from a family.
@param family the family
@return the mother | [
"Get",
"the",
"mother",
"from",
"a",
"family",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java#L52-L55 |
141,595 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java | Estimator.getBirthDate | protected final String getBirthDate(final Person person) {
final GetDateVisitor visitor = new GetDateVisitor("Birth");
person.accept(visitor);
return visitor.getDate();
} | java | protected final String getBirthDate(final Person person) {
final GetDateVisitor visitor = new GetDateVisitor("Birth");
person.accept(visitor);
return visitor.getDate();
} | [
"protected",
"final",
"String",
"getBirthDate",
"(",
"final",
"Person",
"person",
")",
"{",
"final",
"GetDateVisitor",
"visitor",
"=",
"new",
"GetDateVisitor",
"(",
"\"Birth\"",
")",
";",
"person",
".",
"accept",
"(",
"visitor",
")",
";",
"return",
"visitor",
".",
"getDate",
"(",
")",
";",
"}"
] | Get the birth date string of a person.
@param person the person
@return the birth date | [
"Get",
"the",
"birth",
"date",
"string",
"of",
"a",
"person",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java#L63-L67 |
141,596 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java | Estimator.getDate | protected final String getDate(final Attribute attr) {
final GetDateVisitor visitor = new GetDateVisitor();
attr.accept(visitor);
return visitor.getDate();
} | java | protected final String getDate(final Attribute attr) {
final GetDateVisitor visitor = new GetDateVisitor();
attr.accept(visitor);
return visitor.getDate();
} | [
"protected",
"final",
"String",
"getDate",
"(",
"final",
"Attribute",
"attr",
")",
"{",
"final",
"GetDateVisitor",
"visitor",
"=",
"new",
"GetDateVisitor",
"(",
")",
";",
"attr",
".",
"accept",
"(",
"visitor",
")",
";",
"return",
"visitor",
".",
"getDate",
"(",
")",
";",
"}"
] | Get the date string for an attribute.
@param attr the attribute
@return the date | [
"Get",
"the",
"date",
"string",
"for",
"an",
"attribute",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java#L75-L79 |
141,597 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java | Estimator.plusYearsAdjustToBegin | protected final LocalDate plusYearsAdjustToBegin(final LocalDate date,
final int years) {
final LocalDate adjustedYears = plusYears(date, years);
final LocalDate firstMonth = firstMonth(adjustedYears);
return firstDayOfMonth(firstMonth);
} | java | protected final LocalDate plusYearsAdjustToBegin(final LocalDate date,
final int years) {
final LocalDate adjustedYears = plusYears(date, years);
final LocalDate firstMonth = firstMonth(adjustedYears);
return firstDayOfMonth(firstMonth);
} | [
"protected",
"final",
"LocalDate",
"plusYearsAdjustToBegin",
"(",
"final",
"LocalDate",
"date",
",",
"final",
"int",
"years",
")",
"{",
"final",
"LocalDate",
"adjustedYears",
"=",
"plusYears",
"(",
"date",
",",
"years",
")",
";",
"final",
"LocalDate",
"firstMonth",
"=",
"firstMonth",
"(",
"adjustedYears",
")",
";",
"return",
"firstDayOfMonth",
"(",
"firstMonth",
")",
";",
"}"
] | Add years to the date and then adjust to the beginning of the resultant
year.
@param date input date
@param years years to add
@return new date | [
"Add",
"years",
"to",
"the",
"date",
"and",
"then",
"adjust",
"to",
"the",
"beginning",
"of",
"the",
"resultant",
"year",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java#L119-L124 |
141,598 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java | Estimator.minusYearsAdjustToBegin | protected final LocalDate minusYearsAdjustToBegin(final LocalDate date,
final int years) {
final LocalDate adjustedYears = minusYears(date, years);
final LocalDate firstMonth = firstMonth(adjustedYears);
return firstDayOfMonth(firstMonth);
} | java | protected final LocalDate minusYearsAdjustToBegin(final LocalDate date,
final int years) {
final LocalDate adjustedYears = minusYears(date, years);
final LocalDate firstMonth = firstMonth(adjustedYears);
return firstDayOfMonth(firstMonth);
} | [
"protected",
"final",
"LocalDate",
"minusYearsAdjustToBegin",
"(",
"final",
"LocalDate",
"date",
",",
"final",
"int",
"years",
")",
"{",
"final",
"LocalDate",
"adjustedYears",
"=",
"minusYears",
"(",
"date",
",",
"years",
")",
";",
"final",
"LocalDate",
"firstMonth",
"=",
"firstMonth",
"(",
"adjustedYears",
")",
";",
"return",
"firstDayOfMonth",
"(",
"firstMonth",
")",
";",
"}"
] | Subtract years from the date and then adjust to the beginning of the
resultant year.
@param date input date
@param years years to add
@return new date | [
"Subtract",
"years",
"from",
"the",
"date",
"and",
"then",
"adjust",
"to",
"the",
"beginning",
"of",
"the",
"resultant",
"year",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java#L134-L139 |
141,599 | dickschoeller/gedbrowser | gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java | Estimator.createLocalDate | protected final LocalDate createLocalDate(final String dateString) {
if (dateString == null || dateString.isEmpty()) {
return null;
}
final DateParser parser = new DateParser(dateString);
return new LocalDate(parser.getEstimateCalendar());
} | java | protected final LocalDate createLocalDate(final String dateString) {
if (dateString == null || dateString.isEmpty()) {
return null;
}
final DateParser parser = new DateParser(dateString);
return new LocalDate(parser.getEstimateCalendar());
} | [
"protected",
"final",
"LocalDate",
"createLocalDate",
"(",
"final",
"String",
"dateString",
")",
"{",
"if",
"(",
"dateString",
"==",
"null",
"||",
"dateString",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"final",
"DateParser",
"parser",
"=",
"new",
"DateParser",
"(",
"dateString",
")",
";",
"return",
"new",
"LocalDate",
"(",
"parser",
".",
"getEstimateCalendar",
"(",
")",
")",
";",
"}"
] | Create a LocalDate from the given date string. Returns null
for an empty or null date string.
@param dateString the date string
@return the new LocalDate | [
"Create",
"a",
"LocalDate",
"from",
"the",
"given",
"date",
"string",
".",
"Returns",
"null",
"for",
"an",
"empty",
"or",
"null",
"date",
"string",
"."
] | e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1 | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowser-analytics/src/main/java/org/schoellerfamily/gedbrowser/analytics/Estimator.java#L192-L198 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.