Class EngineResourceSet.ResourceSet<R extends EngineResource>
java.lang.Object
com.blackrook.engine.EngineResourceSet.ResourceSet<R>
- Type Parameters:
R- an EngineResource type.
- All Implemented Interfaces:
Iterable<R>
- Enclosing class:
EngineResourceSet
public static class EngineResourceSet.ResourceSet<R extends EngineResource>
extends Object
implements Iterable<R>
Mapping of name-to-resource and id-to-resource.
- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classIndex type.static classValue getter thing for ease of use. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a resource to the list.Gets a resource by its identity.intgetAfterIndexValue(String indexName, Number value, R[] out) Gets all objects that are after an index value.intgetAfterIndexValue(String indexName, Number value, R[] out, int offset) Gets all objects that are after an index value.intgetBeforeIndexValue(String indexName, Number value, R[] out) Gets all objects that are before an index value.intgetBeforeIndexValue(String indexName, Number value, R[] out, int offset) Gets all objects that are before an index value.intgetByIndex(String indexName, Number value, R[] out) Gets all objects that match an index value.intgetByIndex(String indexName, Number value, R[] out, int offset) Gets all objects that match an index value.intGets resources by a tag name.intGets resources by a tag name.booleanisEmpty()iterator()intsize()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
add
-
get
-
getByTag
Gets resources by a tag name. The target array provided will be filled with the qualifying objects sequentially and will stop if the end is reached, even if there may be more to return.- Parameters:
tagName- the tag name.out- the output array to put the objects into.- Returns:
- the amount of objects returned, up to the size of the provided array.
- Throws:
NullPointerException- if the tagName or array provided isnull.
-
getByTag
Gets resources by a tag name. The target array provided will be filled with the qualifying objects sequentially and will stop if the end is reached, even if there may be more to return.- Parameters:
tagName- the tag name.out- the output array to put the objects into.offset- the offset into the array to start putting objects.- Returns:
- the amount of objects returned, up to the size of the provided array.
- Throws:
NullPointerException- if the tagName or array provided isnull.
-
getByIndex
Gets all objects that match an index value. The target array provided will be filled with the qualifying objects sequentially and will stop if the end is reached, even if there may be more to return.- Parameters:
indexName- the name of the index.value- the value to search for.out- the output array to put the objects into.- Returns:
- the amount of objects returned, up to the size of the provided array.
- Throws:
NullPointerException- if the indexName, value, or array provided isnull.
-
getByIndex
Gets all objects that match an index value. The target array provided will be filled with the qualifying objects sequentially and will stop if the end is reached, even if there may be more to return.- Parameters:
indexName- the name of the index.value- the value to search for.out- the output array to put the objects into.offset- the offset into the array to start putting objects.- Returns:
- the amount of objects returned, up to the size of the provided array.
- Throws:
NullPointerException- if the indexName, value, or array provided isnull.
-
getBeforeIndexValue
Gets all objects that are before an index value. The target array provided will be filled with the qualifying objects sequentially and will stop if the end is reached, even if there may be more to return.- Parameters:
indexName- the name of the index.value- the value to search for.out- the output array to put the objects into.- Returns:
- the amount of objects returned, up to the size of the provided array.
- Throws:
NullPointerException- if the indexName, value, or array provided isnull.
-
getBeforeIndexValue
Gets all objects that are before an index value. The target array provided will be filled with the qualifying objects sequentially and will stop if the end is reached, even if there may be more to return.- Parameters:
indexName- the name of the index.value- the value to search for.out- the output array to put the objects into.offset- the offset into the array to start putting objects.- Returns:
- the amount of objects returned, up to the size of the provided array.
- Throws:
NullPointerException- if the indexName, value, or array provided isnull.
-
getAfterIndexValue
Gets all objects that are after an index value. The target array provided will be filled with the qualifying objects sequentially and will stop if the end is reached, even if there may be more to return.- Parameters:
indexName- the name of the index.value- the value to search for.out- the output array to put the objects into.- Returns:
- the amount of objects returned, up to the size of the provided array.
- Throws:
NullPointerException- if the indexName, value, or array provided isnull.
-
getAfterIndexValue
Gets all objects that are after an index value. The target array provided will be filled with the qualifying objects sequentially and will stop if the end is reached, even if there may be more to return.- Parameters:
indexName- the name of the index.value- the value to search for.out- the output array to put the objects into.offset- the offset into the array to start putting objects.- Returns:
- the amount of objects returned, up to the size of the provided array.
- Throws:
NullPointerException- if the indexName, value, or array provided isnull.
-
iterator
-
size
public int size() -
isEmpty
public boolean isEmpty()
-