Top Fields Constructors Methods
org.jboss.logmanager.formatters

pack-priv abstract Class FlagSet<E extends Enum<E>>

extends AbstractSet<E extends Enum<E>>
Class Inheritance
Known Direct Subclasses
org.jboss.logmanager.formatters.GeneralFlags, org.jboss.logmanager.formatters.NumericFlags
Imports
java.util.AbstractSet, .Iterator, .NoSuchElementException, java.util.function.Consumer, .IntFunction

Field Summary

Modifier and TypeField and Description
pack-priv final int

Constructor Summary

AccessConstructor and Description
pack-priv
FlagSet(final int value)

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(final Object
element whose presence in this set is to be tested
o
)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Returns true if this set contains the specified element.

public boolean
contains(final Enum<?> e)

public boolean
equals(final Object
object to be compared for equality with this set
o
)

Overrides java.util.AbstractSet.equals.

Implements java.util.Set.equals, java.util.Collection.equals.

Compares the specified object with this set for equality.

public void
forbid(final E flag)

public void
public void
forbidAllBut(final E flag)

public void
forEach(final Consumer<? super E>
The action to be performed for each element
action
)

Overrides default java.lang.Iterable.forEach.

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception.

public int
hashCode()

Overrides java.util.AbstractSet.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Returns the hash code value for this set.

public Iterator<E>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.

private static IllegalArgumentException
notAllowed(final FlagSet<?> set)

private static IllegalArgumentException
notAllowed(final Enum<?> flag)

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Returns the number of elements in this set (its cardinality).

public <T> T[]
toArray(final IntFunction<T[]>
a function which produces a new array of the desired type and the provided length
generator
)

Overrides default java.util.Collection.toArray.

Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array.

pack-priv abstract E[]
pack-priv abstract FlagSet<E>
without(final E flag)

Inherited from java.util.AbstractSet:
removeAll

Field Detail

valueback to summary
pack-priv final int value

Constructor Detail

FlagSetback to summary
pack-priv FlagSet(final int value)

Method Detail

containsback to summary
public boolean contains(final Object o)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Doc from java.util.Set.contains.

Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that Objects.equals(o, e).

Parameters
o:Object

element whose presence in this set is to be tested

Returns:boolean

true if this set contains the specified element

containsback to summary
public boolean contains(final Enum<?> e)
equalsback to summary
public boolean equals(final Object o)

Overrides java.util.AbstractSet.equals.

Implements java.util.Set.equals, java.util.Collection.equals.

Doc from java.util.AbstractSet.equals.

Compares the specified object with this set for equality. Returns true if the given object is also a set, the two sets have the same size, and every member of the given set is contained in this set. This ensures that the equals method works properly across different implementations of the Set interface.

This implementation first checks if the specified object is this set; if so it returns true. Then, it checks if the specified object is a set whose size is identical to the size of this set; if not, it returns false. If so, it returns containsAll((Collection) o).

Parameters
o:Object

object to be compared for equality with this set

Returns:boolean

true if the specified object is equal to this set

forbidback to summary
public void forbid(final E flag)
forbidAllback to summary
public void forbidAll()
forbidAllButback to summary
public void forbidAllBut(final E flag)
forEachback to summary
public void forEach(final Consumer<? super E> action)

Overrides default java.lang.Iterable.forEach.

Doc from java.lang.Iterable.forEach.

Performs the given action for each element of the Iterable until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.

The behavior of this method is unspecified if the action performs side-effects that modify the underlying source of elements, unless an overriding class has specified a concurrent modification policy.

Parameters
action:Consumer<? super E>

The action to be performed for each element

hashCodeback to summary
public int hashCode()

Overrides java.util.AbstractSet.hashCode.

Implements java.util.Set.hashCode, java.util.Collection.hashCode.

Doc from java.util.AbstractSet.hashCode.

Returns the hash code value for this set. The hash code of a set is defined to be the sum of the hash codes of the elements in the set, where the hash code of a null element is defined to be zero. This ensures that s1.equals(s2) implies that s1.hashCode()==s2.hashCode() for any two sets s1 and s2, as required by the general contract of Object#hashCode.

This implementation iterates over the set, calling the hashCode method on each element in the set, and adding up the results.

Returns:int

the hash code value for this set

iteratorback to summary
public Iterator<E> iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:Iterator<E>

an iterator over the elements in this set

notAllowedback to summary
private static IllegalArgumentException notAllowed(final FlagSet<?> set)
notAllowedback to summary
private static IllegalArgumentException notAllowed(final Enum<?> flag)
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Doc from java.util.Set.size.

Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this set (its cardinality)

toArrayback to summary
public <T> T[] toArray(final IntFunction<T[]> generator)

Overrides default java.util.Collection.toArray.

Doc from java.util.Collection.toArray.

Returns an array containing all of the elements in this collection, using the provided generator function to allocate the returned array.

If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.

Parameters
<T>
the component type of the array to contain the collection
generator:IntFunction<T[]>

a function which produces a new array of the desired type and the provided length

Returns:T[]

an array containing all of the elements in this collection

Annotations
@SuppressWarnings:unchecked
valuesback to summary
pack-priv abstract E[] values()
withoutback to summary
pack-priv abstract FlagSet<E> without(final E flag)