Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Common / Utils / Boolean / Literal.cs / 1305376 / Literal.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Globalization; using System.Collections.ObjectModel; using System.Diagnostics; namespace System.Data.Common.Utils.Boolean { ////// Represents a literal in a normal form expression of the form: /// /// Term /// /// or /// /// !Term /// ///internal sealed class Literal : NormalFormNode , IEquatable > { private readonly TermExpr _term; private readonly bool _isTermPositive; /// /// Initialize a new literal. /// /// Term /// Sign of term internal Literal(TermExprterm, bool isTermPositive) : base(isTermPositive ? (BoolExpr )term : (BoolExpr )new NotExpr (term)) { Debug.Assert(null != term); _term = term; _isTermPositive = isTermPositive; } /// /// Gets literal term. /// internal TermExprTerm { get { return _term; } } /// /// Gets sign of term. /// internal bool IsTermPositive { get { return _isTermPositive; } } ////// Creates a negated version of this literal. /// ///!this internal LiteralMakeNegated() { return IdentifierService .Instance.NegateLiteral(this); } public override string ToString() { return StringUtil.FormatInvariant("{0}{1}", _isTermPositive ? String.Empty : "!", _term); } public override bool Equals(object obj) { Debug.Fail("use typed Equals"); return Equals(obj as Literal ); } public bool Equals(Literal other) { return null != other && other._isTermPositive == _isTermPositive && other._term.Equals(_term); } public override int GetHashCode() { return _term.GetHashCode(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Globalization; using System.Collections.ObjectModel; using System.Diagnostics; namespace System.Data.Common.Utils.Boolean { ////// Represents a literal in a normal form expression of the form: /// /// Term /// /// or /// /// !Term /// ///internal sealed class Literal : NormalFormNode , IEquatable > { private readonly TermExpr _term; private readonly bool _isTermPositive; /// /// Initialize a new literal. /// /// Term /// Sign of term internal Literal(TermExprterm, bool isTermPositive) : base(isTermPositive ? (BoolExpr )term : (BoolExpr )new NotExpr (term)) { Debug.Assert(null != term); _term = term; _isTermPositive = isTermPositive; } /// /// Gets literal term. /// internal TermExprTerm { get { return _term; } } /// /// Gets sign of term. /// internal bool IsTermPositive { get { return _isTermPositive; } } ////// Creates a negated version of this literal. /// ///!this internal LiteralMakeNegated() { return IdentifierService .Instance.NegateLiteral(this); } public override string ToString() { return StringUtil.FormatInvariant("{0}{1}", _isTermPositive ? String.Empty : "!", _term); } public override bool Equals(object obj) { Debug.Fail("use typed Equals"); return Equals(obj as Literal ); } public bool Equals(Literal other) { return null != other && other._isTermPositive == _isTermPositive && other._term.Equals(_term); } public override int GetHashCode() { return _term.GetHashCode(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeAccessPermission.cs
- ConstructorExpr.cs
- SemanticTag.cs
- VectorCollectionConverter.cs
- Timer.cs
- mongolianshape.cs
- CmsInterop.cs
- StatusBarPanel.cs
- ByteRangeDownloader.cs
- util.cs
- ReferenceList.cs
- CaseDesigner.xaml.cs
- TrackingMemoryStream.cs
- WorkflowDefinitionDispenser.cs
- PcmConverter.cs
- PrimitiveDataContract.cs
- MoveSizeWinEventHandler.cs
- Metafile.cs
- FormsAuthenticationUser.cs
- OleDbConnection.cs
- AlphaSortedEnumConverter.cs
- HyperLink.cs
- SupportsEventValidationAttribute.cs
- TrustLevel.cs
- HwndHost.cs
- CombinedTcpChannel.cs
- updateconfighost.cs
- PointConverter.cs
- SrgsRule.cs
- AtomPub10CategoriesDocumentFormatter.cs
- XmlSubtreeReader.cs
- OrderedDictionary.cs
- httpserverutility.cs
- OleDbSchemaGuid.cs
- RecognizerBase.cs
- MaterialGroup.cs
- XmlMembersMapping.cs
- EntityRecordInfo.cs
- DataGridViewCellStyleChangedEventArgs.cs
- CasesDictionary.cs
- Brush.cs
- DbExpressionRules.cs
- OleDbInfoMessageEvent.cs
- ExtensionDataObject.cs
- FillErrorEventArgs.cs
- FontEditor.cs
- WebPartCloseVerb.cs
- SqlDataAdapter.cs
- CodeStatementCollection.cs
- SchemaImporterExtensionElement.cs
- Stroke2.cs
- ClientSideQueueItem.cs
- Cursors.cs
- AutomationElement.cs
- HttpAsyncResult.cs
- GridProviderWrapper.cs
- BreakRecordTable.cs
- CheckBoxPopupAdapter.cs
- XpsPackagingPolicy.cs
- FontUnit.cs
- WmfPlaceableFileHeader.cs
- FormatterConverter.cs
- XmlSchema.cs
- ScrollItemProviderWrapper.cs
- ComponentCodeDomSerializer.cs
- DesignerAttribute.cs
- HostedHttpRequestAsyncResult.cs
- URLAttribute.cs
- figurelength.cs
- CreateRefExpr.cs
- PageAsyncTaskManager.cs
- TimeSpanOrInfiniteValidator.cs
- BindingManagerDataErrorEventArgs.cs
- XmlSchemaComplexContentExtension.cs
- SQLSingle.cs
- PersonalizationProvider.cs
- ArglessEventHandlerProxy.cs
- MailAddressCollection.cs
- RankException.cs
- DataTableReaderListener.cs
- SoapFault.cs
- DirectoryObjectSecurity.cs
- CompleteWizardStep.cs
- ErrorHandlingAcceptor.cs
- DesignTimeTemplateParser.cs
- ConstructorExpr.cs
- ToolStripControlHost.cs
- DrawItemEvent.cs
- FormDocumentDesigner.cs
- XmlWellformedWriter.cs
- HotSpotCollection.cs
- CriticalFinalizerObject.cs
- SwitchAttribute.cs
- DataSvcMapFile.cs
- RelationshipWrapper.cs
- ExtenderProviderService.cs
- Util.cs
- BindingCollection.cs
- QueryTask.cs
- TypeToken.cs