optics
Class RayPencil

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector<Ray>
              extended by optics.RayPencil
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Ray>, java.util.Collection<Ray>, java.util.List<Ray>, java.util.RandomAccess
Direct Known Subclasses:
IntensityRayPencil

public class RayPencil
extends java.util.Vector<Ray>

Abstract Class to implement a RayPencil being an Vector of rays.

This class also implements propagation through OpticalSurfaces and OticalGroups.

For incoherent un-polarsied illumination this class is accessed via is extending class IntensityRayPencil.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
RayPencil()
          Forrm a RayPencil with default title of "Pencil"
RayPencil(java.lang.String title)
          Form RayPencil with specfifed title
 
Method Summary
 void addRay(Ray r)
          Method to add a Ray to the pencil.
 Ray getNext()
          Get the next valid Ray from the Pencil, rays set to invalid are ignored.
 Ray getRay(int i)
          Method to get the nth Ray, Need to be defined in extending class to return the correct type of Ray.
 java.lang.String getTitle()
          Method to get the title string.
 double getWaveLength()
          Method to get the wavelength of the rays, this will be the wavelength of the FIRST valid ray, and other will ne assumned to be the same.
 int propagateThrough(LensSystem g)
          Method to propagate the RayPencil through an OpticalGroup and report the number of rays propagated through its full length.
 int propagateThrough(OpticalSurface s)
          Method to propagate the RayPencil through a single OpticalSurface and report the number of rays propagated.
 int removeInvalid()
          Method to delete the invalid Rays from the RayPencil and report the number deleted.
 void reset()
          Method to reset the nextRay counter to zero.
 void setTitle(java.lang.String t)
          Method to set the title.
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

RayPencil

public RayPencil(java.lang.String title)
Form RayPencil with specfifed title

Parameters:
title -

RayPencil

public RayPencil()
Forrm a RayPencil with default title of "Pencil"

Method Detail

setTitle

public void setTitle(java.lang.String t)
Method to set the title.

Parameters:
t - the title

getTitle

public java.lang.String getTitle()
Method to get the title string.

Returns:
String the title.

getWaveLength

public double getWaveLength()
Method to get the wavelength of the rays, this will be the wavelength of the FIRST valid ray, and other will ne assumned to be the same.

If there are no vaild rays the package default will be rerturned.

Returns:
double typical wavelength of Pencil

addRay

public void addRay(Ray r)
Method to add a Ray to the pencil. It will be added to the end of the underlying vector.

Parameters:
r - the ray to be added.

getRay

public Ray getRay(int i)
Method to get the nth Ray, Need to be defined in extending class to return the correct type of Ray.

Parameters:
i - the ray index
Returns:
RayVector the ray.

reset

public void reset()
Method to reset the nextRay counter to zero.


getNext

public Ray getNext()
Get the next valid Ray from the Pencil, rays set to invalid are ignored. A null is returned if there are no more arrays available.

Returns:
RayVector the next valid RayVector
See Also:
reset()

removeInvalid

public int removeInvalid()
Method to delete the invalid Rays from the RayPencil and report the number deleted.

Returns:
int number or rays deleted from the pencil

propagateThrough

public int propagateThrough(OpticalSurface s)
Method to propagate the RayPencil through a single OpticalSurface and report the number of rays propagated.

Parameters:
s - The OpticalSurface
Returns:
int the number of rays propagated

propagateThrough

public int propagateThrough(LensSystem g)
Method to propagate the RayPencil through an OpticalGroup and report the number of rays propagated through its full length.

Parameters:
g - the LensSystem
Returns:
int number of rays propagated