|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--util.SmartVector
SmartVector
is an enhanced container of java objects.
Basic use is similar to a Vector, e.g. add, remove, get,
size. In addition, you can access the date an object was added to the
SmartVector, the date of last access, and the number of accesses.
Furthermore, you can query the N last accessed objects, the N most
frequently accessed objects, or the N least frequently accessed objects.
Vector
Constructor Summary | |
SmartVector()
Creates a new SmartVector instance. |
Method Summary | |
Object |
add(Object oItem)
Adds an object to the SmartVector if it does not already exist in the SmartVector. |
boolean |
contains(Object oItem)
Returns true if this Smart Vector contains the object, otherwise returns false. |
Enumeration |
elements()
Returns an enumeration of the components of this SmartVector |
Object |
get(int iIndex)
Returns the object at index iIndex. |
int |
getAccessCount(Object oItem)
Returns the number of times an object was accessed. |
Date |
getAccessDate(Object oItem)
Returns the date the object was last accessed. |
Date |
getCreateDate(Object oItem)
Returns the date the object was first added to the SmartVector. |
String |
getInfo(Object oItem)
Returns a string representation of an object in the SmartVector, including the dates of creation and last access (in milliseconds), and the access count. |
Object |
getLast()
Returns the last accessed object in the SmartVector. |
Vector |
getLast(int iNumber)
Returns a Vector with iNumber elements, where the ith element has been accessed more recently than the i+1th element. |
int |
getLexicoRank(Object oItem)
|
Vector |
getLexicoSorted()
Returns a Vector of the elements in this SmartVector with the elements in lexicographical order. |
Object |
getMost()
Returns the most accessed object in the SmartVector. |
Vector |
getMost(int iNumber)
Returns a Vector with iNumber elements, where the ith element has been accessed at least as many times as the i+1th element. |
static void |
main(String[] sArgsv)
Tests this SmartVector. |
Object |
remove(Object oItem)
Removes an object from the SmartVector if it exists. |
int |
size()
Returns the number of objects in this. |
String |
toString()
Returns the String representation of this. |
Object |
touch(Object oItem)
If the object is in SmartVector, Touch updates
the access date to the current date, and increments the access
count by one. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public SmartVector()
SmartVector
instance.Method Detail |
public Object add(Object oItem)
oItem
- an Object
valueObject
valuepublic boolean contains(Object oItem)
oItem
- an Object
valueboolean
valuepublic Object remove(Object oItem)
oItem
- an Object
valueObject
valuepublic Object touch(Object oItem)
Touch
updates
the access date to the current date, and increments the access
count by one. If the object is not found, then Touch returns
null.
Touch should be called when an object is accessed externally.oItem
- an Object
valueObject
valuepublic int size()
int
valuepublic Object get(int iIndex)
iIndex
- an int
valueObject
valuepublic int getAccessCount(Object oItem)
oItem
- an Object
valueint
valuepublic Date getAccessDate(Object oItem)
oItem
- an Object
valueDate
valuepublic Date getCreateDate(Object oItem)
oItem
- an Object
valueDate
valuepublic int getLexicoRank(Object oItem)
public Vector getMost(int iNumber)
iNumber
- an int
valueVector
value#getLeast(int)
public Object getMost()
Object
valuepublic Vector getLast(int iNumber)
iNumber
- an int
valueVector
valuepublic Object getLast()
Object
valuepublic String getInfo(Object oItem)
oItem
- an Object
valueString
valuepublic Enumeration elements()
Enumeration
valuepublic Vector getLexicoSorted()
Vector
valuepublic String toString()
String
valuepublic static void main(String[] sArgsv)
sArgsv[]
- a String
value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |