|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.onwbp.adaptation.RequestResult
Represents the result of a Request.
The preferred protocol for iterating over a request result is
to use nextAdaptation(). This protocol is more adequate than
getAdaptation(int), because in the default
"READ
UNCOMMITTED" isolation level, it supports transparently a
concurrent deletion on the tables viewed. Moreover it does not call
getSize(), hence it will be less expensive if the iteration is
not performed on all occurrences.
Regarding multi-threading on a single instance, please note that the method
nextAdaptation() is not synchronized. If multiple threads invoke
it concurrently on the same instance, they must be synchronized externally.
If table is updated concurrently, the general rules regarding Concurrency and isolation levels are applied.
Request,
Concurrency and isolation levels| Method Summary | |
boolean |
contains(Adaptation anOccurrence)
Returns true if the occurrence specified belongs to the result of this request
(even if the occurrence is obsolete). |
Adaptation |
getAdaptation(int anIndex)
Returns the occurrence at the position specified in this result. |
Request |
getRequest()
Returns the request that has created this result. |
int |
getSize()
Returns the total number of occurrences held by this result. |
AdaptationTable |
getTable()
|
boolean |
isEmpty()
Returns true if result is empty (its size is 0). |
boolean |
isObsolete()
Returns true if result may have changed since last computation.
|
Adaptation |
nextAdaptation()
Moves the cursor to the next occurrence in the result and returns it. |
void |
refresh()
Forces a full recomputation of this result. |
boolean |
refreshIfNeeded()
Performs a refresh of the result if it may have changed. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public AdaptationTable getTable()
public Adaptation getAdaptation(int anIndex)
throws ArrayIndexOutOfBoundsException
Returns the occurrence at the position specified in this result.
Warning: this method will return null if a deletion
has been concurrently performed (see
Concurrency and isolation levels).
It is advised to use nextAdaptation() instead.
ArrayIndexOutOfBoundsExceptionpublic boolean isEmpty()
true if result is empty (its size is 0).
public boolean isObsolete()
true if result may have changed since last computation.
This happens if table has been updated or if request has been changed
(via a set... method).
refreshIfNeeded()public String toString()
public int getSize()
Warning: as this method must perform the full computation
of the result it may be expensive for large numbers of occurrences.
For an iteration, it is more advisable to use the method nextAdaptation()
than a loop between 0 and getSize().
public Adaptation nextAdaptation()
null if result
has no more elements.
RequestResult result = ...;
for (Adaptation occ; (occ = result.nextAdaptation()) != null;)
{
...
}
or (better ?):
while (true)
{
Adaptation occ = result.nextAdaptation();
if (occ == null)
break;
...
}
See Class comment
null if no more elements.
public void refresh()
throws IncompatibleChangeError
IncompatibleChangeError - if underlying schema has become unavailable or table node has
been removed from schema.
public boolean refreshIfNeeded()
throws IncompatibleChangeError
true if a refresh has been done, false otherwise.
IncompatibleChangeErrorisObsolete()public Request getRequest()
public boolean contains(Adaptation anOccurrence)
true if the occurrence specified belongs to the result of this request
(even if the occurrence is obsolete).
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
(report a bug)
EBX.Platform 4.5.2 [0601:0004]
Copyright Orchestra Networks 2000-2008. All rights reserved.