Enum Class SourceSinkType
- All Implemented Interfaces:
Serializable,Comparable<SourceSinkType>,Constable
Enumeration for defining whether an element is a source, a sink, both, or
neither
- Author:
- Steven Arzt
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionaddType(SourceSinkType toAdd) Adds the given source / sink type to the combined type.static SourceSinkTypefromFlags(boolean isSink, boolean isSource) Converts boolean flags (is source, is sink) into a source/sink typestatic SourceSinkTypefromString(String sourceSinkTypeString) booleanisSink()Gets whether this type represents a sinkbooleanisSource()Gets whether this type represents a sourceremoveType(SourceSinkType toRemove) Removes the given source / sink type from the combined type.static SourceSinkTypeReturns the enum constant of this class with the specified name.static SourceSinkType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Undefined
-
Source
-
Sink
-
Neither
-
Both
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
fromFlags
Converts boolean flags (is source, is sink) into a source/sink type- Parameters:
isSink- True if this method is a sinkisSource- True if this method is a source- Returns:
- The source/sink type of the method according to the given flags
-
isSource
public boolean isSource()Gets whether this type represents a source- Returns:
- True if this type represents a source, otherwise false
-
isSink
public boolean isSink()Gets whether this type represents a sink- Returns:
- True if this type represents a sink, otherwise false
-
removeType
Removes the given source / sink type from the combined type. In other words, this method converts, e.g., "Both" to "Source", if "Sink" shall be removed.- Parameters:
toRemove- The element to remove- Returns:
- The new combined type from which the given element was removed
-
addType
Adds the given source / sink type to the combined type. In other words, this method converts, e.g., "Source" to "Both", if "Source" shall be added.- Parameters:
toAdd- The element to add- Returns:
- The new combined type to which the given element was added
-
fromString
-