Class GapLists
java.lang.Object
org.magicwerk.brownies.collections.primitive.GapListPrimitives
org.magicwerk.brownies.collections.helper.GapLists
Helper class offering various functionality:
- create wrapper list objects wrapping primitive GapLists
- methods interacting with CharSequence, Reader, InputStream
- create wrapper list objects wrapping primitive GapLists
- methods interacting with CharSequence, Reader, InputStream
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
add
(CharSequence str, CharGapList list, int start, int end) Add specified number of chars from CharSequence into CharGapList.static IList
<?> createWrapperList
(Class<?> type) Create a GapList wrapping a primitive GapList, e.g.static IList
<?> createWrapperList
(Class<?> type, int capacity) Create a GapList wrapping a primitive GapList, e.g.static int
read
(InputStream istream, ByteGapList list, int len) Read specified number of bytes from InputStream into ByteGapList.static int
read
(Reader reader, CharGapList list, int len) Read specified number of chars from Reader into CharGapList.Return collector which collects the elements into aBigList
.Return collector which collects the elements into aGapList
.Methods inherited from class org.magicwerk.brownies.collections.primitive.GapListPrimitives
write, write
-
Constructor Details
-
GapLists
public GapLists()
-
-
Method Details
-
createWrapperList
Create a GapList wrapping a primitive GapList, e.g. an IntObjGapList wrapping an IntGapList.- Parameters:
type
- primitive type for GapList- Returns:
- created wrapping GapList
- Throws:
IllegalArgumentException
- if no primitive type is specified
-
createWrapperList
Create a GapList wrapping a primitive GapList, e.g. an IntObjGapList wrapping an IntGapList.- Parameters:
type
- primitive type for GapListcapacity
- initial capacity of created list- Returns:
- created wrapping GapList
- Throws:
IllegalArgumentException
- if no primitive type is specified
-
toGapList
Return collector which collects the elements into aGapList
.- Returns:
- collector
-
toBigList
Return collector which collects the elements into aBigList
.- Returns:
- collector
-
read
Read specified number of bytes from InputStream into ByteGapList.- Parameters:
istream
- input stream (source)list
- list (target)len
- maximum number of bytes to read- Returns:
- number of bytes read into the buffer, -1 if end of stream has been reached
- Throws:
IOException
-
read
Read specified number of chars from Reader into CharGapList.- Parameters:
reader
- reader (source)list
- list (target)len
- maximum number of bytes to read- Returns:
- number of bytes read into the buffer, -1 if end of stream has been reached
- Throws:
IOException
-
add
Add specified number of chars from CharSequence into CharGapList.- Parameters:
str
- CharSequence (source)list
- list (target)start
- start position of characters to add in CharSequenceend
- end position of characters to add in CharSequence
-