|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pf.osf.ObjectContainer
public class ObjectContainer
A generic container of objects that keeps it objects in the order they were added. It also provides methods to search for object by match rules.
| Constructor Summary | |
|---|---|
ObjectContainer()
Initialize the new instance with default values. |
|
ObjectContainer(int initialCapacity)
Initialize the new instance with an initial size. |
|
| Method Summary | |
|---|---|
void |
add(AttributeReadAccess object)
Adds the given object to the container |
java.lang.Object[] |
asArray(java.lang.Class elementType)
Returns the elements of this container in an array of the specified type |
java.util.List |
asList()
Returns all contained objects as List. |
void |
clear()
Removes all objects from the container |
boolean |
contains(AttributeReadAccess object)
Returns true if the given object is already in this container. |
boolean |
containsEqualObject(AttributeReadAccess object)
Returns true if the container contains an object equal to the given object. |
ObjectContainer |
copy()
Returns a copy of this object container. |
ObjectSearchResult |
find(IObjectFilter filter)
Returns all objects in this container that match the given filter. |
ObjectSearchResult |
find(MatchRule rule)
Returns all objects in this container that match the given rule. |
void |
find(ObjectSearchResult result,
IObjectFilter filter)
Adds all objects in this container that match the given filter to the given result object container. |
void |
find(ObjectSearchResult result,
MatchRule rule)
Adds all objects in this container that match the given rule to the given result object container. |
void |
find(ObjectSearchResult result,
java.lang.String rule,
boolean ignoreCase)
Adds all objects in this container that match the given rule to the given result object container. |
ObjectSearchResult |
find(java.lang.String rule)
Returns all object in this container that match the given rule. |
AttributeReadAccess |
findFirst(IObjectFilter filter)
Returns the first object in this container that matches the given filter. |
AttributeReadAccess |
findFirst(MatchRule rule)
Returns the first object in this container that matches the given rule. |
AttributeReadAccess |
findFirst(java.lang.String rule)
Returns the first object in this container that matches the given rule or null if no matching element can be found. |
AttributeReadAccess |
findFirstIgnoreCase(java.lang.String rule)
Returns the first object in this container that matches the given rule or null if no matching element can be found. |
ObjectSearchResult |
findIgnoreCase(java.lang.String rule)
Returns all objects in this container that match the given rule. |
AttributeReadAccess |
get(int index)
Returns the object at the given index position. |
boolean |
isEmpty()
Returns true if the container currently contains nothing. |
boolean |
remove(AttributeReadAccess object)
Removes the given object from the container. |
boolean |
removeEqual(AttributeReadAccess object)
Removes the given object from the container. |
AttributeReadAccess |
set(int index,
AttributeReadAccess object)
Puts the given object at the specified index and returns the object previously located at that index. |
int |
size()
Returns the number of contained objects. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectContainer()
public ObjectContainer(int initialCapacity)
initialCapacity - Initial size reserved for elements| Method Detail |
|---|
public void add(AttributeReadAccess object)
public AttributeReadAccess get(int index)
java.lang.ArrayIndexOutOfBoundsException - if the index is outside the elements range
public AttributeReadAccess set(int index,
AttributeReadAccess object)
index - The index of the element to be replacedobject - The object to put into the container
java.lang.ArrayIndexOutOfBoundsException - if the index is outside the current rangepublic void clear()
public ObjectContainer copy()
public boolean remove(AttributeReadAccess object)
object - The object to removeremoveEqual(AttributeReadAccess)public boolean removeEqual(AttributeReadAccess object)
object - The object to removeremove(AttributeReadAccess)public int size()
public boolean isEmpty()
public boolean containsEqualObject(AttributeReadAccess object)
public boolean contains(AttributeReadAccess object)
object - The object to looked for
public AttributeReadAccess findFirst(java.lang.String rule)
throws MatchRuleParseException
rule - A rule based on the attributes the contained objects must match
MatchRuleParseException - For any error when parsing the given ruleDefaultMatchRuleParser
public AttributeReadAccess findFirstIgnoreCase(java.lang.String rule)
throws MatchRuleParseException
rule - A rule based on the attributes the contained objects must match
MatchRuleParseException - For any error when parsing the given ruleDefaultMatchRuleParser
public ObjectSearchResult find(java.lang.String rule)
throws MatchRuleParseException
rule - A rule based on the attributes the contained objects must match
MatchRuleParseException - For any error when parsing the given ruleDefaultMatchRuleParser
public ObjectSearchResult findIgnoreCase(java.lang.String rule)
throws MatchRuleParseException
rule - A rule based on the attributes the contained objects must match
MatchRuleParseException - For any error when parsing the given ruleDefaultMatchRuleParserpublic ObjectSearchResult find(MatchRule rule)
rule - A rule based on the attributes the contained objects must matchpublic ObjectSearchResult find(IObjectFilter filter)
filter - A filter the contained objects must match
public void find(ObjectSearchResult result,
MatchRule rule)
result - The container all found objects must be added torule - A rule based on the attributes the contained objects must match
public void find(ObjectSearchResult result,
IObjectFilter filter)
result - The container all found objects must be added tofilter - A filter the contained objects must match
public void find(ObjectSearchResult result,
java.lang.String rule,
boolean ignoreCase)
throws MatchRuleParseException
result - The container all found objects must be added torule - A rule based on the attributes the contained objects must matchignoreCase - defines whether or not the search should be case-insensitive
MatchRuleParseException - For any error when parsing the given ruleDefaultMatchRuleParserpublic AttributeReadAccess findFirst(MatchRule rule)
rule - A rule based on the attributes the contained objects must matchpublic AttributeReadAccess findFirst(IObjectFilter filter)
filter - A filter the contained objects must matchpublic java.util.List asList()
public java.lang.Object[] asArray(java.lang.Class elementType)
elementType - The type each element must comply to
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||