it.amattioli.encapsulate.range
Class DiscreteRange<T extends Discrete<T>>

Show UML class diagram
java.lang.Object
  extended by it.amattioli.encapsulate.range.AbstractRange<T>
      extended by it.amattioli.encapsulate.range.DiscreteRange<T>
All Implemented Interfaces:
Range<T>, Iterable<T>
Direct Known Subclasses:
GenericDiscreteRange

public abstract class DiscreteRange<T extends Discrete<T>>
extends AbstractRange<T>
implements Iterable<T>


Constructor Summary
DiscreteRange()
           
 
Method Summary
 boolean abutOn(Range<? extends T> r)
          Controlla se un altro range e' adiacente a questo.
 Range<T> gap(Range<T> r)
          Costruisce un nuovo range che rappresenta lo spazio vuoto tra questo e quello passato come parametro.
 Iterator<T> iterator()
           
 Range<T> mergeWith(Range<T> r)
          Costruisce un nuovo range corrispondente all'unione di queso con quello passato come parametro.
 Set<Range<T>> minus(Range<T> r)
           
 
Methods inherited from class it.amattioli.encapsulate.range.AbstractRange
contains, equals, hashCode, hasSameHigh, hasSameLow, includes, intersect, newRange, overlaps, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.amattioli.encapsulate.range.Range
getHigh, getLow, isHighBounded, isLowBounded
 

Constructor Detail

DiscreteRange

public DiscreteRange()
Method Detail

mergeWith

public Range<T> mergeWith(Range<T> r)
Description copied from interface: Range
Costruisce un nuovo range corrispondente all'unione di queso con quello passato come parametro. Questa operazione e' definita solamente se i due range si sovrappongono, altrimenti verra' sollevata un'eccezione.

Specified by:
mergeWith in interface Range<T extends Discrete<T>>

abutOn

public boolean abutOn(Range<? extends T> r)
Description copied from interface: Range
Controlla se un altro range e' adiacente a questo.

Specified by:
abutOn in interface Range<T extends Discrete<T>>

gap

public Range<T> gap(Range<T> r)
Description copied from interface: Range
Costruisce un nuovo range che rappresenta lo spazio vuoto tra questo e quello passato come parametro. Questa operazione e' definita solamente se i due range non si sovrappongono, altrimenti verra' sollevata un'eccezione.

Specified by:
gap in interface Range<T extends Discrete<T>>

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T extends Discrete<T>>

minus

public Set<Range<T>> minus(Range<T> r)
Specified by:
minus in interface Range<T extends Discrete<T>>


Copyright © 2011. All Rights Reserved.