org.space4j.indexing
Class Index

java.lang.Object
  extended by org.space4j.indexing.Index
All Implemented Interfaces:
java.io.Serializable

public class Index
extends java.lang.Object
implements java.io.Serializable

An object representing an Index in the system. An index contains a name, a classname, and a set o attributes. Index can be simple or compound.

See Also:
Serialized Form

Nested Class Summary
static class Index.TYPE
           
 
Constructor Summary
Index(java.lang.String name, java.lang.Object source, Index.TYPE type, java.lang.Class<? extends java.lang.Object> klass, java.lang.String... attributes)
          Create a new Index.
Index(java.lang.String name, java.lang.Object source, Index.TYPE type, java.util.Comparator<Key> comp, java.lang.Class<? extends java.lang.Object> klass, java.lang.String... attributes)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String[] getAttributes()
          Return the attributes of this index.
 java.lang.String getClassName()
          Return the name of the class of this index.
 java.util.Comparator<Key> getComparator()
           
 Key getKey(java.lang.Object value)
          Get a key to be used by this index for a given object.
 java.util.Map<Key,java.lang.Object> getMap()
           
protected  java.util.Map<Key,java.lang.Object> getMap(Index.TYPE type, java.util.Comparator<Key> comparator)
           
 java.lang.String getName()
          Return the name of this index.
 java.lang.Object getSource()
           
 Index.TYPE getType()
           
protected  java.lang.String getTypeName(Index.TYPE type)
           
 boolean hasAttribute(java.lang.String attribute)
          Check if this index contains a given attribute.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Index

public Index(java.lang.String name,
             java.lang.Object source,
             Index.TYPE type,
             java.lang.Class<? extends java.lang.Object> klass,
             java.lang.String... attributes)
Create a new Index.

Parameters:
name - The name of this index.
klass - The class of this index.
attributes - An array of attributes.

Index

public Index(java.lang.String name,
             java.lang.Object source,
             Index.TYPE type,
             java.util.Comparator<Key> comp,
             java.lang.Class<? extends java.lang.Object> klass,
             java.lang.String... attributes)
Method Detail

getComparator

public java.util.Comparator<Key> getComparator()

getSource

public java.lang.Object getSource()

getType

public Index.TYPE getType()

getMap

public java.util.Map<Key,java.lang.Object> getMap()

getTypeName

protected java.lang.String getTypeName(Index.TYPE type)

getMap

protected java.util.Map<Key,java.lang.Object> getMap(Index.TYPE type,
                                                     java.util.Comparator<Key> comparator)

getName

public java.lang.String getName()
Return the name of this index.

Returns:
The name of the index.

getClassName

public java.lang.String getClassName()
Return the name of the class of this index.

Returns:
The name of the class.

getAttributes

public java.lang.String[] getAttributes()
Return the attributes of this index.

Returns:
The attributes of the index.

hasAttribute

public boolean hasAttribute(java.lang.String attribute)
Check if this index contains a given attribute.

Parameters:
attribute - The attribute we are looking for.
Returns:
True if the index contains this attribute.

getKey

public Key getKey(java.lang.Object value)
Get a key to be used by this index for a given object.

Parameters:
value - The object from which we want a key.
Returns:
A key for this object.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005 Space4J Team. All Rights Reserved.