public class FwkSortedArray extends FwkArray implements FwkArrayInterface, java.lang.Cloneable, java.io.Serializable
,
Serialized FormModifier and Type | Field and Description |
---|---|
static char |
ASCENDING
Constant to set the ascending order.
|
static char |
DESCENDING
Constant to set the descending order.
|
static java.lang.String |
version |
Constructor and Description |
---|
FwkSortedArray()
Constructs an empty vector so that its internal data array
has size 10 and its standard capacity increment is
zero.
|
FwkSortedArray(char order)
Constructs an empty vector so that its internal data array
has size 10 and its standard capacity increment is
zero.
|
FwkSortedArray(java.util.Collection c)
Constructs a list containing the elements of the given collection.
|
FwkSortedArray(java.util.Collection c,
char order)
Constructs a list containing the elements of the given collection and order.
|
FwkSortedArray(int initialCapacity)
Constructs an empty vector with the specified initial capacity and
capacity increment.
|
FwkSortedArray(int initialCapacity,
char order)
Constructs an empty vector with the specified initial capacity and
capacity increment.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.Comparable obj)
Adds the specified element to the end of this
|
void |
add(int index,
java.lang.Object element)
This method exist for compatibily only.
|
boolean |
add(java.lang.Object element)
The new element must implement the Comparable interface.
|
boolean |
addAll(java.util.Collection c)
Appends all of the elements in the specified collection to this list:
Depending on the list settings it is possible that some elements are removed
after this operation.
|
boolean |
addAll(int index,
java.util.Collection c)
This method exist for compatibily only.
|
void |
addElement(java.lang.Comparable obj)
Adds the specified component to the end of this vector,
increasing its size by one.
|
int |
find(java.lang.Comparable obj)
This method looks for the specified object inside the list and returns
the index of the found element.
|
protected int |
findAscend(java.lang.Comparable obj,
int pos,
int lower,
int upper)
The private method to find an object if the vetors is ascend oredered.
|
protected int |
findDescend(java.lang.Comparable obj,
int pos,
int lower,
int upper)
The private method to find an object if the vetors is descend oredered.
|
boolean |
getDuplicate()
Get the duplicate flag.
|
java.lang.Comparable |
getLastInsertedElement()
Retrieves the last inserted element.
|
char |
getOrder()
Get the sorting order.
|
java.lang.String |
getParams()
This function returns a string containing all parameters of the object.
|
java.lang.String |
getVersion()
Return the version string of the FWK component.
|
protected void |
insertAscend(java.lang.Comparable obj,
int pos,
int lower,
int upper) |
protected void |
insertDescend(java.lang.Comparable obj,
int pos,
int lower,
int upper) |
void |
insertElementAt(java.lang.Object element,
int index)
This method exist for compatibily only.
|
void |
print(java.io.PrintStream out)
Print vector to print streem.
|
java.lang.Object |
set(int index,
java.lang.Object element)
Replaces the element at the specified position in this Vector with the
specified element.
|
void |
setDuplicate(boolean dup)
Set the duplicate flag.
|
void |
setElementAt(java.lang.Object obj,
int index)
Replaces the element at the specified position in this Vector with the
specified element.
|
void |
setOrder(char order)
Set the sorting order.
|
java.lang.String |
toString()
This function returns a string containing the string representation of
the object.
|
getFwkMimeTypes, getPresentationString, getPresentationString, release
addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, setSize, size, subList, toArray, toArray, trimToSize
finalize, getClass, notify, notifyAll, wait, wait, wait
getPresentationString, getPresentationString
release
public static final java.lang.String version
public static final char ASCENDING
public static final char DESCENDING
public FwkSortedArray()
public FwkSortedArray(char order)
order
- The order of the Use the
predefined constants to specify it.
The default is ASCENDING.public FwkSortedArray(int initialCapacity, char order)
initialCapacity
- the initial capacity of theorder
- the order of the Use the
predefined constants to specify it.
The default is ASCENDING.java.lang.IllegalArgumentException
- if the specified initial capacity
is negativepublic FwkSortedArray(int initialCapacity)
initialCapacity
- the initial capacity of thejava.lang.IllegalArgumentException
- if the specified initial capacity
is negativepublic FwkSortedArray(java.util.Collection c)
c
- the initial collection of the list.java.lang.IllegalArgumentException
- if the specified initial capacity
is negativepublic FwkSortedArray(java.util.Collection c, char order)
c
- the initial collection of the list.order
- the order of the Use the
predefined constants to specify it.
The default is ASCENDING.java.lang.IllegalArgumentException
- if the specified initial capacity
is negativepublic java.lang.String getVersion()
FwkInterface
getVersion
in interface FwkInterface
getVersion
in class FwkArray
public void setOrder(char order)
public char getOrder()
public boolean getDuplicate()
public void setDuplicate(boolean dup)
public void insertElementAt(java.lang.Object element, int index)
insertElementAt
in class java.util.Vector
element
- The new element.public void addElement(java.lang.Comparable obj)
This method is identical in functionality to the add(Object) method (which is part of the List interface).
obj
- the component to be added.add(Object)
,
List
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
set
in class java.util.Vector
index
- Index of element to replace.element
- element to be stored at the specified position.public void setElementAt(java.lang.Object obj, int index)
setElementAt
in class java.util.Vector
index
- Index of element to replace.element
- element to be stored at the specified position.public void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class java.util.Vector
element
- The new element.public boolean add(java.lang.Object element)
add
in interface java.util.Collection
add
in interface java.util.List
add
in class java.util.Vector
element
- The new element.public boolean add(java.lang.Comparable obj)
o
- element to be appended to thispublic boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class java.util.Vector
c
- collection whose elements are to be added to this list.public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in class java.util.Vector
c
- collection whose elements are to be added to this list.public java.lang.Comparable getLastInsertedElement()
public void print(java.io.PrintStream out)
out
- the print streamprotected void insertAscend(java.lang.Comparable obj, int pos, int lower, int upper)
protected void insertDescend(java.lang.Comparable obj, int pos, int lower, int upper)
public int find(java.lang.Comparable obj)
obj
- The object to find.protected int findAscend(java.lang.Comparable obj, int pos, int lower, int upper)
obj
- The object to find.pos
- The position to compare.protected int findDescend(java.lang.Comparable obj, int pos, int lower, int upper)
obj
- The object to find.pos
- The position to compare.public java.lang.String getParams()
toString
public java.lang.String toString()
"ObjectName["+getParams()+"]"
toString
in class java.util.Vector
getParams