Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gcc-cobol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COBOLworx
gcc-cobol
Commits
e2d79607
Commit
e2d79607
authored
24 years ago
by
Bryce McKinlay
Browse files
Options
Downloads
Patches
Plain Diff
Re-indent in preparation for diff.
From-SVN: r37115
parent
db50e427
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libjava/java/util/BitSet.java
+36
-36
36 additions, 36 deletions
libjava/java/util/BitSet.java
with
36 additions
and
36 deletions
libjava/java/util/BitSet.java
+
36
−
36
View file @
e2d79607
...
...
@@ -2,11 +2,11 @@
/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
This file is part of libgcj.
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
package
java.util
;
import
java.io.Serializable
;
...
...
@@ -22,9 +22,9 @@ import java.io.Serializable;
public
final
class
BitSet
implements
Cloneable
,
Serializable
{
public
void
and
(
BitSet
bs
)
public
void
and
(
BitSet
bs
)
{
int
max
=
Math
.
min
(
bits
.
length
,
bs
.
bits
.
length
);
int
max
=
Math
.
min
(
bits
.
length
,
bs
.
bits
.
length
);
int
i
;
for
(
i
=
0
;
i
<
max
;
++
i
)
bits
[
i
]
&=
bs
.
bits
[
i
];
...
...
@@ -32,44 +32,44 @@ public final class BitSet implements Cloneable, Serializable
bits
[
i
]
=
0
;
}
public
BitSet
()
public
BitSet
()
{
this
(
64
);
this
(
64
);
}
public
BitSet
(
int
nbits
)
public
BitSet
(
int
nbits
)
{
if
(
nbits
<
0
)
throw
new
NegativeArraySizeException
();
throw
new
NegativeArraySizeException
();
int
length
=
nbits
/
64
;
if
(
nbits
%
64
!=
0
)
++
length
;
bits
=
new
long
[
length
];
}
public
void
clear
(
int
pos
)
public
void
clear
(
int
pos
)
{
if
(
pos
<
0
)
throw
new
IndexOutOfBoundsException
();
throw
new
IndexOutOfBoundsException
();
int
bit
=
pos
%
64
;
int
offset
=
pos
/
64
;
ensure
(
offset
);
ensure
(
offset
);
bits
[
offset
]
&=
~(
1L
<<
bit
);
}
public
Object
clone
()
public
Object
clone
()
{
BitSet
bs
=
new
BitSet
(
bits
.
length
*
64
);
System
.
arraycopy
(
bits
,
0
,
bs
.
bits
,
0
,
bits
.
length
);
BitSet
bs
=
new
BitSet
(
bits
.
length
*
64
);
System
.
arraycopy
(
bits
,
0
,
bs
.
bits
,
0
,
bits
.
length
);
return
bs
;
}
public
boolean
equals
(
Object
obj
)
public
boolean
equals
(
Object
obj
)
{
if
(!(
obj
instanceof
BitSet
))
return
false
;
BitSet
bs
=
(
BitSet
)
obj
;
int
max
=
Math
.
min
(
bits
.
length
,
bs
.
bits
.
length
);
int
max
=
Math
.
min
(
bits
.
length
,
bs
.
bits
.
length
);
int
i
;
for
(
i
=
0
;
i
<
max
;
++
i
)
if
(
bits
[
i
]
!=
bs
.
bits
[
i
])
...
...
@@ -84,10 +84,10 @@ public final class BitSet implements Cloneable, Serializable
return
true
;
}
public
boolean
get
(
int
pos
)
public
boolean
get
(
int
pos
)
{
if
(
pos
<
0
)
throw
new
IndexOutOfBoundsException
();
throw
new
IndexOutOfBoundsException
();
int
bit
=
pos
%
64
;
int
offset
=
pos
/
64
;
...
...
@@ -98,7 +98,7 @@ public final class BitSet implements Cloneable, Serializable
return
(
bits
[
offset
]
&
(
1L
<<
bit
))
==
0
?
false
:
true
;
}
public
int
hashCode
()
public
int
hashCode
()
{
long
h
=
1234
;
for
(
int
i
=
bits
.
length
-
1
;
i
>=
0
;
--
i
)
...
...
@@ -106,32 +106,32 @@ public final class BitSet implements Cloneable, Serializable
return
(
int
)
((
h
>>
32
)
^
h
);
}
public
void
or
(
BitSet
bs
)
public
void
or
(
BitSet
bs
)
{
ensure
(
bs
.
bits
.
length
-
1
);
ensure
(
bs
.
bits
.
length
-
1
);
int
i
;
for
(
i
=
0
;
i
<
bs
.
bits
.
length
;
++
i
)
bits
[
i
]
|=
bs
.
bits
[
i
];
}
public
void
set
(
int
pos
)
public
void
set
(
int
pos
)
{
if
(
pos
<
0
)
throw
new
IndexOutOfBoundsException
();
throw
new
IndexOutOfBoundsException
();
int
bit
=
pos
%
64
;
int
offset
=
pos
/
64
;
ensure
(
offset
);
ensure
(
offset
);
bits
[
offset
]
|=
1L
<<
bit
;
}
public
int
size
()
public
int
size
()
{
return
bits
.
length
*
64
;
}
public
String
toString
()
public
String
toString
()
{
StringBuffer
result
=
new
StringBuffer
(
"{"
);
StringBuffer
result
=
new
StringBuffer
(
"{"
);
boolean
first
=
true
;
for
(
int
i
=
0
;
i
<
bits
.
length
;
++
i
)
{
...
...
@@ -142,32 +142,32 @@ public final class BitSet implements Cloneable, Serializable
if
((
word
&
bit
)
!=
0
)
{
if
(!
first
)
result
.
append
(
", "
);
result
.
append
(
64
*
i
+
j
);
result
.
append
(
", "
);
result
.
append
(
64
*
i
+
j
);
first
=
false
;
}
bit
<<=
1
;
}
}
return
result
.
append
(
"}"
).
toString
();
return
result
.
append
(
"}"
).
toString
();
}
public
void
xor
(
BitSet
bs
)
public
void
xor
(
BitSet
bs
)
{
ensure
(
bs
.
bits
.
length
-
1
);
ensure
(
bs
.
bits
.
length
-
1
);
int
i
;
for
(
i
=
0
;
i
<
bs
.
bits
.
length
;
++
i
)
bits
[
i
]
^=
bs
.
bits
[
i
];
}
// Make sure the vector is big enough.
private
final
void
ensure
(
int
lastElt
)
private
final
void
ensure
(
int
lastElt
)
{
if
(
lastElt
+
1
>
bits
.
length
)
{
long
[]
nd
=
new
long
[
lastElt
+
1
];
System
.
arraycopy
(
bits
,
0
,
nd
,
0
,
bits
.
length
);
System
.
arraycopy
(
bits
,
0
,
nd
,
0
,
bits
.
length
);
bits
=
nd
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment