public static class CharBigLists.EmptyBigList extends CharCollections.EmptyCollection implements CharBigList, Serializable, Cloneable
This class may be useful to implement your own in case you subclass a type-specific list.
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Character k)
Deprecated.
Please use the corresponding type-specific method
instead.
|
void |
add(long index,
char k)
Inserts the specified element at the specified position in this
type-specific big list (optional operation).
|
void |
add(long index,
Character k)
Deprecated.
Please use the corresponding type-specific method
instead.
|
boolean |
addAll(CharBigList c)
Appends all of the elements in the specified type-specific big list to
the end of this type-specific big list (optional operation).
|
boolean |
addAll(CharCollection c)
Adds all elements of the given type-specific collection to this
collection.
|
boolean |
addAll(long i,
CharBigList c)
Inserts all of the elements in the specified type-specific big list into
this type-specific big list at the specified position (optional
operation).
|
boolean |
addAll(long i,
CharCollection c)
Inserts all of the elements in the specified type-specific collection
into this type-specific big list at the specified position (optional
operation).
|
boolean |
addAll(long i,
Collection<? extends Character> c)
Inserts all of the elements in the specified collection into this big list at the specified position (optional operation).
|
void |
addElements(long index,
char[][] a)
Add (hopefully quickly) elements to this type-specific big list.
|
void |
addElements(long index,
char[][] a,
long offset,
long length)
Add (hopefully quickly) elements to this type-specific big list.
|
Object |
clone()
Creates and returns a copy of this object.
|
int |
compareTo(BigList<? extends Character> o)
Compares this object with the specified object for order.
|
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
Character |
get(long i)
Deprecated.
Please use the corresponding type-specific method
instead.
|
char |
getChar(long i)
Returns the element at the specified position.
|
void |
getElements(long from,
char[][] a,
long offset,
long length)
Copies (hopefully quickly) elements of this type-specific big list into
the given big array.
|
int |
hashCode()
Returns a hash code value for the object.
|
long |
indexOf(char k)
Returns the index of the first occurrence of the specified element in
this type-specific big list, or -1 if this big list does not contain the
element.
|
long |
indexOf(Object k)
Deprecated.
Please use the corresponding type-specific method
instead.
|
CharBigListIterator |
iterator()
Returns an iterator over the elements contained in this collection.
|
long |
lastIndexOf(char k)
Returns the index of the last occurrence of the specified element in this
type-specific big list, or -1 if this big list does not contain the
element.
|
long |
lastIndexOf(Object k)
Deprecated.
Please use the corresponding type-specific method
instead.
|
CharBigListIterator |
listIterator()
Returns a type-specific big-list iterator on this type-specific big list.
|
CharBigListIterator |
listIterator(long i)
Returns a type-specific list iterator on this type-specific big list
starting at a given index.
|
boolean |
rem(char k)
Removes a single instance of the specified element from this collection,
if it is present (optional operation).
|
Character |
remove(long k)
Deprecated.
Please use the corresponding type-specific method
instead.
|
char |
removeChar(long i)
Removes the element at the specified position.
|
void |
removeElements(long from,
long to)
Removes (hopefully quickly) elements of this type-specific big list.
|
char |
set(long index,
char k)
Replaces the element at the specified position in this big list with the
specified element (optional operation).
|
Character |
set(long index,
Character k)
Deprecated.
Please use the corresponding type-specific method
instead.
|
void |
size(long s)
Sets the size of this big list.
|
long |
size64()
Returns the size of this data structure as a long.
|
CharBigList |
subList(long from,
long to)
Returns a type-specific view of the portion of this type-specific big
list from the index
from, inclusive, to the index to,
exclusive. |
String |
toString()
Returns a string representation of this collection.
|
addAll, clear, contains, removeAll, removeAll, retainAll, retainAll, size, toArrayadd, contains, containsAll, remove, toArray, toCharArray, toCharArraycontainsAll, isEmpty, toArrayadd, contains, contains, containsAll, remove, removeAll, retainAll, toArray, toCharArray, toCharArrayaddAll, clear, containsAll, isEmpty, parallelStream, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArrayforEach, forEachpublic char getChar(long i)
CharBigListgetChar in interface CharBigListBigList.get(long)public boolean rem(char k)
AbstractCharCollection
Note that this method should be called
remove(), but the clash with
the similarly named index-based method in the List
interface forces us to use a distinguished name. For simplicity, the set
interfaces reinstates remove().
This implementation iterates over the elements in the collection, looking for the specified element and tries to remove it.
rem in interface CharCollectionrem in class AbstractCharCollectionCollection.remove(Object)public char removeChar(long i)
CharBigListremoveChar in interface CharBigListBigList.remove(long)public void add(long index,
char k)
CharBigListadd in interface CharBigListBigList.add(long,Object)public char set(long index,
char k)
CharBigListset in interface CharBigListBigList.set(long,Object)public long indexOf(char k)
CharBigListindexOf in interface CharBigListBigList.indexOf(Object)public long lastIndexOf(char k)
CharBigListlastIndexOf in interface CharBigListBigList.lastIndexOf(Object)public boolean addAll(long i,
Collection<? extends Character> c)
BigListaddAll in interface BigList<Character>i - index at which to insert the first element from the specified collection.c - collection containing elements to be added to this big list.true if this big list changed as a result of the callList.addAll(int, Collection)public boolean addAll(CharCollection c)
CharCollectionaddAll in interface CharCollectionaddAll in class CharCollections.EmptyCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.addAll(Collection)public boolean addAll(CharBigList c)
CharBigListaddAll in interface CharBigListList.addAll(int,java.util.Collection)public boolean addAll(long i,
CharCollection c)
CharBigListaddAll in interface CharBigListList.addAll(int,java.util.Collection)public boolean addAll(long i,
CharBigList c)
CharBigListaddAll in interface CharBigListList.addAll(int,java.util.Collection)@Deprecated public void add(long index, Character k)
add in interface BigList<Character>add in interface CharBigListindex - a position in the big list.k - an element to be inserted.List.add(int,Object)@Deprecated public boolean add(Character k)
Collections that support this operation may place limitations on what elements may be added to this collection. In particular, some collections will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. Collection classes should clearly specify in their documentation any restrictions on what elements may be added.
If a collection refuses to add a particular element for any reason other than that it already contains the element, it must throw an exception (rather than returning false). This preserves the invariant that a collection always contains the specified element after this call returns.
This implementation always throws an UnsupportedOperationException.
This implementation delegates to the corresponding type-specific method.
add in interface CharCollectionadd in interface Collection<Character>add in class AbstractCharCollectionk - element whose presence in this collection is to be ensured@Deprecated public Character get(long i)
get in interface BigList<Character>get in interface CharBigListi - a position in the big list.List.get(int)@Deprecated public Character set(long index, Character k)
set in interface BigList<Character>set in interface CharBigListindex - a position in the big list.k - the element to be stored at the specified position.List.set(int,Object)@Deprecated public Character remove(long k)
remove in interface BigList<Character>remove in interface CharBigListk - a position in the big list.List.remove(int)@Deprecated public long indexOf(Object k)
indexOf in interface BigList<Character>indexOf in interface CharBigListk - the object to search for.List.indexOf(Object)@Deprecated public long lastIndexOf(Object k)
lastIndexOf in interface BigList<Character>lastIndexOf in interface CharBigListk - the object to search for.List.lastIndexOf(Object)public CharBigListIterator listIterator()
CharBigList
Note that this specification strengthens the one given in
BigList.listIterator().
listIterator in interface BigList<Character>listIterator in interface CharBigListBigList.listIterator()public CharBigListIterator iterator()
java.util.AbstractCollectioniterator in interface CharBigListiterator in interface CharCollectioniterator in interface CharIterableiterator in interface Iterable<Character>iterator in interface Collection<Character>iterator in class CharCollections.EmptyCollectionIterable.iterator()public CharBigListIterator listIterator(long i)
CharBigList
Note that this specification strengthens the one given in
BigList.listIterator(long).
listIterator in interface BigList<Character>listIterator in interface CharBigListi - index of first element to be returned from the big-list iterator.BigList.listIterator(long)public CharBigList subList(long from, long to)
CharBigListfrom, inclusive, to the index to,
exclusive.
Note that this specification strengthens the one given in
BigList.subList(long,long).
subList in interface BigList<Character>subList in interface CharBigListfrom - the starting element (inclusive).to - the ending element (exclusive).BigList.subList(long,long)public void getElements(long from,
char[][] a,
long offset,
long length)
CharBigListgetElements in interface CharBigListfrom - the start index (inclusive).a - the destination big array.offset - the offset into the destination big array where to store the
first element copied.length - the number of elements to be copied.public void removeElements(long from,
long to)
CharBigListremoveElements in interface CharBigListfrom - the start index (inclusive).to - the end index (exclusive).public void addElements(long index,
char[][] a,
long offset,
long length)
CharBigListaddElements in interface CharBigListindex - the index at which to add elements.a - the big array containing the elements.offset - the offset of the first element to add.length - the number of elements to add.public void addElements(long index,
char[][] a)
CharBigListaddElements in interface CharBigListindex - the index at which to add elements.a - the big array containing the elements.public void size(long s)
BigListIf the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null/false.
public long size64()
Size64public int compareTo(BigList<? extends Character> o)
java.lang.ComparableThe implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)
The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.
Finally, the implementor must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.
It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."
In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive.
compareTo in interface Comparable<BigList<? extends Character>>o - the object to be compared.public Object clone()
java.lang.Objectx, the expression:
will be true, and that the expression:x.clone() != x
will bex.clone().getClass() == x.getClass()
true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x)
true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
super.clone. If a class and all of its superclasses (except
Object) obey this convention, it will be the case that
x.clone().getClass() == x.getClass().
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by super.clone before returning it. Typically, this means
copying any mutable objects that comprise the internal "deep structure"
of the object being cloned and replacing the references to these
objects with references to the copies. If a class contains only
primitive fields or references to immutable objects, then it is usually
the case that no fields in the object returned by super.clone
need to be modified.
The method clone for class Object performs a
specific cloning operation. First, if the class of this object does
not implement the interface Cloneable, then a
CloneNotSupportedException is thrown. Note that all arrays
are considered to implement the interface Cloneable and that
the return type of the clone method of an array type T[]
is T[] where T is any reference or primitive type.
Otherwise, this method creates a new instance of the class of this
object and initializes all its fields with exactly the contents of
the corresponding fields of this object, as if by assignment; the
contents of the fields are not themselves cloned. Thus, this method
performs a "shallow copy" of this object, not a "deep copy" operation.
The class Object does not itself implement the interface
Cloneable, so calling the clone method on an object
whose class is Object will result in throwing an
exception at run time.
public int hashCode()
java.lang.ObjectHashMap.
The general contract of hashCode is:
hashCode method
must consistently return the same integer, provided no information
used in equals comparisons on the object is modified.
This integer need not remain consistent from one execution of an
application to another execution of the same application.
equals(Object)
method, then calling the hashCode method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hash tables.
As much as is reasonably practical, the hashCode method defined by
class Object does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
hashCode in interface Collection<Character>hashCode in class CharCollections.EmptyCollectionObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public boolean equals(Object o)
java.lang.Object
The equals method implements an equivalence relation
on non-null object references:
x, x.equals(x) should return
true.
x and y, x.equals(y)
should return true if and only if
y.equals(x) returns true.
x, y, and z, if
x.equals(y) returns true and
y.equals(z) returns true, then
x.equals(z) should return true.
x and y, multiple invocations of
x.equals(y) consistently return true
or consistently return false, provided no
information used in equals comparisons on the
objects is modified.
x,
x.equals(null) should return false.
The equals method for class Object implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x and
y, this method returns true if and only
if x and y refer to the same object
(x == y has the value true).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode method, which states
that equal objects must have equal hash codes.
equals in interface Collection<Character>equals in class CharCollections.EmptyCollectiono - the reference object with which to compare.true if this object is the same as the obj
argument; false otherwise.Object.hashCode(),
HashMappublic String toString()
java.util.AbstractCollectionString.valueOf(Object).toString in class AbstractCharCollection