Commit 3afa32be authored by RAHUL SHARMA's avatar RAHUL SHARMA

Initial Commit

parents
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_9" default="true" project-jdk-name="9.0" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/OrderMatching.iml" filepath="$PROJECT_DIR$/OrderMatching.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="adc67a67-9f57-4ff6-8cd4-578335b241d1" name="Default" comment="" />
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<splitter split-orientation="horizontal" split-proportion="0.5">
<split-first>
<leaf>
<file leaf-file-name="StockExchange.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/StockExchange.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="457">
<caret line="42" column="30" lean-forward="true" selection-start-line="42" selection-start-column="30" selection-end-line="42" selection-end-column="30" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Matcher.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Matcher.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="704">
<caret line="47" column="0" lean-forward="false" selection-start-line="47" selection-start-column="0" selection-end-line="47" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="TestStockExchange.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/TestStockExchange.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="45">
<caret line="3" column="0" lean-forward="false" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Transaction.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Transaction.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-52">
<caret line="11" column="27" lean-forward="false" selection-start-line="11" selection-start-column="27" selection-end-line="11" selection-end-column="27" />
<folding>
<element signature="e#355#356#0" expanded="true" />
<element signature="e#387#388#0" expanded="true" />
<element signature="e#419#420#0" expanded="true" />
<element signature="e#450#451#0" expanded="true" />
<element signature="e#495#496#0" expanded="true" />
<element signature="e#535#536#0" expanded="true" />
<element signature="e#573#574#0" expanded="true" />
<element signature="e#608#609#0" expanded="true" />
<element signature="e#663#664#0" expanded="true" />
<element signature="e#711#712#0" expanded="true" />
<element signature="e#748#749#0" expanded="true" />
<element signature="e#781#782#0" expanded="true" />
<element signature="e#833#834#0" expanded="true" />
<element signature="e#877#878#0" expanded="true" />
<element signature="e#909#910#0" expanded="true" />
<element signature="e#937#938#0" expanded="true" />
<element signature="e#979#980#0" expanded="true" />
<element signature="e#1013#1014#0" expanded="true" />
<element signature="e#1053#1054#0" expanded="true" />
<element signature="e#1089#1090#0" expanded="true" />
<element signature="e#1147#1148#0" expanded="true" />
<element signature="e#1197#1198#0" expanded="true" />
<marker date="1516556048474" expanded="true" signature="265:319" ph="//..." />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</split-first>
<split-second>
<leaf>
<file leaf-file-name="Transaction.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Transaction.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1035">
<caret line="69" column="0" lean-forward="false" selection-start-line="69" selection-start-column="0" selection-end-line="69" selection-end-column="0" />
<folding>
<element signature="e#291#292#0" expanded="true" />
<element signature="e#318#319#0" expanded="true" />
<element signature="e#355#356#0" expanded="true" />
<element signature="e#387#388#0" expanded="true" />
<element signature="e#419#420#0" expanded="true" />
<element signature="e#450#451#0" expanded="true" />
<element signature="e#495#496#0" expanded="true" />
<element signature="e#535#536#0" expanded="true" />
<element signature="e#573#574#0" expanded="true" />
<element signature="e#608#609#0" expanded="true" />
<element signature="e#663#664#0" expanded="true" />
<element signature="e#711#712#0" expanded="true" />
<element signature="e#748#749#0" expanded="true" />
<element signature="e#781#782#0" expanded="true" />
<element signature="e#833#834#0" expanded="true" />
<element signature="e#877#878#0" expanded="true" />
<element signature="e#909#910#0" expanded="true" />
<element signature="e#937#938#0" expanded="true" />
<element signature="e#979#980#0" expanded="true" />
<element signature="e#1013#1014#0" expanded="true" />
<element signature="e#1053#1054#0" expanded="true" />
<element signature="e#1089#1090#0" expanded="true" />
<element signature="e#1147#1148#0" expanded="true" />
<element signature="e#1197#1198#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</split-second>
</splitter>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="GradleLocalSettings">
<option name="externalProjectsViewState">
<projects_view />
</option>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/src/Order.java" />
<option value="$PROJECT_DIR$/src/NewRequest.java" />
<option value="$PROJECT_DIR$/src/TestStockExchange.java" />
<option value="$PROJECT_DIR$/src/Matcher.java" />
<option value="$PROJECT_DIR$/src/StockExchange.java" />
<option value="$PROJECT_DIR$/src/Transaction.java" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds" fullScreen="true">
<option name="width" value="1440" />
<option name="height" value="900" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="AndroidView" />
<pane id="Scope" />
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="OrderMatching" type="b2602c69:ProjectViewProjectNode" />
<item name="OrderMatching" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="OrderMatching" type="b2602c69:ProjectViewProjectNode" />
<item name="OrderMatching" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="settings.editor.selected.configurable" value="blaze.view" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration default="true" type="Applet" factoryName="Applet">
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<module />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
</configuration>
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file id="idea.log" enabled="true" />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="adc67a67-9f57-4ff6-8cd4-578335b241d1" name="Default" comment="" />
<created>1516537072477</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1516537072477</updated>
<workItem from="1516537077933" duration="15290000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="15290000" />
</component>
<component name="ToolWindowManager">
<frame x="0" y="0" width="1440" height="900" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="8" side_tool="false" content_ui="combo" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/Transaction.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="90">
<caret line="6" column="23" lean-forward="true" selection-start-line="6" selection-start-column="23" selection-end-line="6" selection-end-column="23" />
<folding>
<element signature="e#291#292#0" expanded="true" />
<element signature="e#318#319#0" expanded="true" />
<element signature="e#355#356#0" expanded="true" />
<element signature="e#387#388#0" expanded="true" />
<element signature="e#419#420#0" expanded="true" />
<element signature="e#450#451#0" expanded="true" />
<element signature="e#495#496#0" expanded="true" />
<element signature="e#535#536#0" expanded="true" />
<element signature="e#573#574#0" expanded="true" />
<element signature="e#608#609#0" expanded="true" />
<element signature="e#663#664#0" expanded="true" />
<element signature="e#711#712#0" expanded="true" />
<element signature="e#748#749#0" expanded="true" />
<element signature="e#781#782#0" expanded="true" />
<element signature="e#833#834#0" expanded="true" />
<element signature="e#877#878#0" expanded="true" />
<element signature="e#909#910#0" expanded="true" />
<element signature="e#937#938#0" expanded="true" />
<element signature="e#979#980#0" expanded="true" />
<element signature="e#1013#1014#0" expanded="true" />
<element signature="e#1053#1054#0" expanded="true" />
<element signature="e#1089#1090#0" expanded="true" />
<element signature="e#1147#1148#0" expanded="true" />
<element signature="e#1197#1198#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="jar:///Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/lib/src.zip!/java.base/java/util/ArrayList.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="275">
<caret line="515" column="13" lean-forward="false" selection-start-line="515" selection-start-column="13" selection-end-line="515" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TestStockExchange.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="45">
<caret line="3" column="0" lean-forward="false" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Matcher.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="704">
<caret line="47" column="0" lean-forward="false" selection-start-line="47" selection-start-column="0" selection-end-line="47" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/StockExchange.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="457">
<caret line="42" column="30" lean-forward="true" selection-start-line="42" selection-start-column="30" selection-end-line="42" selection-end-column="30" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Transaction.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1035">
<caret line="69" column="0" lean-forward="false" selection-start-line="69" selection-start-column="0" selection-end-line="69" selection-end-column="0" />
<folding>
<element signature="e#291#292#0" expanded="true" />
<element signature="e#318#319#0" expanded="true" />
<element signature="e#355#356#0" expanded="true" />
<element signature="e#387#388#0" expanded="true" />
<element signature="e#419#420#0" expanded="true" />
<element signature="e#450#451#0" expanded="true" />
<element signature="e#495#496#0" expanded="true" />
<element signature="e#535#536#0" expanded="true" />
<element signature="e#573#574#0" expanded="true" />
<element signature="e#608#609#0" expanded="true" />
<element signature="e#663#664#0" expanded="true" />
<element signature="e#711#712#0" expanded="true" />
<element signature="e#748#749#0" expanded="true" />
<element signature="e#781#782#0" expanded="true" />
<element signature="e#833#834#0" expanded="true" />
<element signature="e#877#878#0" expanded="true" />
<element signature="e#909#910#0" expanded="true" />
<element signature="e#937#938#0" expanded="true" />
<element signature="e#979#980#0" expanded="true" />
<element signature="e#1013#1014#0" expanded="true" />
<element signature="e#1053#1054#0" expanded="true" />
<element signature="e#1089#1090#0" expanded="true" />
<element signature="e#1147#1148#0" expanded="true" />
<element signature="e#1197#1198#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>No facets are configured</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>9.0</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<last-edited>OrderMatching</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
<option value="0.6" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
public class Matcher {
public enum MatchType {FULL_MATCH, PARTIAL_MATCH, NO_MATCH}
public MatchType match(Transaction t1, Transaction t2) {
if (t1.getCustomerId().equals(t2.getCustomerId())) {
return MatchType.NO_MATCH;
}
if (!t1.getStock().equals(t2.getStock())) {
return MatchType.NO_MATCH;
}
if (!t1.getTypeOfRequest().equals(t2.getTypeOfRequest())) {
return MatchType.NO_MATCH;
}
//current trans is sell
if (t1.getTypeOfRequest().equals("Buy") && t2.getTypeOfRequest().equals("Sell")) {
if (t1.getPricePerUnit() < t2.getPricePerUnit()) {
return MatchType.NO_MATCH;
}
//selling quantity of current transaction exhausts
else{
if(t2.getQuantity() <= t1.getQuantity()){
return MatchType.FULL_MATCH;
}
else{
return MatchType.PARTIAL_MATCH;
}
}
}
// current trans is buy
else{
if(t1.getPricePerUnit() > t2.getPricePerUnit()){
return MatchType.NO_MATCH;
}
// buying quantity of current trans exhausts
else {
if(t2.getQuantity() <= t1.getQuantity()){
return MatchType.FULL_MATCH;
}
else {
return MatchType.PARTIAL_MATCH;
}
}
}
}
}
\ No newline at end of file
import java.io.*;
import java.util.ArrayList;
import java.util.StringTokenizer;
public class StockExchange {
public void run() throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
Matcher matcher = new Matcher();
boolean shouldContinue = true;
ArrayList<Transaction> transactionList = new ArrayList<>();
while (shouldContinue) {
// get/parse user input
Transaction currentTransaction = new Transaction();
System.out.println("New Transacrion: \"Time Quantity Price Customer_Id Stock Type\" ");
String inputString = reader.readLine();
StringTokenizer stringTokenizer = new StringTokenizer(inputString);
if (stringTokenizer.hasMoreTokens()) {
currentTransaction.setTime(Integer.parseInt(stringTokenizer.nextToken()));
currentTransaction.setQuantity(Integer.parseInt(stringTokenizer.nextToken()));
currentTransaction.setPricePerUnit(Float.parseFloat(stringTokenizer.nextToken()));
currentTransaction.setCustomerId(stringTokenizer.nextToken());
currentTransaction.setStock(stringTokenizer.nextToken());
currentTransaction.setTypeOfRequest(stringTokenizer.nextToken());
}
if (!transactionList.isEmpty()) {
for (int i = 0; i < transactionList.size(); i++) {
Matcher.MatchType matchType = matcher.match(transactionList.get(i), currentTransaction);
if (matchType == Matcher.MatchType.FULL_MATCH) {
// modify ith transaction
transactionList.get(i).setQuantity(transactionList.get(i).getQuantity() - currentTransaction.getQuantity() );
if(transactionList.get(i).getQuantity() == 0){
transactionList.remove(i);
}
System.out.println(currentTransaction.getCustomerId()+" successfully traded "+ transactionList.get(i).getQuantity()+" stocks with "+transactionList.get(i).getCustomerId());
break;
} else if (matchType == Matcher.MatchType.PARTIAL_MATCH) {
// modify current Transaction
// drop i'th transaction
currentTransaction.setQuantity(currentTransaction.getQuantity() - transactionList.get(i).getQuantity());
transactionList.remove(i);
System.out.println(currentTransaction.getCustomerId()+" successfully traded "+ transactionList.get(i).getQuantity()+" stocks with "+transactionList.get(i).getCustomerId());
} else if (matchType == Matcher.MatchType.NO_MATCH) {
// move on
continue;
}
if(i == transactionList.size()-1 && currentTransaction.getQuantity() > 0) {
transactionList.add(currentTransaction);
}
}
} else {
// add this transaction if list is empty
transactionList.add(currentTransaction);
}
System.out.println("Do you want to continue? y|n");
String userResponseString = reader.readLine();
if (userResponseString.equals("n")) {
shouldContinue = false;
}
}
}
}
import java.io.IOException;
public class TestStockExchange {
public static void main(String[] args) throws IOException {
StockExchange stockExchange = new StockExchange();
stockExchange.run();
}
}
import java.util.Comparator;
public class Transaction implements Comparator<Transaction> {
private int time;
private int quantity;
private float pricePerUnit;
private String customerId;
private String stock;
private String typeOfRequest;
private int getTime() {
return time;
}
public void setTime(int time) {
this.time = time;
}
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
public float getPricePerUnit() {
return pricePerUnit;
}
public void setPricePerUnit(float pricePerUnit) {
this.pricePerUnit = pricePerUnit;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public String getStock() {
return stock;
}
public void setStock(String stock) {
this.stock = stock;
}
public String getTypeOfRequest() {
return typeOfRequest;
}
public void setTypeOfRequest(String typeOfRequest) {
this.typeOfRequest = typeOfRequest;
}
@Override
public String toString() {
return "Transaction{" +
"time=" + time +
", quantity=" + quantity +
", pricePerUnit=" + pricePerUnit +
", customerId='" + customerId + '\'' +
", stock='" + stock + '\'' +
", typeOfRequest='" + typeOfRequest + '\'' +
'}';
}
// add comparator
@Override
public int compare(Transaction o1, Transaction o2) {
if(o1.getTime() == o2.getTime()){
return 0;
}
else if(o1.getTime() > o2.getTime()){
return 1;
}
else {
return -1;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment