summaryrefslogtreecommitdiff
path: root/base/src/main/java/bjc/utils/components
diff options
context:
space:
mode:
authorBenjamin J. Culkin <bjculkin@mix.wvu.edu>2020-12-14 19:29:37 -0400
committerBenjamin J. Culkin <bjculkin@mix.wvu.edu>2020-12-14 19:29:37 -0400
commit9351ea3e97bbe2d348aa17067ccc6267dc7c080f (patch)
treedd2269c26161c735d94d8dc83d56e6076c2a155d /base/src/main/java/bjc/utils/components
parent8933de7f646f0565edf700aa2f2fcab06d639855 (diff)
parent6dcadc360dafdd12142d53327f44579379a4c9dd (diff)
Merge branch 'master' of https://github.com/bculkin2442/bjc-utils2
Diffstat (limited to 'base/src/main/java/bjc/utils/components')
-rw-r--r--base/src/main/java/bjc/utils/components/ComponentDescription.java6
-rw-r--r--base/src/main/java/bjc/utils/components/ComponentRepository.java (renamed from base/src/main/java/bjc/utils/components/IComponentRepository.java)12
-rw-r--r--base/src/main/java/bjc/utils/components/DescribedComponent.java (renamed from base/src/main/java/bjc/utils/components/IDescribedComponent.java)4
-rw-r--r--base/src/main/java/bjc/utils/components/FileComponentRepository.java18
-rw-r--r--base/src/main/java/bjc/utils/components/MemoryComponentRepository.java14
5 files changed, 27 insertions, 27 deletions
diff --git a/base/src/main/java/bjc/utils/components/ComponentDescription.java b/base/src/main/java/bjc/utils/components/ComponentDescription.java
index 189ef90..2feed8d 100644
--- a/base/src/main/java/bjc/utils/components/ComponentDescription.java
+++ b/base/src/main/java/bjc/utils/components/ComponentDescription.java
@@ -5,7 +5,7 @@ package bjc.utils.components;
*
* @author ben
*/
-public class ComponentDescription implements IDescribedComponent {
+public class ComponentDescription implements DescribedComponent {
/* Check arguments are good. */
@SuppressWarnings("unused")
private static void sanityCheckArgs(final String name, final String author,
@@ -58,7 +58,7 @@ public class ComponentDescription implements IDescribedComponent {
@Override
public String getAuthor() {
if (author == null) {
- return IDescribedComponent.super.getAuthor();
+ return DescribedComponent.super.getAuthor();
}
return author;
@@ -67,7 +67,7 @@ public class ComponentDescription implements IDescribedComponent {
@Override
public String getDescription() {
if (description == null) {
- return IDescribedComponent.super.getDescription();
+ return DescribedComponent.super.getDescription();
}
return description;
diff --git a/base/src/main/java/bjc/utils/components/IComponentRepository.java b/base/src/main/java/bjc/utils/components/ComponentRepository.java
index 5ebb1de..120edc8 100644
--- a/base/src/main/java/bjc/utils/components/IComponentRepository.java
+++ b/base/src/main/java/bjc/utils/components/ComponentRepository.java
@@ -1,25 +1,25 @@
package bjc.utils.components;
-import bjc.funcdata.IList;
-import bjc.funcdata.IMap;
+import bjc.funcdata.ListEx;
+import bjc.funcdata.MapEx;
/**
* A collection of implementations of a particular type of
- * {@link IDescribedComponent}.
+ * {@link DescribedComponent}.
*
* @author ben
*
* @param <ComponentType>
* The type of components contained in this repository.
*/
-public interface IComponentRepository<ComponentType extends IDescribedComponent> {
+public interface ComponentRepository<ComponentType extends DescribedComponent> {
/**
* Get all of the components this repository knows about.
*
* @return A map from component name to component, containing all of the
* components in the repositories.
*/
- public IMap<String, ComponentType> getAll();
+ public MapEx<String, ComponentType> getAll();
/**
* Get a component with a specific name.
@@ -36,7 +36,7 @@ public interface IComponentRepository<ComponentType extends IDescribedComponent>
*
* @return A list of all the registered components.
*/
- public default IList<ComponentType> getList() {
+ public default ListEx<ComponentType> getList() {
return getAll().valueList();
}
diff --git a/base/src/main/java/bjc/utils/components/IDescribedComponent.java b/base/src/main/java/bjc/utils/components/DescribedComponent.java
index ae3e06c..dcbaf59 100644
--- a/base/src/main/java/bjc/utils/components/IDescribedComponent.java
+++ b/base/src/main/java/bjc/utils/components/DescribedComponent.java
@@ -7,7 +7,7 @@ package bjc.utils.components;
* @author ben
*
*/
-public interface IDescribedComponent extends Comparable<IDescribedComponent> {
+public interface DescribedComponent extends Comparable<DescribedComponent> {
/**
* Get the author of this component.
*
@@ -52,7 +52,7 @@ public interface IDescribedComponent extends Comparable<IDescribedComponent> {
}
@Override
- default int compareTo(final IDescribedComponent o) {
+ default int compareTo(final DescribedComponent o) {
int res = getName().compareTo(o.getName());
if (res == 0) {
diff --git a/base/src/main/java/bjc/utils/components/FileComponentRepository.java b/base/src/main/java/bjc/utils/components/FileComponentRepository.java
index 6e6e604..e0e929f 100644
--- a/base/src/main/java/bjc/utils/components/FileComponentRepository.java
+++ b/base/src/main/java/bjc/utils/components/FileComponentRepository.java
@@ -9,11 +9,11 @@ import java.util.function.Function;
import java.util.logging.Level;
import java.util.logging.Logger;
-import bjc.data.IHolder;
+import bjc.data.Holder;
import bjc.data.Identity;
import bjc.funcdata.FunctionalMap;
-import bjc.funcdata.IList;
-import bjc.funcdata.IMap;
+import bjc.funcdata.ListEx;
+import bjc.funcdata.MapEx;
import bjc.utils.funcutils.FileUtils;
/**
@@ -24,14 +24,14 @@ import bjc.utils.funcutils.FileUtils;
* @param <ComponentType>
* The type of component being read in.
*/
-public class FileComponentRepository<ComponentType extends IDescribedComponent>
- implements IComponentRepository<ComponentType> {
+public class FileComponentRepository<ComponentType extends DescribedComponent>
+ implements ComponentRepository<ComponentType> {
/* The logger to use for storing data about this class. */
private static final Logger CLASS_LOGGER
= Logger.getLogger("FileComponentRepository");
/* The internal storage of components. */
- private IMap<String, ComponentType> components;
+ private MapEx<String, ComponentType> components;
/* The path that all the components came from. */
private Path sourceDirectory;
@@ -69,7 +69,7 @@ public class FileComponentRepository<ComponentType extends IDescribedComponent>
sourceDirectory = directory.toPath().toAbsolutePath();
/* Marker for making sure we don't skip the parent. */
- final IHolder<Boolean> isFirstDir = new Identity<>(true);
+ final Holder<Boolean> isFirstDir = new Identity<>(true);
/*
* Predicate to use to traverse all the files in a directory, but not recurse
@@ -110,7 +110,7 @@ public class FileComponentRepository<ComponentType extends IDescribedComponent>
}
@Override
- public IMap<String, ComponentType> getAll() {
+ public MapEx<String, ComponentType> getAll() {
return components;
}
@@ -120,7 +120,7 @@ public class FileComponentRepository<ComponentType extends IDescribedComponent>
}
@Override
- public IList<ComponentType> getList() {
+ public ListEx<ComponentType> getList() {
return components.valueList();
}
diff --git a/base/src/main/java/bjc/utils/components/MemoryComponentRepository.java b/base/src/main/java/bjc/utils/components/MemoryComponentRepository.java
index bba0867..f83c293 100644
--- a/base/src/main/java/bjc/utils/components/MemoryComponentRepository.java
+++ b/base/src/main/java/bjc/utils/components/MemoryComponentRepository.java
@@ -1,6 +1,6 @@
package bjc.utils.components;
-import bjc.funcdata.IMap;
+import bjc.funcdata.MapEx;
/**
* A repository of components stored in memory.
@@ -10,9 +10,9 @@ import bjc.funcdata.IMap;
* @param <ComponentType>
* The type of component stored in the repository.
*/
-public class MemoryComponentRepository<ComponentType extends IDescribedComponent>
- implements IComponentRepository<ComponentType> {
- private final IMap<String, ComponentType> repo;
+public class MemoryComponentRepository<ComponentType extends DescribedComponent>
+ implements ComponentRepository<ComponentType> {
+ private final MapEx<String, ComponentType> repo;
private final String source;
@@ -22,7 +22,7 @@ public class MemoryComponentRepository<ComponentType extends IDescribedComponent
* @param repo
* The set of components to use.
*/
- public MemoryComponentRepository(IMap<String, ComponentType> repo) {
+ public MemoryComponentRepository(MapEx<String, ComponentType> repo) {
this(repo, "memory");
}
@@ -34,14 +34,14 @@ public class MemoryComponentRepository<ComponentType extends IDescribedComponent
* @param source
* Where the components came from.
*/
- public MemoryComponentRepository(IMap<String, ComponentType> repo, String source) {
+ public MemoryComponentRepository(MapEx<String, ComponentType> repo, String source) {
this.repo = repo;
this.source = source;
}
@Override
- public IMap<String, ComponentType> getAll() {
+ public MapEx<String, ComponentType> getAll() {
return repo;
}