artisynth.core.modelbase
Interface ComponentListView<E extends ModelComponent>

Type Parameters:
E - Model component type found in this list
All Superinterfaces:
java.lang.Iterable<E>, ListView<E>
All Known Subinterfaces:
RenderableComponentListView<C>
All Known Implementing Classes:
ArticulatedBeamBody, ArticulatedDemo, ArticulatedFem, AttachDemo, AttachedBeamDemo, AuxMaterialBundleList, AuxMaterialElementDescList, AxialSpringList, BlockTest, CollisionHandlerList, ColoredFemBeam3d, CompliantConstraintDemo, ComponentList, ConstrainedParticle, CoupledSolveDemo, DoubleArmDemo, FaceList, FallingSkull, Fem3dBlock, FemBeam3d, FemBeamMech, FemCollision, FemElement3dList, FemFrictionBeam, FemModel, FemModel3d, FemMuscleArm, FemMuscleDemo, FemMuscleModel, FemSingleTet, FemSkinDemo, FemSphere, FishDemo, ForceEffectorList, FrameSpringDemo, Hex3dBlock, HexBeam3d, HexFrame, HexIncompress, HexSheet, HydrostatDemo, HydrostatInvDemo, HydrostatModel, HydrostatTubeDemo, LaymanBowl, LaymanDemo, LaymanModel, LockingDemo, LumbarSpringDemo, MassSpringDemo, MechModel, MechModelCollide, MechModelDemo, MechSystemBase, MeshComponentList, MFreeAuxMaterialBundleList, MFreeAuxMaterialElementDescList, MFreeElement3dList, MFreeModel3d, MFreeMuscleBundleList, MFreeMuscleElementDescList, MFreeMuscleModel, ModelBase, MultiMuscleDemo, MultiPointSpringList, MultiSpringDemo, MuscleArm, MuscleBundleList, MuscleElementDescList, NetDemo, PlanarConnectorDemo, PlaneConstrainedFem, PointForceDemo, PointList, PointModel, PointModel1d, PointModel2d, PointModel3d, PointSpringList, PointToPointMuscle, PuddleDemo, PuppetDemo, QuadFishDemo, ReferenceList, RenderableComponentList, RenderableModelBase, RigidBodyCollision, RigidBodyDemo, RigidTentacle, RobustCube, RollPitchJointDemo, RootModel, ScalableList, SegmentedPlaneDemo, SelfCollision, SheetDemo, SimpleCollide, SingleHex, SinglePyramid, SingleQuadhex, SingleQuadpyramid, SingleQuadtet, SingleQuadwedge, SingleTet, SingleWedge, SkinDemo, SkullParticles, SphericalJointDemo, SpongeDemo, SpongeModel, SpringMeshDemo, Tentacle, TetBeam3d, TransformableList, VertexList, ViscousBeam

public interface ComponentListView<E extends ModelComponent>
extends ListView<E>

A read-only view of a ComponentList that allows it's contents to be queried but not modified.

Author:
John E Lloyd

Method Summary
 boolean contains(E comp)
          Returns true if a particular component is contained in this list.
 E get(int idx)
          Get the component at a particular index, or null if there is no such component.
 E get(java.lang.String name)
          Get the component with particular name, or null if there is no such component.
 E getByNumber(int num)
          Get the component with the specified number, or null if there is no such component.
 java.lang.String getName()
          Gets the name of this component list.
 java.lang.String getShortName()
          Gets the short name of this component list.
 int indexOf(ModelComponent comp)
          Get the index of a particular component in this list, or -1 if the specified component is not present.
 java.util.Iterator<E> iterator()
          Return an iterator over all components in this list.
 int nextComponentNumber()
          Returns the number that will be assigned to the next component added to this list.
 int size()
          Get the number of components in this list.
 
Methods inherited from interface maspack.util.ListView
contains
 

Method Detail

iterator

java.util.Iterator<E> iterator()
Return an iterator over all components in this list.

Specified by:
iterator in interface java.lang.Iterable<E extends ModelComponent>
Specified by:
iterator in interface ListView<E extends ModelComponent>
Returns:
iterator over list components

get

E get(int idx)
Get the component at a particular index, or null if there is no such component.

Specified by:
get in interface ListView<E extends ModelComponent>
Parameters:
idx - index of the component
Returns:
component at specified index

getByNumber

E getByNumber(int num)
Get the component with the specified number, or null if there is no such component.

Parameters:
num - number of the component
Returns:
component with specified number

get

E get(java.lang.String name)
Get the component with particular name, or null if there is no such component.

Parameters:
name - name of the component
Returns:
component with specified name

size

int size()
Get the number of components in this list.

Specified by:
size in interface ListView<E extends ModelComponent>
Returns:
number of components

indexOf

int indexOf(ModelComponent comp)
Get the index of a particular component in this list, or -1 if the specified component is not present.

Parameters:
comp - component to search for
Returns:
index of the component within this list

contains

boolean contains(E comp)
Returns true if a particular component is contained in this list.

Parameters:
comp - component to search for
Returns:
true if the component is contained in this list

nextComponentNumber

int nextComponentNumber()
Returns the number that will be assigned to the next component added to this list.

Returns:
next component number for this list

getName

java.lang.String getName()
Gets the name of this component list.

Returns:
name of this list

getShortName

java.lang.String getShortName()
Gets the short name of this component list.

Returns:
short name of this list