public final class BinaryStorage extends Object
Binary Storage.
Modifier and Type | Method and Description |
---|---|
static BinaryStorage |
create(int size)
Factory method to construct a binary storage.
|
BinaryStorage |
extend(int index,
boolean truth)
Extends truth value.
|
boolean |
get(int index)
Get truth value.
|
BinaryStorage |
intersection(BinaryStorage storage)
Intersection.
|
BinaryStorage |
reduce(int index,
boolean truth)
Reduce truth value.
|
BinaryStorage |
set(int index,
boolean truth)
Set truth value.
|
int |
size()
Get the size.
|
String |
toString()
Returns a String representation of this object.
|
BinaryStorage |
union(BinaryStorage storage)
Union.
|
public static BinaryStorage create(int size)
Factory method to construct a binary storage.
size
- number of bitspublic boolean get(int index)
Get truth value.
index
- truth value to be getpublic BinaryStorage set(int index, boolean truth)
Set truth value.
index
- truth value to be settruth
- new truth valuepublic BinaryStorage reduce(int index, boolean truth)
Reduce truth value.
index
- truth value to be reducedtruth
- truth valuepublic BinaryStorage extend(int index, boolean truth)
Extends truth value.
index
- truth value to be extendedtruth
- truth valuepublic BinaryStorage intersection(BinaryStorage storage)
Intersection.
storage
- BinaryStorageIllegalArgumentException
public BinaryStorage union(BinaryStorage storage)
Union.
storage
- BinaryStorageIllegalArgumentException
public int size()
Get the size.
Copyright © 2010–2016 The Galactic Organization. All rights reserved.