|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
Interface for one-to-many relation. There are two types of relations: embedded (when references to the relarted obejcts are stored in relation owner obejct itself) and stanalone (when relation is separate object, which contains the reference to the relation owner and relation members). Both kinds of relations implements Link interface. Embedded relation is created by Storage.createLink method and standalone relation is represented by Relation persistent class created by Storage.createRelation method.
| Method Summary | ||
|---|---|---|
boolean |
add(T obj)
Add new object to the relation |
|
boolean |
addAll(Link<T> link)
Add all object members of the other relation to this relation |
|
void |
addAll(T[] arr)
Add all elements of the array to the relation |
|
void |
addAll(T[] arr,
int from,
int length)
Add specified elements of the array to the relation |
|
void |
clear()
Remove all members from the relation |
|
boolean |
contains(java.lang.Object obj)
Check if there is linked object which is equal to the specified object. |
|
boolean |
containsElement(int i,
T obj)
Check if i-th element of Link is the same as specified obj |
|
boolean |
containsObject(T obj)
Checks if relation contains specified object instance |
|
T |
get(int i)
Get related object by index |
|
IPersistent |
getRaw(int i)
Get related object by index without loading it. |
|
int |
indexOf(java.lang.Object obj)
Get index of the specified object in the relation |
|
void |
insert(int i,
T obj)
Insert new object in the relation |
|
boolean |
isEmpty()
Returns true if there are no related object |
|
java.util.Iterator<T> |
iterator()
Get iterator through link members This iterator supports remove() method. |
|
void |
pin()
Replace references to elements with direct references. |
|
void |
remove(int i)
Remove object with specified index from the relation |
|
boolean |
remove(java.lang.Object o)
Remove object from the relation |
|
void |
set(int i,
T obj)
Replace i-th element of the relation |
|
void |
setSize(int newSize)
Set number of the linked objects |
|
int |
size()
Get number of the linked objects |
|
|
toArray(T[] arr)
Get all relation members as array. |
|
IPersistent[] |
toPersistentArray()
Get relation members as array of object |
|
IPersistent[] |
toRawArray()
Return array with relation members. |
|
void |
unpin()
Replace all direct references to linked objects with stubs. |
|
| Methods inherited from interface org.garret.perst.ITable |
|---|
select |
| Methods inherited from interface java.util.Collection |
|---|
add, addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray |
| Method Detail |
|---|
boolean add(T obj)
obj - object inserted in the relationboolean addAll(Link<T> link)
link - another relationvoid addAll(T[] arr)
arr - array of obects which should be added to the relation
void addAll(T[] arr,
int from,
int length)
arr - array of obects which should be added to the relationfrom - index of the first element in the array to be added to the relationlength - number of elements in the array to be added in the relationvoid clear()
clear in interface java.util.Collectionboolean contains(java.lang.Object obj)
contains in interface java.util.Collectionobj - object to be searched in the index. Object should contain indexed field.
true if collection contains object equals to the specified
boolean containsElement(int i,
T obj)
i - element indexobj - object to compare with
true if i-th element of Link reference the same object as "obj"boolean containsObject(T obj)
obj - specified object
true if object is present in the collection, false otherwiseT get(int i)
i - index of the object in the relation
IPersistent getRaw(int i)
equals method
i - index of the object in the relation
int indexOf(java.lang.Object obj)
obj - specified object
void insert(int i,
T obj)
i - insert poistion, should be in [0,size()]obj - object inserted in the relationboolean isEmpty()
isEmpty in interface java.util.Collectionjava.util.Iterator<T> iterator()
iterator in interface java.util.Collectionvoid pin()
void remove(int i)
i - index in the relartionboolean remove(java.lang.Object o)
remove in interface java.util.Collectiono - removed object
true if relation is changed as the result of this operation
void set(int i,
T obj)
i - index in the relartionobj - object to be included in the relationvoid setSize(int newSize)
newSize - new number of linked objects (if it is greater than original number,
than extra elements will be set to null)int size()
size in interface java.util.Collection<T> T[] toArray(T[] arr)
If this index fits in the specified array with room to spare (i.e., the array has more elements than this index), the element in the array immediately following the end of the index is set to null. This is useful in determining the length of this index only if the caller knows that this index does not contain any null elements.)
toArray in interface java.util.CollectionIPersistent[] toPersistentArray()
IPersistent[] toRawArray()
void unpin()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||