public abstract class PropertyPack.Cluster
extends java.lang.Object
stem{variant}.{ext}
Modifier and Type | Field and Description |
---|---|
java.util.ArrayList<PropertyPack.PropNode> |
propNodeList
The PropNodes generated for this cluster.
|
Modifier | Constructor and Description |
---|---|
protected |
Cluster()
Cluster constructor that does not require a stem name.
|
|
Cluster(java.lang.String stem)
Construct a Cluster with a specified stem path.
|
Modifier and Type | Method and Description |
---|---|
int |
addPropNodes()
Add to propNodes all those with the Cluster's memberName and
a possible locale-variant.
|
int |
countPropNodes() |
boolean |
equals(java.lang.Object o) |
void |
forEachProperty(java.util.function.Consumer<java.lang.String> sink)
Iterate all defined properties, including those in
backup properties (although there is no way to create the latter).
|
void |
forEachPropNode(java.util.function.Consumer<PropertyPack.PropNode> sink) |
java.net.URL |
getURL() |
int |
hashCode() |
abstract InputStream |
openFile(java.lang.String relName) |
abstract java.lang.String |
toString() |
public java.util.ArrayList<PropertyPack.PropNode> propNodeList
protected Cluster()
public Cluster(java.lang.String stem)
stem
- The memberStem for all files requested of this cluster.
It is the path from the top-level of the Cluster's home to
all files that will be requested from the Cluster.
The path is made to end in slash.public void forEachProperty(java.util.function.Consumer<java.lang.String> sink)
sink
- a BiConsumer object w/ method accept(String,String)public void forEachPropNode(java.util.function.Consumer<PropertyPack.PropNode> sink)
public int countPropNodes()
public java.net.URL getURL()
public abstract InputStream openFile(java.lang.String relName) throws IOException
relName
- location of the desired file within the cluster.
Usually this method is called from
createPropNode
; in this case relName
is a locale suffix and an extension. To open a sibling
of the properties file, relName
may be
/../siblingname.ext
.
The client MUST close the stream. Accordingly, an IOException
may thrown. This is intended to encourage calling this method
from within the parenthesized resouces clause
of a try
statement.
IOException
- if an error occurs.public int addPropNodes()
An overriding method must check if propNodeList is null
and if so, set it to new ArrayList<>();
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public abstract java.lang.String toString()
toString
in class java.lang.Object