org.compass.core.mapping
Class AbstractMultipleMapping

java.lang.Object
  extended by org.compass.core.mapping.AbstractMapping
      extended by org.compass.core.mapping.AbstractMultipleMapping
All Implemented Interfaces:
Mapping, MultipleMapping
Direct Known Subclasses:
AbstractAccessorMultipleMapping, AbstractResourceMapping, ContractMapping

public abstract class AbstractMultipleMapping
extends AbstractMapping
implements MultipleMapping

Author:
kimchy

Field Summary
protected  ArrayList mappings
           
protected  HashMap mappingsByNameMap
           
 
Constructor Summary
AbstractMultipleMapping()
           
 
Method Summary
 int addMapping(Mapping mapping)
          Adds the mapping.
 void addMappings(MultipleMapping mapping)
           
 void clearMappings()
           
protected  void copy(MultipleMapping mapping)
           
 Mapping getMapping(int index)
          Returns the mapping at the given index.
 Mapping getMapping(String name)
          Returns the mapping associated with the given name.
 Iterator mappingsIt()
          Returns an iterator over the stored mappings.
 int mappingsSize()
           
 void removeExistingByName(Mapping mapping)
           
 void replaceMappings(MultipleMapping mapping)
           
protected  void shallowCopy(MultipleMapping mapping)
           
 
Methods inherited from class org.compass.core.mapping.AbstractMapping
controlsObjectNullability, copy, getConverter, getConverterName, getName, getPath, setConverter, setConverterName, setName, setPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.compass.core.mapping.Mapping
controlsObjectNullability, copy, getConverter, getConverterName, getName, getPath, setConverter, setConverterName, setName, setPath
 

Field Detail

mappings

protected ArrayList mappings

mappingsByNameMap

protected HashMap mappingsByNameMap
Constructor Detail

AbstractMultipleMapping

public AbstractMultipleMapping()
Method Detail

removeExistingByName

public void removeExistingByName(Mapping mapping)

addMapping

public int addMapping(Mapping mapping)
Description copied from interface: MultipleMapping
Adds the mapping. Returns the location that the mapping was added to.

Specified by:
addMapping in interface MultipleMapping
Parameters:
mapping - The mapping to add
Returns:
The location the mapping was added to.

addMappings

public void addMappings(MultipleMapping mapping)

replaceMappings

public void replaceMappings(MultipleMapping mapping)

mappingsIt

public Iterator mappingsIt()
Description copied from interface: MultipleMapping
Returns an iterator over the stored mappings.

Specified by:
mappingsIt in interface MultipleMapping

mappingsSize

public int mappingsSize()

getMapping

public Mapping getMapping(String name)
Description copied from interface: MultipleMapping
Returns the mapping associated with the given name. Don't be confused with Mapping.getName(), since the mappings might be saved not under the mapping name (it might be under the mapping path). It really depends on the actual implementation.

Specified by:
getMapping in interface MultipleMapping
Parameters:
name - The name tha mapping was registered under when it was added.
Returns:
The mapping found, or null if nothing was found.

getMapping

public Mapping getMapping(int index)
Description copied from interface: MultipleMapping
Returns the mapping at the given index.

Specified by:
getMapping in interface MultipleMapping

clearMappings

public void clearMappings()

copy

protected void copy(MultipleMapping mapping)

shallowCopy

protected void shallowCopy(MultipleMapping mapping)


Copyright (c) 2004-2008 The Compass Project.