|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--au.com.prunge.jgenfile.OperationHints
A set of hints to give operations that may affect their execution.
Operation hints are only hints, in that one, some or all of the hints given to an operation may be ignored.
Nested Class Summary | |
static interface |
OperationHints.Key
An operation hints key. |
static interface |
OperationHints.Value
An operation hints value. |
Field Summary | |
static OperationHints.Key |
KEY_PROGRESS_OBSERVING
Key for specifying whether progress observing is desired for operation execution. |
static OperationHints.Value |
PROGRESS_OBSERVING_DESIRED
Specifies that progress observation is desired, but should not be used if performance will suffer greatly. |
static OperationHints.Value |
PROGRESS_OBSERVING_HIGHLY_DESIRED
Specifies that progress observation is important and that every effort should be made to allow the monitoring of progress of operations. |
static OperationHints.Value |
PROGRESS_OBSERVING_UNNEEDED
Specifies that progress observing need not be supported by operations. |
Constructor Summary | |
OperationHints()
Constructs an OperationHints object
with initially no keys and values. |
|
OperationHints(Map hintsMap)
Constructs an OperationHints with
the keys and values in hintsMap |
|
OperationHints(OperationHints.Key key,
OperationHints.Value value)
Constructs an OperationHints with
the specified key and value. |
Method Summary | |
void |
clear()
|
Object |
clone()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
protected Map |
createHintsMap()
Creates the internal map used for storing hints in. |
Set |
entrySet()
|
boolean |
equals(Object obj)
|
Object |
get(Object key)
|
int |
hashCode()
|
boolean |
isEmpty()
|
Set |
keySet()
|
Object |
put(Object key,
Object value)
|
void |
putAll(Map m)
|
Object |
remove(Object key)
|
int |
size()
|
String |
toString()
|
Collection |
values()
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final OperationHints.Key KEY_PROGRESS_OBSERVING
Some operations may need to use additional memory if progress needs to be observed, or might have to sacrifice efficiency.
The default value is PROGRESS_OBSERVING_UNNEEDED.
PROGRESS_OBSERVING_HIGHLY_DESIRED
,
PROGRESS_OBSERVING_DESIRED
,
PROGRESS_OBSERVING_UNNEEDED
public static final OperationHints.Value PROGRESS_OBSERVING_HIGHLY_DESIRED
Use this value instead of PROGRESS_OBSERVING_DESIRED if you are willing to sacrifice performance and memory in order for the operation to be observable.
For example, a file copy operation might need to use slower code to be able to monitor progress instead of faster native code. It might be desirable, however, to monitor progress if the file is large, since the user might not want to wait not knowing what is going on. It might be useful to give the user an option (perhaps in a configuration dialog) as to whether performance should be sacrificed in exchange for the progress bar.
public static final OperationHints.Value PROGRESS_OBSERVING_DESIRED
public static final OperationHints.Value PROGRESS_OBSERVING_UNNEEDED
Operations might need to use additional memory and have worse perforamance if progress observing is required. If progress will never be observed by the creator of the operation anyway, this allows the operation to not consume resources that would not be needed anyway.
Constructor Detail |
public OperationHints(Map hintsMap)
OperationHints
with
the keys and values in hintsMap
hintsMap
- a map with OperationHints.Key keys
and OperationHints.Value values.public OperationHints()
OperationHints
object
with initially no keys and values.
public OperationHints(OperationHints.Key key, OperationHints.Value value)
OperationHints
with
the specified key and value.
key
- the key to use.value
- the value to use.
NullPointerException
- ifMethod Detail |
protected Map createHintsMap()
Subclasses may override this method to use a different map implementation. HashMap is used by default.
public void clear()
clear
in interface Map
Map.clear()
public boolean containsKey(Object key)
containsKey
in interface Map
Map.containsKey(java.lang.Object)
public boolean containsValue(Object value)
containsValue
in interface Map
Map.containsValue(java.lang.Object)
public Set entrySet()
entrySet
in interface Map
Map.entrySet()
public Object get(Object key)
get
in interface Map
Map.get(java.lang.Object)
public boolean isEmpty()
isEmpty
in interface Map
Map.isEmpty()
public Set keySet()
keySet
in interface Map
Map.keySet()
public Object put(Object key, Object value)
put
in interface Map
Map.put(java.lang.Object, java.lang.Object)
public void putAll(Map m)
putAll
in interface Map
Map.putAll(java.util.Map)
public Object remove(Object key)
remove
in interface Map
Map.remove(java.lang.Object)
public int size()
size
in interface Map
Map.size()
public Collection values()
values
in interface Map
Map.values()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Object.clone()
public boolean equals(Object obj)
equals
in interface Map
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in interface Map
hashCode
in class Object
Object.hashCode()
public String toString()
toString
in class Object
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |