|
static void | and (long[] bits, long con) |
|
static long[] | bits (int b) |
|
static boolean | check_multi_bits (long[] bits) |
|
static int | idx (long i) |
|
static void | join (Tree tree, long[] bits0, long[] bits1, long[] bits2) |
|
static long | mask (long i) |
|
static void | or (long[] bits, long con) |
|
static boolean | test (long[] bits, int i) |
|
Definition at line 8 of file BitsRPC.java.
◆ abit()
◆ above_center()
◆ ALL()
BitsRPC com.cliffc.aa.type.BitsRPC.ALL |
( |
| ) |
|
◆ and()
◆ ANY()
BitsRPC com.cliffc.aa.type.BitsRPC.ANY |
( |
| ) |
|
◆ bitCount()
Definition at line 113 of file Bits.java.
114 if(
_bits==
null )
return _con==0 ? 0 : 1;
116 for(
long b :
_bits )
117 sum += Long.bitCount(b);
◆ bits()
Definition at line 283 of file Bits.java.
283 {
return new long[
idx(b)+1]; }
◆ bitset()
Definition at line 391 of file Bits.java.
392 IBitSet bs =
new IBitSet();
393 for(
int alias :
this )
◆ check()
Definition at line 89 of file Bits.java.
90 if(
_bits==
null )
return true;
91 if(
_con != 1 &&
_con != -1 )
return false;
92 if(
_bits.length==0 )
return false;
93 if(
_bits.length==1 &&
_bits[0]== 0 )
return false;
95 if(
_bits.length==1 &&
_bits[0]==1 )
return true;
99 while( (i =
tree.parent(i)) != 0 )
◆ check_multi_bits()
Definition at line 105 of file Bits.java.
106 int len =
bits.length;
107 long b =
bits[len-1];
108 if( (b & (b-1))!=0 )
return true;
110 for(
int i=0; i<len-1; i++ )
if(
bits[i] != 0 )
return true;
◆ clear()
Definition at line 255 of file Bits.java.
256 if( !
test(bit) )
return (B)
this;
258 long[] bs =
_bits.clone();
◆ dual()
◆ EMPTY()
BitsRPC com.cliffc.aa.type.BitsRPC.EMPTY |
( |
| ) |
|
◆ equals()
Definition at line 121 of file Bits.java.
122 if(
this==o )
return true;
123 if( !(o instanceof Bits) )
return false;
125 if(
_con != bs._con ||
_hash != bs._hash )
return false;
126 if(
_bits == bs._bits )
return true;
127 if(
_bits ==
null || bs._bits==
null )
return false;
128 if(
_bits.length != bs._bits.length )
return false;
129 for(
int i=0; i<
_bits.length; i++ )
130 if(
_bits[i]!=bs._bits[i] )
return false;
◆ getbit()
◆ hashCode()
◆ idx()
Definition at line 199 of file Bits.java.
199 {
return (
int)(i>>6); }
◆ init()
◆ init0()
static void com.cliffc.aa.type.BitsRPC.init0 |
( |
| ) |
|
|
static |
◆ is_con()
◆ is_empty()
◆ is_nil()
◆ isa()
◆ iterator()
- Returns
- an iterator
Definition at line 523 of file Bits.java.
523 {
return new Iter(); }
◆ join() [1/2]
Definition at line 370 of file Bits.java.
370 {
return dual().meet(bs.dual()).dual(); }
◆ join() [2/2]
Definition at line 349 of file Bits.java.
351 for(
int i=0; i<bits0.length; i++ ) {
356 for(
int j=0; j<64; j++ )
357 if( (
mask(j)&l) != 0 ) {
358 for(
int par = (i<<6)+j; par!=0; par =
tree.parent(par) )
359 if(
test(bits1,par) )
360 { bits2[i]|=
mask(j);
break; }
◆ make() [1/3]
Definition at line 154 of file Bits.java.
158 for(
int i=0; i<
bits.length; i++ ) {
161 for(
int j=0; j<64; j++ )
162 if( (
mask(j)&l) != 0 ) {
164 while( (par =
tree.parent(par)) != 0 )
172 int len =
bits.length;
173 while( len > 1 &&
bits[len-1]==0 ) len--;
174 if(
bits.length != len )
bits = Arrays.copyOf(
bits,len);
183 int bnum0 = 63 - Long.numberOfLeadingZeros(
bits[len-1]);
184 int bnum = bnum0 + ((len-1)<<6);
185 if( any ) bnum = -bnum;
◆ make() [2/3]
◆ make() [3/3]
◆ make0()
static BitsRPC com.cliffc.aa.type.BitsRPC.make0 |
( |
int |
bit | ) |
|
|
staticpackage |
◆ make_impl()
BitsRPC com.cliffc.aa.type.BitsRPC.make_impl |
( |
int |
con, |
|
|
long[] |
bits |
|
) |
| |
|
package |
◆ mask()
Definition at line 200 of file Bits.java.
200 {
return 1L<<(i&63); }
◆ max()
◆ may_nil()
◆ meet()
Definition at line 298 of file Bits.java.
299 if(
this==bs )
return (B)
this;
301 if(
this==full || bs==full )
return full;
303 if(
this==any )
return bs;
304 if( bs ==any )
return (B)
this;
308 if(
is_empty() )
return bs.above_center() ? (B)
this : bs;
309 if( bs.is_empty() )
return above_center() ? bs : (B)
this;
311 long[] bits0 =
_bits, bits1 = bs._bits;
312 int con0 = Math.abs(
_con), con1 = Math.abs(bs._con);
315 if( bits0==
null )
or(bits0=
bits(con0), con0);
316 if( bits1==
null )
or(bits1=
bits(con1), con1);
317 con0 =
_con < 0 ? -1 : 1;
318 con1 = bs._con < 0 ? -1 : 1;
321 if( bits0.length < bits1.length ) {
long[] tmp=bits0; bits0=bits1; bits1=tmp;
int t=con0; con0=con1; con1=t; }
323 if( con0 == 1 && con1 == 1 ) {
324 long[]
bits = bits0.clone();
325 for(
int i=0; i<bits1.length; i++ )
332 if( con0 == -1 && con1 == -1 ) {
333 long[]
bits =
new long[bits0.length];
337 if( (bits0[0]&1)==1 && (bits1[0]&1)==1 )
bits[0]|=1;
◆ meet_nil()
Definition at line 212 of file Bits.java.
214 if(
test(0) )
return (B)
this;
218 else bs =
_bits.clone();
220 return make(
false,bs);
◆ new_rpc()
static int com.cliffc.aa.type.BitsRPC.new_rpc |
( |
int |
par | ) |
|
|
static |
◆ not_nil()
◆ oob()
◆ or()
◆ overlaps()
Definition at line 382 of file Bits.java.
383 for(
int alias :
this )
384 for(
int kid=alias; kid!=0; kid =
tree().next_kid(alias,kid) )
385 if( bs.test_recur(kid) )
◆ reset_to_init0()
static void com.cliffc.aa.type.BitsRPC.reset_to_init0 |
( |
| ) |
|
|
static |
◆ set()
Definition at line 264 of file Bits.java.
265 if(
test(bit) )
return (B)
this;
267 if(
this ==
EMPTY() )
return b;
◆ str()
Definition at line 134 of file Bits.java.
136 if(
_con== 0 )
return sb.p(
"[]");
137 if(
_con== 1 )
return sb.p(
"[ALL]");
138 if(
_con==-1 )
return sb.p(
"[ANY]");
139 return sb.p(
'[').p(
_con).p(
']');
148 for( Integer
idx :
this ) sb.p(
idx).p(sep);
149 return sb.unchar().p(
']');
◆ strip_nil()
Definition at line 273 of file Bits.java.
274 if(
_bits ==
null )
return (B)
this;
275 if( (
_bits[0] &1)==0 )
return (B)
this;
276 long[] bs =
_bits.clone();
◆ subtract()
Definition at line 374 of file Bits.java.
376 for(
int alias :
this )
377 for(
int kid=alias; kid!=0; kid =
tree().next_kid(alias,kid) )
378 if( bs.test_recur(kid) )
379 bs0 = bs0.clear(kid);
◆ test() [1/2]
◆ test() [2/2]
◆ test_recur()
Definition at line 232 of file Bits.java.
233 if(
test(i) )
return true;
235 while( (i =
tree.parent(i)) != 0 )
◆ toString()
◆ tree()
Tree<BitsRPC> com.cliffc.aa.type.BitsRPC.tree |
( |
| ) |
|
|
package |
◆ _bits
◆ _con
◆ _hash
◆ ALL
final int com.cliffc.aa.type.BitsRPC.ALL = new_rpc(0) |
|
static |
◆ ANY
final BitsRPC com.cliffc.aa.type.BitsRPC.ANY = FULL.dual() |
|
staticprivate |
◆ EMPTY
final BitsRPC com.cliffc.aa.type.BitsRPC.EMPTY = FULL.make() |
|
staticprivate |
◆ FREE
BitsRPC com.cliffc.aa.type.BitsRPC.FREE =null |
|
staticprivate |
◆ FULL
◆ INTERN
HashMap<BitsRPC,BitsRPC> com.cliffc.aa.type.BitsRPC.INTERN = new HashMap<>() |
|
staticprivate |
◆ NIL
◆ TREE
final Bits.Tree<BitsRPC> com.cliffc.aa.type.BitsRPC.TREE = new Bits.Tree<>() |
|
staticprivate |
The documentation for this class was generated from the following file: