scala

trait Product

[source: scala/Product.scala]

trait Product
extends Equals with AnyRef
The trait Product defines access functions for instances of products, in particular case classes.
Author
Burak Emir
Version
1.0
Since
2.3
Direct Known Subclasses:
Cell, Left, Right, Either.LeftProjection, Either.RightProjection, Option, Some, None, Product1, Product10, Product11, Product12, Product13, Product14, Product15, Product16, Product17, Product18, Product19, Product2, Product20, Product21, Product22, Product3, Product4, Product5, Product6, Product7, Product8, Product9, Tuple1, Tuple10, Tuple11, Tuple12, Tuple13, Tuple14, Tuple15, Tuple16, Tuple17, Tuple18, Tuple19, Tuple2, Tuple20, Tuple21, Tuple22, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, Tuple8, Tuple9, UninitializedFieldError, Action.NoAction, MenuBar.NoMenuBar, Swing.EmptyIcon, Swing.Lowered, Swing.Raised, JavaConversions.IteratorWrapper, JavaConversions.JIteratorWrapper, JavaConversions.JEnumerationWrapper, JavaConversions.IterableWrapper, JavaConversions.JIterableWrapper, JavaConversions.JCollectionWrapper, JavaConversions.MutableBufferWrapper, JavaConversions.JListWrapper, JavaConversions.MutableSetWrapper, JavaConversions.JSetWrapper, JavaConversions.MutableMapWrapper, JavaConversions.JMapWrapper, TIMEOUT, Exit, !, NamedSend, RemoteApply0, LocalApply0, SendTo, Terminate, Locator, Node, List, Nil, ::, RedBlack.Empty, RedBlack.RedTree, RedBlack.BlackTree, Start, End, NoLo, Index, Include, Update, Remove, Reset, TIMEOUT, pilib.UGP, pilib.Sum, BytePickle.Ref, BytePickle.Def, Invocation.PreservedAnyVal, Invocation.PreservedAnyRef, SUnit.AssertFailed, DocNil, DocBreak, DocText, DocGroup, DocNest, DocCons, TailRec.Call, TailRec.Done, ConsRHS, AnyHedgeRHS, EmptyHedgeRHS, LabelledRHS, AnyTreeRHS, Binders.BoundElement, Parsers.Success, Parsers.Failure, Parsers.Error, Parsers.~, Ident, Number, Str, OffsetPosition, StdTokens.Keyword, StdTokens.NumericLit, StdTokens.StringLit, StdTokens.Identifier, Tokens.ErrorToken, Tokens.EOF, Base.Alt, Base.Sequ, Base.Star, Base.Eps, PointedHedgeExp.Node, PointedHedgeExp.TopIter, PointedHedgeExp.Point, WordExp.Letter, WordExp.Wildcard, Comment, EntityRef, Group, MalformedAttributeException, NamespaceBinding, Null, PCData, PrettyPrinter.Break, PrettyPrinter.Box, PrettyPrinter.Para, ProcInstr, TopScope, ContentModel.ElemName, PCDATA, EMPTY, ANY, MIXED, ELEMENTS, ElemDecl, AttListDecl, AttrDecl, ParsedEntityDecl, ParameterEntityDecl, UnparsedEntityDecl, NotationDecl, IntDef, ExtDef, PEReference, REQUIRED, IMPLIED, DEFAULT, DocType, SystemID, PublicID, ValidationException, FatalError, EvElemStart, EvElemEnd, EvText, EvEntityRef, EvProcInstr, EvComment, XMLEventReader.POISON, BackgroundChanged, ButtonClicked, CaretUpdate, ComponentMoved, ComponentResized, ComponentShown, ComponentHidden, ComponentAdded, ComponentRemoved, EditDone, FocusGained, FocusLost, FontChanged, ForegroundChanged, KeyTyped, KeyPressed, KeyReleased, MouseClicked, MousePressed, MouseReleased, MouseMoved, MouseDragged, MouseEntered, MouseExited, MouseWheelMoved, SelectionChanged, TableStructureChanged, TableChanged, TableUpdated, TableRowsAdded, TableRowsRemoved, TableColumnsSelected, TableRowsSelected, UIElementMoved, UIElementResized, UIElementShown, UIElementHidden, WindowActivated, WindowClosed, WindowClosing, WindowDeactivated, WindowDeiconified, WindowIconified, WindowOpened

Method Summary
abstract def productArity : Int
return k for a product A(x_1,...,x_k)
abstract def productElement (n : Int) : Any
for a product A(x_1,...,x_k), returns x_(n+1) for 0 <= n < k
def productElements : Iterator[Any]
def productIterator : Iterator[Any]
An iterator that returns all fields of this product
def productPrefix : java.lang.String
By default the empty string. Implementations may override this method in order to prepend a string prefix to the result of the toString methods.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Methods inherited from Equals
canEqual (abstract)
Method Details
abstract def productElement(n : Int) : Any
for a product A(x_1,...,x_k), returns x_(n+1) for 0 <= n < k
Parameters
n - the index of the element to return
Throws
IndexOutOfBoundsException -
Returns
The element n elements after the first element

abstract def productArity : Int
return k for a product A(x_1,...,x_k)

def productIterator : Iterator[Any]
An iterator that returns all fields of this product

@deprecated("use productIterator instead")

def productElements : Iterator[Any]

def productPrefix : java.lang.String
By default the empty string. Implementations may override this method in order to prepend a string prefix to the result of the toString methods.