Java Doc for BitSet.java in  » Parser » antlr-3.0.1 » org » antlr » misc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Parser » antlr 3.0.1 » org.antlr.misc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.antlr.misc.BitSet

BitSet
public class BitSet implements IntSet,Cloneable(Code)
A BitSet to replace java.util.BitSet. Primary differences are that most set operators return new sets as opposed to oring and anding "in place". Further, a number of operations were added. I cannot contain a BitSet because there is no way to access the internal bits (which I need for speed) and, because it is final, I cannot subclass to add functionality. Consider defining set degree. Without access to the bits, I must call a method n times to test the ith bit...ack! Also seems like or() from util is wrong when size of incoming set is bigger than this.bits.length.
author:
   Terence Parr


Field Summary
final protected static  intBITS
    
final protected static  intLOG_BITS
    
final protected static  intMOD_MASK
    
protected  longbits
    

Constructor Summary
public  BitSet()
    
public  BitSet(long[] bits_)
    
public  BitSet(int nbits)
    

Method Summary
public  voidadd(int el)
    
public  voidaddAll(IntSet set)
    
public  voidaddAll(int[] elements)
    
public  voidaddAll(List elements)
    
public  IntSetand(IntSet a)
    
public  voidandInPlace(BitSet a)
    
public  voidclear()
    
public  voidclear(int el)
    
public  Objectclone()
    
public  IntSetcomplement()
    
public  IntSetcomplement(IntSet set)
    
public  booleanequals(Object other)
    
public  intgetSingleElement()
     Get the first element you find and return it.
public  voidgrowToInclude(int bit)
     Grows the set to a larger number of bits.
public  booleanisNil()
    
public  intlengthInLongWords()
     return how much space is being used by the bits array not how many actually have member bits on.
public  booleanmember(int el)
    
public  voidnotInPlace()
    
public  voidnotInPlace(int maxBit)
     complement bits in the range 0..maxBit.
public  voidnotInPlace(int minBit, int maxBit)
     complement bits in the range minBit..maxBit.
public  intnumBits()
    
public static  BitSetof(int el)
    
public static  BitSetof(Collection elements)
    
public static  BitSetof(IntSet set)
    
public static  BitSetof(Map elements)
    
public  IntSetor(IntSet a)
    
public  voidorInPlace(BitSet a)
    
public static  BitSetrange(int a, int b)
    
public  voidremove(int el)
    
public  intsize()
    
public  booleansubset(BitSet a)
    
public  IntSetsubtract(IntSet a)
    
public  voidsubtractInPlace(BitSet a)
     Subtract the elements of 'a' from 'this' in-place.
public  int[]toArray()
    
public  ListtoList()
    
public  long[]toPackedArray()
    
public  StringtoString()
    
public  StringtoString(Grammar g)
    
public  StringtoString(String separator, List vocabulary)
     Create a string representation where instead of integer elements, the ith element of vocabulary is displayed instead.
public  StringtoStringOfHalfWords()
     Dump a comma-separated list of the words making up the bit set.
public  StringtoStringOfWords()
     Dump a comma-separated list of the words making up the bit set.
public  StringtoStringWithRanges()
    

Field Detail
BITS
final protected static int BITS(Code)



LOG_BITS
final protected static int LOG_BITS(Code)



MOD_MASK
final protected static int MOD_MASK(Code)



bits
protected long bits(Code)
The actual data bits




Constructor Detail
BitSet
public BitSet()(Code)
Construct a bitset of size one word (64 bits)



BitSet
public BitSet(long[] bits_)(Code)
Construction from a static array of longs



BitSet
public BitSet(int nbits)(Code)
Construct a bitset given the size
Parameters:
  nbits - The size of the bitset in bits




Method Detail
add
public void add(int el)(Code)
or this element into this set (grow as necessary to accommodate)



addAll
public void addAll(IntSet set)(Code)



addAll
public void addAll(int[] elements)(Code)



addAll
public void addAll(List elements)(Code)



and
public IntSet and(IntSet a)(Code)



andInPlace
public void andInPlace(BitSet a)(Code)



clear
public void clear()(Code)



clear
public void clear(int el)(Code)



clone
public Object clone()(Code)



complement
public IntSet complement()(Code)



complement
public IntSet complement(IntSet set)(Code)



equals
public boolean equals(Object other)(Code)



getSingleElement
public int getSingleElement()(Code)
Get the first element you find and return it. Return Label.INVALID otherwise.



growToInclude
public void growToInclude(int bit)(Code)
Grows the set to a larger number of bits.
Parameters:
  bit - element that must fit in set



isNil
public boolean isNil()(Code)



lengthInLongWords
public int lengthInLongWords()(Code)
return how much space is being used by the bits array not how many actually have member bits on.



member
public boolean member(int el)(Code)



notInPlace
public void notInPlace()(Code)



notInPlace
public void notInPlace(int maxBit)(Code)
complement bits in the range 0..maxBit.



notInPlace
public void notInPlace(int minBit, int maxBit)(Code)
complement bits in the range minBit..maxBit.



numBits
public int numBits()(Code)



of
public static BitSet of(int el)(Code)



of
public static BitSet of(Collection elements)(Code)



of
public static BitSet of(IntSet set)(Code)



of
public static BitSet of(Map elements)(Code)



or
public IntSet or(IntSet a)(Code)
return this | a in a new set



orInPlace
public void orInPlace(BitSet a)(Code)



range
public static BitSet range(int a, int b)(Code)



remove
public void remove(int el)(Code)



size
public int size()(Code)



subset
public boolean subset(BitSet a)(Code)
Is this contained within a?



subtract
public IntSet subtract(IntSet a)(Code)



subtractInPlace
public void subtractInPlace(BitSet a)(Code)
Subtract the elements of 'a' from 'this' in-place. Basically, just turn off all bits of 'this' that are in 'a'.



toArray
public int[] toArray()(Code)



toList
public List toList()(Code)



toPackedArray
public long[] toPackedArray()(Code)



toString
public String toString()(Code)



toString
public String toString(Grammar g)(Code)
Transform a bit set into a string by formatting each element as an integer separator The string to put in between elements A commma-separated list of values



toString
public String toString(String separator, List vocabulary)(Code)
Create a string representation where instead of integer elements, the ith element of vocabulary is displayed instead. Vocabulary is a Vector of Strings. separator The string to put in between elements A commma-separated list of character constants.



toStringOfHalfWords
public String toStringOfHalfWords()(Code)
Dump a comma-separated list of the words making up the bit set. Split each 64 bit number into two more manageable 32 bit numbers. This generates a comma-separated list of C++-like unsigned long constants.



toStringOfWords
public String toStringOfWords()(Code)
Dump a comma-separated list of the words making up the bit set. This generates a comma-separated list of Java-like long int constants.



toStringWithRanges
public String toStringWithRanges()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.