|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<Flags>
org.ogf.saga.namespace.Flags
public enum Flags
Enumerates some flags for methods in this package. Note: since enumerations
cannot be extended, all flags are included here. The SAGA specs gets away
with this as it has no real enumeration type. In Java, the values should all
be of the same type, or else the file package for instance cannot inherit
from the namespace package. These flags are meant to be or-ed together,
resulting in an integer. Java does not define arithmetic operators for
enumerations, so methods are added here to test for presence and or-ing. For
instance,
int flags = Flags.EXCL.or(Flags.READ.or(Flags.WRITE));
if (Flags.READ.isSet(flags)) ...
Enum Constant Summary | |
---|---|
ALLFILEFLAGS
All flags applicable to the file package. |
|
ALLLOGICALFILEFLAGS
All flags applicable to the logical file package. |
|
ALLNAMESPACEFLAGS
All flags applicable to the namespace package. |
|
APPEND
Upon opening, the file pointer is set to the end of the file. |
|
BINARY
For OS-es that distinguish between binary and non-binary modes. |
|
CREATE
Allows a namespace entry to be created while opening it, if it does not already exist. |
|
CREATEPARENTS
Implies that missing path elements are created on the fly. |
|
DEREFERENCE
Enforces an operation to apply not to the entry pointed to by the target name, but to the link target of that entry. |
|
EXCL
If the entry already exists, the CREATE flag is not silenty
ignored. |
|
LOCK
Enforces a lock on the namespace entry when it is opened. |
|
NONE
Indicates the absence of flags. |
|
OVERWRITE
Enforces an operation which creates a new namespace entry to continue even if the target entry does not already exist. |
|
READ
The file or directory is opened for reading. |
|
READWRITE
The file or directory is opened for reading and writing. |
|
RECURSIVE
Enforces an operation to apply recursively on a directory tree. |
|
TRUNCATE
Upon opening, the file is truncated to length 0. |
|
WRITE
The file or directory is opened for writing. |
Method Summary | |
---|---|
int |
getValue()
Returns the integer value of this enumeration literal. |
boolean |
isSet(int val)
Tests for the presence of this flag in the specified value. |
int |
or(Flags val)
Returns the result of or-ing this flag into another. |
int |
or(int val)
Returns the result of or-ing this flag into an integer. |
static Flags |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static Flags[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final Flags NONE
public static final Flags OVERWRITE
public static final Flags RECURSIVE
public static final Flags DEREFERENCE
public static final Flags CREATE
public static final Flags EXCL
CREATE
flag is not silenty
ignored. Instead, an AlreadyExistsException
is raised.
public static final Flags LOCK
public static final Flags CREATEPARENTS
public static final Flags TRUNCATE
public static final Flags APPEND
public static final Flags READ
public static final Flags WRITE
public static final Flags READWRITE
public static final Flags ALLNAMESPACEFLAGS
public static final Flags BINARY
public static final Flags ALLLOGICALFILEFLAGS
public static final Flags ALLFILEFLAGS
Method Detail |
---|
public static Flags[] values()
for (Flags c : Flags.values()) System.out.println(c);
public static Flags valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic int getValue()
public int or(int val)
val
- the value to OR this enumeration value into.
public int or(Flags val)
val
- the value to OR this enumeration value into.
public boolean isSet(int val)
val
- the value.
true
if this flag is present.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |