scala

trait Product

[source: scala/Product.scala]

trait Product
extends AnyRef
The trait Product defines access functions for instances of products, in particular case classes.
Author
Burak Emir
Version
1.0
Direct Known Subclasses:
TIMEOUT, Exit, !, Node, Cell, Left, Right, Either.LeftProjection, Either.RightProjection, List, Nil, ::, 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, Seq.singleton, Tuple1, Tuple10, Tuple11, Tuple12, Tuple13, Tuple14, Tuple15, Tuple16, Tuple17, Tuple18, Tuple19, Tuple2, Tuple20, Tuple21, Tuple22, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, Tuple8, Tuple9, UninitializedFieldError, ImmutableIterator.Empty, RedBlack.Empty, RedBlack.RedTree, RedBlack.BlackTree, NA, Start, End, Index, Include, Update, Remove, Reset, TIMEOUT, pilib.UGP, pilib.Sum, BytePickle.Ref, BytePickle.Def, SUnit.AssertFailed, DocNil, DocBreak, DocText, DocGroup, DocNest, DocCons, ConsRHS, AnyHedgeRHS, EmptyHedgeRHS, LabelledRHS, AnyTreeRHS, Binders.BoundElement, Parsers.Success, Parsers.Failure, Parsers.Error, Parsers.~, Ident, Number, Str, ~, Parsers.Success, Parsers.Failure, Parsers.Error, 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, Null, PCData, PrettyPrinter.Break, PrettyPrinter.Box, PrettyPrinter.Para, ProcInstr, Text, TopScope, Unparsed, 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, Expression.FExp, Expression.Attrib, Expression.Root, Expression.Child, Expression.DescOrSelf, Expression.WildcardTest, Expression.NameTest, Expression.Exists, Expression.Equals, EvElemStart, EvElemEnd, EvText, EvEntityRef, EvProcInstr, EvComment, BasicTransformer.NeedsCopy, Action.NoAction, Swing.EmptyIcon, Swing.Lowered, Swing.Raised, ActionEvent, BackgroundChanged, ButtonClicked, CaretUpdate, ComponentMoved, ComponentResized, ComponentShown, ComponentHidden, ComponentAdded, ComponentRemoved, EditDone, FocusGained, FocusLost, FontChanged, ForegroundChanged, MouseClicked, MousePressed, MouseReleased, MouseMoved, MouseDragged, MouseEntered, MouseExited, MouseWheelMoved, SelectionChanged, ListSelectionChanged, TableStructureChanged, TableChanged, TableUpdated, TableResized, TableRowsAdded, TableRowsRemoved, TableColumnsSelected, TableRowsSelected, ValueChanged, 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 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
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 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.