ru.novosoft.dc.core.util
Class Flags

java.lang.Object
  |
  +--ru.novosoft.dc.core.util.Flags
Direct Known Subclasses:
DocumentContext, Pagination, RowPagination

public class Flags
extends java.lang.Object
implements java.lang.Cloneable

The class contains an array of parameters of the boolean type. The array length is specifed while constructing. Two primitive operations, namely set and has, are provided. The class allows the deep copy and deep compare operations.


Constructor Summary
Flags(boolean[] flags)
          Construct an object as a wrapper of the specified array of flags.
Flags(int size)
          Construct an array of flags of the specified size.
 
Method Summary
 java.lang.Object clone()
          Create a deep copy of this object.
 boolean equals(java.lang.Object obj)
          Compare this object with another vector of flags and return true if they coinside.
 boolean[] flags()
          Return the array of flags wrapped by this object.
 boolean has(int index)
          Return the flag of the specified index.
 boolean set(int index, boolean value)
          Set a flag of the specified index and return it.
 int size()
          Return a length of the array.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Flags

public Flags(int size)
Construct an array of flags of the specified size.

Flags

public Flags(boolean[] flags)
Construct an object as a wrapper of the specified array of flags.
Method Detail

size

public final int size()
Return a length of the array.

flags

public final boolean[] flags()
Return the array of flags wrapped by this object.

has

public final boolean has(int index)
Return the flag of the specified index.

set

public final boolean set(int index,
                         boolean value)
Set a flag of the specified index and return it.

clone

public java.lang.Object clone()
Create a deep copy of this object.
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compare this object with another vector of flags and return true if they coinside.
Overrides:
equals in class java.lang.Object