5 |
|
|
6 |
/** An object representing an entity which would like |
/** An object representing an entity which would like |
7 |
* to consume a significant amount of memory (large image or such). |
* to consume a significant amount of memory (large image or such). |
8 |
* Memoryconsumers <b>must</b> work as hash keys. |
* Memoryconsumers <b>must</b> work as hash keys; a new consumer with |
9 |
|
* the same meaning as a previous one must be found in a hash. |
10 |
* <p> |
* <p> |
11 |
* Quality is an important variable whose semantics are not defined in this interface |
* Quality is an important variable whose semantics are not defined in this interface |
12 |
* beyond that |
* beyond that |
21 |
public interface MemoryConsumer { |
public interface MemoryConsumer { |
22 |
/** Whether this object can make use of byte amounts less |
/** Whether this object can make use of byte amounts less |
23 |
* than getMaxBytes() returns. |
* than getMaxBytes() returns. |
24 |
|
* For example, images can be scaled down but text cannot. |
25 |
*/ |
*/ |
26 |
boolean getScalable(); |
boolean getScalable(); |
27 |
/** The maximum number of bytes this object would like to consume. |
/** The maximum number of bytes this object would like to consume. |
34 |
* setReservation has been called, it is undefined whether |
* setReservation has been called, it is undefined whether |
35 |
* the previous Obs will be called at all. The size, when the later Obs |
* the previous Obs will be called at all. The size, when the later Obs |
36 |
* is called, is the new one. |
* is called, is the new one. |
37 |
|
* <p> |
38 |
|
* <b>This method may only be called by {@link MemoryPartitioner}.</b> |
39 |
* @param bytes The maximum amount of bytes this object should reserve. |
* @param bytes The maximum amount of bytes this object should reserve. |
40 |
* @param quality Maximum quality that should be loaded (if quality is |
* @param quality Maximum quality that should be loaded (if quality is |
41 |
* adjusted in discrete steps, the class may round upwards). |
* adjusted in discrete steps, the class may round upwards). |
46 |
*/ |
*/ |
47 |
int getReservation(); |
int getReservation(); |
48 |
|
|
49 |
|
/** Get the quality currently used. |
50 |
|
*/ |
51 |
|
float getQuality(); |
52 |
|
|
53 |
} |
} |