Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.core
Class IntIndexSelector  view IntIndexSelector download IntIndexSelector.java

java.lang.Object
  extended byorg.scopemvc.core.Selector
      extended byorg.scopemvc.core.IntIndexSelector

public final class IntIndexSelector
extends Selector

An implementation of Selector that identifies a property by its int index within the parent model object. This is used to access properties in java.util.List and Object[].

Create by Selector.fromInt(int) 55 or Selector.fromString(String) 55 .

Version:
$Revision: 1.2 $ $Date: 2002/01/12 09:35:40 $

Field Summary
private  int index
          The int index of the selected property.
 
Fields inherited from class org.scopemvc.core.Selector
DELIMITER
 
Constructor Summary
(package private) IntIndexSelector(int inIndex)
          Package private for factory to create.
 
Method Summary
 int getIndex()
           
 java.lang.String getName()
          Used to serialise Selectors Selector.asString(org.scopemvc.core.Selector) 55 and for debug by Selector.toString() 55 .
protected  Selector getShallowCopy()
          Return a shallow copy of the head of this.
 int hashCode()
          Get a value that represents this Object, as uniquely as possible within the confines of an int.
 void setIndex(int inIndex)
           
protected  boolean shallowEquals(Selector inSelector)
          Compare the head Selector of this against the head of another Selector list -- ie a shallow compare operation (not including the chained selectors).
 
Methods inherited from class org.scopemvc.core.Selector
asString, chain, deepClone, equals, fromInt, fromString, getLast, getNext, removeLast, setNext, startsWith, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

index

private int index
The int index of the selected property.

Constructor Detail

IntIndexSelector

IntIndexSelector(int inIndex)
Package private for factory to create.

Method Detail

getIndex

public int getIndex()

setIndex

public void setIndex(int inIndex)

shallowEquals

protected boolean shallowEquals(Selector inSelector)
Description copied from class: Selector
Compare the head Selector of this against the head of another Selector list -- ie a shallow compare operation (not including the chained selectors).

Specified by:
shallowEquals in class Selector

getName

public java.lang.String getName()
Description copied from class: Selector
Used to serialise Selectors Selector.asString(org.scopemvc.core.Selector) 55 and for debug by Selector.toString() 55 . ***** public access for test cases -- this is nasty.

Specified by:
getName in class Selector

getShallowCopy

protected Selector getShallowCopy()
Description copied from class: Selector
Return a shallow copy of the head of this.

Specified by:
getShallowCopy in class Selector

hashCode

public int hashCode()
Description copied from class: java.lang.Object
Get a value that represents this Object, as uniquely as possible within the confines of an int.

There are some requirements on this method which subclasses must follow:

  • Semantic equality implies identical hashcodes. In other words, if a.equals(b) is true, then a.hashCode() == b.hashCode() must be as well. However, the reverse is not necessarily true, and two objects may have the same hashcode without being equal.
  • It must be consistent. Whichever value o.hashCode() returns on the first invocation must be the value returned on all later invocations as long as the object exists. Notice, however, that the result of hashCode may change between separate executions of a Virtual Machine, because it is not invoked on the same object.

Notice that since hashCode is used in java.util.Hashtable and other hashing classes, a poor implementation will degrade the performance of hashing (so don't blindly implement it as returning a constant!). Also, if calculating the hash is time-consuming, a class may consider caching the results.

The default implementation returns System.identityHashCode(this)