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

Quick Search    Search Deep

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

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

public final class StringIndexSelector
extends Selector

An implementation of Selector that identifies a property by its String index within the parent model object.

Create by Selector.fromString(String) 55 .

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

Field Summary
private  java.lang.String index
          The String index of the selected property.
 
Fields inherited from class org.scopemvc.core.Selector
DELIMITER
 
Constructor Summary
(package private) StringIndexSelector(java.lang.String inIndex)
          Package private for factory to create.
 
Method Summary
 java.lang.String 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(java.lang.String 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 java.lang.String index
The String index of the selected property. Immutable after construction.

Constructor Detail

StringIndexSelector

StringIndexSelector(java.lang.String inIndex)
Package private for factory to create.

Method Detail

getIndex

public final java.lang.String getIndex()

setIndex

public void setIndex(java.lang.String inIndex)

shallowEquals

protected final 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 final 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)