com.miginfocom.util.repetition
Class DefaultRepetitionSpec

java.lang.Object
  extended by com.miginfocom.util.repetition.DefaultRepetitionSpec
All Implemented Interfaces:
RepetitionSpec, java.io.Serializable
Direct Known Subclasses:
DefaultGridLineProvider

public class DefaultRepetitionSpec
extends java.lang.Object
implements RepetitionSpec

Default implementation that only iterares the repetitions and returns the first that applies.

See Also:
Serialized Form

Constructor Summary
DefaultRepetitionSpec(GridLineRepetition[] repetitions)
          Constructor.
 
Method Summary
 Repetition getRepetition(int n, int count)
          Returns the Repetition for the nth index.
 Repetition[] getRepetitions()
          Returns the live array of repetitions stored in this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRepetitionSpec

public DefaultRepetitionSpec(GridLineRepetition[] repetitions)
Constructor.

Parameters:
repetitions - A number of repetitions, not null.
Method Detail

getRepetitions

public Repetition[] getRepetitions()
Returns the live array of repetitions stored in this object.

Returns:
The live array of repetitions stored in this object.

getRepetition

public Repetition getRepetition(int n,
                                int count)
Description copied from interface: RepetitionSpec
Returns the Repetition for the nth index.

Specified by:
getRepetition in interface RepetitionSpec
Parameters:
n - The repetition to return the size for. Must be less than count.
count - The total in the range. Used for knowing when the "last" index is asked for.
Returns:
The repetition that is active (E.g. "applies") for that index. Can be null if none of the contained Repetitions applies to n.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.